@mittwald/flow-react-components 1.2.0-next.36 → 1.2.0-next.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/default.mjs +1 -1
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs +2 -4
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +2 -4
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Option/Option.mjs +10 -2
- package/dist/js/packages/components/src/components/Option/Option.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Option/optionsTunnel.mjs +36 -0
- package/dist/js/packages/components/src/components/Option/optionsTunnel.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Select/Select.mjs +2 -4
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/componentFactory/flowComponent.mjs +1 -0
- package/dist/js/packages/components/src/lib/componentFactory/flowComponent.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/types/props.mjs.map +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/types/components/Modal/components/ModalTrigger/ModalTrigger.d.ts +1 -0
- package/dist/types/components/Modal/components/ModalTrigger/ModalTrigger.d.ts.map +1 -1
- package/dist/types/components/Option/Option.d.ts +7 -0
- package/dist/types/components/Option/Option.d.ts.map +1 -1
- package/dist/types/components/Option/optionsTunnel.d.ts +22 -0
- package/dist/types/components/Option/optionsTunnel.d.ts.map +1 -0
- package/dist/types/components/Select/Select.d.ts.map +1 -1
- package/dist/types/lib/componentFactory/flowComponent.d.ts.map +1 -1
- package/dist/types/lib/types/props.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/js/default.mjs
CHANGED
|
@@ -178,6 +178,7 @@ import { AlertBadge } from "./packages/components/src/components/AlertBadge/Aler
|
|
|
178
178
|
import { AlertText } from "./packages/components/src/components/AlertText/AlertText.mjs";
|
|
179
179
|
import { Combine } from "./packages/components/src/components/Combine/Combine.mjs";
|
|
180
180
|
import { Align } from "./packages/components/src/components/Align/Align.mjs";
|
|
181
|
+
import { Option } from "./packages/components/src/components/Option/Option.mjs";
|
|
181
182
|
import { PopoverContent } from "./packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs";
|
|
182
183
|
import { Popover } from "./packages/components/src/components/Popover/Popover.mjs";
|
|
183
184
|
import { Autocomplete } from "./packages/components/src/components/Autocomplete/Autocomplete.mjs";
|
|
@@ -242,7 +243,6 @@ import { ContextMenuTrigger } from "./packages/components/src/components/Context
|
|
|
242
243
|
import { ContextMenuSection } from "./packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs";
|
|
243
244
|
import { ContextualHelp } from "./packages/components/src/components/ContextualHelp/ContextualHelp.mjs";
|
|
244
245
|
import { CounterBadge } from "./packages/components/src/components/CounterBadge/CounterBadge.mjs";
|
|
245
|
-
import { Option } from "./packages/components/src/components/Option/Option.mjs";
|
|
246
246
|
import { CountryOptions } from "./packages/components/src/components/CountryOptions/CountryOptions.mjs";
|
|
247
247
|
import { sortByDachFirst } from "./packages/components/src/components/CountryOptions/lib/sortBy.mjs";
|
|
248
248
|
import { DatePicker } from "./packages/components/src/components/DatePicker/DatePicker.mjs";
|
|
@@ -5,6 +5,7 @@ import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
|
|
|
5
5
|
import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
|
|
6
6
|
import { useOverlayController } from "../../lib/controller/overlay/useOverlayController.mjs";
|
|
7
7
|
import { Text } from "../Text/Text.mjs";
|
|
8
|
+
import { getOptionsTunnelProps } from "../Option/optionsTunnel.mjs";
|
|
8
9
|
import { Options } from "../Options/Options.mjs";
|
|
9
10
|
import __locale_default from "../../../../../_virtual/_3.locale.mjs";
|
|
10
11
|
import Autocomplete_module_default from "./Autocomplete.module.mjs";
|
|
@@ -51,10 +52,7 @@ var Autocomplete = flowComponent("Autocomplete", (props) => {
|
|
|
51
52
|
const propsContext = {
|
|
52
53
|
SearchField: inputProps,
|
|
53
54
|
TextField: inputProps,
|
|
54
|
-
Option: { tunnel:
|
|
55
|
-
id: "options",
|
|
56
|
-
component: "Autocomplete"
|
|
57
|
-
} },
|
|
55
|
+
Option: { tunnel: getOptionsTunnelProps("Autocomplete") },
|
|
58
56
|
Popover: { className: Autocomplete_module_default.popover },
|
|
59
57
|
...fieldPropsContext
|
|
60
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.mjs","names":[],"sources":["../../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { isFocused } from \"@/lib/form/isFocused\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport clsx from \"clsx\";\n\nexport interface AutocompleteProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement>,\n Omit<\n Aria.AutocompleteProps,\n \"children\" | \"onInputChange\" | \"inputValue\" | \"defaultInputValue\" | \"ref\"\n > {}\n\n/** @flr-generate all */\nexport const Autocomplete = flowComponent(\"Autocomplete\", (props) => {\n const { children, className, ref, ...rest } = props;\n\n const inputRef = useObjectRef(ref);\n\n const { contains } = Aria.useFilter({ sensitivity: \"base\" });\n const stringFormatter = useLocalizedStringFormatter(locales);\n const container = useRef(null);\n\n const optionsOverlayController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n\n const focusWithin = useFocusWithin({\n onBlurWithin: () => optionsOverlayController.close(),\n });\n\n const renderEmptyState = () => (\n <Text className={styles.empty}>\n {stringFormatter.format(\"autocomplete.empty\")}\n </Text>\n );\n\n const handleInputChange = (value: string) => {\n if (value === \"\") {\n optionsOverlayController.close();\n } else if (isFocused(inputRef.current)) {\n optionsOverlayController.open();\n }\n };\n\n const handleOptionAction = (key: Aria.Key) => {\n const value = String(key);\n if (inputRef.current) {\n emitElementValueChange(inputRef.current, value);\n }\n optionsOverlayController.close();\n };\n\n const inputProps: SearchFieldProps & TextFieldProps = {\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && optionsOverlayController.isOpen) {\n e.preventDefault();\n }\n },\n ref: inputRef,\n onChange: handleInputChange,\n };\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Autocomplete\");\n\n const rootClassName = clsx(\n styles.autocomplete,\n fieldProps.className,\n className,\n );\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnel:
|
|
1
|
+
{"version":3,"file":"Autocomplete.mjs","names":[],"sources":["../../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { getOptionsTunnelProps } from \"@/components/Option/optionsTunnel\";\nimport { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { isFocused } from \"@/lib/form/isFocused\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport clsx from \"clsx\";\n\nexport interface AutocompleteProps\n extends\n PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement>,\n Omit<\n Aria.AutocompleteProps,\n \"children\" | \"onInputChange\" | \"inputValue\" | \"defaultInputValue\" | \"ref\"\n > {}\n\n/** @flr-generate all */\nexport const Autocomplete = flowComponent(\"Autocomplete\", (props) => {\n const { children, className, ref, ...rest } = props;\n\n const inputRef = useObjectRef(ref);\n\n const { contains } = Aria.useFilter({ sensitivity: \"base\" });\n const stringFormatter = useLocalizedStringFormatter(locales);\n const container = useRef(null);\n\n const optionsOverlayController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n\n const focusWithin = useFocusWithin({\n onBlurWithin: () => optionsOverlayController.close(),\n });\n\n const renderEmptyState = () => (\n <Text className={styles.empty}>\n {stringFormatter.format(\"autocomplete.empty\")}\n </Text>\n );\n\n const handleInputChange = (value: string) => {\n if (value === \"\") {\n optionsOverlayController.close();\n } else if (isFocused(inputRef.current)) {\n optionsOverlayController.open();\n }\n };\n\n const handleOptionAction = (key: Aria.Key) => {\n const value = String(key);\n if (inputRef.current) {\n emitElementValueChange(inputRef.current, value);\n }\n optionsOverlayController.close();\n };\n\n const inputProps: SearchFieldProps & TextFieldProps = {\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && optionsOverlayController.isOpen) {\n e.preventDefault();\n }\n },\n ref: inputRef,\n onChange: handleInputChange,\n };\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Autocomplete\");\n\n const rootClassName = clsx(\n styles.autocomplete,\n fieldProps.className,\n className,\n );\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnel: getOptionsTunnelProps(\"Autocomplete\"),\n },\n Popover: {\n className: styles.popover,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div {...fieldProps} className={rootClassName}>\n <FieldErrorCaptureContext>\n <PropsContextProvider\n props={propsContext}\n dependencies={[optionsOverlayController]}\n >\n <div {...focusWithin.focusWithinProps} ref={container}>\n <UNSAFE_PortalProvider getContainer={() => container.current}>\n <Aria.Autocomplete\n filter={contains}\n disableAutoFocusFirst\n {...rest}\n >\n {children}\n <Options\n onAction={handleOptionAction}\n triggerRef={container}\n controller={optionsOverlayController}\n renderEmptyState={renderEmptyState}\n isNonModal\n placement=\"bottom start\"\n >\n <UiComponentTunnelExit\n id=\"options\"\n component=\"Autocomplete\"\n />\n </Options>\n </Aria.Autocomplete>\n </UNSAFE_PortalProvider>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Autocomplete;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,eAAe,cAAc,iBAAiB,UAAU;CACnE,MAAM,EAAE,UAAU,WAAW,KAAK,GAAG,SAAS;CAE9C,MAAM,WAA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AAC,uBAAD;KAAuB,oBAAoB,UAAU;KACnD,UAAA,qBAAC,KAAK,cAAN;MACE,QAAQ;MACR,uBAAA;MACA,GAAI;MAHN,UAAA,CAKG,UACD,oBAAC,SAAD;OACE,UAAU;OACV,YAAY;OACZ,YAAY;OACM;OAClB,YAAA;OACA,WAAU;OAEV,UAAA,oBAAC,uBAAD;QACE,IAAG;QACH,WAAU;OACX,CAAA;MACM,CAAA,CACQ;;IACE,CAAA;GACpB,CAAA;EACe,CAAA,EACE,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { useLocalizedStringFormatter } from "../TranslationProvider/useLocalized
|
|
|
7
7
|
import { Button } from "../Button/Button.mjs";
|
|
8
8
|
import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
|
|
9
9
|
import { useOverlayController } from "../../lib/controller/overlay/useOverlayController.mjs";
|
|
10
|
+
import { getOptionsTunnelProps } from "../Option/optionsTunnel.mjs";
|
|
10
11
|
import { Options } from "../Options/Options.mjs";
|
|
11
12
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
12
13
|
import ComboBox_module_default from "./ComboBox.module.mjs";
|
|
@@ -23,10 +24,7 @@ var ComboBox = flowComponent("ComboBox", (props) => {
|
|
|
23
24
|
const stringFormatter = useLocalizedStringFormatter(__locale_default, "ComboBox");
|
|
24
25
|
const rootClassName = clsx(fieldProps.className, ComboBox_module_default.comboBox, className);
|
|
25
26
|
const propsContext = {
|
|
26
|
-
Option: { tunnel:
|
|
27
|
-
id: "options",
|
|
28
|
-
component: "ComboBox"
|
|
29
|
-
} },
|
|
27
|
+
Option: { tunnel: getOptionsTunnelProps("ComboBox") },
|
|
30
28
|
...fieldPropsContext
|
|
31
29
|
};
|
|
32
30
|
const handleSelectionChange = (key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.mjs","names":[],"sources":["../../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\" | \"onChange\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n /** Called with the key of the selected option whenever the selection changes. */\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"ComboBox\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"ComboBox\");\n\n const rootClassName = clsx(fieldProps.className, styles.comboBox, className);\n\n const propsContext: PropsContext = {\n Option: {\n tunnel:
|
|
1
|
+
{"version":3,"file":"ComboBox.mjs","names":[],"sources":["../../../../../../../src/components/ComboBox/ComboBox.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport { Button } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./ComboBox.module.scss\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { getOptionsTunnelProps } from \"@/components/Option/optionsTunnel\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ComboBoxProps\n extends\n Omit<Aria.ComboBoxProps<never>, \"children\" | \"onChange\">,\n Pick<Aria.InputProps, \"placeholder\">,\n Pick<OptionsProps, \"renderEmptyState\">,\n PropsWithChildren,\n FlowComponentProps<HTMLInputElement> {\n /** Called with the key of the selected option whenever the selection changes. */\n onChange?: (value: string) => void;\n}\n\n/** @flr-generate all */\nexport const ComboBox = flowComponent(\"ComboBox\", (props) => {\n const {\n children,\n className,\n menuTrigger = \"focus\",\n onChange,\n onSelectionChange,\n placeholder,\n ref,\n renderEmptyState,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"ComboBox\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"ComboBox\");\n\n const rootClassName = clsx(fieldProps.className, styles.comboBox, className);\n\n const propsContext: PropsContext = {\n Option: {\n tunnel: getOptionsTunnelProps(\"ComboBox\"),\n },\n ...fieldPropsContext,\n };\n\n const handleSelectionChange = (key: Key | null) => {\n if (key === null) {\n return;\n }\n onChange?.(String(key));\n onSelectionChange?.(key);\n };\n\n const controller = useOverlayController(\"ComboBox\", {\n reuseControllerFromContext: false,\n });\n\n return (\n <Aria.ComboBox\n {...fieldProps}\n menuTrigger={menuTrigger}\n className={rootClassName}\n {...rest}\n onSelectionChange={handleSelectionChange}\n onOpenChange={(isOpen) => {\n controller.setOpen(isOpen);\n }}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n <div className={styles.input}>\n <Aria.Input placeholder={placeholder} ref={ref} />\n <Button\n className={styles.toggle}\n aria-label={stringFormatter.format(\"showOptions\")}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n </Button>\n </div>\n\n {children}\n\n <Options\n controller={controller}\n onOpenChange={() => {\n // cut-off to avoid double controller state changes\n }}\n renderEmptyState={renderEmptyState}\n >\n <UiComponentTunnelExit id=\"options\" component=\"ComboBox\" />\n </Options>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.ComboBox>\n );\n});\n\nexport default ComboBox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EACJ,UACA,WACA,cAAc,SACd,UACA,mBACA,aACA,KACA,kBACA,GAAG,SACD;CAEJ,MAAM,EACJ,gBACA,0BACA,YACA,sBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,kBAAkB,4BAA4B,kBAAS,UAAU;CAEvE,MAAM,gBAAgB,KAAK,WAAW,WAAW,wBAAO,UAAU,SAAS;CAE3E,MAAM,eAA6B;EACjC,QAAQ,EACN,QAAQ,sBAAsB,UAAU,EAC1C;EACA,GAAG;CACL;CAEA,MAAM,yBAAyB,QAAoB;EACjD,IAAI,QAAQ,MACV;EAEF,WAAW,OAAO,GAAG,CAAC;EACtB,oBAAoB,GAAG;CACzB;CAEA,MAAM,aAAa,qBAAqB,YAAY,EAClD,4BAA4B,MAC9B,CAAC;CAED,OACE,oBAAC,KAAK,UAAN;EACE,GAAI;EACS;EACb,WAAW;EACX,GAAI;EACJ,mBAAmB;EACnB,eAAe,WAAW;GACxB,WAAW,QAAQ,MAAM;EAC3B;EAEA,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA,CACE,qBAAC,0BAAD,EAAA,UAAA;IACE,qBAAC,OAAD;KAAK,WAAW,wBAAO;KAAvB,UAAA,CACE,oBAAC,KAAK,OAAN;MAAyB;MAAkB;KAAM,CAAA,GACjD,oBAAC,QAAD;MACE,WAAW,wBAAO;MAClB,cAAY,gBAAgB,OAAO,aAAa;MAChD,SAAQ;MACR,OAAM;MAEN,UAAA,oBAAC,iBAAD,CAAkB,CAAA;KACZ,CAAA,CACL;;IAEJ;IAED,oBAAC,SAAD;KACc;KACZ,oBAAoB,CAEpB;KACkB;KAElB,UAAA,oBAAC,uBAAD;MAAuB,IAAG;MAAU,WAAU;KAAY,CAAA;IACnD,CAAA;GACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;CACT,CAAA;AAEnB,CAAC"}
|
|
@@ -9,9 +9,17 @@ import { Children, useEffect, useRef } from "react";
|
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import * as Aria from "react-aria-components";
|
|
11
11
|
//#region src/components/Option/Option.tsx
|
|
12
|
+
/**
|
|
13
|
+
* The key an option contributes to its collection: an explicit `value`, else
|
|
14
|
+
* the `textValue`, else the text among the children. Shared with the props
|
|
15
|
+
* context that routes options through a field's tunnel, so both derive the same
|
|
16
|
+
* identity for one option.
|
|
17
|
+
*/
|
|
18
|
+
var getOptionValue = (props) => props.value ?? props.textValue ?? extractTextFromChildren(props.children);
|
|
12
19
|
/** @flr-generate all */
|
|
13
20
|
var Option = flowComponent("Option", (props) => {
|
|
14
|
-
const { className, children, textValue = extractTextFromChildren(children), value
|
|
21
|
+
const { className, children, textValue = extractTextFromChildren(children), value: valueIgnored, ref, ...rest } = props;
|
|
22
|
+
const value = getOptionValue(props);
|
|
15
23
|
useWarnMissingValue(value === void 0);
|
|
16
24
|
const rootClassName = clsx(Option_module_default.option, className);
|
|
17
25
|
const hasChildren = Children.count(children) >= 1;
|
|
@@ -39,6 +47,6 @@ var useWarnMissingValue = (isMissing) => {
|
|
|
39
47
|
}, [isMissing]);
|
|
40
48
|
};
|
|
41
49
|
//#endregion
|
|
42
|
-
export { Option, Option as default };
|
|
50
|
+
export { Option, Option as default, getOptionValue };
|
|
43
51
|
|
|
44
52
|
//# sourceMappingURL=Option.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.mjs","names":[],"sources":["../../../../../../../src/components/Option/Option.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport { Children, useEffect, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Option.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { extractTextFromChildren } from \"@/lib/react/remote\";\nimport { IconCheck } from \"@/components/Icon/components/icons\";\n\nexport interface OptionProps\n extends\n Omit<Aria.ListBoxItemProps, \"children\" | \"value\" | \"id\">,\n PropsWithChildren,\n FlowComponentProps {\n /**\n * The value this option contributes to the field's selection, and the key\n * `defaultValue` / `value` of the surrounding field target.\n *\n * Defaults to `textValue`, which itself defaults to the text among the\n * option's children — element children such as a `Badge` do not contribute,\n * so `<Option>Millennium Falcon <Badge>Latest</Badge></Option>` is\n * `\"Millennium Falcon\"`. Pass it explicitly when the value must not follow\n * the display text, or when the children carry no text at all.\n */\n value?: string | number;\n}\n\n/** @flr-generate all */\nexport const Option = flowComponent(\"Option\", (props) => {\n const {\n className,\n children,\n textValue = extractTextFromChildren(children),\n value
|
|
1
|
+
{"version":3,"file":"Option.mjs","names":[],"sources":["../../../../../../../src/components/Option/Option.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport { Children, useEffect, useRef } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Option.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { extractTextFromChildren } from \"@/lib/react/remote\";\nimport { IconCheck } from \"@/components/Icon/components/icons\";\n\nexport interface OptionProps\n extends\n Omit<Aria.ListBoxItemProps, \"children\" | \"value\" | \"id\">,\n PropsWithChildren,\n FlowComponentProps {\n /**\n * The value this option contributes to the field's selection, and the key\n * `defaultValue` / `value` of the surrounding field target.\n *\n * Defaults to `textValue`, which itself defaults to the text among the\n * option's children — element children such as a `Badge` do not contribute,\n * so `<Option>Millennium Falcon <Badge>Latest</Badge></Option>` is\n * `\"Millennium Falcon\"`. Pass it explicitly when the value must not follow\n * the display text, or when the children carry no text at all.\n */\n value?: string | number;\n}\n\n/**\n * The key an option contributes to its collection: an explicit `value`, else\n * the `textValue`, else the text among the children. Shared with the props\n * context that routes options through a field's tunnel, so both derive the same\n * identity for one option.\n */\nexport const getOptionValue = (\n props: Pick<OptionProps, \"value\" | \"textValue\" | \"children\">,\n): string | number | undefined =>\n props.value ?? props.textValue ?? extractTextFromChildren(props.children);\n\n/** @flr-generate all */\nexport const Option = flowComponent(\"Option\", (props) => {\n const {\n className,\n children,\n textValue = extractTextFromChildren(children),\n // Derived through `getOptionValue` below; destructured only to keep it out\n // of the props spread onto the react-aria item.\n value: valueIgnored,\n ref,\n ...rest\n } = props;\n\n const value = getOptionValue(props);\n\n useWarnMissingValue(value === undefined);\n\n const rootClassName = clsx(styles.option, className);\n const hasChildren = Children.count(children) >= 1;\n\n return (\n <Aria.ListBoxItem\n className={rootClassName}\n ref={ref}\n id={value}\n {...rest}\n textValue={textValue}\n >\n <span className={styles.content}>\n {hasChildren ? children : textValue}\n </span>\n <IconCheck aria-hidden className={styles.checkMark} />\n </Aria.ListBoxItem>\n );\n});\n\n/*\n * Without an `id`, react-aria gives the item a key off a render-order counter\n * (`react-aria-1`). That key is what the field reports as its selected value\n * and what `defaultValue` has to match, so an option without a `value` silently\n * submits a meaningless string and cannot be preselected — and the key shifts\n * when unrelated markup around it changes. react-aria warns about the missing\n * `textValue` in this situation but says nothing about the key, which is the\n * expensive half (#3028).\n *\n * Warn in an effect rather than during render, so a double render in StrictMode\n * does not log twice; the ref keeps it to once per option.\n */\nconst useWarnMissingValue = (isMissing: boolean): void => {\n const hasWarned = useRef(false);\n\n useEffect(() => {\n if (!isMissing || hasWarned.current) {\n return;\n }\n\n hasWarned.current = true;\n console.error(\n \"An <Option> has no 'value' and none could be inferred from its children, so it falls back to a generated, render-order-dependent key. Pass a 'value' to give the option a stable key.\",\n );\n }, [isMissing]);\n};\n\nexport default Option;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,IAAa,kBACX,UAEA,MAAM,SAAS,MAAM,aAAa,wBAAwB,MAAM,QAAQ;;AAG1E,IAAa,SAAS,cAAc,WAAW,UAAU;CACvD,MAAM,EACJ,WACA,UACA,YAAY,wBAAwB,QAAQ,GAG5C,OAAO,cACP,KACA,GAAG,SACD;CAEJ,MAAM,QAAQ,eAAe,KAAK;CAElC,oBAAoB,UAAU,KAAA,CAAS;CAEvC,MAAM,gBAAgB,KAAK,sBAAO,QAAQ,SAAS;CACnD,MAAM,cAAc,SAAS,MAAM,QAAQ,KAAK;CAEhD,OACE,qBAAC,KAAK,aAAN;EACE,WAAW;EACN;EACL,IAAI;EACJ,GAAI;EACO;EALb,UAAA,CAOE,oBAAC,QAAD;GAAM,WAAW,sBAAO;GACrB,UAAA,cAAc,WAAW;EACtB,CAAA,GACN,oBAAC,WAAD;GAAW,eAAA;GAAY,WAAW,sBAAO;EAAY,CAAA,CACrC;;AAEtB,CAAC;AAcD,IAAM,uBAAuB,cAA6B;CACxD,MAAM,YAAY,OAAO,KAAK;CAE9B,gBAAgB;EACd,IAAI,CAAC,aAAa,UAAU,SAC1B;EAGF,UAAU,UAAU;EACpB,QAAQ,MACN,uLACF;CACF,GAAG,CAAC,SAAS,CAAC;AAChB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
|
|
4
|
+
import { getOptionValue } from "./Option.mjs";
|
|
5
|
+
//#region src/components/Option/optionsTunnel.ts
|
|
6
|
+
var optionsTunnelId = "options";
|
|
7
|
+
/**
|
|
8
|
+
* Props context entry that routes a field's `Option` children through its
|
|
9
|
+
* "options" tunnel.
|
|
10
|
+
*
|
|
11
|
+
* The entry id is the option's own collection key rather than a generated one.
|
|
12
|
+
* react-aria renders collection children twice — once into its hidden
|
|
13
|
+
* collection document, once for real — and both renders register a tunnel
|
|
14
|
+
* entry. With a generated id each render becomes its own entry, so the tunnel
|
|
15
|
+
* exit renders every option twice: the collection then holds two element nodes
|
|
16
|
+
* per key, and the `prevKey`/`nextKey` links derived from that doubled sibling
|
|
17
|
+
* chain form a ring. That ring makes `ArrowUp` on the first option wrap to the
|
|
18
|
+
* last one, and lets react-stately's focus restoration walk `getKeyBefore`
|
|
19
|
+
* forever, which freezes the tab.
|
|
20
|
+
*
|
|
21
|
+
* An option without a value keeps a generated id. Its collection key is a
|
|
22
|
+
* react-aria render counter in that case, which is unstable for other reasons
|
|
23
|
+
* already — `Option` warns about it.
|
|
24
|
+
*/
|
|
25
|
+
var getOptionsTunnelProps = (component) => dynamic((optionProps) => {
|
|
26
|
+
const value = getOptionValue(optionProps);
|
|
27
|
+
return {
|
|
28
|
+
id: optionsTunnelId,
|
|
29
|
+
component,
|
|
30
|
+
staticEntryId: value === void 0 ? void 0 : String(value)
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { getOptionsTunnelProps, optionsTunnelId };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=optionsTunnel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionsTunnel.mjs","names":[],"sources":["../../../../../../../src/components/Option/optionsTunnel.ts"],"sourcesContent":["import type { FlowComponentName } from \"@/components/propTypes\";\nimport { dynamic } from \"@/lib/propsContext\";\nimport { getOptionValue } from \"./Option\";\n\nexport const optionsTunnelId = \"options\";\n\n/**\n * Props context entry that routes a field's `Option` children through its\n * \"options\" tunnel.\n *\n * The entry id is the option's own collection key rather than a generated one.\n * react-aria renders collection children twice — once into its hidden\n * collection document, once for real — and both renders register a tunnel\n * entry. With a generated id each render becomes its own entry, so the tunnel\n * exit renders every option twice: the collection then holds two element nodes\n * per key, and the `prevKey`/`nextKey` links derived from that doubled sibling\n * chain form a ring. That ring makes `ArrowUp` on the first option wrap to the\n * last one, and lets react-stately's focus restoration walk `getKeyBefore`\n * forever, which freezes the tab.\n *\n * An option without a value keeps a generated id. Its collection key is a\n * react-aria render counter in that case, which is unstable for other reasons\n * already — `Option` warns about it.\n */\nexport const getOptionsTunnelProps = (component: FlowComponentName) =>\n dynamic<\"Option\", \"tunnel\">((optionProps) => {\n const value = getOptionValue(optionProps);\n\n return {\n id: optionsTunnelId,\n component,\n staticEntryId: value === undefined ? undefined : String(value),\n };\n });\n"],"mappings":";;;;;AAIA,IAAa,kBAAkB;;;;;;;;;;;;;;;;;;;AAoB/B,IAAa,yBAAyB,cACpC,SAA6B,gBAAgB;CAC3C,MAAM,QAAQ,eAAe,WAAW;CAExC,OAAO;EACL,IAAI;EACJ;EACA,eAAe,UAAU,KAAA,IAAY,KAAA,IAAY,OAAO,KAAK;CAC/D;AACF,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { useWarnDeprecation } from "../DeprecationWarningProvider/DeprecationWar
|
|
|
6
6
|
import { IconChevronDown } from "../Icon/components/icons/IconChevronDown.mjs";
|
|
7
7
|
import { UiComponentTunnelExit } from "../UiComponentTunnel/UiComponentTunnelExit.mjs";
|
|
8
8
|
import { useOverlayController } from "../../lib/controller/overlay/useOverlayController.mjs";
|
|
9
|
+
import { getOptionsTunnelProps } from "../Option/optionsTunnel.mjs";
|
|
9
10
|
import { Options } from "../Options/Options.mjs";
|
|
10
11
|
import FormField_module_default from "../FormField/FormField.module.mjs";
|
|
11
12
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
@@ -23,10 +24,7 @@ var Select = flowComponent("Select", (props) => {
|
|
|
23
24
|
const { FieldErrorView, fieldPropsContext, fieldProps, FieldErrorCaptureContext } = useFieldComponent(props, "Select");
|
|
24
25
|
const rootClassName = clsx(Select_module_default.select, FormField_module_default.formField, className);
|
|
25
26
|
const propsContext = {
|
|
26
|
-
Option: { tunnel:
|
|
27
|
-
id: "options",
|
|
28
|
-
component: "Select"
|
|
29
|
-
} },
|
|
27
|
+
Option: { tunnel: getOptionsTunnelProps("Select") },
|
|
30
28
|
...fieldPropsContext
|
|
31
29
|
};
|
|
32
30
|
const controller = useOverlayController("Select", { reuseControllerFromContext: false });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.mjs","names":[],"sources":["../../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./Select.module.scss\";\nimport clsx from \"clsx\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Options } from \"@/components/Options\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"../UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nexport interface SelectProps\n extends\n PropsWithChildren<\n Omit<\n Aria.SelectProps<string, \"single\" | \"multiple\">,\n \"children\" | \"className\" | \"ref\"\n >\n >,\n FlowComponentProps<HTMLButtonElement>,\n PropsWithClassName {\n /** Handler that is called when the selected value changes. */\n onChange?: (value: Key | Key[] | null) => void;\n /** @deprecated Use `onChange` instead. */\n onSelectionChange?: (value: Key | Key[] | null) => void;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Select = flowComponent(\"Select\", (props) => {\n const {\n children,\n className,\n onChange,\n onSelectionChange,\n isReadOnly,\n ref,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (onSelectionChange !== undefined) {\n warnDeprecation(\n \"The 'onSelectionChange' prop is deprecated and will be removed in a future release. Use 'onChange' instead.\",\n );\n }\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"Select\");\n\n const rootClassName = clsx(\n styles.select,\n formFieldStyles.formField,\n className,\n );\n\n const propsContext: PropsContext = {\n Option: {\n tunnel:
|
|
1
|
+
{"version":3,"file":"Select.mjs","names":[],"sources":["../../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./Select.module.scss\";\nimport clsx from \"clsx\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Options } from \"@/components/Options\";\nimport { getOptionsTunnelProps } from \"@/components/Option/optionsTunnel\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"../UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nexport interface SelectProps\n extends\n PropsWithChildren<\n Omit<\n Aria.SelectProps<string, \"single\" | \"multiple\">,\n \"children\" | \"className\" | \"ref\"\n >\n >,\n FlowComponentProps<HTMLButtonElement>,\n PropsWithClassName {\n /** Handler that is called when the selected value changes. */\n onChange?: (value: Key | Key[] | null) => void;\n /** @deprecated Use `onChange` instead. */\n onSelectionChange?: (value: Key | Key[] | null) => void;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Select = flowComponent(\"Select\", (props) => {\n const {\n children,\n className,\n onChange,\n onSelectionChange,\n isReadOnly,\n ref,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (onSelectionChange !== undefined) {\n warnDeprecation(\n \"The 'onSelectionChange' prop is deprecated and will be removed in a future release. Use 'onChange' instead.\",\n );\n }\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"Select\");\n\n const rootClassName = clsx(\n styles.select,\n formFieldStyles.formField,\n className,\n );\n\n const propsContext: PropsContext = {\n Option: {\n tunnel: getOptionsTunnelProps(\"Select\"),\n },\n ...fieldPropsContext,\n };\n\n const controller = useOverlayController(\"Select\", {\n reuseControllerFromContext: false,\n });\n const isOpen = controller.useIsOpen();\n\n return (\n <Aria.Select\n {...rest}\n {...fieldProps}\n className={clsx(rootClassName, fieldProps.className)}\n onChange={(value) => {\n if (!isReadOnly) {\n onChange?.(value);\n onSelectionChange?.(value);\n }\n }}\n onOpenChange={(isOpen) => !isReadOnly && controller.setOpen(isOpen)}\n isOpen={isOpen}\n data-readonly={isReadOnly}\n >\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.Button\n data-readonly={isReadOnly}\n className={styles.toggle}\n ref={ref}\n >\n <Aria.SelectValue>\n {({ selectedText, isPlaceholder }) =>\n isPlaceholder || !selectedText ? undefined : selectedText\n }\n </Aria.SelectValue>\n <IconChevronDown />\n </Aria.Button>\n {children}\n <Options controller={controller}>\n <UiComponentTunnelExit id=\"options\" component=\"Select\" />\n </Options>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.Select>\n );\n});\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,IAAa,SAAS,cAAc,WAAW,UAAU;CACvD,MAAM,EACJ,UACA,WACA,UACA,mBACA,YACA,KACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB;CAC3C,IAAI,sBAAsB,KAAA,GACxB,gBACE,6GACF;CAGF,MAAM,EACJ,gBACA,mBACA,YACA,6BACE,kBAAkB,OAAO,QAAQ;CAErC,MAAM,gBAAgB,KACpB,sBAAO,QACP,yBAAgB,WAChB,SACF;CAEA,MAAM,eAA6B;EACjC,QAAQ,EACN,QAAQ,sBAAsB,QAAQ,EACxC;EACA,GAAG;CACL;CAEA,MAAM,aAAa,qBAAqB,UAAU,EAChD,4BAA4B,MAC9B,CAAC;CACD,MAAM,SAAS,WAAW,UAAU;CAEpC,OACE,qBAAC,KAAK,QAAN;EACE,GAAI;EACJ,GAAI;EACJ,WAAW,KAAK,eAAe,WAAW,SAAS;EACnD,WAAW,UAAU;GACnB,IAAI,CAAC,YAAY;IACf,WAAW,KAAK;IAChB,oBAAoB,KAAK;GAC3B;EACF;EACA,eAAe,WAAW,CAAC,cAAc,WAAW,QAAQ,MAAM;EAC1D;EACR,iBAAe;EAZjB,UAAA,CAcE,oBAAC,0BAAD,EAAA,UACE,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA;IACE,qBAAC,KAAK,QAAN;KACE,iBAAe;KACf,WAAW,sBAAO;KACb;KAHP,UAAA,CAKE,oBAAC,KAAK,aAAN,EAAA,WACI,EAAE,cAAc,oBAChB,iBAAiB,CAAC,eAAe,KAAA,IAAY,aAE/B,CAAA,GAClB,oBAAC,iBAAD,CAAkB,CAAA,CACP;;IACZ;IACD,oBAAC,SAAD;KAAqB;KACnB,UAAA,oBAAC,uBAAD;MAAuB,IAAG;MAAU,WAAU;KAAU,CAAA;IACjD,CAAA;GACW;EACE,CAAA,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACN;;AAEjB,CAAC"}
|
|
@@ -57,6 +57,7 @@ function flowComponent(componentName, ImplementationComponentType, options = {})
|
|
|
57
57
|
if (tunnel) element = /* @__PURE__ */ jsx(UiComponentTunnelEntry, {
|
|
58
58
|
id: tunnel.id,
|
|
59
59
|
component: tunnel.component,
|
|
60
|
+
staticEntryId: tunnel.staticEntryId,
|
|
60
61
|
children: element
|
|
61
62
|
});
|
|
62
63
|
if (isViewComposition) element = /* @__PURE__ */ jsx(ViewCompositionReset, { children: element });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowComponent.mjs","names":[],"sources":["../../../../../../../src/lib/componentFactory/flowComponent.tsx"],"sourcesContent":["import type {\n FlowComponentName,\n FlowComponentProps as FlowComponentPropsOfName,\n} from \"@/components/propTypes\";\nimport type {\n ComponentProps,\n ComponentType,\n FunctionComponent,\n ReactElement,\n ReactNode,\n RefAttributes,\n} from \"react\";\nimport { cloneElement, memo } from \"react\";\nimport type { PropsWithTunnel } from \"@/lib/types/props\";\nimport SlotContextProvider from \"@/lib/slotContext/SlotContextProvider\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { useComponentPropsContext } from \"@/lib/propsContext/propsContext\";\nimport { ComponentPropsContextProvider } from \"@/components/ComponentPropsContextProvider\";\nimport { ClearPropsContext } from \"@/components/ClearPropsContext\";\nimport ClearPropsContextView from \"@/views/ClearPropsContextView\";\nimport { UiComponentTunnelProvider } from \"@/components/UiComponentTunnel/UiComponentTunnelProvider\";\nimport { UiComponentTunnelEntry } from \"@/components/UiComponentTunnel/UiComponentTunnelEntry\";\nimport {\n useReportComponentUsage,\n ViewCompositionReset,\n} from \"@/components/ComponentUsageProvider\";\n\ntype RefType<T> = T extends RefAttributes<infer R> ? R : undefined;\n\nexport interface FlowComponentProps<R = HTMLDivElement>\n extends PropsWithTunnel, RefAttributes<R> {\n /**\n * A React element the component is wrapped with. The element is cloned and\n * receives the component as its only child — useful to render the component\n * inside a link, a tooltip trigger or any other wrapper without changing the\n * surrounding markup.\n */\n wrapWith?: ReactElement;\n}\n\nexport type FlowComponentImplementationProps<C extends FlowComponentName> =\n Omit<FlowComponentPropsOfName<C>, keyof FlowComponentProps> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\ntype FlowComponentImplementationType<C extends FlowComponentName> =\n ComponentType<FlowComponentImplementationProps<C>>;\n\ntype FlowComponentType<C extends FlowComponentName> = FunctionComponent<\n FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>\n>;\n\nexport type FlowComponentProvisionType = \"provider\" | \"ui\" | \"layout\";\n\ninterface Options {\n type?: FlowComponentProvisionType;\n isRemoteComponent?: boolean;\n}\n\nexport function flowComponent<C extends FlowComponentName>(\n componentName: C,\n ImplementationComponentType: FlowComponentImplementationType<C>,\n options: Options = {},\n): FlowComponentType<C> {\n type Props = FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\n const { type = \"ui\", isRemoteComponent = false } = options;\n\n const MemoizedImplementationComponentType = memo(ImplementationComponentType);\n\n function Component(props: Props) {\n const isViewComposition = useReportComponentUsage(componentName);\n\n const { tunnel, wrapWith, ...propsWithContext } = useProps(\n componentName,\n props as FlowComponentPropsOfName<C>,\n ) as FlowComponentProps<RefType<FlowComponentPropsOfName<C>>>;\n\n const implementationTypeProps = propsWithContext as ComponentProps<\n typeof ImplementationComponentType\n >;\n\n const componentProps = useComponentPropsContext(componentName);\n\n ImplementationComponentType.displayName = `FlowComponentImpl(${componentName})`;\n\n let element: ReactNode = (\n <MemoizedImplementationComponentType {...implementationTypeProps} />\n );\n\n if (type === \"ui\" || type === \"layout\") {\n element = (\n <UiComponentTunnelProvider component={componentName}>\n {element}\n </UiComponentTunnelProvider>\n );\n }\n\n element = (\n <ComponentPropsContextProvider componentProps={componentProps}>\n {element}\n </ComponentPropsContextProvider>\n );\n\n if (type === \"ui\") {\n /**\n * Protect the inside of UI components for accidental prop changes through\n * the Props Context.\n */\n if (isRemoteComponent) {\n element = <ClearPropsContext>{element}</ClearPropsContext>;\n } else {\n /**\n * In case of a UI component that does not have a remote counterpart\n * (like the Modal component), the <ClearPropsContext> must be\n * additionally applied on the host side by using the\n * <ClearPropsContextView>.\n *\n * This prevents Props Contexts created by parent components on the host\n * side affecting the children of this UI component.\n */\n element = (\n <ClearPropsContext>\n <ClearPropsContextView>{element}</ClearPropsContextView>\n </ClearPropsContext>\n );\n }\n }\n\n if (\"slot\" in props && !!props.slot && typeof props.slot === \"string\") {\n element = (\n <SlotContextProvider slot={props.slot} component={componentName}>\n {element}\n </SlotContextProvider>\n );\n }\n\n if (wrapWith) {\n element = cloneElement(wrapWith, undefined, element);\n }\n\n if (tunnel) {\n element = (\n <UiComponentTunnelEntry
|
|
1
|
+
{"version":3,"file":"flowComponent.mjs","names":[],"sources":["../../../../../../../src/lib/componentFactory/flowComponent.tsx"],"sourcesContent":["import type {\n FlowComponentName,\n FlowComponentProps as FlowComponentPropsOfName,\n} from \"@/components/propTypes\";\nimport type {\n ComponentProps,\n ComponentType,\n FunctionComponent,\n ReactElement,\n ReactNode,\n RefAttributes,\n} from \"react\";\nimport { cloneElement, memo } from \"react\";\nimport type { PropsWithTunnel } from \"@/lib/types/props\";\nimport SlotContextProvider from \"@/lib/slotContext/SlotContextProvider\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { useComponentPropsContext } from \"@/lib/propsContext/propsContext\";\nimport { ComponentPropsContextProvider } from \"@/components/ComponentPropsContextProvider\";\nimport { ClearPropsContext } from \"@/components/ClearPropsContext\";\nimport ClearPropsContextView from \"@/views/ClearPropsContextView\";\nimport { UiComponentTunnelProvider } from \"@/components/UiComponentTunnel/UiComponentTunnelProvider\";\nimport { UiComponentTunnelEntry } from \"@/components/UiComponentTunnel/UiComponentTunnelEntry\";\nimport {\n useReportComponentUsage,\n ViewCompositionReset,\n} from \"@/components/ComponentUsageProvider\";\n\ntype RefType<T> = T extends RefAttributes<infer R> ? R : undefined;\n\nexport interface FlowComponentProps<R = HTMLDivElement>\n extends PropsWithTunnel, RefAttributes<R> {\n /**\n * A React element the component is wrapped with. The element is cloned and\n * receives the component as its only child — useful to render the component\n * inside a link, a tooltip trigger or any other wrapper without changing the\n * surrounding markup.\n */\n wrapWith?: ReactElement;\n}\n\nexport type FlowComponentImplementationProps<C extends FlowComponentName> =\n Omit<FlowComponentPropsOfName<C>, keyof FlowComponentProps> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\ntype FlowComponentImplementationType<C extends FlowComponentName> =\n ComponentType<FlowComponentImplementationProps<C>>;\n\ntype FlowComponentType<C extends FlowComponentName> = FunctionComponent<\n FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>\n>;\n\nexport type FlowComponentProvisionType = \"provider\" | \"ui\" | \"layout\";\n\ninterface Options {\n type?: FlowComponentProvisionType;\n isRemoteComponent?: boolean;\n}\n\nexport function flowComponent<C extends FlowComponentName>(\n componentName: C,\n ImplementationComponentType: FlowComponentImplementationType<C>,\n options: Options = {},\n): FlowComponentType<C> {\n type Props = FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\n const { type = \"ui\", isRemoteComponent = false } = options;\n\n const MemoizedImplementationComponentType = memo(ImplementationComponentType);\n\n function Component(props: Props) {\n const isViewComposition = useReportComponentUsage(componentName);\n\n const { tunnel, wrapWith, ...propsWithContext } = useProps(\n componentName,\n props as FlowComponentPropsOfName<C>,\n ) as FlowComponentProps<RefType<FlowComponentPropsOfName<C>>>;\n\n const implementationTypeProps = propsWithContext as ComponentProps<\n typeof ImplementationComponentType\n >;\n\n const componentProps = useComponentPropsContext(componentName);\n\n ImplementationComponentType.displayName = `FlowComponentImpl(${componentName})`;\n\n let element: ReactNode = (\n <MemoizedImplementationComponentType {...implementationTypeProps} />\n );\n\n if (type === \"ui\" || type === \"layout\") {\n element = (\n <UiComponentTunnelProvider component={componentName}>\n {element}\n </UiComponentTunnelProvider>\n );\n }\n\n element = (\n <ComponentPropsContextProvider componentProps={componentProps}>\n {element}\n </ComponentPropsContextProvider>\n );\n\n if (type === \"ui\") {\n /**\n * Protect the inside of UI components for accidental prop changes through\n * the Props Context.\n */\n if (isRemoteComponent) {\n element = <ClearPropsContext>{element}</ClearPropsContext>;\n } else {\n /**\n * In case of a UI component that does not have a remote counterpart\n * (like the Modal component), the <ClearPropsContext> must be\n * additionally applied on the host side by using the\n * <ClearPropsContextView>.\n *\n * This prevents Props Contexts created by parent components on the host\n * side affecting the children of this UI component.\n */\n element = (\n <ClearPropsContext>\n <ClearPropsContextView>{element}</ClearPropsContextView>\n </ClearPropsContext>\n );\n }\n }\n\n if (\"slot\" in props && !!props.slot && typeof props.slot === \"string\") {\n element = (\n <SlotContextProvider slot={props.slot} component={componentName}>\n {element}\n </SlotContextProvider>\n );\n }\n\n if (wrapWith) {\n element = cloneElement(wrapWith, undefined, element);\n }\n\n if (tunnel) {\n element = (\n <UiComponentTunnelEntry\n id={tunnel.id}\n component={tunnel.component}\n staticEntryId={tunnel.staticEntryId}\n >\n {element}\n </UiComponentTunnelEntry>\n );\n }\n\n if (isViewComposition) {\n element = <ViewCompositionReset>{element}</ViewCompositionReset>;\n }\n\n return element;\n }\n\n Component.displayName = `FlowComponent(${componentName})`;\n return memo(Component);\n}\n"],"mappings":";;;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,SAAS;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.mjs","names":[],"sources":["../../../../../../../src/lib/types/props.ts"],"sourcesContent":["import type { FlowComponentName } from \"@/components/propTypes\";\nimport type { ExoticComponent, HTMLAttributes } from \"react\";\n\nexport const statusTypes = [\n \"info\",\n \"success\",\n \"warning\",\n \"danger\",\n \"unavailable\",\n] as const;\n\nexport type Status = (typeof statusTypes)[number];\n\nexport type PropsWithStatus<T extends Status = Status, P = unknown> = P & {\n /** The elements status */\n status?: T;\n};\n\nexport interface PropsWithTunnel {\n /** @internal */\n tunnel?: {\n id: string;\n component: FlowComponentName;\n } | null;\n}\n\nexport interface PropsWithClassName {\n /** The elements class name. */\n className?: string;\n}\n\nexport type PropsWithElementType<\n T extends keyof HTMLElementTagNameMap = never,\n> = HTMLAttributes<HTMLElement> & {\n /** The HTML element or React component rendered as the elements root. */\n elementType?: T | ExoticComponent;\n};\n\nexport type ContainerBreakpointSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface PropsWithContainerBreakpointSize {\n /**\n * The breakpoint at which the element switches to its compact layout.\n * Evaluated as a container query against the surrounding container, not\n * against the viewport.\n */\n containerBreakpointSize?: ContainerBreakpointSize;\n}\n\nexport const alphaColors = [\n \"dark\",\n \"light\",\n \"dark-static\",\n \"light-static\",\n] as const;\n\nexport type AlphaColor = (typeof alphaColors)[number];\n\nexport function isAlphaColor(color: string): color is AlphaColor {\n return alphaColors.includes(color as AlphaColor);\n}\n"],"mappings":";;;AAGA,IAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;AACF;
|
|
1
|
+
{"version":3,"file":"props.mjs","names":[],"sources":["../../../../../../../src/lib/types/props.ts"],"sourcesContent":["import type { FlowComponentName } from \"@/components/propTypes\";\nimport type { ExoticComponent, HTMLAttributes } from \"react\";\n\nexport const statusTypes = [\n \"info\",\n \"success\",\n \"warning\",\n \"danger\",\n \"unavailable\",\n] as const;\n\nexport type Status = (typeof statusTypes)[number];\n\nexport type PropsWithStatus<T extends Status = Status, P = unknown> = P & {\n /** The elements status */\n status?: T;\n};\n\nexport interface PropsWithTunnel {\n /** @internal */\n tunnel?: {\n id: string;\n component: FlowComponentName;\n /**\n * A stable entry id instead of a generated one. Needed wherever the same\n * component is rendered more than once for a single logical element:\n * react-aria renders collection children twice — once into its hidden\n * collection document, once for real — and a generated id would register\n * each render as its own entry, so the tunnel exit renders every element\n * twice. Must be unique among the siblings of one tunnel.\n */\n staticEntryId?: string;\n } | null;\n}\n\nexport interface PropsWithClassName {\n /** The elements class name. */\n className?: string;\n}\n\nexport type PropsWithElementType<\n T extends keyof HTMLElementTagNameMap = never,\n> = HTMLAttributes<HTMLElement> & {\n /** The HTML element or React component rendered as the elements root. */\n elementType?: T | ExoticComponent;\n};\n\nexport type ContainerBreakpointSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface PropsWithContainerBreakpointSize {\n /**\n * The breakpoint at which the element switches to its compact layout.\n * Evaluated as a container query against the surrounding container, not\n * against the viewport.\n */\n containerBreakpointSize?: ContainerBreakpointSize;\n}\n\nexport const alphaColors = [\n \"dark\",\n \"light\",\n \"dark-static\",\n \"light-static\",\n] as const;\n\nexport type AlphaColor = (typeof alphaColors)[number];\n\nexport function isAlphaColor(color: string): color is AlphaColor {\n return alphaColors.includes(color as AlphaColor);\n}\n"],"mappings":";;;AAGA,IAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;AACF;AAiDA,IAAa,cAAc;CACzB;CACA;CACA;CACA;AACF;AAIA,SAAgB,aAAa,OAAoC;CAC/D,OAAO,YAAY,SAAS,KAAmB;AACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAmB9C,MAAM,WAAW,iBACf,SACE,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CACF,IAAI,CAAC,iBAAiB,EACtB,UAAU,GAAG,eAAe,GAAG,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAC1E;CAAG;AAER,wBAAwB;AACxB,eAAO,MAAM,YAAY,wGA8GvB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAU9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAU9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,MAAM,WAAW,aACf,SACE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,EACxD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EACpC,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,EACtC,iBAAiB,EACjB,kBAAkB,CAAC,gBAAgB,CAAC;IACtC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,oGAoFnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -9,6 +9,7 @@ export declare const ModalTrigger: import('react').FunctionComponent<{
|
|
|
9
9
|
tunnel?: {
|
|
10
10
|
id: string;
|
|
11
11
|
component: import('../../../propTypes').FlowComponentName;
|
|
12
|
+
staticEntryId?: string;
|
|
12
13
|
} | null | undefined;
|
|
13
14
|
ref?: import('react').Ref<HTMLDivElement> | undefined;
|
|
14
15
|
key?: import('react').Key | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTrigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/components/ModalTrigger/ModalTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAI1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"ModalTrigger.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/components/ModalTrigger/ModalTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAI1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,YAAY;;;;;;;qBAkBqK,CAAC;;;;;kDAH9L,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -14,6 +14,13 @@ export interface OptionProps extends Omit<Aria.ListBoxItemProps, "children" | "v
|
|
|
14
14
|
*/
|
|
15
15
|
value?: string | number;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The key an option contributes to its collection: an explicit `value`, else
|
|
19
|
+
* the `textValue`, else the text among the children. Shared with the props
|
|
20
|
+
* context that routes options through a field's tunnel, so both derive the same
|
|
21
|
+
* identity for one option.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getOptionValue: (props: Pick<OptionProps, "value" | "textValue" | "children">) => string | number | undefined;
|
|
17
24
|
/** @flr-generate all */
|
|
18
25
|
export declare const Option: import('react').FunctionComponent<OptionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
26
|
export default Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/components/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAG9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK/E,MAAM,WAAW,WACf,SACE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC,EACxD,iBAAiB,EACjB,kBAAkB;IACpB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,wBAAwB;AACxB,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/components/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAG9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK/E,MAAM,WAAW,WACf,SACE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC,EACxD,iBAAiB,EACjB,kBAAkB;IACpB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC,KAC3D,MAAM,GAAG,MAAM,GAAG,SACsD,CAAC;AAE5E,wBAAwB;AACxB,eAAO,MAAM,MAAM,gGAiCjB,CAAC;AA6BH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FlowComponentName } from '../propTypes';
|
|
2
|
+
export declare const optionsTunnelId = "options";
|
|
3
|
+
/**
|
|
4
|
+
* Props context entry that routes a field's `Option` children through its
|
|
5
|
+
* "options" tunnel.
|
|
6
|
+
*
|
|
7
|
+
* The entry id is the option's own collection key rather than a generated one.
|
|
8
|
+
* react-aria renders collection children twice — once into its hidden
|
|
9
|
+
* collection document, once for real — and both renders register a tunnel
|
|
10
|
+
* entry. With a generated id each render becomes its own entry, so the tunnel
|
|
11
|
+
* exit renders every option twice: the collection then holds two element nodes
|
|
12
|
+
* per key, and the `prevKey`/`nextKey` links derived from that doubled sibling
|
|
13
|
+
* chain form a ring. That ring makes `ArrowUp` on the first option wrap to the
|
|
14
|
+
* last one, and lets react-stately's focus restoration walk `getKeyBefore`
|
|
15
|
+
* forever, which freezes the tab.
|
|
16
|
+
*
|
|
17
|
+
* An option without a value keeps a generated id. Its collection key is a
|
|
18
|
+
* react-aria render counter in that case, which is unstable for other reasons
|
|
19
|
+
* already — `Option` warns about it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getOptionsTunnelProps: (component: FlowComponentName) => import('../../lib/propsContext/dynamicProps/types').DynamicProp<"Option", "tunnel">;
|
|
22
|
+
//# sourceMappingURL=optionsTunnel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionsTunnel.d.ts","sourceRoot":"","sources":["../../../../src/components/Option/optionsTunnel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,iBAAiB,wFAS9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAO9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAO9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAM5D,MAA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C,MAAM,CAAC,CAAC;AAEtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"@internationalized/string-compiler": "^3.4.1",
|
|
79
79
|
"@lezer/common": "^1.5.2",
|
|
80
80
|
"@lezer/highlight": "^1.2.3",
|
|
81
|
-
"@mittwald/flow-icons": "1.2.0-next.
|
|
81
|
+
"@mittwald/flow-icons": "1.2.0-next.37",
|
|
82
82
|
"@mittwald/password-tools-js": "^3.0.0",
|
|
83
|
-
"@mittwald/react-tunnel": "1.2.0-next.
|
|
83
|
+
"@mittwald/react-tunnel": "1.2.0-next.37",
|
|
84
84
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
85
85
|
"@react-aria/form": "^3.2.1",
|
|
86
86
|
"@react-aria/i18n": "^3.13.1",
|
|
@@ -134,12 +134,12 @@
|
|
|
134
134
|
"@internationalized/date": "^3.12.3",
|
|
135
135
|
"@lezer/generator": "^1.8.0",
|
|
136
136
|
"@lezer/lr": "^1.4.10",
|
|
137
|
-
"@mittwald/flow-core": "1.2.0-next.
|
|
138
|
-
"@mittwald/flow-design-tokens": "1.2.0-next.
|
|
139
|
-
"@mittwald/flow-icons-base": "1.2.0-next.
|
|
137
|
+
"@mittwald/flow-core": "1.2.0-next.37",
|
|
138
|
+
"@mittwald/flow-design-tokens": "1.2.0-next.37",
|
|
139
|
+
"@mittwald/flow-icons-base": "1.2.0-next.37",
|
|
140
140
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
141
141
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
142
|
-
"@mittwald/typescript-config": "1.2.0-next.
|
|
142
|
+
"@mittwald/typescript-config": "1.2.0-next.37",
|
|
143
143
|
"@nx/storybook": "^22.7.6",
|
|
144
144
|
"@storybook/addon-a11y": "^10.5.10",
|
|
145
145
|
"@storybook/addon-actions": "^9.0.8",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
},
|
|
192
192
|
"peerDependencies": {
|
|
193
193
|
"@internationalized/date": "^3.12.2",
|
|
194
|
-
"@mittwald/flow-icons-pro": "1.2.0-next.
|
|
194
|
+
"@mittwald/flow-icons-pro": "1.2.0-next.37",
|
|
195
195
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
196
196
|
"next": "^16.2.3",
|
|
197
197
|
"react": "^19.2.0",
|
|
@@ -215,5 +215,5 @@
|
|
|
215
215
|
"browserslist": [
|
|
216
216
|
"baseline widely available"
|
|
217
217
|
],
|
|
218
|
-
"gitHead": "
|
|
218
|
+
"gitHead": "1ff5a2ee7a082d019a73d879aa420fa41ff85438"
|
|
219
219
|
}
|