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,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "OptionGroup", {
enumerable: true,
get: function() {
return OptionGroup;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useOptionGroup = require("./useOptionGroup");
const _renderOptionGroup = require("./renderOptionGroup");
const _useOptionGroupStylesstyles = require("./useOptionGroupStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const OptionGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useOptionGroup.useOptionGroup_unstable)(props, ref);
(0, _useOptionGroupStylesstyles.useOptionGroupStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useOptionGroupStyles_unstable')(state);
return (0, _renderOptionGroup.renderOptionGroup_unstable)(state);
});
OptionGroup.displayName = 'OptionGroup';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/OptionGroup/OptionGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useOptionGroup_unstable } from './useOptionGroup';\nimport { renderOptionGroup_unstable } from './renderOptionGroup';\nimport { useOptionGroupStyles_unstable } from './useOptionGroupStyles.styles';\nimport type { OptionGroupProps } from './OptionGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * OptionGroup component: allows grouping of Option components within a Combobox\n */\nexport const OptionGroup: ForwardRefComponent<OptionGroupProps> = React.forwardRef((props, ref) => {\n const state = useOptionGroup_unstable(props, ref);\n\n useOptionGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useOptionGroupStyles_unstable')(state);\n\n return renderOptionGroup_unstable(state);\n});\n\nOptionGroup.displayName = 'OptionGroup';\n"],"names":["OptionGroup","React","forwardRef","props","ref","state","useOptionGroup_unstable","useOptionGroupStyles_unstable","useCustomStyleHook_unstable","renderOptionGroup_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCACiB;mCACG;4CACG;qCAGF;AAKrC,MAAMA,cAAAA,WAAAA,GAAqDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQC,IAAAA,uCAAAA,EAAwBH,OAAOC;IAE7CG,IAAAA,yDAAAA,EAA8BF;IAE9BG,IAAAA,gDAAAA,EAA4B,iCAAiCH;IAE7D,OAAOI,IAAAA,6CAAAA,EAA2BJ;AACpC;AAEAL,YAAYU,WAAW,GAAG"}
@@ -0,0 +1,6 @@
/**
* State used in rendering OptionGroup
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/OptionGroup/OptionGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type OptionGroupSlots = {\n /** The root group wrapper */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * The option group label, displayed as static text before the child options.\n * If not using label, it's recommended to set `aria-label` directly on the OptionGroup instead.\n */\n label?: Slot<'span'>;\n};\n\n/**\n * OptionGroup Props\n */\nexport type OptionGroupProps = ComponentProps<Partial<OptionGroupSlots>>;\n\n/**\n * State used in rendering OptionGroup\n */\nexport type OptionGroupState = ComponentState<OptionGroupSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAkBA;;CAEC"}
@@ -0,0 +1,31 @@
"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, {
OptionGroup: function() {
return _OptionGroup.OptionGroup;
},
optionGroupClassNames: function() {
return _useOptionGroupStylesstyles.optionGroupClassNames;
},
renderOptionGroup_unstable: function() {
return _renderOptionGroup.renderOptionGroup_unstable;
},
useOptionGroupStyles_unstable: function() {
return _useOptionGroupStylesstyles.useOptionGroupStyles_unstable;
},
useOptionGroup_unstable: function() {
return _useOptionGroup.useOptionGroup_unstable;
}
});
const _OptionGroup = require("./OptionGroup");
const _renderOptionGroup = require("./renderOptionGroup");
const _useOptionGroup = require("./useOptionGroup");
const _useOptionGroupStylesstyles = require("./useOptionGroupStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/OptionGroup/index.ts"],"sourcesContent":["export { OptionGroup } from './OptionGroup';\nexport type { OptionGroupProps, OptionGroupSlots, OptionGroupState } from './OptionGroup.types';\nexport { renderOptionGroup_unstable } from './renderOptionGroup';\nexport { useOptionGroup_unstable } from './useOptionGroup';\nexport { optionGroupClassNames, useOptionGroupStyles_unstable } from './useOptionGroupStyles.styles';\n"],"names":["OptionGroup","optionGroupClassNames","renderOptionGroup_unstable","useOptionGroupStyles_unstable","useOptionGroup_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,WAAW;eAAXA,wBAAW;;IAIXC,qBAAqB;eAArBA,iDAAqB;;IAFrBC,0BAA0B;eAA1BA,6CAA0B;;IAEHC,6BAA6B;eAA7BA,yDAA6B;;IADpDC,uBAAuB;eAAvBA,uCAAuB;;;6BAHJ;mCAEe;gCACH;4CAC6B"}
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderOptionGroup_unstable", {
enumerable: true,
get: function() {
return renderOptionGroup_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderOptionGroup_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.label && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {
children: state.label.children
}),
state.root.children
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/OptionGroup/renderOptionGroup.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { OptionGroupState, OptionGroupSlots } from './OptionGroup.types';\n\n/**\n * Render the final JSX of OptionGroup\n */\nexport const renderOptionGroup_unstable = (state: OptionGroupState) => {\n assertSlots<OptionGroupSlots>(state);\n\n return (\n <state.root>\n {state.label && <state.label>{state.label.children}</state.label>}\n {state.root.children}\n </state.root>\n );\n};\n"],"names":["renderOptionGroup_unstable","state","assertSlots","_jsxs","root","label","_jsx","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAE9B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,KAAK,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,KAAK,EAAA;0BAAEJ,MAAMI,KAAK,CAACE,QAAQ;;YACjDN,MAAMG,IAAI,CAACG,QAAQ;;;AAG1B"}
@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useOptionGroup_unstable", {
enumerable: true,
get: function() {
return useOptionGroup_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const useOptionGroup_unstable = (props, ref)=>{
const labelId = (0, _reactutilities.useId)('group-label');
const { label } = props;
return {
components: {
root: 'div',
label: 'span'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
role: 'group',
'aria-labelledby': label ? labelId : undefined,
...props
}), {
elementType: 'div'
}),
label: _reactutilities.slot.optional(label, {
defaultProps: {
id: labelId,
role: 'presentation'
},
elementType: 'span'
})
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/OptionGroup/useOptionGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport type { OptionGroupProps, OptionGroupState } from './OptionGroup.types';\n\n/**\n * Create the state required to render OptionGroup.\n *\n * The returned state can be modified with hooks such as useOptionGroupStyles_unstable,\n * before being passed to renderOptionGroup_unstable.\n *\n * @param props - props from this instance of OptionGroup\n * @param ref - reference to root HTMLElement of OptionGroup\n */\nexport const useOptionGroup_unstable = (props: OptionGroupProps, ref: React.Ref<HTMLElement>): OptionGroupState => {\n const labelId = useId('group-label');\n const { label } = props;\n\n return {\n components: {\n root: 'div',\n label: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n role: 'group',\n 'aria-labelledby': label ? labelId : undefined,\n ...props,\n }),\n { elementType: 'div' },\n ),\n label: slot.optional(label, {\n defaultProps: {\n id: labelId,\n role: 'presentation',\n },\n elementType: 'span',\n }),\n };\n};\n"],"names":["useOptionGroup_unstable","props","ref","labelId","useId","label","components","root","slot","always","getIntrinsicElementProps","role","undefined","elementType","optional","defaultProps","id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;gCAC+B;AAY/C,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,UAAUC,IAAAA,qBAAAA,EAAM;IACtB,MAAM,EAAEC,KAAK,EAAE,GAAGJ;IAElB,OAAO;QACLK,YAAY;YACVC,MAAM;YACNF,OAAO;QACT;QACAE,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FR,KAAKA;YACLS,MAAM;YACN,mBAAmBN,QAAQF,UAAUS;YACrC,GAAGX,KAAK;QACV,IACA;YAAEY,aAAa;QAAM;QAEvBR,OAAOG,oBAAAA,CAAKM,QAAQ,CAACT,OAAO;YAC1BU,cAAc;gBACZC,IAAIb;gBACJQ,MAAM;YACR;YACAE,aAAa;QACf;IACF;AACF"}
@@ -0,0 +1,108 @@
"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, {
optionGroupClassNames: function() {
return optionGroupClassNames;
},
useOptionGroupStyles_unstable: function() {
return useOptionGroupStyles_unstable;
}
});
const _react = require("@griffel/react");
const optionGroupClassNames = {
root: 'fui-OptionGroup',
label: 'fui-OptionGroup__label'
};
/**
* Styles for the root slot
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "f22iagw",
Beiy3e4: "f1vx9l62",
Belr9w4: "fiut8dr",
B8lkq7l: "f1xxzjds",
eii1in: 0,
H93o2g: 0,
Gwp8xu: 0,
Bd39igo: "f16cmn8k",
om0q45: "f5642y",
Hl9o3s: "ffdf81h",
sl1c2c: 0,
z4hxbw: 0,
B0i58d9: 0,
Bi9x0x4: 0,
Bgurq3m: "f1bsn9kn"
},
label: {
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
sj55zd: "f11d4kpn",
mc9l5x: "ftgm304",
Be2twd7: "fy9rknc",
Bhrd7zp: "fl43uef",
Bg96gwp: "fwrc4pm",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1mpq0zz"
}
}, {
d: [
".f22iagw{display:flex;}",
".f1vx9l62{flex-direction:column;}",
".fiut8dr{row-gap:var(--spacingHorizontalXXS);}",
".f1xxzjds:not(:last-child)::after{content:\"\";}",
[
".f16cmn8k:not(:last-child)::after{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}",
{
p: -1
}
],
".f5642y:not(:last-child)::after{display:block;}",
".ffdf81h:not(:last-child)::after{padding-bottom:var(--spacingHorizontalXS);}",
[
".f1bsn9kn:not(:last-child)::after{margin:0 calc(var(--spacingHorizontalXS) * -1) var(--spacingVerticalXS);}",
{
p: -1
}
],
[
".ft85np5{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".f11d4kpn{color:var(--colorNeutralForeground3);}",
".ftgm304{display:block;}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".fl43uef{font-weight:var(--fontWeightSemibold);}",
".fwrc4pm{line-height:var(--lineHeightBase200);}",
[
".f1mpq0zz{padding:var(--spacingHorizontalS) var(--spacingHorizontalSNudge);}",
{
p: -1
}
]
]
});
const useOptionGroupStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(optionGroupClassNames.root, styles.root, state.root.className);
if (state.label) {
state.label.className = (0, _react.mergeClasses)(optionGroupClassNames.label, styles.label, state.label.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["useOptionGroupStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nexport const optionGroupClassNames = {\n root: 'fui-OptionGroup',\n label: 'fui-OptionGroup__label'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n rowGap: tokens.spacingHorizontalXXS,\n '&:not(:last-child)::after': {\n content: '\"\"',\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n display: 'block',\n paddingBottom: tokens.spacingHorizontalXS,\n margin: `0 ${`calc(${tokens.spacingHorizontalXS} * -1)`} ${tokens.spacingVerticalXS}`\n }\n },\n label: {\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase200,\n padding: `${tokens.spacingHorizontalS} ${tokens.spacingHorizontalSNudge}`\n }\n});\n/**\n * Apply styling to the OptionGroup slots based on the state\n */ export const useOptionGroupStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(optionGroupClassNames.root, styles.root, state.root.className);\n if (state.label) {\n state.label.className = mergeClasses(optionGroupClassNames.label, styles.label, state.label.className);\n }\n return state;\n};\n"],"names":["optionGroupClassNames","useOptionGroupStyles_unstable","root","label","useStyles","__styles","mc9l5x","Beiy3e4","Belr9w4","B8lkq7l","eii1in","H93o2g","Gwp8xu","Bd39igo","om0q45","Hl9o3s","sl1c2c","z4hxbw","B0i58d9","Bi9x0x4","Bgurq3m","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","sj55zd","Be2twd7","Bhrd7zp","Bg96gwp","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","d","p","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,qBAAqB;eAArBA;;IA+BIC,6BAA6B;eAA7BA;;;uBAhCwB;AAClC,MAAMD,wBAAwB;IACjCE,MAAM;IACNC,OAAO;AACX;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAH,MAAA;QAAAI,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;IAAAjB,OAAA;QAAAkB,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAApB,QAAA;QAAAqB,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;KAAA;AAAA;AAyBX,MAAMnC,gCAAiCoC,CAAAA;IAC9C;IACA,MAAMC,SAASlC;IACfiC,MAAMnC,IAAI,CAACqC,SAAS,GAAGC,IAAAA,mBAAY,EAACxC,sBAAsBE,IAAI,EAAEoC,OAAOpC,IAAI,EAAEmC,MAAMnC,IAAI,CAACqC,SAAS;IACjG,IAAIF,MAAMlC,KAAK,EAAE;QACbkC,MAAMlC,KAAK,CAACoC,SAAS,GAAGC,IAAAA,mBAAY,EAACxC,sBAAsBG,KAAK,EAAEmC,OAAOnC,KAAK,EAAEkC,MAAMlC,KAAK,CAACoC,SAAS;IACzG;IACA,OAAOF;AACX"}