Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
SwatchPickerProvider: function() {
return _swatchPicker.SwatchPickerProvider;
},
swatchPickerContextDefaultValue: function() {
return _swatchPicker.swatchPickerContextDefaultValue;
},
useSwatchPickerContextValue_unstable: function() {
return _swatchPicker.useSwatchPickerContextValue_unstable;
},
useSwatchPickerContextValues: function() {
return _swatchPicker.useSwatchPickerContextValues;
}
});
const _swatchPicker = require("./swatchPicker");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SwatchPickerContextValue, SwatchPickerContextValues } from './swatchPicker';\nexport {\n SwatchPickerProvider,\n swatchPickerContextDefaultValue,\n useSwatchPickerContextValue_unstable,\n useSwatchPickerContextValues,\n} from './swatchPicker';\n"],"names":["SwatchPickerProvider","swatchPickerContextDefaultValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,oBAAoB;eAApBA,kCAAoB;;IACpBC,+BAA+B;eAA/BA,6CAA+B;;IAC/BC,oCAAoC;eAApCA,kDAAoC;;IACpCC,4BAA4B;eAA5BA,0CAA4B;;;8BACvB"}
@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
SwatchPickerProvider: function() {
return SwatchPickerProvider;
},
swatchPickerContextDefaultValue: function() {
return swatchPickerContextDefaultValue;
},
useSwatchPickerContextValue_unstable: function() {
return useSwatchPickerContextValue_unstable;
},
useSwatchPickerContextValues: function() {
return useSwatchPickerContextValues;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactcontextselector = require("@fluentui/react-context-selector");
const useSwatchPickerContextValues = (state)=>{
const { isGrid, size, shape, spacing, requestSelectionChange, selectedValue } = state;
// This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
const swatchPicker = {
isGrid,
size,
shape,
spacing,
selectedValue,
requestSelectionChange
};
return {
swatchPicker
};
};
const swatchPickerContextDefaultValue = {
requestSelectionChange: ()=>{
/*noop*/ },
isGrid: false,
size: 'medium',
shape: 'square',
spacing: 'medium',
selectedValue: undefined
};
const SwatchPickerContext = (0, _reactcontextselector.createContext)(undefined);
const SwatchPickerProvider = SwatchPickerContext.Provider;
const useSwatchPickerContextValue_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(SwatchPickerContext, (ctx = swatchPickerContextDefaultValue)=>selector(ctx));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/swatchPicker.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SwatchPickerProps, SwatchPickerState } from '../components/SwatchPicker/SwatchPicker.types';\n\n/**\n * The context through which individual color controls communicate with the picker.\n */\nexport type SwatchPickerContextValue = Pick<SwatchPickerProps, 'size' | 'shape' | 'spacing' | 'selectedValue'> & {\n /**\n * Whether layout is grid.\n */\n isGrid: boolean;\n\n /**\n * @internal\n * Callback used by ColorSwatch to request a change on it's selected state\n * Should be used to select ColorSwatch\n */\n requestSelectionChange: (\n event: React.MouseEvent<HTMLButtonElement>,\n data: { selectedValue: string; selectedSwatch: string },\n ) => void;\n};\n\nexport const useSwatchPickerContextValues = (state: SwatchPickerState): SwatchPickerContextValues => {\n const { isGrid, size, shape, spacing, requestSelectionChange, selectedValue } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const swatchPicker: SwatchPickerContextValue = {\n isGrid,\n size,\n shape,\n spacing,\n selectedValue,\n requestSelectionChange,\n };\n\n return { swatchPicker };\n};\n\nexport const swatchPickerContextDefaultValue: SwatchPickerContextValue = {\n requestSelectionChange: () => {\n /*noop*/\n },\n isGrid: false,\n size: 'medium',\n shape: 'square',\n spacing: 'medium',\n selectedValue: undefined,\n};\n\nexport type SwatchPickerContextValues = {\n swatchPicker: SwatchPickerContextValue;\n};\n\nconst SwatchPickerContext = createContext<SwatchPickerContextValue | undefined>(\n undefined,\n) as Context<SwatchPickerContextValue>;\n\nexport const SwatchPickerProvider = SwatchPickerContext.Provider;\n\nexport const useSwatchPickerContextValue_unstable = <T>(selector: ContextSelector<SwatchPickerContextValue, T>): T =>\n useContextSelector(SwatchPickerContext, (ctx = swatchPickerContextDefaultValue) => selector(ctx));\n"],"names":["SwatchPickerProvider","swatchPickerContextDefaultValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues","state","isGrid","size","shape","spacing","requestSelectionChange","selectedValue","swatchPicker","undefined","SwatchPickerContext","createContext","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA4DaA,oBAAAA;eAAAA;;IAnBAC,+BAAAA;eAAAA;;IAqBAC,oCAAAA;eAAAA;;IArCAC,4BAAAA;eAAAA;;;;iEAzBU;sCAC2B;AAwB3C,MAAMA,+BAA+B,CAACC;IAC3C,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAEC,sBAAsB,EAAEC,aAAa,EAAE,GAAGN;IAEhF,mGAAmG;IACnG,MAAMO,eAAyC;QAC7CN;QACAC;QACAC;QACAC;QACAE;QACAD;IACF;IAEA,OAAO;QAAEE;IAAa;AACxB;AAEO,MAAMV,kCAA4D;IACvEQ,wBAAwB;IACtB,MAAM,GACR;IACAJ,QAAQ;IACRC,MAAM;IACNC,OAAO;IACPC,SAAS;IACTE,eAAeE;AACjB;AAMA,MAAMC,sBAAsBC,IAAAA,mCAAAA,EAC1BF;AAGK,MAAMZ,uBAAuBa,oBAAoBE,QAAQ;AAEzD,MAAMb,uCAAuC,CAAIc,WACtDC,IAAAA,wCAAAA,EAAmBJ,qBAAqB,CAACK,MAAMjB,+BAA+B,GAAKe,SAASE"}