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
+28
View File
@@ -0,0 +1,28 @@
"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, {
Radio: function() {
return _index.Radio;
},
radioClassNames: function() {
return _index.radioClassNames;
},
renderRadio_unstable: function() {
return _index.renderRadio_unstable;
},
useRadioStyles_unstable: function() {
return _index.useRadioStyles_unstable;
},
useRadio_unstable: function() {
return _index.useRadio_unstable;
}
});
const _index = require("./components/Radio/index");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Radio.ts"],"sourcesContent":["export type { RadioOnChangeData, RadioProps, RadioSlots, RadioState } from './components/Radio/index';\nexport {\n Radio,\n radioClassNames,\n renderRadio_unstable,\n useRadioStyles_unstable,\n useRadio_unstable,\n} from './components/Radio/index';\n"],"names":["Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,KAAK;eAALA,YAAK;;IACLC,eAAe;eAAfA,sBAAe;;IACfC,oBAAoB;eAApBA,2BAAoB;;IACpBC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,iBAAiB;eAAjBA,wBAAiB;;;uBACZ"}
+28
View File
@@ -0,0 +1,28 @@
"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, {
RadioGroup: function() {
return _index.RadioGroup;
},
radioGroupClassNames: function() {
return _index.radioGroupClassNames;
},
renderRadioGroup_unstable: function() {
return _index.renderRadioGroup_unstable;
},
useRadioGroupStyles_unstable: function() {
return _index.useRadioGroupStyles_unstable;
},
useRadioGroup_unstable: function() {
return _index.useRadioGroup_unstable;
}
});
const _index = require("./components/RadioGroup/index");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/RadioGroup.ts"],"sourcesContent":["export type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './components/RadioGroup/index';\nexport {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './components/RadioGroup/index';\n"],"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IASEA,UAAU;eAAVA,iBAAU;;IACVC,oBAAoB;eAApBA,2BAAoB;;IACpBC,yBAAyB;eAAzBA,gCAAyB;;IACzBC,4BAA4B;eAA5BA,mCAA4B;;IAC5BC,sBAAsB;eAAtBA,6BAAsB;;;uBACjB"}
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Radio", {
enumerable: true,
get: function() {
return Radio;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _renderRadio = require("./renderRadio");
const _useRadio = require("./useRadio");
const _useRadioStylesstyles = require("./useRadioStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const Radio = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRadio.useRadio_unstable)(props, ref);
(0, _useRadioStylesstyles.useRadioStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useRadioStyles_unstable')(state);
return (0, _renderRadio.renderRadio_unstable)(state);
});
Radio.displayName = 'Radio';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { RadioProps } from './Radio.types';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio: ForwardRefComponent<RadioProps> = React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n\n useRadioStyles_unstable(state);\n\n useCustomStyleHook_unstable('useRadioStyles_unstable')(state);\n\n return renderRadio_unstable(state);\n});\n\nRadio.displayName = 'Radio';\n"],"names":["Radio","React","forwardRef","props","ref","state","useRadio_unstable","useRadioStyles_unstable","useCustomStyleHook_unstable","renderRadio_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;6BAGc;0BACH;sCACM;qCACI;AAKrC,MAAMA,QAAAA,WAAAA,GAAyCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQC,IAAAA,2BAAAA,EAAkBH,OAAOC;IAEvCG,IAAAA,6CAAAA,EAAwBF;IAExBG,IAAAA,gDAAAA,EAA4B,2BAA2BH;IAEvD,OAAOI,IAAAA,iCAAAA,EAAqBJ;AAC9B;AAEAL,MAAMU,WAAW,GAAG"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Radio/Radio.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -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, {
Radio: function() {
return _Radio.Radio;
},
radioClassNames: function() {
return _useRadioStylesstyles.radioClassNames;
},
renderRadio_unstable: function() {
return _renderRadio.renderRadio_unstable;
},
useRadioStyles_unstable: function() {
return _useRadioStylesstyles.useRadioStyles_unstable;
},
useRadio_unstable: function() {
return _useRadio.useRadio_unstable;
}
});
const _Radio = require("./Radio");
const _renderRadio = require("./renderRadio");
const _useRadio = require("./useRadio");
const _useRadioStylesstyles = require("./useRadioStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Radio/index.ts"],"sourcesContent":["export { Radio } from './Radio';\nexport type { RadioOnChangeData, RadioProps, RadioSlots, RadioState } from './Radio.types';\nexport { renderRadio_unstable } from './renderRadio';\nexport { useRadio_unstable } from './useRadio';\nexport { radioClassNames, useRadioStyles_unstable } from './useRadioStyles.styles';\n"],"names":["Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAILC,eAAe;eAAfA,qCAAe;;IAFfC,oBAAoB;eAApBA,iCAAoB;;IAEHC,uBAAuB;eAAvBA,6CAAuB;;IADxCC,iBAAiB;eAAjBA,2BAAiB;;;uBAHJ;6BAEe;0BACH;sCACuB"}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRadio_unstable", {
enumerable: true,
get: function() {
return renderRadio_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderRadio_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.input, {}),
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.indicator, {}),
state.label && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Radio/renderRadio.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { RadioSlots, RadioState } from './Radio.types';\n\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = (state: RadioState) => {\n assertSlots<RadioSlots>(state);\n\n return (\n <state.root>\n <state.input />\n <state.indicator />\n {state.label && <state.label />}\n </state.root>\n );\n};\n"],"names":["renderRadio_unstable","state","assertSlots","_jsxs","root","_jsx","input","indicator","label"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,uBAAuB,CAACC;IACnCC,IAAAA,2BAAAA,EAAwBD;IAExB,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;0BACTC,IAAAA,eAAA,EAACJ,MAAMK,KAAK,EAAA,CAAA;0BACZD,IAAAA,eAAA,EAACJ,MAAMM,SAAS,EAAA,CAAA;YACfN,MAAMO,KAAK,IAAA,WAAA,GAAIH,IAAAA,eAAA,EAACJ,MAAMO,KAAK,EAAA,CAAA;;;AAGlC"}
@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRadio_unstable", {
enumerable: true,
get: function() {
return useRadio_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactlabel = require("@fluentui/react-label");
const _reactutilities = require("@fluentui/react-utilities");
const _RadioGroupContext = require("../../contexts/RadioGroupContext");
const _reacttabster = require("@fluentui/react-tabster");
const useRadio_unstable = (props, ref)=>{
const group = (0, _RadioGroupContext.useRadioGroupContextValue_unstable)();
const { name = group.name, checked = group.value !== undefined ? group.value === props.value : undefined, defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined, labelPosition = group.layout === 'horizontal-stacked' ? 'below' : 'after', disabled = group.disabled, required = group.required, 'aria-describedby': ariaDescribedBy = group['aria-describedby'], onChange } = props;
const nativeProps = (0, _reactutilities.getPartitionedNativeProps)({
props,
primarySlotTagName: 'input',
excludedPropNames: [
'checked',
'defaultChecked',
'onChange'
]
});
const root = _reactutilities.slot.always(props.root, {
defaultProps: {
ref: (0, _reacttabster.useFocusWithin)(),
...nativeProps.root
},
elementType: 'span'
});
const input = _reactutilities.slot.always(props.input, {
defaultProps: {
ref,
type: 'radio',
id: (0, _reactutilities.useId)('radio-', nativeProps.primary.id),
name,
checked,
defaultChecked,
disabled,
required,
'aria-describedby': ariaDescribedBy,
...nativeProps.primary
},
elementType: 'input'
});
input.onChange = (0, _reactutilities.mergeCallbacks)(input.onChange, (ev)=>onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
value: ev.currentTarget.value
}));
const label = _reactutilities.slot.optional(props.label, {
defaultProps: {
htmlFor: input.id,
disabled: input.disabled
},
elementType: _reactlabel.Label
});
const indicator = _reactutilities.slot.always(props.indicator, {
defaultProps: {
'aria-hidden': true
},
elementType: 'div'
});
return {
labelPosition,
components: {
root: 'span',
input: 'input',
label: _reactlabel.Label,
indicator: 'div'
},
root,
input,
label,
indicator
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport { useRadioGroupContextValue_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const group = useRadioGroupContextValue_unstable();\n\n const {\n name = group.name,\n checked = group.value !== undefined ? group.value === props.value : undefined,\n defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,\n labelPosition = group.layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = group.disabled,\n required = group.required,\n 'aria-describedby': ariaDescribedBy = group['aria-describedby'],\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = slot.always(props.root, {\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n elementType: 'span',\n });\n const input = slot.always(props.input, {\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n 'aria-describedby': ariaDescribedBy,\n ...nativeProps.primary,\n },\n elementType: 'input',\n });\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n const label = slot.optional(props.label, {\n defaultProps: { htmlFor: input.id, disabled: input.disabled },\n elementType: Label,\n });\n const indicator = slot.always(props.indicator, {\n defaultProps: { 'aria-hidden': true },\n elementType: 'div',\n });\n return {\n labelPosition,\n components: { root: 'span', input: 'input', label: Label, indicator: 'div' },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"names":["useRadio_unstable","props","ref","group","useRadioGroupContextValue_unstable","name","checked","value","undefined","defaultChecked","defaultValue","labelPosition","layout","disabled","required","ariaDescribedBy","onChange","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","root","slot","always","defaultProps","useFocusWithin","elementType","input","type","id","useId","primary","mergeCallbacks","ev","currentTarget","label","optional","htmlFor","Label","indicator","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;4BACD;gCACiD;mCACpB;8BACpB;AAYxB,MAAMA,oBAAoB,CAACC,OAAmBC;IACnD,MAAMC,QAAQC,IAAAA,qDAAAA;IAEd,MAAM,EACJC,OAAOF,MAAME,IAAI,EACjBC,UAAUH,MAAMI,KAAK,KAAKC,YAAYL,MAAMI,KAAK,KAAKN,MAAMM,KAAK,GAAGC,SAAS,EAC7EC,iBAAiBN,MAAMO,YAAY,KAAKF,YAAYL,MAAMO,YAAY,KAAKT,MAAMM,KAAK,GAAGC,SAAS,EAClGG,gBAAgBR,MAAMS,MAAM,KAAK,uBAAuB,UAAU,OAAO,EACzEC,WAAWV,MAAMU,QAAQ,EACzBC,WAAWX,MAAMW,QAAQ,EACzB,oBAAoBC,kBAAkBZ,KAAK,CAAC,mBAAmB,EAC/Da,QAAQ,EACT,GAAGf;IAEJ,MAAMgB,cAAcC,IAAAA,yCAAAA,EAA0B;QAC5CjB;QACAkB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAW;YAAkB;SAAW;IAC9D;IAEA,MAAMC,OAAOC,oBAAAA,CAAKC,MAAM,CAACtB,MAAMoB,IAAI,EAAE;QACnCG,cAAc;YACZtB,KAAKuB,IAAAA,4BAAAA;YACL,GAAGR,YAAYI,IAAI;QACrB;QACAK,aAAa;IACf;IACA,MAAMC,QAAQL,oBAAAA,CAAKC,MAAM,CAACtB,MAAM0B,KAAK,EAAE;QACrCH,cAAc;YACZtB;YACA0B,MAAM;YACNC,IAAIC,IAAAA,qBAAAA,EAAM,UAAUb,YAAYc,OAAO,CAACF,EAAE;YAC1CxB;YACAC;YACAG;YACAI;YACAC;YACA,oBAAoBC;YACpB,GAAGE,YAAYc,OAAO;QACxB;QACAL,aAAa;IACf;IACAC,MAAMX,QAAQ,GAAGgB,IAAAA,8BAAAA,EAAeL,MAAMX,QAAQ,EAAEiB,CAAAA,KAAMjB,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAWiB,IAAI;YAAE1B,OAAO0B,GAAGC,aAAa,CAAC3B,KAAK;QAAC;IACrG,MAAM4B,QAAQb,oBAAAA,CAAKc,QAAQ,CAACnC,MAAMkC,KAAK,EAAE;QACvCX,cAAc;YAAEa,SAASV,MAAME,EAAE;YAAEhB,UAAUc,MAAMd,QAAQ;QAAC;QAC5Da,aAAaY,iBAAAA;IACf;IACA,MAAMC,YAAYjB,oBAAAA,CAAKC,MAAM,CAACtB,MAAMsC,SAAS,EAAE;QAC7Cf,cAAc;YAAE,eAAe;QAAK;QACpCE,aAAa;IACf;IACA,OAAO;QACLf;QACA6B,YAAY;YAAEnB,MAAM;YAAQM,OAAO;YAASQ,OAAOG,iBAAAA;YAAOC,WAAW;QAAM;QAC3ElB;QACAM;QACAQ;QACAI;IACF;AACF"}
@@ -0,0 +1,179 @@
"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, {
radioClassNames: function() {
return radioClassNames;
},
useRadioStyles_unstable: function() {
return useRadioStyles_unstable;
}
});
const _react = require("@griffel/react");
const radioClassNames = {
root: 'fui-Radio',
indicator: 'fui-Radio__indicator',
input: 'fui-Radio__input',
label: 'fui-Radio__label'
};
// The indicator size is used by the indicator and label styles
const indicatorSize = '16px';
const useRootBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1siqwd8", "rmnplyc", {
r: [
".r1siqwd8{display:inline-flex;position:relative;}",
".r1siqwd8:focus{outline-style:none;}",
".r1siqwd8:focus-visible{outline-style:none;}",
".r1siqwd8[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}",
".r1siqwd8[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border:2px solid var(--colorStrokeFocus2);border-radius:var(--borderRadiusMedium);top:calc(2px * -1);right:calc(2px * -1);bottom:calc(2px * -1);left:calc(2px * -1);}",
".rmnplyc{display:inline-flex;position:relative;}",
".rmnplyc:focus{outline-style:none;}",
".rmnplyc:focus-visible{outline-style:none;}",
".rmnplyc[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}",
".rmnplyc[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border:2px solid var(--colorStrokeFocus2);border-radius:var(--borderRadiusMedium);top:calc(2px * -1);left:calc(2px * -1);bottom:calc(2px * -1);right:calc(2px * -1);}"
],
s: [
"@media (forced-colors: active){.r1siqwd8[data-fui-focus-within]:focus-within::after{border-top-color:Highlight;border-right-color:Highlight;border-bottom-color:Highlight;border-left-color:Highlight;}}",
"@media (forced-colors: active){.rmnplyc[data-fui-focus-within]:focus-within::after{border-top-color:Highlight;border-left-color:Highlight;border-bottom-color:Highlight;border-right-color:Highlight;}}"
]
});
const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
vertical: {
Beiy3e4: "f1vx9l62",
Bt984gj: "f122n59"
}
}, {
d: [
".f1vx9l62{flex-direction:column;}",
".f122n59{align-items:center;}"
]
});
const useInputBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rg1upok", "rzwdzb4", {
r: [
".rg1upok{position:absolute;left:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}",
".rg1upok:enabled{cursor:pointer;}",
".rg1upok:enabled~.fui-Radio__label{cursor:pointer;}",
".rg1upok:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}",
".rg1upok:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}",
".rg1upok:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}",
".rg1upok:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}",
".rg1upok:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
".rg1upok:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}",
".rg1upok:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
".rg1upok:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}",
".rg1upok:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}",
".rg1upok:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}",
".rg1upok:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}",
".rg1upok:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}",
".rzwdzb4{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}",
".rzwdzb4:enabled{cursor:pointer;}",
".rzwdzb4:enabled~.fui-Radio__label{cursor:pointer;}",
".rzwdzb4:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}",
".rzwdzb4:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}",
".rzwdzb4:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}",
".rzwdzb4:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}",
".rzwdzb4:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
".rzwdzb4:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}",
".rzwdzb4:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
".rzwdzb4:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}",
".rzwdzb4:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}",
".rzwdzb4:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}",
".rzwdzb4:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}",
".rzwdzb4:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}"
],
s: [
"@media (forced-colors: active){.rg1upok:enabled:not(:checked)~.fui-Radio__indicator{border-color:ButtonBorder;}}",
"@media (forced-colors: active){.rg1upok:enabled:checked~.fui-Radio__indicator{border-color:Highlight;color:Highlight;}.rg1upok:enabled:checked~.fui-Radio__indicator::after{background-color:Highlight;}}",
"@media (forced-colors: active){.rg1upok:disabled~.fui-Radio__label{color:GrayText;}}",
"@media (forced-colors: active){.rg1upok:disabled~.fui-Radio__indicator{border-color:GrayText;color:GrayText;}.rg1upok:disabled~.fui-Radio__indicator::after{background-color:GrayText;}}",
"@media (forced-colors: active){.rzwdzb4:enabled:not(:checked)~.fui-Radio__indicator{border-color:ButtonBorder;}}",
"@media (forced-colors: active){.rzwdzb4:enabled:checked~.fui-Radio__indicator{border-color:Highlight;color:Highlight;}.rzwdzb4:enabled:checked~.fui-Radio__indicator::after{background-color:Highlight;}}",
"@media (forced-colors: active){.rzwdzb4:disabled~.fui-Radio__label{color:GrayText;}}",
"@media (forced-colors: active){.rzwdzb4:disabled~.fui-Radio__indicator{border-color:GrayText;color:GrayText;}.rzwdzb4:disabled~.fui-Radio__indicator::after{background-color:GrayText;}}"
]
});
const useInputStyles = /*#__PURE__*/ (0, _react.__styles)({
below: {
a9b677: "fly5x3f",
Bqenvij: "f1je6zif"
},
defaultIndicator: {
Blbys7f: "f9ma1gx"
},
customIndicator: {
Bj53wkj: "f12zxao0"
}
}, {
d: [
".fly5x3f{width:100%;}",
".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}",
".f9ma1gx:checked~.fui-Radio__indicator::after{content:\"\";}",
".f12zxao0:not(:checked)~.fui-Radio__indicator>*{opacity:0;}"
]
});
const useIndicatorBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rwtekvw", null, [
".rwtekvw{position:relative;width:16px;height:16px;font-size:12px;box-sizing:border-box;flex-shrink:0;display:flex;align-items:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}",
".rwtekvw::after{position:absolute;width:16px;height:16px;border-radius:var(--borderRadiusCircular);transform:scale(0.625);background-color:currentColor;}"
]);
// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
const useLabelStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
qb2dma: "f7nlbp4",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1f5q0n8"
},
after: {
uwmqm3: [
"fruq291",
"f7x41pl"
],
B6of3ja: "fjzwpt6",
jrapky: "fh6j2fo"
},
below: {
z8tnut: "f1ywm7hm",
fsow6f: "f17mccla"
}
}, {
d: [
".f7nlbp4{align-self:center;}",
[
".f1f5q0n8{padding:var(--spacingVerticalS) var(--spacingHorizontalS);}",
{
p: -1
}
],
".fruq291{padding-left:var(--spacingHorizontalXS);}",
".f7x41pl{padding-right:var(--spacingHorizontalXS);}",
".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}",
".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}",
".f1ywm7hm{padding-top:var(--spacingVerticalXS);}",
".f17mccla{text-align:center;}"
]
});
const useRadioStyles_unstable = (state)=>{
'use no memo';
const { labelPosition } = state;
const rootBaseClassName = useRootBaseClassName();
const rootStyles = useRootStyles();
state.root.className = (0, _react.mergeClasses)(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
const inputBaseClassName = useInputBaseClassName();
const inputStyles = useInputStyles();
state.input.className = (0, _react.mergeClasses)(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator, state.input.className);
const indicatorBaseClassName = useIndicatorBaseClassName();
state.indicator.className = (0, _react.mergeClasses)(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
const labelStyles = useLabelStyles();
if (state.label) {
state.label.className = (0, _react.mergeClasses)(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
}
return state;
};
File diff suppressed because one or more lines are too long
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "RadioGroup", {
enumerable: true,
get: function() {
return RadioGroup;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _renderRadioGroup = require("./renderRadioGroup");
const _useRadioGroup = require("./useRadioGroup");
const _useRadioGroupStylesstyles = require("./useRadioGroupStyles.styles");
const _useRadioGroupContextValues = require("../../contexts/useRadioGroupContextValues");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const RadioGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRadioGroup.useRadioGroup_unstable)(props, ref);
const contextValues = (0, _useRadioGroupContextValues.useRadioGroupContextValues)(state);
(0, _useRadioGroupStylesstyles.useRadioGroupStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useRadioGroupStyles_unstable')(state);
return (0, _renderRadioGroup.renderRadioGroup_unstable)(state, contextValues);
});
RadioGroup.displayName = 'RadioGroup';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles.styles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n\n useRadioGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useRadioGroupStyles_unstable')(state);\n\n return renderRadioGroup_unstable(state, contextValues);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["RadioGroup","React","forwardRef","props","ref","state","useRadioGroup_unstable","contextValues","useRadioGroupContextValues","useRadioGroupStyles_unstable","useCustomStyleHook_unstable","renderRadioGroup_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;kCAGmB;+BACH;2CACM;4CACF;qCACC;AAKrC,MAAMA,aAAAA,WAAAA,GAAmDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQC,IAAAA,qCAAAA,EAAuBH,OAAOC;IAC5C,MAAMG,gBAAgBC,IAAAA,sDAAAA,EAA2BH;IAEjDI,IAAAA,uDAAAA,EAA6BJ;IAE7BK,IAAAA,gDAAAA,EAA4B,gCAAgCL;IAE5D,OAAOM,IAAAA,2CAAAA,EAA0BN,OAAOE;AAC1C;AAEAP,WAAWY,WAAW,GAAG"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RadioGroup/RadioGroup.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require a selection in this group. Adds the `required` prop to all child Radio items.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Pick<RadioGroupProps, 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required' | 'aria-describedby'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -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, {
RadioGroup: function() {
return _RadioGroup.RadioGroup;
},
radioGroupClassNames: function() {
return _useRadioGroupStylesstyles.radioGroupClassNames;
},
renderRadioGroup_unstable: function() {
return _renderRadioGroup.renderRadioGroup_unstable;
},
useRadioGroupStyles_unstable: function() {
return _useRadioGroupStylesstyles.useRadioGroupStyles_unstable;
},
useRadioGroup_unstable: function() {
return _useRadioGroup.useRadioGroup_unstable;
}
});
const _RadioGroup = require("./RadioGroup");
const _renderRadioGroup = require("./renderRadioGroup");
const _useRadioGroup = require("./useRadioGroup");
const _useRadioGroupStylesstyles = require("./useRadioGroupStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RadioGroup/index.ts"],"sourcesContent":["export { RadioGroup } from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup.types';\nexport { renderRadioGroup_unstable } from './renderRadioGroup';\nexport { useRadioGroup_unstable } from './useRadioGroup';\nexport { radioGroupClassNames, useRadioGroupStyles_unstable } from './useRadioGroupStyles.styles';\n"],"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,UAAU;eAAVA,sBAAU;;IAWVC,oBAAoB;eAApBA,+CAAoB;;IAFpBC,yBAAyB;eAAzBA,2CAAyB;;IAEHC,4BAA4B;eAA5BA,uDAA4B;;IADlDC,sBAAsB;eAAtBA,qCAAsB;;;4BAVJ;kCASe;+BACH;2CAC4B"}
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRadioGroup_unstable", {
enumerable: true,
get: function() {
return renderRadioGroup_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _RadioGroupContext = require("../../contexts/RadioGroupContext");
const renderRadioGroup_unstable = (state, contextValues)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_RadioGroupContext.RadioGroupContext.Provider, {
value: contextValues.radioGroup,
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RadioGroup/renderRadioGroup.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n assertSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <state.root />\n </RadioGroupContext.Provider>\n );\n};\n"],"names":["renderRadioGroup_unstable","state","contextValues","assertSlots","_jsx","RadioGroupContext","Provider","value","radioGroup","root"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAE4B;mCACM;AAM3B,MAAMA,4BAA4B,CAACC,OAAwBC;IAChEC,IAAAA,2BAAAA,EAA6BF;IAE7B,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,oCAAAA,CAAkBC,QAAQ,EAAA;QAACC,OAAOL,cAAcM,UAAU;kBACzD,WAAA,GAAAJ,IAAAA,eAAA,EAACH,MAAMQ,IAAI,EAAA,CAAA;;AAGjB"}
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRadioGroup_unstable", {
enumerable: true,
get: function() {
return useRadioGroup_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactfield = require("@fluentui/react-field");
const _reactutilities = require("@fluentui/react-utilities");
const useRadioGroup_unstable = (props, ref)=>{
// Merge props from surrounding <Field>, if any
props = (0, _reactfield.useFieldControlProps_unstable)(props);
const generatedName = (0, _reactutilities.useId)('radiogroup-');
const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;
return {
layout,
name,
value,
defaultValue,
disabled,
required,
components: {
root: 'div'
},
root: {
ref,
role: 'radiogroup',
..._reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', props, /*excludedPropNames:*/ [
'onChange',
'name'
]), {
elementType: 'div'
}),
onChange: (0, _reactutilities.useEventCallback)((ev)=>{
if (onChange && (0, _reactutilities.isHTMLElement)(ev.target, {
constructorName: 'HTMLInputElement'
}) && ev.target.type === 'radio') {
onChange(ev, {
value: ev.target.value
});
}
})
}
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RadioGroup/useRadioGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { getIntrinsicElementProps, isHTMLElement, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props);\n\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;\n\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...slot.always(getIntrinsicElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']), {\n elementType: 'div',\n }),\n onChange: useEventCallback(ev => {\n if (\n onChange &&\n isHTMLElement(ev.target, { constructorName: 'HTMLInputElement' }) &&\n ev.target.type === 'radio'\n ) {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"names":["useRadioGroup_unstable","props","ref","useFieldControlProps_unstable","generatedName","useId","name","value","defaultValue","disabled","layout","onChange","required","components","root","role","slot","always","getIntrinsicElementProps","elementType","useEventCallback","ev","isHTMLElement","target","constructorName","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;;iEAdU;4BACuB;gCACyC;AAYhF,MAAMA,yBAAyB,CAACC,OAAwBC;IAC7D,+CAA+C;IAC/CD,QAAQE,IAAAA,yCAAAA,EAA8BF;IAEtC,MAAMG,gBAAgBC,IAAAA,qBAAAA,EAAM;IAE5B,MAAM,EAAEC,OAAOF,aAAa,EAAEG,KAAK,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,SAAS,UAAU,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGX;IAEzG,OAAO;QACLS;QACAJ;QACAC;QACAC;QACAC;QACAG;QACAC,YAAY;YACVC,MAAM;QACR;QACAA,MAAM;YACJZ;YACAa,MAAM;YACN,GAAGC,oBAAAA,CAAKC,MAAM,CAACC,IAAAA,wCAAAA,EAAyB,OAAOjB,OAAO,oBAAoB,GAAG;gBAAC;gBAAY;aAAO,GAAG;gBAClGkB,aAAa;YACf,EAAE;YACFR,UAAUS,IAAAA,gCAAAA,EAAiBC,CAAAA;gBACzB,IACEV,YACAW,IAAAA,6BAAAA,EAAcD,GAAGE,MAAM,EAAE;oBAAEC,iBAAiB;gBAAmB,MAC/DH,GAAGE,MAAM,CAACE,IAAI,KAAK,SACnB;oBACAd,SAASU,IAAI;wBAAEd,OAAOc,GAAGE,MAAM,CAAChB,KAAK;oBAAC;gBACxC;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,43 @@
"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, {
radioGroupClassNames: function() {
return radioGroupClassNames;
},
useRadioGroupStyles_unstable: function() {
return useRadioGroupStyles_unstable;
}
});
const _react = require("@griffel/react");
const radioGroupClassNames = {
root: 'fui-RadioGroup'
};
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "f22iagw",
Bt984gj: "f6jr5hl"
},
vertical: {
Beiy3e4: "f1vx9l62"
}
}, {
d: [
".f22iagw{display:flex;}",
".f6jr5hl{align-items:flex-start;}",
".f1vx9l62{flex-direction:column;}"
]
});
const useRadioGroupStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["useRadioGroupStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const radioGroupClassNames = {\n root: 'fui-RadioGroup'\n};\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'flex-start'\n },\n vertical: {\n flexDirection: 'column'\n }\n});\n/**\n * Apply styling to the RadioGroup slots based on the state\n */ export const useRadioGroupStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);\n return state;\n};\n"],"names":["radioGroupClassNames","useRadioGroupStyles_unstable","root","useStyles","__styles","mc9l5x","Bt984gj","vertical","Beiy3e4","d","state","styles","className","mergeClasses","layout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACaA,oBAAoB;eAApBA;;IAcIC,4BAA4B;eAA5BA;;;uBAfwB;AAClC,MAAMD,uBAAuB;IAChCE,MAAM;AACV;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAF,MAAA;QAAAG,QAAA;QAAAC,SAAA;IAAA;IAAAC,UAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAWP,MAAMR,+BAAgCS,CAAAA;IAC7C;IACA,MAAMC,SAASR;IACfO,MAAMR,IAAI,CAACU,SAAS,GAAGC,IAAAA,mBAAY,EAACb,qBAAqBE,IAAI,EAAES,OAAOT,IAAI,EAAEQ,MAAMI,MAAM,KAAK,cAAcH,OAAOJ,QAAQ,EAAEG,MAAMR,IAAI,CAACU,SAAS;IAChJ,OAAOF;AACX"}
@@ -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, {
RadioGroupContext: function() {
return RadioGroupContext;
},
RadioGroupProvider: function() {
return RadioGroupProvider;
},
useRadioGroupContextValue_unstable: function() {
return useRadioGroupContextValue_unstable;
},
useRadioGroupContext_unstable: function() {
return useRadioGroupContext_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const RadioGroupContext = /*#__PURE__*/ _react.createContext(undefined);
const radioGroupContextDefaultValue = {};
const RadioGroupProvider = RadioGroupContext.Provider;
const useRadioGroupContextValue_unstable = ()=>_react.useContext(RadioGroupContext) || radioGroupContextDefaultValue;
const useRadioGroupContext_unstable = (selector)=>selector(useRadioGroupContextValue_unstable());
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/RadioGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue | undefined>(undefined);\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\n/**\n * Get the value of the RadioGroupContext.\n */\nexport const useRadioGroupContextValue_unstable = () =>\n React.useContext(RadioGroupContext) || radioGroupContextDefaultValue;\n\n/**\n * @deprecated Use useRadioGroupContextValue_unstable instead.\n * RadioGroupContext is no longer a selector context, and no longer benefits from having a selector.\n */\nexport const useRadioGroupContext_unstable = <T>(selector: (ctx: RadioGroupContextValue) => T): T =>\n selector(useRadioGroupContextValue_unstable());\n"],"names":["RadioGroupContext","RadioGroupProvider","useRadioGroupContextValue_unstable","useRadioGroupContext_unstable","React","createContext","undefined","radioGroupContextDefaultValue","Provider","useContext","selector"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,iBAAAA;eAAAA;;IAIAC,kBAAAA;eAAAA;;IAKAC,kCAAAA;eAAAA;;IAOAC,6BAAAA;eAAAA;;;;iEAvBU;AAOhB,MAAMH,kCAAoBI,OAAMC,aAAa,CAAqCC;AAEzF,MAAMC,gCAAwD,CAAC;AAExD,MAAMN,qBAAqBD,kBAAkBQ,QAAQ;AAKrD,MAAMN,qCAAqC,IAChDE,OAAMK,UAAU,CAACT,sBAAsBO;AAMlC,MAAMJ,gCAAgC,CAAIO,WAC/CA,SAASR"}
+29
View File
@@ -0,0 +1,29 @@
"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, {
RadioGroupContext: function() {
return _RadioGroupContext.RadioGroupContext;
},
RadioGroupProvider: function() {
return _RadioGroupContext.RadioGroupProvider;
},
useRadioGroupContextValue_unstable: function() {
return _RadioGroupContext.useRadioGroupContextValue_unstable;
},
useRadioGroupContextValues: function() {
return _useRadioGroupContextValues.useRadioGroupContextValues;
},
useRadioGroupContext_unstable: function() {
return _RadioGroupContext.useRadioGroupContext_unstable;
}
});
const _RadioGroupContext = require("./RadioGroupContext");
const _useRadioGroupContextValues = require("./useRadioGroupContextValues");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export {\n RadioGroupContext,\n RadioGroupProvider,\n useRadioGroupContextValue_unstable,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n useRadioGroupContext_unstable,\n} from './RadioGroupContext';\nexport { useRadioGroupContextValues } from './useRadioGroupContextValues';\n"],"names":["RadioGroupContext","RadioGroupProvider","useRadioGroupContextValue_unstable","useRadioGroupContextValues","useRadioGroupContext_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,iBAAiB;eAAjBA,oCAAiB;;IACjBC,kBAAkB;eAAlBA,qCAAkB;;IAClBC,kCAAkC;eAAlCA,qDAAkC;;IAI3BC,0BAA0B;eAA1BA,sDAA0B;;IAFjCC,6BAA6B;eAA7BA,gDAA6B;;;mCACxB;4CACoC"}
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRadioGroupContextValues", {
enumerable: true,
get: function() {
return useRadioGroupContextValues;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const useRadioGroupContextValues = (state)=>{
const { name, value, defaultValue, disabled, layout, required } = state;
const ariaDescribedBy = state.root['aria-describedby'];
const radioGroup = _react.useMemo(()=>({
name,
value,
defaultValue,
disabled,
layout,
required,
'aria-describedby': ariaDescribedBy
}), [
name,
value,
defaultValue,
disabled,
layout,
required,
ariaDescribedBy
]);
return {
radioGroup
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/contexts/useRadioGroupContextValues.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n const ariaDescribedBy = state.root['aria-describedby'];\n\n const radioGroup = React.useMemo<RadioGroupContextValue>(\n () => ({\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n 'aria-describedby': ariaDescribedBy,\n }),\n [name, value, defaultValue, disabled, layout, required, ariaDescribedBy],\n );\n\n return { radioGroup };\n};\n"],"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","ariaDescribedBy","root","radioGroup","React","useMemo"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;AAIhB,MAAMA,6BAA6B,CAACC;IACzC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAE,GAAGN;IAClE,MAAMO,kBAAkBP,MAAMQ,IAAI,CAAC,mBAAmB;IAEtD,MAAMC,aAAaC,OAAMC,OAAO,CAC9B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,oBAAoBC;QACtB,CAAA,GACA;QAACN;QAAMC;QAAOC;QAAcC;QAAUC;QAAQC;QAAUC;KAAgB;IAG1E,OAAO;QAAEE;IAAW;AACtB"}
+57
View File
@@ -0,0 +1,57 @@
"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, {
Radio: function() {
return _Radio.Radio;
},
RadioGroup: function() {
return _RadioGroup.RadioGroup;
},
RadioGroupProvider: function() {
return _index.RadioGroupProvider;
},
radioClassNames: function() {
return _Radio.radioClassNames;
},
radioGroupClassNames: function() {
return _RadioGroup.radioGroupClassNames;
},
renderRadioGroup_unstable: function() {
return _RadioGroup.renderRadioGroup_unstable;
},
renderRadio_unstable: function() {
return _Radio.renderRadio_unstable;
},
useRadioGroupContextValue_unstable: function() {
return _index.useRadioGroupContextValue_unstable;
},
useRadioGroupContextValues: function() {
return _index.useRadioGroupContextValues;
},
useRadioGroupContext_unstable: function() {
return _index.useRadioGroupContext_unstable;
},
useRadioGroupStyles_unstable: function() {
return _RadioGroup.useRadioGroupStyles_unstable;
},
useRadioGroup_unstable: function() {
return _RadioGroup.useRadioGroup_unstable;
},
useRadioStyles_unstable: function() {
return _Radio.useRadioStyles_unstable;
},
useRadio_unstable: function() {
return _Radio.useRadio_unstable;
}
});
const _RadioGroup = require("./RadioGroup");
const _Radio = require("./Radio");
const _index = require("./contexts/index");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport {\n RadioGroupProvider,\n useRadioGroupContextValues,\n useRadioGroupContext_unstable, // eslint-disable-line @typescript-eslint/no-deprecated\n useRadioGroupContextValue_unstable,\n} from './contexts/index';\n"],"names":["Radio","RadioGroup","RadioGroupProvider","radioClassNames","radioGroupClassNames","renderRadioGroup_unstable","renderRadio_unstable","useRadioGroupContextValue_unstable","useRadioGroupContextValues","useRadioGroupContext_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","useRadioStyles_unstable","useRadio_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAeSA,KAAK;eAALA,YAAK;;IAdZC,UAAU;eAAVA,sBAAU;;IAiBVC,kBAAkB;eAAlBA,yBAAkB;;IAHJC,eAAe;eAAfA,sBAAe;;IAb7BC,oBAAoB;eAApBA,gCAAoB;;IACpBC,yBAAyB;eAAzBA,qCAAyB;;IAYMC,oBAAoB;eAApBA,2BAAoB;;IAMnDC,kCAAkC;eAAlCA,yCAAkC;;IAFlCC,0BAA0B;eAA1BA,iCAA0B;;IAC1BC,6BAA6B;eAA7BA,oCAA6B;;IAhB7BC,4BAA4B;eAA5BA,wCAA4B;;IAC5BC,sBAAsB;eAAtBA,kCAAsB;;IAU+BC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;;4BAT1F;uBASkG;uBAOlG"}