@fluentui/react-field 9.0.0-alpha.1 → 9.0.0-alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +671 -1
- package/CHANGELOG.md +176 -2
- package/dist/index.d.ts +30 -95
- package/lib/Field.js.map +1 -1
- package/lib/components/Field/Field.types.js.map +1 -1
- package/lib/components/Field/SlotComponent.types.js.map +1 -1
- package/lib/components/Field/index.js.map +1 -1
- package/lib/components/Field/renderField.js.map +1 -1
- package/lib/components/Field/useField.js +30 -25
- package/lib/components/Field/useField.js.map +1 -1
- package/lib/components/Field/useFieldStyles.js +3 -3
- package/lib/components/Field/useFieldStyles.js.map +1 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +1 -1
- package/lib-amd/Field.js +6 -0
- package/lib-amd/Field.js.map +1 -0
- package/lib-amd/components/Field/Field.types.js +5 -0
- package/lib-amd/components/Field/Field.types.js.map +1 -0
- package/lib-amd/components/Field/SlotComponent.types.js +5 -0
- package/lib-amd/components/Field/SlotComponent.types.js.map +1 -0
- package/lib-amd/components/Field/index.js +9 -0
- package/lib-amd/components/Field/index.js.map +1 -0
- package/lib-amd/components/Field/renderField.js +20 -0
- package/lib-amd/components/Field/renderField.js.map +1 -0
- package/lib-amd/components/Field/useField.js +119 -0
- package/lib-amd/components/Field/useField.js.map +1 -0
- package/lib-amd/components/Field/useFieldStyles.js +97 -0
- package/lib-amd/components/Field/useFieldStyles.js.map +1 -0
- package/lib-amd/index.js +10 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-commonjs/Field.js.map +1 -1
- package/lib-commonjs/components/Field/index.js.map +1 -1
- package/lib-commonjs/components/Field/renderField.js.map +1 -1
- package/lib-commonjs/components/Field/useField.js +30 -25
- package/lib-commonjs/components/Field/useField.js.map +1 -1
- package/lib-commonjs/components/Field/useFieldStyles.js +4 -4
- package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -136
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +22 -24
- package/Spec.md +0 -354
- package/lib/CheckboxField.js +0 -2
- package/lib/CheckboxField.js.map +0 -1
- package/lib/ComboboxField.js +0 -2
- package/lib/ComboboxField.js.map +0 -1
- package/lib/InputField.js +0 -2
- package/lib/InputField.js.map +0 -1
- package/lib/RadioGroupField.js +0 -2
- package/lib/RadioGroupField.js.map +0 -1
- package/lib/SelectField.js +0 -2
- package/lib/SelectField.js.map +0 -1
- package/lib/SliderField.js +0 -2
- package/lib/SliderField.js.map +0 -1
- package/lib/SpinButtonField.js +0 -2
- package/lib/SpinButtonField.js.map +0 -1
- package/lib/SwitchField.js +0 -2
- package/lib/SwitchField.js.map +0 -1
- package/lib/TextareaField.js +0 -2
- package/lib/TextareaField.js.map +0 -1
- package/lib/components/CheckboxField/CheckboxField.js +0 -32
- package/lib/components/CheckboxField/CheckboxField.js.map +0 -1
- package/lib/components/CheckboxField/index.js +0 -2
- package/lib/components/CheckboxField/index.js.map +0 -1
- package/lib/components/ComboboxField/ComboboxField.js +0 -14
- package/lib/components/ComboboxField/ComboboxField.js.map +0 -1
- package/lib/components/ComboboxField/index.js +0 -2
- package/lib/components/ComboboxField/index.js.map +0 -1
- package/lib/components/InputField/InputField.js +0 -14
- package/lib/components/InputField/InputField.js.map +0 -1
- package/lib/components/InputField/index.js +0 -2
- package/lib/components/InputField/index.js.map +0 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +0 -15
- package/lib/components/RadioGroupField/RadioGroupField.js.map +0 -1
- package/lib/components/RadioGroupField/index.js +0 -2
- package/lib/components/RadioGroupField/index.js.map +0 -1
- package/lib/components/SelectField/SelectField.js +0 -14
- package/lib/components/SelectField/SelectField.js.map +0 -1
- package/lib/components/SelectField/index.js +0 -2
- package/lib/components/SelectField/index.js.map +0 -1
- package/lib/components/SliderField/SliderField.js +0 -14
- package/lib/components/SliderField/SliderField.js.map +0 -1
- package/lib/components/SliderField/index.js +0 -2
- package/lib/components/SliderField/index.js.map +0 -1
- package/lib/components/SpinButtonField/SpinButtonField.js +0 -14
- package/lib/components/SpinButtonField/SpinButtonField.js.map +0 -1
- package/lib/components/SpinButtonField/index.js +0 -2
- package/lib/components/SpinButtonField/index.js.map +0 -1
- package/lib/components/SwitchField/SwitchField.js +0 -14
- package/lib/components/SwitchField/SwitchField.js.map +0 -1
- package/lib/components/SwitchField/index.js +0 -2
- package/lib/components/SwitchField/index.js.map +0 -1
- package/lib/components/TextareaField/TextareaField.js +0 -14
- package/lib/components/TextareaField/TextareaField.js.map +0 -1
- package/lib/components/TextareaField/index.js +0 -2
- package/lib/components/TextareaField/index.js.map +0 -1
- package/lib-commonjs/CheckboxField.js +0 -10
- package/lib-commonjs/CheckboxField.js.map +0 -1
- package/lib-commonjs/ComboboxField.js +0 -10
- package/lib-commonjs/ComboboxField.js.map +0 -1
- package/lib-commonjs/InputField.js +0 -10
- package/lib-commonjs/InputField.js.map +0 -1
- package/lib-commonjs/RadioGroupField.js +0 -10
- package/lib-commonjs/RadioGroupField.js.map +0 -1
- package/lib-commonjs/SelectField.js +0 -10
- package/lib-commonjs/SelectField.js.map +0 -1
- package/lib-commonjs/SliderField.js +0 -10
- package/lib-commonjs/SliderField.js.map +0 -1
- package/lib-commonjs/SpinButtonField.js +0 -10
- package/lib-commonjs/SpinButtonField.js.map +0 -1
- package/lib-commonjs/SwitchField.js +0 -10
- package/lib-commonjs/SwitchField.js.map +0 -1
- package/lib-commonjs/TextareaField.js +0 -10
- package/lib-commonjs/TextareaField.js.map +0 -1
- package/lib-commonjs/components/CheckboxField/CheckboxField.js +0 -42
- package/lib-commonjs/components/CheckboxField/CheckboxField.js.map +0 -1
- package/lib-commonjs/components/CheckboxField/index.js +0 -10
- package/lib-commonjs/components/CheckboxField/index.js.map +0 -1
- package/lib-commonjs/components/ComboboxField/ComboboxField.js +0 -24
- package/lib-commonjs/components/ComboboxField/ComboboxField.js.map +0 -1
- package/lib-commonjs/components/ComboboxField/index.js +0 -10
- package/lib-commonjs/components/ComboboxField/index.js.map +0 -1
- package/lib-commonjs/components/InputField/InputField.js +0 -24
- package/lib-commonjs/components/InputField/InputField.js.map +0 -1
- package/lib-commonjs/components/InputField/index.js +0 -10
- package/lib-commonjs/components/InputField/index.js.map +0 -1
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +0 -25
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +0 -1
- package/lib-commonjs/components/RadioGroupField/index.js +0 -10
- package/lib-commonjs/components/RadioGroupField/index.js.map +0 -1
- package/lib-commonjs/components/SelectField/SelectField.js +0 -24
- package/lib-commonjs/components/SelectField/SelectField.js.map +0 -1
- package/lib-commonjs/components/SelectField/index.js +0 -10
- package/lib-commonjs/components/SelectField/index.js.map +0 -1
- package/lib-commonjs/components/SliderField/SliderField.js +0 -24
- package/lib-commonjs/components/SliderField/SliderField.js.map +0 -1
- package/lib-commonjs/components/SliderField/index.js +0 -10
- package/lib-commonjs/components/SliderField/index.js.map +0 -1
- package/lib-commonjs/components/SpinButtonField/SpinButtonField.js +0 -24
- package/lib-commonjs/components/SpinButtonField/SpinButtonField.js.map +0 -1
- package/lib-commonjs/components/SpinButtonField/index.js +0 -10
- package/lib-commonjs/components/SpinButtonField/index.js.map +0 -1
- package/lib-commonjs/components/SwitchField/SwitchField.js +0 -24
- package/lib-commonjs/components/SwitchField/SwitchField.js.map +0 -1
- package/lib-commonjs/components/SwitchField/index.js +0 -10
- package/lib-commonjs/components/SwitchField/index.js.map +0 -1
- package/lib-commonjs/components/TextareaField/TextareaField.js +0 -24
- package/lib-commonjs/components/TextareaField/TextareaField.js.map +0 -1
- package/lib-commonjs/components/TextareaField/index.js +0 -10
- package/lib-commonjs/components/TextareaField/index.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Field/useField.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,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A,KAAK,CAAC,OAAN,MAAa,IAAb,IAAa,EAAA,KAAA,KAAA,CAAb,GAAa,EAAb,GAAA,KAAK,CAAC,OAAN,GAAkB,OAAO,CAAC,EAA1B;EACD;;EAED,MAAM,KAAK,GAA6B;IACtC,WADsC;IAEtC,eAFsC;IAGtC,UAAU,EAAE,MAAM,CAAC,UAHmB;IAItC,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,OAAO,EAAE,MAAM,CAAC,SAFN;MAGV,KAAK,EAAE,aAAA,CAAA,KAHG;MAIV,iBAAiB,EAAE,KAJT;MAKV,qBAAqB,EAAE,MALb;MAMV,IAAI,EAAE;IANI,CAJ0B;IAYtC,IAZsC;IAatC,OAbsC;IActC,KAdsC;IAetC,qBAfsC;IAgBtC,iBAhBsC;IAiBtC;EAjBsC,CAAxC;EAoBA,OAAO,KAAP;AACD,CAhGM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourcesContent":["import * as React from 'react';\nimport { CheckmarkCircle12Filled, ErrorCircle12Filled, Warning12Filled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { FieldConfig, FieldControl, FieldPropsWithOptionalComponentProps, FieldState } from './Field.types';\n\nconst validationMessageIcons = {\n error: <ErrorCircle12Filled />,\n warning: <Warning12Filled />,\n success: <CheckmarkCircle12Filled />,\n} as const;\n\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nexport const getPartitionedFieldProps = (props: FieldPropsWithOptionalComponentProps<FieldControl>) => {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n root,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...restOfProps\n } = props;\n\n const fieldProps = {\n className,\n control,\n hint,\n label,\n orientation,\n root,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n };\n\n return [fieldProps, restOfProps] as const;\n};\n\n/**\n * Create the state required to render Field.\n *\n * The returned state can be modified with hooks such as useFieldStyles_unstable,\n * before being passed to renderField_unstable.\n *\n * @param props - Props passed to this field\n * @param ref - Ref to the control slot (primary slot)\n * @param params - Configuration parameters for this Field\n */\nexport const useField_unstable = <T extends FieldControl>(\n props: FieldPropsWithOptionalComponentProps<T>,\n ref: React.Ref<HTMLElement>,\n params: FieldConfig<T>,\n): FieldState<T> => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(props);\n const { orientation = 'vertical', validationState } = fieldProps;\n const { labelConnection = 'htmlFor', ariaInvalidOnError = true } = params;\n\n const baseId = useId('field-');\n\n const root = resolveShorthand(fieldProps.root, {\n required: true,\n defaultProps: getNativeElementProps('div', fieldProps),\n });\n\n const label = resolveShorthand(fieldProps.label, {\n defaultProps: {\n id: baseId + '__label',\n required: controlProps.required,\n size: typeof controlProps.size === 'string' ? controlProps.size : undefined,\n // htmlFor is handled below\n },\n });\n\n const validationMessage = resolveShorthand(fieldProps.validationMessage, {\n defaultProps: {\n id: baseId + '__validationMessage',\n },\n });\n\n const hint = resolveShorthand(fieldProps.hint, {\n defaultProps: {\n id: baseId + '__hint',\n },\n });\n\n const validationMessageIcon = resolveShorthand(fieldProps.validationMessageIcon, {\n required: !!validationState,\n defaultProps: {\n children: validationState ? validationMessageIcons[validationState] : undefined,\n },\n });\n\n // Hook up aria props on the control\n if (label && labelConnection === 'aria-labelledby') {\n controlProps['aria-labelledby'] ??= label.id;\n }\n\n if (validationMessage || hint) {\n // The control is described by the validation message, or hint, or both\n // We also preserve and append any aria-describedby supplied by the user\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n controlProps['aria-describedby'] = [validationMessage?.id, hint?.id, controlProps['aria-describedby']]\n .filter(Boolean)\n .join(' ');\n }\n\n if (validationState === 'error' && ariaInvalidOnError) {\n controlProps['aria-invalid'] ??= true;\n }\n\n const control = resolveShorthand(fieldProps.control, {\n required: true,\n defaultProps: {\n ref,\n id: baseId + '__control',\n ...controlProps,\n },\n });\n\n if (label && labelConnection === 'htmlFor') {\n label.htmlFor ??= control.id;\n }\n\n const state: FieldState<FieldControl> = {\n orientation,\n validationState,\n classNames: params.classNames,\n components: {\n root: 'div',\n control: params.component,\n label: Label,\n validationMessage: 'div',\n validationMessageIcon: 'span',\n hint: 'div',\n },\n root,\n control,\n label,\n validationMessageIcon,\n validationMessage,\n hint,\n };\n\n return state as FieldState<T>;\n};\n"],"sourceRoot":"../src/"}
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useFieldStyles_unstable = exports.getFieldClassNames = void 0;
|
7
7
|
|
8
|
-
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
9
|
|
10
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
11
|
+
|
12
12
|
const getFieldClassNames = name => ({
|
13
13
|
root: `fui-${name}`,
|
14
14
|
control: `fui-${name}__control`,
|
@@ -25,7 +25,7 @@ exports.getFieldClassNames = getFieldClassNames;
|
|
25
25
|
|
26
26
|
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
27
27
|
"base": {
|
28
|
-
"mc9l5x": "
|
28
|
+
"mc9l5x": "f13qh94s",
|
29
29
|
"Bxotwcr": "f14np9u9",
|
30
30
|
"B7hvi0a": "f1m2n5bn"
|
31
31
|
},
|
@@ -37,7 +37,7 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
37
37
|
"Br312pm": "fd46tj4"
|
38
38
|
}
|
39
39
|
}, {
|
40
|
-
"d": [".
|
40
|
+
"d": [".f13qh94s{display:grid;}", ".f14np9u9{grid-auto-flow:row;}", ".f1m2n5bn{justify-items:start;}", ".fai812u{grid-template-rows:auto auto auto auto;}", ".fckz59x{grid-template-columns:1fr 2fr;}", ".fd46tj4{grid-column-start:2;}"]
|
41
41
|
});
|
42
42
|
|
43
43
|
const useLabelStyles = /*#__PURE__*/react_1.__styles({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Field/useFieldStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,
|
1
|
+
{"version":3,"sources":["packages/react-components/react-field/src/components/Field/useFieldStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAEA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGO,MAAM,kBAAkB,GAAI,IAAD,KAA6D;EAC7F,IAAI,EAAE,OAAO,IAAI,EAD4E;EAE7F,OAAO,EAAE,OAAO,IAAI,WAFyE;EAG7F,KAAK,EAAE,OAAO,IAAI,SAH2E;EAI7F,iBAAiB,EAAE,OAAO,IAAI,qBAJ+D;EAK7F,qBAAqB,EAAE,OAAO,IAAI,yBAL2D;EAM7F,IAAI,EAAE,OAAO,IAAI;AAN4E,CAA7D,CAA3B;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB;AASb;;AAEG;;AACH,MAAM,aAAa,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAtB;;AAiBA,MAAM,cAAc,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAvB;;AAeA,MAAM,sBAAsB,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA/B;;AAYA,MAAM,8BAA8B,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAvC;AAmBA;;AAEG;;;AACI,MAAM,uBAAuB,GAA4B,KAAzB,I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C,iBAAV,EAA6B;IAC3B,KAAK,CAAC,iBAAN,CAAwB,SAAxB,GAAoC,OAAA,CAAA,YAAA,CAClC,UAAU,CAAC,iBADuB,EAElC,mBAAmB,CAAC,IAFc,EAGlC,UAAU,IAAI,UAAU,CAAC,YAHS,EAIlC,eAAe,KAAK,OAApB,IAA+B,mBAAmB,CAAC,KAJjB,EAKlC,KAAK,CAAC,iBAAN,CAAwB,SALU,CAApC;EAOD;;EAED,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,UAAU,CAAC,IADU,EAErB,mBAAmB,CAAC,IAFC,EAGrB,UAAU,IAAI,UAAU,CAAC,YAHJ,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAMD;AACF,CA5DM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { FieldControl, FieldProps, FieldSlots, FieldState } from './Field.types';\n\nexport const getFieldClassNames = (name: string): SlotClassNames<FieldSlots<FieldControl>> => ({\n root: `fui-${name}`,\n control: `fui-${name}__control`,\n label: `fui-${name}__label`,\n validationMessage: `fui-${name}__validationMessage`,\n validationMessageIcon: `fui-${name}__validationMessageIcon`,\n hint: `fui-${name}__hint`,\n});\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n display: 'grid',\n gridAutoFlow: 'row',\n justifyItems: 'start',\n },\n\n horizontal: {\n gridTemplateRows: 'auto auto auto auto',\n gridTemplateColumns: '1fr 2fr',\n },\n\n secondColumn: {\n gridColumnStart: '2',\n },\n});\n\nconst useLabelStyles = makeStyles({\n base: {\n marginTop: tokens.spacingVerticalXXS,\n marginBottom: tokens.spacingVerticalXXS,\n },\n\n horizontal: {\n gridRowStart: '1',\n gridRowEnd: '-1',\n marginRight: tokens.spacingHorizontalM,\n alignSelf: 'start',\n justifySelf: 'stretch',\n },\n});\n\nconst useSecondaryTextStyles = makeStyles({\n base: {\n marginTop: tokens.spacingVerticalXXS,\n color: tokens.colorNeutralForeground3,\n ...typographyStyles.caption1,\n },\n\n error: {\n color: tokens.colorPaletteRedForeground1,\n },\n});\n\nconst useValidationMessageIconStyles = makeStyles({\n base: {\n fontSize: '12px',\n lineHeight: '12px',\n verticalAlign: 'middle',\n marginRight: tokens.spacingHorizontalXS,\n },\n\n error: {\n color: tokens.colorPaletteRedForeground1,\n },\n warning: {\n color: tokens.colorPaletteDarkOrangeForeground1,\n },\n success: {\n color: tokens.colorPaletteGreenForeground1,\n },\n});\n\n/**\n * Apply styling to the Field slots based on the state\n */\nexport const useFieldStyles_unstable = <T extends FieldControl>(state: FieldState<T>) => {\n const classNames = state.classNames;\n const validationState: FieldProps<FieldControl>['validationState'] = state.validationState;\n const horizontal = state.orientation === 'horizontal';\n\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n classNames.root,\n rootStyles.base,\n horizontal && rootStyles.horizontal,\n state.root.className,\n );\n\n if (state.control) {\n state.control.className = mergeClasses(\n classNames.control,\n horizontal && rootStyles.secondColumn,\n state.control.className,\n );\n }\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n classNames.label,\n labelStyles.base,\n horizontal && labelStyles.horizontal,\n state.label.className,\n );\n }\n\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = mergeClasses(\n classNames.validationMessageIcon,\n validationMessageIconStyles.base,\n !!validationState && validationMessageIconStyles[validationState],\n state.validationMessageIcon.className,\n );\n }\n\n const secondaryTextStyles = useSecondaryTextStyles();\n if (state.validationMessage) {\n state.validationMessage.className = mergeClasses(\n classNames.validationMessage,\n secondaryTextStyles.base,\n horizontal && rootStyles.secondColumn,\n validationState === 'error' && secondaryTextStyles.error,\n state.validationMessage.className,\n );\n }\n\n if (state.hint) {\n state.hint.className = mergeClasses(\n classNames.hint,\n secondaryTextStyles.base,\n horizontal && rootStyles.secondColumn,\n state.hint.className,\n );\n }\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useField_unstable = exports.useFieldStyles_unstable = exports.renderField_unstable = exports.getFieldClassNames = void 0;
|
7
7
|
|
8
8
|
var Field_1 = /*#__PURE__*/require("./Field");
|
9
9
|
|
@@ -31,139 +31,4 @@ Object.defineProperty(exports, "useField_unstable", {
|
|
31
31
|
return Field_1.useField_unstable;
|
32
32
|
}
|
33
33
|
});
|
34
|
-
|
35
|
-
var CheckboxField_1 = /*#__PURE__*/require("./CheckboxField");
|
36
|
-
|
37
|
-
Object.defineProperty(exports, "CheckboxField", {
|
38
|
-
enumerable: true,
|
39
|
-
get: function () {
|
40
|
-
return CheckboxField_1.CheckboxField;
|
41
|
-
}
|
42
|
-
});
|
43
|
-
Object.defineProperty(exports, "checkboxFieldClassNames", {
|
44
|
-
enumerable: true,
|
45
|
-
get: function () {
|
46
|
-
return CheckboxField_1.checkboxFieldClassNames;
|
47
|
-
}
|
48
|
-
});
|
49
|
-
|
50
|
-
var ComboboxField_1 = /*#__PURE__*/require("./ComboboxField");
|
51
|
-
|
52
|
-
Object.defineProperty(exports, "ComboboxField", {
|
53
|
-
enumerable: true,
|
54
|
-
get: function () {
|
55
|
-
return ComboboxField_1.ComboboxField;
|
56
|
-
}
|
57
|
-
});
|
58
|
-
Object.defineProperty(exports, "comboboxFieldClassNames", {
|
59
|
-
enumerable: true,
|
60
|
-
get: function () {
|
61
|
-
return ComboboxField_1.comboboxFieldClassNames;
|
62
|
-
}
|
63
|
-
});
|
64
|
-
|
65
|
-
var InputField_1 = /*#__PURE__*/require("./InputField");
|
66
|
-
|
67
|
-
Object.defineProperty(exports, "InputField", {
|
68
|
-
enumerable: true,
|
69
|
-
get: function () {
|
70
|
-
return InputField_1.InputField;
|
71
|
-
}
|
72
|
-
});
|
73
|
-
Object.defineProperty(exports, "inputFieldClassNames", {
|
74
|
-
enumerable: true,
|
75
|
-
get: function () {
|
76
|
-
return InputField_1.inputFieldClassNames;
|
77
|
-
}
|
78
|
-
});
|
79
|
-
|
80
|
-
var RadioGroupField_1 = /*#__PURE__*/require("./RadioGroupField");
|
81
|
-
|
82
|
-
Object.defineProperty(exports, "RadioGroupField", {
|
83
|
-
enumerable: true,
|
84
|
-
get: function () {
|
85
|
-
return RadioGroupField_1.RadioGroupField;
|
86
|
-
}
|
87
|
-
});
|
88
|
-
Object.defineProperty(exports, "radioGroupFieldClassNames", {
|
89
|
-
enumerable: true,
|
90
|
-
get: function () {
|
91
|
-
return RadioGroupField_1.radioGroupFieldClassNames;
|
92
|
-
}
|
93
|
-
});
|
94
|
-
|
95
|
-
var SelectField_1 = /*#__PURE__*/require("./SelectField");
|
96
|
-
|
97
|
-
Object.defineProperty(exports, "SelectField", {
|
98
|
-
enumerable: true,
|
99
|
-
get: function () {
|
100
|
-
return SelectField_1.SelectField;
|
101
|
-
}
|
102
|
-
});
|
103
|
-
Object.defineProperty(exports, "selectFieldClassNames", {
|
104
|
-
enumerable: true,
|
105
|
-
get: function () {
|
106
|
-
return SelectField_1.selectFieldClassNames;
|
107
|
-
}
|
108
|
-
});
|
109
|
-
|
110
|
-
var SliderField_1 = /*#__PURE__*/require("./SliderField");
|
111
|
-
|
112
|
-
Object.defineProperty(exports, "SliderField", {
|
113
|
-
enumerable: true,
|
114
|
-
get: function () {
|
115
|
-
return SliderField_1.SliderField;
|
116
|
-
}
|
117
|
-
});
|
118
|
-
Object.defineProperty(exports, "sliderFieldClassNames", {
|
119
|
-
enumerable: true,
|
120
|
-
get: function () {
|
121
|
-
return SliderField_1.sliderFieldClassNames;
|
122
|
-
}
|
123
|
-
});
|
124
|
-
|
125
|
-
var SpinButtonField_1 = /*#__PURE__*/require("./SpinButtonField");
|
126
|
-
|
127
|
-
Object.defineProperty(exports, "SpinButtonField", {
|
128
|
-
enumerable: true,
|
129
|
-
get: function () {
|
130
|
-
return SpinButtonField_1.SpinButtonField;
|
131
|
-
}
|
132
|
-
});
|
133
|
-
Object.defineProperty(exports, "spinButtonFieldClassNames", {
|
134
|
-
enumerable: true,
|
135
|
-
get: function () {
|
136
|
-
return SpinButtonField_1.spinButtonFieldClassNames;
|
137
|
-
}
|
138
|
-
});
|
139
|
-
|
140
|
-
var SwitchField_1 = /*#__PURE__*/require("./SwitchField");
|
141
|
-
|
142
|
-
Object.defineProperty(exports, "SwitchField", {
|
143
|
-
enumerable: true,
|
144
|
-
get: function () {
|
145
|
-
return SwitchField_1.SwitchField;
|
146
|
-
}
|
147
|
-
});
|
148
|
-
Object.defineProperty(exports, "switchFieldClassNames", {
|
149
|
-
enumerable: true,
|
150
|
-
get: function () {
|
151
|
-
return SwitchField_1.switchFieldClassNames;
|
152
|
-
}
|
153
|
-
});
|
154
|
-
|
155
|
-
var TextareaField_1 = /*#__PURE__*/require("./TextareaField");
|
156
|
-
|
157
|
-
Object.defineProperty(exports, "TextareaField", {
|
158
|
-
enumerable: true,
|
159
|
-
get: function () {
|
160
|
-
return TextareaField_1.TextareaField;
|
161
|
-
}
|
162
|
-
});
|
163
|
-
Object.defineProperty(exports, "textareaFieldClassNames", {
|
164
|
-
enumerable: true,
|
165
|
-
get: function () {
|
166
|
-
return TextareaField_1.textareaFieldClassNames;
|
167
|
-
}
|
168
|
-
});
|
169
34
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;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iBAAA;EAAiB;AAAjB,CAAA","sourcesContent":["export { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport type { FieldConfig, FieldControl, FieldProps, FieldSlots, FieldState } from './Field';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-field",
|
3
|
-
"version": "9.0.0-alpha.
|
3
|
+
"version": "9.0.0-alpha.11",
|
4
4
|
"description": "Fluent UI Field components",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "dist/index.d.ts",
|
7
|
+
"typings": "./dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -20,39 +20,29 @@
|
|
20
20
|
"start": "yarn storybook",
|
21
21
|
"storybook": "start-storybook",
|
22
22
|
"test": "jest --passWithNoTests",
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"type-check": "tsc -b tsconfig.json"
|
23
|
+
"type-check": "tsc -b tsconfig.json",
|
24
|
+
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
|
26
25
|
},
|
27
26
|
"devDependencies": {
|
28
27
|
"@fluentui/eslint-plugin": "*",
|
29
28
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
29
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.18",
|
31
30
|
"@fluentui/scripts": "^1.0.0"
|
32
31
|
},
|
33
32
|
"dependencies": {
|
34
|
-
"@fluentui/react-
|
35
|
-
"@fluentui/react-combobox": "^9.0.0-beta.9",
|
36
|
-
"@fluentui/react-context-selector": "^9.0.3",
|
33
|
+
"@fluentui/react-context-selector": "^9.1.3",
|
37
34
|
"@fluentui/react-icons": "^2.0.175",
|
38
|
-
"@fluentui/react-
|
39
|
-
"@fluentui/react-
|
40
|
-
"@fluentui/react-
|
41
|
-
"@
|
42
|
-
"@fluentui/react-slider": "^9.0.4",
|
43
|
-
"@fluentui/react-spinbutton": "^9.0.1",
|
44
|
-
"@fluentui/react-switch": "^9.0.5",
|
45
|
-
"@fluentui/react-textarea": "^9.0.5",
|
46
|
-
"@fluentui/react-theme": "^9.1.0",
|
47
|
-
"@fluentui/react-utilities": "^9.1.0",
|
48
|
-
"@griffel/react": "^1.3.0",
|
35
|
+
"@fluentui/react-label": "^9.0.13",
|
36
|
+
"@fluentui/react-theme": "^9.1.4",
|
37
|
+
"@fluentui/react-utilities": "^9.3.0",
|
38
|
+
"@griffel/react": "^1.4.2",
|
49
39
|
"tslib": "^2.1.0"
|
50
40
|
},
|
51
41
|
"peerDependencies": {
|
52
|
-
"@types/react": ">=16.8.0 <
|
53
|
-
"@types/react-dom": ">=16.8.0 <
|
54
|
-
"react": ">=16.8.0 <
|
55
|
-
"react-dom": ">=16.8.0 <
|
42
|
+
"@types/react": ">=16.8.0 <19.0.0",
|
43
|
+
"@types/react-dom": ">=16.8.0 <19.0.0",
|
44
|
+
"react": ">=16.8.0 <19.0.0",
|
45
|
+
"react-dom": ">=16.8.0 <19.0.0"
|
56
46
|
},
|
57
47
|
"beachball": {
|
58
48
|
"disallowedChangeTypes": [
|
@@ -60,5 +50,13 @@
|
|
60
50
|
"minor",
|
61
51
|
"patch"
|
62
52
|
]
|
53
|
+
},
|
54
|
+
"exports": {
|
55
|
+
".": {
|
56
|
+
"types": "./dist/index.d.ts",
|
57
|
+
"import": "./lib/index.js",
|
58
|
+
"require": "./lib-commonjs/index.js"
|
59
|
+
},
|
60
|
+
"./package.json": "./package.json"
|
63
61
|
}
|
64
62
|
}
|