@mittwald/flow-react-components 0.2.0-alpha.1004 → 0.2.0-alpha.1006
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 +12 -2
- package/CHANGELOG.md +12 -0
- package/MIGRATION.md +41 -0
- package/dist/assets/doc-properties.json +7497 -6352
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/default.mjs +2 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +1 -0
- package/dist/js/flr-universal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +1 -0
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +1 -0
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Action/Action.mjs +1 -0
- package/dist/js/packages/components/src/components/Action/Action.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs +1 -0
- package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs +1 -0
- package/dist/js/packages/components/src/components/AlertText/AlertText.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Align/Align.mjs +1 -0
- package/dist/js/packages/components/src/components/Align/Align.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs +1 -0
- package/dist/js/packages/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs +1 -0
- package/dist/js/packages/components/src/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs +1 -0
- package/dist/js/packages/components/src/components/AvatarStack/AvatarStack.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +1 -0
- package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs +1 -0
- package/dist/js/packages/components/src/components/BigNumber/BigNumber.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs +1 -0
- package/dist/js/packages/components/src/components/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs +1 -0
- package/dist/js/packages/components/src/components/BrowserOnly/BrowserOnly.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Button/Button.mjs +1 -0
- package/dist/js/packages/components/src/components/Button/Button.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Chat/Chat.mjs +1 -0
- package/dist/js/packages/components/src/components/Chat/Chat.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +1 -0
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs +1 -0
- package/dist/js/packages/components/src/components/CheckboxButton/CheckboxButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +1 -0
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs +1 -0
- package/dist/js/packages/components/src/components/ColumnLayout/ColumnLayout.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +1 -0
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/ComponentDefaultsProvider.mjs +40 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/ComponentDefaultsProvider.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/defaults.mjs +13 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/defaults.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs +34 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +1 -0
- package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs +1 -0
- package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/ContextualHelp.mjs +1 -0
- package/dist/js/packages/components/src/components/ContextualHelp/ContextualHelp.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +1 -0
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +1 -0
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +1 -0
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs +1 -0
- package/dist/js/packages/components/src/components/FileCard/FileCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs +1 -0
- package/dist/js/packages/components/src/components/FileCardList/FileCardList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +1 -0
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/FileField.mjs +1 -0
- package/dist/js/packages/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs +1 -0
- package/dist/js/packages/components/src/components/FileField/components/FileInput.mjs.map +1 -1
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs +1 -0
- package/dist/js/packages/components/src/components/HeaderNavigation/HeaderNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +1 -0
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -0
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +1 -0
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs +1 -0
- package/dist/js/packages/components/src/components/LabeledValue/LabeledValue.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs +1 -0
- package/dist/js/packages/components/src/components/LayoutCard/LayoutCard.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -0
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs +1 -0
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGalleryItem/LightBoxGalleryItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Link/Link.mjs +1 -0
- package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.mjs +1 -0
- package/dist/js/packages/components/src/components/List/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs +1 -0
- package/dist/js/packages/components/src/components/List/components/ListItemView/components/ListItemViewContent/ListItemViewContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoader.mjs +4 -2
- package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs +1 -0
- package/dist/js/packages/components/src/components/MenuItem/components/MenuItemContent/MenuItemContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Message/Message.mjs +1 -0
- package/dist/js/packages/components/src/components/Message/Message.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -0
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +1 -0
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.mjs +1 -0
- package/dist/js/packages/components/src/components/Navigation/Navigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Notification/Notification.mjs +1 -0
- package/dist/js/packages/components/src/components/Notification/Notification.mjs.map +1 -1
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +1 -0
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs +1 -0
- package/dist/js/packages/components/src/components/OverlayTrigger/OverlayTrigger.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs +1 -0
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +1 -0
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/components/RadioButton/RadioButton.mjs +1 -0
- package/dist/js/packages/components/src/components/RadioGroup/components/RadioButton/RadioButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/Rating.mjs +1 -0
- package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/EmptySegment.mjs +1 -0
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/EmptySegment.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/FilledSegment.mjs +1 -0
- package/dist/js/packages/components/src/components/Rating/components/RatingSegment/FilledSegment.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +1 -0
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs +1 -0
- package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +1 -0
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +1 -0
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +1 -0
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +1 -0
- package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Switch/Switch.mjs +1 -0
- package/dist/js/packages/components/src/components/Switch/Switch.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs +1 -0
- package/dist/js/packages/components/src/components/TabNavigation/TabNavigation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +1 -0
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/Tab/Tab.mjs +1 -0
- package/dist/js/packages/components/src/components/Tabs/components/Tab/Tab.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Text/Text.mjs +1 -0
- package/dist/js/packages/components/src/components/Text/Text.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +1 -0
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +1 -0
- package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +1 -0
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/dist/js/packages/components/src/flags.mjs +18 -4
- package/dist/js/packages/components/src/flags.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -0
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs +7 -5
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs +1 -0
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs +1 -0
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs +1 -0
- package/dist/js/packages/components/src/lib/controller/overlay/useModalController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs +1 -0
- package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs +1 -0
- package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs.map +1 -1
- package/dist/js/packages/components/src/status/component-status.json.mjs +1 -0
- package/dist/js/packages/components/src/status/component-status.json.mjs.map +1 -1
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.d.ts +24 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.test.d.ts +2 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.test.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/defaults.d.ts +37 -0
- package/dist/types/components/ComponentDefaultsProvider/defaults.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/deprecatedFlags.d.ts +8 -0
- package/dist/types/components/ComponentDefaultsProvider/deprecatedFlags.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/index.d.ts +4 -0
- package/dist/types/components/ComponentDefaultsProvider/index.d.ts.map +1 -0
- package/dist/types/components/List/model/loading/IncrementalLoader.d.ts.map +1 -1
- package/dist/types/components/List/model/loading/types.d.ts +8 -0
- package/dist/types/components/List/model/loading/types.d.ts.map +1 -1
- package/dist/types/components/public.d.ts +1 -0
- package/dist/types/components/public.d.ts.map +1 -1
- package/dist/types/flags.d.ts +23 -2
- package/dist/types/flags.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/status/component-status.json.d.ts +4 -0
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.mjs","sources":["../../../../../../../src/components/Chat/Chat.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./Chat.module.scss\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ChatProps extends PropsWithChildren, PropsWithClassName {\n // Height of the chat component\n height?: CSSProperties[\"height\"];\n}\n\n/** @flr-generate all */\nexport const Chat: FC<ChatProps> = flowComponent(\n \"Chat\",\n (props) => {\n const { height, className, children } = props;\n\n const rootClassName = clsx(styles.chat, className);\n\n const propsContext: PropsContext = {\n MessageThread: {\n tunnel: {\n id: \"messageThread\",\n component: \"Chat\",\n },\n },\n FileCardList: {\n className: styles.fileCardList,\n tunnel: {\n id: \"fileCardList\",\n component: \"Chat\",\n },\n },\n Button: {\n className: dynamic((props) => {\n return props.color === \"accent\" ? styles.accentButton : styles.button;\n }),\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div style={{ height }} className={rootClassName}>\n <div className={styles.messageThreadContainer}>\n <UiComponentTunnelExit id=\"messageThread\" component=\"Chat\" />\n </div>\n <div className={styles.controls}>{children}</div>\n <UiComponentTunnelExit id=\"fileCardList\" component=\"Chat\" />\n </div>\n </PropsContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Chat;\n"],"names":["props"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chat.mjs","sources":["../../../../../../../src/components/Chat/Chat.tsx"],"sourcesContent":["import type { CSSProperties, FC, PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport styles from \"./Chat.module.scss\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface ChatProps extends PropsWithChildren, PropsWithClassName {\n // Height of the chat component\n height?: CSSProperties[\"height\"];\n}\n\n/** @flr-generate all */\nexport const Chat: FC<ChatProps> = flowComponent(\n \"Chat\",\n (props) => {\n const { height, className, children } = props;\n\n const rootClassName = clsx(styles.chat, className);\n\n const propsContext: PropsContext = {\n MessageThread: {\n tunnel: {\n id: \"messageThread\",\n component: \"Chat\",\n },\n },\n FileCardList: {\n className: styles.fileCardList,\n tunnel: {\n id: \"fileCardList\",\n component: \"Chat\",\n },\n },\n Button: {\n className: dynamic((props) => {\n return props.color === \"accent\" ? styles.accentButton : styles.button;\n }),\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <div style={{ height }} className={rootClassName}>\n <div className={styles.messageThreadContainer}>\n <UiComponentTunnelExit id=\"messageThread\" component=\"Chat\" />\n </div>\n <div className={styles.controls}>{children}</div>\n <UiComponentTunnelExit id=\"fileCardList\" component=\"Chat\" />\n </div>\n </PropsContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Chat;\n"],"names":["props"],"mappings":";;;;;;;;;AAkBO,MAAM,IAAA,GAAsB,aAAA;AAAA,EACjC,MAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,MAAA,EAAQ,SAAA,EAAW,QAAA,EAAS,GAAI,KAAA;AAExC,IAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,IA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
|
|
9
9
|
import * as Aria from 'react-aria-components';
|
|
10
10
|
import styles from './Checkbox.module.scss.mjs';
|
|
11
11
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
12
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
12
13
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
13
14
|
import { useObjectRef } from 'react-aria';
|
|
14
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.mjs","sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n\n return (\n <div\n {...fieldProps}\n className={clsx(styles.checkbox, className, fieldProps.className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n inputRef={inputRef}\n className={clsx(inputClassName, styles.input)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {isSelected ? (\n <IconCheckboxChecked className={styles.icon} />\n ) : isIndeterminate ? (\n <IconCheckboxIndeterminate className={styles.icon} />\n ) : (\n <IconCheckboxEmpty className={styles.icon} />\n )}\n {children}\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.mjs","sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n\n return (\n <div\n {...fieldProps}\n className={clsx(styles.checkbox, className, fieldProps.className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n inputRef={inputRef}\n className={clsx(inputClassName, styles.input)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {isSelected ? (\n <IconCheckboxChecked className={styles.icon} />\n ) : isIndeterminate ? (\n <IconCheckboxIndeterminate className={styles.icon} />\n ) : (\n <IconCheckboxEmpty className={styles.icon} />\n )}\n {children}\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,KAAK,cAAA,EAAgB,GAAG,MAAK,GAAI,KAAA;AAE9D,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,UAAU,CAAA;AAEvC,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,UAAA;AAAA,MACJ,WAAW,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,SAAA,EAAW,WAAW,SAAS,CAAA;AAAA,MAEhE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,wBAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,UAAC,IAAA,CAAK,QAAA;AAAA,UAAL;AAAA,YACE,GAAG,IAAA;AAAA,YACJ,QAAA;AAAA,YACA,SAAA,EAAW,IAAA,CAAK,cAAA,EAAgB,MAAA,CAAO,KAAK,CAAA;AAAA,YAE3C,QAAA,EAAA,CAAC,EAAE,UAAA,EAAY,eAAA,uBACd,IAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,iBAAA,EAC1B,QAAA,EAAA;AAAA,cAAA,UAAA,uBACE,mBAAA,EAAA,EAAoB,SAAA,EAAW,MAAA,CAAO,IAAA,EAAM,IAC3C,eAAA,mBACF,GAAA,CAAC,yBAAA,EAAA,EAA0B,SAAA,EAAW,OAAO,IAAA,EAAM,CAAA,uBAElD,iBAAA,EAAA,EAAkB,SAAA,EAAW,OAAO,IAAA,EAAM,CAAA;AAAA,cAE5C;AAAA,aAAA,EACH;AAAA;AAAA,SAEJ,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import styles from './CheckboxButton.module.scss.mjs';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import { Checkbox } from '../Checkbox/Checkbox.mjs';
|
|
8
9
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxButton.mjs","sources":["../../../../../../../src/components/CheckboxButton/CheckboxButton.tsx"],"sourcesContent":["import styles from \"./CheckboxButton.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport { Checkbox } from \"@/components/Checkbox\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface CheckboxButtonProps\n extends CheckboxProps, FlowComponentProps<HTMLInputElement> {}\n\n/** @flr-generate all */\nexport const CheckboxButton = flowComponent(\"CheckboxButton\", (props) => {\n const { children, className, inputClassName, ...rest } = props;\n\n const {\n fieldPropsContext,\n fieldProps,\n FieldErrorView,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"CheckboxButton\");\n\n const mergedPropsContext: PropsContext = {\n Text: {\n className: styles.label,\n },\n Content: {\n className: styles.content,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div\n {...fieldProps}\n className={clsx(fieldProps.className, styles.checkboxButton, className)}\n >\n <FieldErrorCaptureContext>\n <Checkbox {...rest} inputClassName={clsx(inputClassName, styles.input)}>\n <PropsContextProvider props={mergedPropsContext}>\n {children}\n </PropsContextProvider>\n </Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default CheckboxButton;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxButton.mjs","sources":["../../../../../../../src/components/CheckboxButton/CheckboxButton.tsx"],"sourcesContent":["import styles from \"./CheckboxButton.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport { Checkbox } from \"@/components/Checkbox\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface CheckboxButtonProps\n extends CheckboxProps, FlowComponentProps<HTMLInputElement> {}\n\n/** @flr-generate all */\nexport const CheckboxButton = flowComponent(\"CheckboxButton\", (props) => {\n const { children, className, inputClassName, ...rest } = props;\n\n const {\n fieldPropsContext,\n fieldProps,\n FieldErrorView,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"CheckboxButton\");\n\n const mergedPropsContext: PropsContext = {\n Text: {\n className: styles.label,\n },\n Content: {\n className: styles.content,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div\n {...fieldProps}\n className={clsx(fieldProps.className, styles.checkboxButton, className)}\n >\n <FieldErrorCaptureContext>\n <Checkbox {...rest} inputClassName={clsx(inputClassName, styles.input)}>\n <PropsContextProvider props={mergedPropsContext}>\n {children}\n </PropsContextProvider>\n </Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default CheckboxButton;\n"],"names":[],"mappings":";;;;;;;;;AAcO,MAAM,cAAA,GAAiB,aAAA,CAAc,gBAAA,EAAkB,CAAC,KAAA,KAAU;AACvE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,GAAG,MAAK,GAAI,KAAA;AAEzD,EAAA,MAAM;AAAA,IACJ,iBAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,gBAAgB,CAAA;AAE7C,EAAA,MAAM,kBAAA,GAAmC;AAAA,IACvC,IAAA,EAAM;AAAA,MACJ,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,GAAG;AAAA,GACL;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,UAAA;AAAA,MACJ,WAAW,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,MAAA,CAAO,gBAAgB,SAAS,CAAA;AAAA,MAEtE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,4BACC,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAU,GAAG,IAAA,EAAM,gBAAgB,IAAA,CAAK,cAAA,EAAgB,MAAA,CAAO,KAAK,GACnE,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,kBAAA,EAC1B,QAAA,EACH,GACF,CAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { ColumnLayout } from '../ColumnLayout/ColumnLayout.mjs';
|
|
5
5
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import clsx from 'clsx';
|
|
8
9
|
import * as Aria from 'react-aria-components';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.mjs","sources":["../../../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./CheckboxGroup.module.scss\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface CheckboxGroupProps\n extends\n PropsWithChildren<Omit<Aria.CheckboxGroupProps, \"children\">>,\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const CheckboxGroup = flowComponent(\"CheckboxGroup\", (props) => {\n const { children, className, isInvalid, s, m, l, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"CheckboxGroup\");\n\n const propsContext: PropsContext = {\n Checkbox: {\n isInvalid,\n className: styles.checkbox,\n tunnel: {\n id: \"checkboxes\",\n component: \"CheckboxGroup\",\n },\n },\n CheckboxButton: {\n isInvalid,\n className: styles.checkboxButton,\n tunnel: {\n id: \"checkboxButtons\",\n component: \"CheckboxGroup\",\n },\n },\n ...fieldPropsContext,\n };\n\n const objectRef = useObjectRef(ref);\n useMakeFocusable(objectRef);\n\n return (\n <Aria.CheckboxGroup\n {...rest}\n {...fieldProps}\n isInvalid={isInvalid}\n className={clsx(fieldProps.className, className)}\n ref={objectRef}\n >\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n {children}\n\n <ColumnLayout s={s} m={m} l={l} className={styles.checkboxGroup}>\n <UiComponentTunnelExit\n id=\"checkboxButtons\"\n component=\"CheckboxGroup\"\n />\n </ColumnLayout>\n\n <ColumnLayout\n s={s ?? [1]}\n m={m ?? [1]}\n l={l ?? [1]}\n rowGap=\"s\"\n className={styles.checkboxGroup}\n >\n <UiComponentTunnelExit id=\"checkboxes\" component=\"CheckboxGroup\" />\n </ColumnLayout>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.CheckboxGroup>\n );\n});\n\nexport default CheckboxGroup;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.mjs","sources":["../../../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./CheckboxGroup.module.scss\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface CheckboxGroupProps\n extends\n PropsWithChildren<Omit<Aria.CheckboxGroupProps, \"children\">>,\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const CheckboxGroup = flowComponent(\"CheckboxGroup\", (props) => {\n const { children, className, isInvalid, s, m, l, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props, \"CheckboxGroup\");\n\n const propsContext: PropsContext = {\n Checkbox: {\n isInvalid,\n className: styles.checkbox,\n tunnel: {\n id: \"checkboxes\",\n component: \"CheckboxGroup\",\n },\n },\n CheckboxButton: {\n isInvalid,\n className: styles.checkboxButton,\n tunnel: {\n id: \"checkboxButtons\",\n component: \"CheckboxGroup\",\n },\n },\n ...fieldPropsContext,\n };\n\n const objectRef = useObjectRef(ref);\n useMakeFocusable(objectRef);\n\n return (\n <Aria.CheckboxGroup\n {...rest}\n {...fieldProps}\n isInvalid={isInvalid}\n className={clsx(fieldProps.className, className)}\n ref={objectRef}\n >\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n {children}\n\n <ColumnLayout s={s} m={m} l={l} className={styles.checkboxGroup}>\n <UiComponentTunnelExit\n id=\"checkboxButtons\"\n component=\"CheckboxGroup\"\n />\n </ColumnLayout>\n\n <ColumnLayout\n s={s ?? [1]}\n m={m ?? [1]}\n l={l ?? [1]}\n rowGap=\"s\"\n className={styles.checkboxGroup}\n >\n <UiComponentTunnelExit id=\"checkboxes\" component=\"CheckboxGroup\" />\n </ColumnLayout>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.CheckboxGroup>\n );\n});\n\nexport default CheckboxGroup;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBO,MAAM,aAAA,GAAgB,aAAA,CAAc,e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GAAM,CAAA,EAAM,SAAA,EAAW,OAAO,aAAA,EAChD,QAAA,kBAAA,GAAA;AAAA,YAAC,qBAAA;AAAA,YAAA;AAAA,cACC,EAAA,EAAG,iBAAA;AAAA,cACH,SAAA,EAAU;AAAA;AAAA,WACZ,EACF,CAAA;AAAA,0BAEA,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,CAAA,EAAG,CAAA,IAAK,CAAC,CAAC,CAAA;AAAA,cACV,CAAA,EAAG,CAAA,IAAK,CAAC,CAAC,CAAA;AAAA,cACV,CAAA,EAAG,CAAA,IAAK,CAAC,CAAC,CAAA;AAAA,cACV,MAAA,EAAO,GAAA;AAAA,cACP,WAAW,MAAA,CAAO,aAAA;AAAA,cAElB,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,YAAA,EAAa,WAAU,eAAA,EAAgB;AAAA;AAAA;AACnE,SAAA,EACF,CAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -6,6 +6,7 @@ import { useId } from 'react';
|
|
|
6
6
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
7
7
|
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
8
8
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
9
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
9
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
10
11
|
import clsx from 'clsx';
|
|
11
12
|
import styles from './CodeEditor.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport { useId } from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * The label reference only resolves when a label is given. Without one, an\n * `aria-label` names the editor instead – the name computation skips\n * references that point at nothing.\n */\n const labelledBy = [ariaLabelledBy, labelId].filter(Boolean).join(\" \");\n\n const describedBy =\n [descriptionId, fieldProps[\"aria-describedby\"]].filter(Boolean).join(\" \") ||\n undefined;\n\n const contentAttributes = EditorView.contentAttributes.of({\n \"aria-labelledby\": labelledBy,\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={[...enabledExtensions, contentAttributes]}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n {children}\n </CodeMirror>\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror, { EditorView } from \"@uiw/react-codemirror\";\nimport { useId } from \"react\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/**\n * @flr-generate all\n * @flowStatus new\n */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const labelId = useId();\n const descriptionId = useId();\n\n /**\n * The label and the field description are declared as children of the code\n * editor, but must be rendered outside of the editor itself. They are\n * tunneled out of the editor – just like the field error. Their ids are the\n * ones the editor references.\n */\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n id: labelId,\n tunnel: { id: \"label\", component: \"CodeEditor\" },\n },\n FieldDescription: {\n ...fieldPropsContext.FieldDescription,\n id: descriptionId,\n tunnel: { id: \"fieldDescription\", component: \"CodeEditor\" },\n },\n };\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n /**\n * The editable element of CodeMirror is the `.cm-content` element – not the\n * root element the props are applied to. Its ARIA attributes are set through\n * the content attributes facet.\n *\n * The label reference only resolves when a label is given. Without one, an\n * `aria-label` names the editor instead – the name computation skips\n * references that point at nothing.\n */\n const labelledBy = [ariaLabelledBy, labelId].filter(Boolean).join(\" \");\n\n const describedBy =\n [descriptionId, fieldProps[\"aria-describedby\"]].filter(Boolean).join(\" \") ||\n undefined;\n\n const contentAttributes = EditorView.contentAttributes.of({\n \"aria-labelledby\": labelledBy,\n ...(ariaLabel ? { \"aria-label\": ariaLabel } : {}),\n ...(describedBy ? { \"aria-describedby\": describedBy } : {}),\n ...(isRequired ? { \"aria-required\": \"true\" } : {}),\n ...(isInvalid ? { \"aria-invalid\": \"true\" } : {}),\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={propsContext}>\n <UiComponentTunnelExit id=\"label\" component=\"CodeEditor\" />\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n data-invalid={isInvalid || undefined}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={[...enabledExtensions, contentAttributes]}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n {children}\n </CodeMirror>\n </FieldErrorCaptureContext>\n <UiComponentTunnelExit id=\"fieldDescription\" component=\"CodeEditor\" />\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default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,EAAe;AAAA,GAAA,EAClB,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import styles from './ColumnLayout.module.scss.mjs';
|
|
5
5
|
import { getColumns } from './lib/getColumns.mjs';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
7
8
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
8
9
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnLayout.mjs","sources":["../../../../../../../src/components/ColumnLayout/ColumnLayout.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport styles from \"./ColumnLayout.module.scss\";\nimport { getColumns } from \"./lib/getColumns\";\nimport clsx from \"clsx\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\ntype GapSize = \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface ColumnLayoutProps<\n T extends keyof HTMLElementTagNameMap = \"div\" | \"ul\",\n>\n extends\n PropsWithChildren,\n PropsWithElementType<T>,\n PropsWithClassName,\n FlowComponentProps<HTMLElementTagNameMap[T]> {\n /** Column layout for container size s. */\n s?: (number | null)[];\n /** Column layout for container size m. */\n m?: (number | null)[];\n /** Column layout for container size l. */\n l?: (number | null)[];\n /**\n * Size of the row and column gap between the content blocks inside the column\n * layout.\n *\n * @default \"m\"\n */\n gap?: GapSize;\n /** Size of the row gap between the content blocks inside the column layout. */\n rowGap?: GapSize;\n /** Size of the column gap between the content blocks inside the column layout. */\n columnGap?: GapSize;\n}\n\n/** @flr-generate all */\nexport const ColumnLayout = flowComponent(\n \"ColumnLayout\",\n (props) => {\n const {\n children,\n className,\n s,\n m,\n l,\n gap = \"m\",\n rowGap = gap,\n columnGap = gap,\n elementType = \"div\",\n \"aria-label\": ariaLabel,\n ref,\n style: styleFromProps,\n } = props;\n\n let elementClassName = styles.columnLayout;\n\n s?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-s-${i + 1}`]);\n }\n });\n m?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-m-${i + 1}`]);\n }\n });\n l?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-l-${i + 1}`]);\n }\n });\n\n const columnsS = s ? getColumns(s) : \"1fr\";\n const columnsM = m ? getColumns(m) : s ? columnsS : \"1fr 1fr\";\n const columnsL = l ? getColumns(l) : m || s ? columnsM : \"1fr 1fr 1fr\";\n\n const style = {\n ...styleFromProps,\n \"--column-layout--columns-s\": columnsS,\n \"--column-layout--columns-m\": columnsM,\n \"--column-layout--columns-l\": columnsL,\n \"--column-layout--row-gap\": `var(--column-layout--gap--${rowGap})`,\n \"--column-layout--column-gap\": `var(--column-layout--gap--${columnGap})`,\n } as CSSProperties;\n\n const rootClassName = clsx(styles.columnLayoutContainer, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n Section: {\n hideSeparator: true,\n },\n };\n\n return (\n <div className={rootClassName} style={style}>\n <Element\n ref={ref as never}\n aria-label={ariaLabel}\n className={elementClassName}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ColumnLayout;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColumnLayout.mjs","sources":["../../../../../../../src/components/ColumnLayout/ColumnLayout.tsx"],"sourcesContent":["import type { CSSProperties, PropsWithChildren } from \"react\";\nimport styles from \"./ColumnLayout.module.scss\";\nimport { getColumns } from \"./lib/getColumns\";\nimport clsx from \"clsx\";\nimport type {\n PropsWithClassName,\n PropsWithElementType,\n} from \"@/lib/types/props\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\n\ntype GapSize = \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface ColumnLayoutProps<\n T extends keyof HTMLElementTagNameMap = \"div\" | \"ul\",\n>\n extends\n PropsWithChildren,\n PropsWithElementType<T>,\n PropsWithClassName,\n FlowComponentProps<HTMLElementTagNameMap[T]> {\n /** Column layout for container size s. */\n s?: (number | null)[];\n /** Column layout for container size m. */\n m?: (number | null)[];\n /** Column layout for container size l. */\n l?: (number | null)[];\n /**\n * Size of the row and column gap between the content blocks inside the column\n * layout.\n *\n * @default \"m\"\n */\n gap?: GapSize;\n /** Size of the row gap between the content blocks inside the column layout. */\n rowGap?: GapSize;\n /** Size of the column gap between the content blocks inside the column layout. */\n columnGap?: GapSize;\n}\n\n/** @flr-generate all */\nexport const ColumnLayout = flowComponent(\n \"ColumnLayout\",\n (props) => {\n const {\n children,\n className,\n s,\n m,\n l,\n gap = \"m\",\n rowGap = gap,\n columnGap = gap,\n elementType = \"div\",\n \"aria-label\": ariaLabel,\n ref,\n style: styleFromProps,\n } = props;\n\n let elementClassName = styles.columnLayout;\n\n s?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-s-${i + 1}`]);\n }\n });\n m?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-m-${i + 1}`]);\n }\n });\n l?.map((v, i) => {\n if (v === null) {\n elementClassName = clsx(elementClassName, styles[`hide-l-${i + 1}`]);\n }\n });\n\n const columnsS = s ? getColumns(s) : \"1fr\";\n const columnsM = m ? getColumns(m) : s ? columnsS : \"1fr 1fr\";\n const columnsL = l ? getColumns(l) : m || s ? columnsM : \"1fr 1fr 1fr\";\n\n const style = {\n ...styleFromProps,\n \"--column-layout--columns-s\": columnsS,\n \"--column-layout--columns-m\": columnsM,\n \"--column-layout--columns-l\": columnsL,\n \"--column-layout--row-gap\": `var(--column-layout--gap--${rowGap})`,\n \"--column-layout--column-gap\": `var(--column-layout--gap--${columnGap})`,\n } as CSSProperties;\n\n const rootClassName = clsx(styles.columnLayoutContainer, className);\n\n const Element = elementType;\n\n const propsContext: PropsContext = {\n Section: {\n hideSeparator: true,\n },\n };\n\n return (\n <div className={rootClassName} style={style}>\n <Element\n ref={ref as never}\n aria-label={ariaLabel}\n className={elementClassName}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </Element>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ColumnLayout;\n"],"names":[],"mappings":";;;;;;;;AA6CO,MAAM,YAAA,GAAe,aAAA;AAAA,EAC1B,cAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,CAAA;AAAA,MACA,CAAA;AAAA,MACA,CAAA;AAAA,MACA,GAAA,GAAM,GAAA;AAAA,MACN,MAAA,GAAS,GAAA;AAAA,MACT,SAAA,GAAY,GAAA;AAAA,MACZ,WAAA,GAAc,KAAA;AAAA,MACd,YAAA,EAAc,SAAA;AAAA,MACd,GAAA;AAAA,MACA,KAAA,EAAO;AAAA,KACT,GAAI,KAAA;AAEJ,IAAA,IAAI,mBAAmB,MAAA,CAAO,YAAA;AAE9B,IAAA,CAAA,EAAG,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,KAAM;AACf,MAAA,IAAI,MAAM,IAAA,EAAM;AACd,QAAA,gBAAA,GAAmB,KAAK,gBAAA,EAAkB,MAAA,CAAO,UAAU,CAAA,GAAI,CAAC,EAAE,CAAC,CAAA;AAAA,MACrE;AAAA,IACF,CAAC,CAAA;AACD,IAAA,CAAA,EAAG,GAAA,CAAI,CAAC,CAA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EAAI,SAAA,EAAW,aAAA,EAAe,KAAA,EAC7B,QAAA,kBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,YAAA,EAAY,SAAA;AAAA,QACZ,SAAA,EAAW,gBAAA;AAAA,QAEX,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH;AAAA;AAAA,KACF,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -6,6 +6,7 @@ import * as Aria from 'react-aria-components';
|
|
|
6
6
|
import { Button } from '../Button/Button.mjs';
|
|
7
7
|
import { IconChevronDown } from '../Icon/components/icons/IconChevronDown.mjs';
|
|
8
8
|
import { Options } from '../Options/Options.mjs';
|
|
9
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
9
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
10
11
|
import clsx from 'clsx';
|
|
11
12
|
import styles from './ComboBox.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.mjs","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 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: {\n id: \"options\",\n component: \"ComboBox\",\n },\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"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ComboBox.mjs","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 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: {\n id: \"options\",\n component: \"ComboBox\",\n },\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8BO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA,GAAc,OAAA;AAAA,IACd,QAAA;AAAA,IACA,iBAAA;AAAA,IACA,WAAA;AAAA,IACA,GAAA;AAAA,IACA,gBAA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AAAA,wBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,KAAA,EACrB,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,CAAK,KAAA,EAAL,EAAW,WAAA,EAA0B,GAAA,EAAU,CAAA;AAAA,4BAChD,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,WAAW,MAAA,CAAO,MAAA;AAAA,gBAClB,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,aAAa,CAAA;AAAA,gBAChD,OAAA,EAAQ,OAAA;AAAA,gBACR,KAAA,EAAM,WAAA;AAAA,gBAEN,8BAAC,eAAA,EAAA,EAAgB;AAAA;AAAA;AACnB,WAAA,EACF,CAAA;AAAA,UAEC,QAAA;AAAA,0BAED,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,UAAA;AAAA,cACA,cAAc,MAAM;AAAA,cAEpB,CAAA;AAAA,cACA,gBAAA;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,EAAA,EAAG,SAAA,EAAU,WAAU,UAAA,EAAW;AAAA;AAAA;AAC3D,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { builtInComponentDefaults } from './defaults.mjs';
|
|
5
|
+
import { useDeprecatedFlagDefaults } from './deprecatedFlags.mjs';
|
|
6
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
const ComponentDefaultsContext = createContext(
|
|
9
|
+
{}
|
|
10
|
+
);
|
|
11
|
+
const mergeDefaults = (base, override) => {
|
|
12
|
+
const merged = { ...base };
|
|
13
|
+
for (const component of Object.keys(override)) {
|
|
14
|
+
Object.assign(merged, {
|
|
15
|
+
[component]: { ...base[component], ...override[component] }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return merged;
|
|
19
|
+
};
|
|
20
|
+
const ComponentDefaultsProvider = (props) => {
|
|
21
|
+
const { defaults, children } = props;
|
|
22
|
+
const inheritedDefaults = useContext(ComponentDefaultsContext);
|
|
23
|
+
const value = useMemo(
|
|
24
|
+
() => mergeDefaults(inheritedDefaults, defaults),
|
|
25
|
+
[inheritedDefaults, defaults]
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ jsx(ComponentDefaultsContext.Provider, { value, children });
|
|
28
|
+
};
|
|
29
|
+
const useComponentDefaults = (component) => {
|
|
30
|
+
const fromContext = useContext(ComponentDefaultsContext)[component];
|
|
31
|
+
const fromDeprecatedFlags = useDeprecatedFlagDefaults(component);
|
|
32
|
+
return {
|
|
33
|
+
...builtInComponentDefaults[component],
|
|
34
|
+
...fromDeprecatedFlags,
|
|
35
|
+
...fromContext
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { ComponentDefaultsContext, ComponentDefaultsProvider, useComponentDefaults };
|
|
40
|
+
//# sourceMappingURL=ComponentDefaultsProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentDefaultsProvider.mjs","sources":["../../../../../../../src/components/ComponentDefaultsProvider/ComponentDefaultsProvider.tsx"],"sourcesContent":["import {\n builtInComponentDefaults,\n type ComponentDefaults,\n type ComponentWithDefaults,\n type PartialComponentDefaults,\n} from \"@/components/ComponentDefaultsProvider/defaults\";\nimport { useDeprecatedFlagDefaults } from \"@/components/ComponentDefaultsProvider/deprecatedFlags\";\nimport {\n createContext,\n type FC,\n type PropsWithChildren,\n useContext,\n useMemo,\n} from \"react\";\n\nexport const ComponentDefaultsContext = createContext<PartialComponentDefaults>(\n {},\n);\n\nexport interface ComponentDefaultsProviderProps extends PropsWithChildren {\n /**\n * Defaults per component. Every setting that is not given keeps the default\n * of a surrounding ComponentDefaultsProvider, or its built-in default.\n */\n defaults: PartialComponentDefaults;\n}\n\nconst mergeDefaults = (\n base: PartialComponentDefaults,\n override: PartialComponentDefaults,\n): PartialComponentDefaults => {\n const merged: PartialComponentDefaults = { ...base };\n\n for (const component of Object.keys(override) as ComponentWithDefaults[]) {\n Object.assign(merged, {\n [component]: { ...base[component], ...override[component] },\n });\n }\n\n return merged;\n};\n\n/**\n * Defines the default behavior of components for the whole application – or,\n * nested, for a part of it.\n *\n * @flowStatus new\n */\nexport const ComponentDefaultsProvider: FC<ComponentDefaultsProviderProps> = (\n props,\n) => {\n const { defaults, children } = props;\n const inheritedDefaults = useContext(ComponentDefaultsContext);\n\n const value = useMemo(\n () => mergeDefaults(inheritedDefaults, defaults),\n [inheritedDefaults, defaults],\n );\n\n return (\n <ComponentDefaultsContext.Provider value={value}>\n {children}\n </ComponentDefaultsContext.Provider>\n );\n};\n\n/**\n * The defaults that apply to a component: built-in defaults, overridden by the\n * deprecated `flags` object, overridden by the ComponentDefaultsProvider.\n */\nexport const useComponentDefaults = <C extends ComponentWithDefaults>(\n component: C,\n): ComponentDefaults[C] => {\n const fromContext = useContext(ComponentDefaultsContext)[component];\n const fromDeprecatedFlags = useDeprecatedFlagDefaults(component);\n\n return {\n ...builtInComponentDefaults[component],\n ...fromDeprecatedFlags,\n ...fromContext,\n };\n};\n\nexport default ComponentDefaultsProvider;\n"],"names":[],"mappings":";;;;;AAeO,MAAM,wBAAA,GAA2B,aAAA;AAAA,EACtC;AACF;AAUA,MAAM,aAAA,GAAgB,CACpB,IAAA,EACA,QAAA,KAC6B;AAC7B,EAAA,MAAM,MAAA,GAAmC,EAAE,GAAG,IAAA,EAAK;AAEnD,EAAA,KAAA,MAAW,SAAA,IAAa,MAAA,CAAO,IAAA,CAAK,QAAQ,CAAA,EAA8B;AACxE,IAAA,MAAA,CAAO,OAAO,MAAA,EAAQ;AAAA,MACpB,CAAC,SAAS,GAAG,EAAE,GAAG,IAAA,CAAK,SAAS,CAAA,EAAG,GAAG,QAAA,CAAS,SAAS,CAAA;AAAE,KAC3D,CAAA;AAAA,EACH;AAEA,EAAA,OAAO,MAAA;AACT,CAAA;AAQO,MAAM,yBAAA,GAAgE,CAC3E,KAAA,KACG;AACH,EAAA,MAAM,EAAE,QAAA,EAAU,QAAA,EAAS,GAAI,KAAA;AAC/B,EAAA,MAAM,iBAAA,GAAoB,WAAW,wBAAwB,CAAA;AAE7D,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MAAM,aAAA,CAAc,iBAAA,EAAmB,QAAQ,CAAA;AAAA,IAC/C,CAAC,mBAAmB,QAAQ;AAAA,GAC9B;AAEA,EAAA,uBACE,GAAA,CAAC,wBAAA,CAAyB,QAAA,EAAzB,EAAkC,OAChC,QAAA,EACH,CAAA;AAEJ;AAMO,MAAM,oBAAA,GAAuB,CAClC,SAAA,KACyB;AACzB,EAAA,MAAM,WAAA,GAAc,UAAA,CAAW,wBAAwB,CAAA,CAAE,SAAS,CAAA;AAClE,EAAA,MAAM,mBAAA,GAAsB,0BAA0B,SAAS,CAAA;AAE/D,EAAA,OAAO;AAAA,IACL,GAAG,yBAAyB,SAAS,CAAA;AAAA,IACrC,GAAG,mBAAA;AAAA,IACH,GAAG;AAAA,GACL;AACF;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
const builtInComponentDefaults = {
|
|
4
|
+
List: {
|
|
5
|
+
disableInitialSuspenseBoundary: false
|
|
6
|
+
},
|
|
7
|
+
Form: {
|
|
8
|
+
confirmModalCloseOnUnsavedChanges: true
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { builtInComponentDefaults };
|
|
13
|
+
//# sourceMappingURL=defaults.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.mjs","sources":["../../../../../../../src/components/ComponentDefaultsProvider/defaults.ts"],"sourcesContent":["/**\n * Behavior of components that an application can define once, globally, instead\n * of repeating it at every usage. Every setting has a built-in default and\n * stays overridable at the component itself.\n */\nexport interface ComponentDefaults {\n List: {\n /**\n * Whether a `List` renders no own Suspense boundary while it initially\n * loads. Suspending is then handed over to the closest Suspense boundary\n * above the List, so the List appears with loaded data instead of showing\n * its loading view (skeleton) first.\n *\n * Overridable per List through the `disableInitialSuspenseBoundary`\n * property of its data source.\n *\n * @default false\n */\n disableInitialSuspenseBoundary: boolean;\n };\n Form: {\n /**\n * Whether closing a `Modal` that contains a `Form` with unsaved changes\n * must be confirmed. Applies as long as the Form is _dirty_ – after a\n * successful submit or a `form.reset()` it is not.\n *\n * @default true\n */\n confirmModalCloseOnUnsavedChanges: boolean;\n };\n}\n\nexport type ComponentWithDefaults = keyof ComponentDefaults;\n\nexport type PartialComponentDefaults = {\n [C in ComponentWithDefaults]?: Partial<ComponentDefaults[C]>;\n};\n\nexport const builtInComponentDefaults: ComponentDefaults = {\n List: {\n disableInitialSuspenseBoundary: false,\n },\n Form: {\n confirmModalCloseOnUnsavedChanges: true,\n },\n};\n"],"names":[],"mappings":"AAsCO,MAAM,wBAAA,GAA8C;AAAA,EACzD,IAAA,EAAM;AAAA,IACJ,8BAAA,EAAgC;AAAA,GAClC;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,iCAAA,EAAmC;AAAA;AAEvC;;;;"}
|
package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { useWarnDeprecation } from '../DeprecationWarningProvider/DeprecationWarningProvider.mjs';
|
|
4
|
+
import { flagIsAssigned, flags } from '../../flags.mjs';
|
|
5
|
+
|
|
6
|
+
const deprecatedFlagBridges = [
|
|
7
|
+
{
|
|
8
|
+
flag: "requireCloseModalConfirmationOnUnsavedChanges",
|
|
9
|
+
component: "Form",
|
|
10
|
+
setting: "confirmModalCloseOnUnsavedChanges",
|
|
11
|
+
message: "The 'requireCloseModalConfirmationOnUnsavedChanges' flag is deprecated and will be removed in a future release. Confirming the close of a Modal that contains a Form with unsaved changes is the default now ('Form.confirmModalCloseOnUnsavedChanges: true'). Use the 'defaults' property of the ComponentDefaultsProvider to change it."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
flag: "disableInitialListSuspenseBoundaries",
|
|
15
|
+
component: "List",
|
|
16
|
+
setting: "disableInitialSuspenseBoundary",
|
|
17
|
+
message: "The 'disableInitialListSuspenseBoundaries' flag is deprecated and will be removed in a future release. Its default is unchanged ('List.disableInitialSuspenseBoundary: false'). Use the 'defaults' property of the ComponentDefaultsProvider to change it."
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
const useDeprecatedFlagDefaults = (component) => {
|
|
21
|
+
const warnDeprecation = useWarnDeprecation();
|
|
22
|
+
const fromFlags = {};
|
|
23
|
+
for (const bridge of deprecatedFlagBridges) {
|
|
24
|
+
if (bridge.component !== component || !flagIsAssigned(bridge.flag)) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
warnDeprecation(bridge.message);
|
|
28
|
+
fromFlags[bridge.setting] = flags[bridge.flag];
|
|
29
|
+
}
|
|
30
|
+
return fromFlags;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { useDeprecatedFlagDefaults };
|
|
34
|
+
//# sourceMappingURL=deprecatedFlags.mjs.map
|
package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecatedFlags.mjs","sources":["../../../../../../../src/components/ComponentDefaultsProvider/deprecatedFlags.ts"],"sourcesContent":["import { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport type {\n ComponentDefaults,\n ComponentWithDefaults,\n} from \"@/components/ComponentDefaultsProvider/defaults\";\nimport { flagIsAssigned, flags, type FlagName } from \"@/flags\";\n\ninterface DeprecatedFlagBridge {\n flag: FlagName;\n component: ComponentWithDefaults;\n setting: string;\n message: string;\n}\n\n/**\n * The global `flags` object is superseded by the ComponentDefaultsProvider. A\n * flag an application still assigns keeps working – it acts as the application\n * wide default below the provider – and warns about its replacement.\n */\nconst deprecatedFlagBridges: DeprecatedFlagBridge[] = [\n {\n flag: \"requireCloseModalConfirmationOnUnsavedChanges\",\n component: \"Form\",\n setting: \"confirmModalCloseOnUnsavedChanges\",\n message:\n \"The 'requireCloseModalConfirmationOnUnsavedChanges' flag is deprecated and will be removed in a future release. Confirming the close of a Modal that contains a Form with unsaved changes is the default now ('Form.confirmModalCloseOnUnsavedChanges: true'). Use the 'defaults' property of the ComponentDefaultsProvider to change it.\",\n },\n {\n flag: \"disableInitialListSuspenseBoundaries\",\n component: \"List\",\n setting: \"disableInitialSuspenseBoundary\",\n message:\n \"The 'disableInitialListSuspenseBoundaries' flag is deprecated and will be removed in a future release. Its default is unchanged ('List.disableInitialSuspenseBoundary: false'). Use the 'defaults' property of the ComponentDefaultsProvider to change it.\",\n },\n];\n\n/**\n * Defaults an application still contributes through the deprecated `flags`\n * object. Ranks below the ComponentDefaultsProvider and above the built-in\n * defaults.\n */\nexport const useDeprecatedFlagDefaults = <C extends ComponentWithDefaults>(\n component: C,\n): Partial<ComponentDefaults[C]> => {\n const warnDeprecation = useWarnDeprecation();\n const fromFlags: Record<string, boolean> = {};\n\n for (const bridge of deprecatedFlagBridges) {\n if (bridge.component !== component || !flagIsAssigned(bridge.flag)) {\n continue;\n }\n\n warnDeprecation(bridge.message);\n fromFlags[bridge.setting] = flags[bridge.flag];\n }\n\n return fromFlags as Partial<ComponentDefaults[C]>;\n};\n"],"names":[],"mappings":";;;AAmBA,MAAM,qBAAA,GAAgD;AAAA,EACpD;AAAA,IACE,IAAA,EAAM,+CAAA;AAAA,IACN,SAAA,EAAW,MAAA;AAAA,IACX,OAAA,EAAS,mCAAA;AAAA,IACT,OAAA,EACE;AAAA,GACJ;AAAA,EACA;AAAA,IACE,IAAA,EAAM,sCAAA;AAAA,IACN,SAAA,EAAW,MAAA;AAAA,IACX,OAAA,EAAS,gCAAA;AAAA,IACT,OAAA,EACE;AAAA;AAEN,CAAA;AAOO,MAAM,yBAAA,GAA4B,CACvC,SAAA,KACkC;AAClC,EAAA,MAAM,kBAAkB,kBAAA,EAAmB;AAC3C,EAAA,MAAM,YAAqC,EAAC;AAE5C,EAAA,KAAA,MAAW,UAAU,qBAAA,EAAuB;AAC1C,IAAA,IAAI,OAAO,SAAA,KAAc,SAAA,IAAa,CAAC,cAAA,CAAe,MAAA,CAAO,IAAI,CAAA,EAAG;AAClE,MAAA;AAAA,IACF;AAEA,IAAA,eAAA,CAAgB,OAAO,OAAO,CAAA;AAC9B,IAAA,SAAA,CAAU,MAAA,CAAO,OAAO,CAAA,GAAI,KAAA,CAAM,OAAO,IAAI,CAAA;AAAA,EAC/C;AAEA,EAAA,OAAO,SAAA;AACT;;;;"}
|
|
@@ -6,6 +6,7 @@ import { getCloseOverlayType, getAriaSelectionMode, getMenuItemSelectionVariant
|
|
|
6
6
|
import { Popover } from '../Popover/Popover.mjs';
|
|
7
7
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
8
|
import { OverlayContextProvider } from '../../lib/controller/overlay/OverlayContextProvider.mjs';
|
|
9
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
9
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
10
11
|
import ContextMenuContentView from '../../views/ContextMenuContentView.mjs';
|
|
11
12
|
import styles from './ContextMenu.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\nimport { OverlayContentSuspendWatcher } from \"@/lib/controller/overlay/OverlayContentSuspendWatcher\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <OverlayContentSuspendWatcher overlayController={overlayController}>\n <Popover\n {...rest}\n className={styles.popover}\n controller={overlayController}\n isDialogContent={false}\n >\n <OverlayContextProvider\n type=\"ContextMenu\"\n controller={overlayController}\n >\n <ContextMenuContentView\n className={styles.contextMenu}\n onAction={onAction}\n selectionMode={getAriaSelectionMode(selectionMode)}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n onSelectionChange={onSelectionChange}\n renderEmptyState={renderEmptyState}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </PropsContextProvider>\n </ContextMenuContentView>\n </OverlayContextProvider>\n </Popover>\n </OverlayContentSuspendWatcher>\n );\n});\n\nexport default ContextMenu;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { Action } from \"@/components/Action\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\nimport { Popover, type PopoverProps } from \"@/components/Popover/Popover\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { OverlayContextProvider } from \"@/lib/controller/overlay/OverlayContextProvider\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport ContextMenuContentView from \"@/views/ContextMenuContentView\";\nimport type * as Aria from \"react-aria-components\";\nimport styles from \"./ContextMenu.module.scss\";\nimport { OverlayContentSuspendWatcher } from \"@/lib/controller/overlay/OverlayContentSuspendWatcher\";\n\nexport interface ContextMenuProps\n extends\n Omit<PopoverProps, \"withTip\">,\n Pick<\n Aria.MenuProps<MenuItemProps>,\n | \"onAction\"\n | \"selectedKeys\"\n | \"defaultSelectedKeys\"\n | \"onSelectionChange\"\n | \"disabledKeys\"\n | \"renderEmptyState\"\n >,\n FlowComponentProps {\n /** The type of selection that is allowed in the context menu. */\n selectionMode?: ContextMenuSelectionMode;\n /** Sets the context menu to a fixed width. */\n width?: string | number;\n}\n\n/** @flr-generate all */\nexport const ContextMenu = flowComponent(\"ContextMenu\", (props) => {\n const {\n children,\n onAction,\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n disabledKeys,\n onSelectionChange,\n renderEmptyState,\n ref,\n controller: overlayControllerFromProps,\n ...rest\n } = props;\n\n const overlayControllerFromContext = useOverlayController(\"ContextMenu\", {\n reuseControllerFromContext: true,\n });\n\n const overlayController =\n overlayControllerFromProps ?? overlayControllerFromContext;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n MenuItem: {\n selectionVariant,\n Avatar: {\n size: \"l\",\n },\n },\n\n Section: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n renderContextMenuSection: true,\n },\n\n ContextMenuSection: {\n MenuItem: {\n Avatar: {\n size: \"l\",\n },\n },\n },\n };\n\n return (\n <OverlayContentSuspendWatcher overlayController={overlayController}>\n <Popover\n {...rest}\n className={styles.popover}\n controller={overlayController}\n isDialogContent={false}\n >\n <OverlayContextProvider\n type=\"ContextMenu\"\n controller={overlayController}\n >\n <ContextMenuContentView\n className={styles.contextMenu}\n onAction={onAction}\n selectionMode={getAriaSelectionMode(selectionMode)}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n onSelectionChange={onSelectionChange}\n renderEmptyState={renderEmptyState}\n ref={ref}\n >\n <PropsContextProvider props={propsContext}>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </PropsContextProvider>\n </ContextMenuContentView>\n </OverlayContextProvider>\n </Popover>\n </OverlayContentSuspendWatcher>\n );\n});\n\nexport default ContextMenu;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwCO,MAAM,WAAA,GAAc,aAAA,CAAc,aAAA,EAAe,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,mBAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,gBAAA;AAAA,IACA,GAAA;AAAA,IACA,UAAA,EAAY,0BAAA;AAAA,IACZ,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,4BAAA,GAA+B,qBAAqB,aAAA,EAAe;AAAA,IACvE,0BAAA,EAA4B;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,oBACJ,0BAAA,IAA8B,4BAAA;AAEhC,EAAA,MAAM,gBAAA,GAAmB,4BAA4B,aAAa,CAAA;AAElE,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,QAAA,EAAU;AAAA,MACR,gBAAA;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IAEA,OAAA,EAAS;AAAA,MACP,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR,OACF;AAAA,MACA,wBAAA,EAA0B;AAAA,KAC5B;AAAA,IAEA,kBAAA,EAAoB;AAAA,MAClB,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR;AACF;AACF,GACF;AAEA,EAAA,uBACE,GAAA,CAAC,gCAA6B,iBAAA,EAC5B,QAAA,kBAAA,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,UAAA,EAAY,iBAAA;AAAA,MACZ,eAAA,EAAiB,KAAA;AAAA,MAEjB,QAAA,kBAAA,GAAA;AAAA,QAAC,sBAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,aAAA;AAAA,UACL,UAAA,EAAY,iBAAA;AAAA,UAEZ,QAAA,kBAAA,GAAA;AAAA,YAAC,sBAAA;AAAA,YAAA;AAAA,cACC,WAAW,MAAA,CAAO,WAAA;AAAA,cAClB,QAAA;AAAA,cACA,aAAA,EAAe,qBAAqB,aAAa,CAAA;AAAA,cACjD,YAAA;AAAA,cACA,mBAAA;AAAA,cACA,YAAA;AAAA,cACA,iBAAA;AAAA,cACA,gBAAA;AAAA,cACA,GAAA;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,YAAA,EAAc,mBAAA,CAAoB,aAAa,CAAA,EACpD,QAAA,EACH,CAAA,EACF;AAAA;AAAA;AACF;AAAA;AACF;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import * as Aria from 'react-aria-components';
|
|
5
|
+
import '../../../../lib/propsContext/propsContext.mjs';
|
|
5
6
|
import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
6
7
|
import { flowComponent } from '../../../../lib/componentFactory/flowComponent.mjs';
|
|
7
8
|
import styles from '../../ContextMenu.module.scss.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuSection.mjs","sources":["../../../../../../../../../src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"../../ContextMenu.module.scss\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport { Action } from \"@/components/Action\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\n\nexport type ContextMenuSectionProps = PropsWithChildren &\n FlowComponentProps &\n Pick<\n Aria.MenuSectionProps<MenuItemProps>,\n \"defaultSelectedKeys\" | \"selectedKeys\"\n > & {\n selectionMode?: ContextMenuSelectionMode;\n };\n\n/** @flr-generate all */\nexport const ContextMenuSection = flowComponent(\n \"ContextMenuSection\",\n (props) => {\n const { children, selectionMode, ref, ...rest } = props;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n Heading: {\n level: 5,\n wrapWith: <Aria.Header />,\n },\n MenuItem: {\n selectionVariant,\n },\n };\n\n return (\n <Aria.MenuSection\n ref={ref}\n {...rest}\n selectionMode={getAriaSelectionMode(selectionMode)}\n className={styles.section}\n >\n <PropsContextProvider props={propsContext}>\n <Action skip>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </Action>\n </PropsContextProvider>\n </Aria.MenuSection>\n );\n },\n { type: \"layout\" },\n);\n\nexport default ContextMenuSection;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMenuSection.mjs","sources":["../../../../../../../../../src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { PropsWithChildren } from \"react\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport styles from \"../../ContextMenu.module.scss\";\nimport type { ContextMenuSelectionMode } from \"@/components/ContextMenu/lib\";\nimport {\n getAriaSelectionMode,\n getCloseOverlayType,\n getMenuItemSelectionVariant,\n} from \"@/components/ContextMenu/lib\";\nimport { Action } from \"@/components/Action\";\nimport type { MenuItemProps } from \"@/components/MenuItem\";\n\nexport type ContextMenuSectionProps = PropsWithChildren &\n FlowComponentProps &\n Pick<\n Aria.MenuSectionProps<MenuItemProps>,\n \"defaultSelectedKeys\" | \"selectedKeys\"\n > & {\n selectionMode?: ContextMenuSelectionMode;\n };\n\n/** @flr-generate all */\nexport const ContextMenuSection = flowComponent(\n \"ContextMenuSection\",\n (props) => {\n const { children, selectionMode, ref, ...rest } = props;\n\n const selectionVariant = getMenuItemSelectionVariant(selectionMode);\n\n const propsContext: PropsContext = {\n Heading: {\n level: 5,\n wrapWith: <Aria.Header />,\n },\n MenuItem: {\n selectionVariant,\n },\n };\n\n return (\n <Aria.MenuSection\n ref={ref}\n {...rest}\n selectionMode={getAriaSelectionMode(selectionMode)}\n className={styles.section}\n >\n <PropsContextProvider props={propsContext}>\n <Action skip>\n <Action closeOverlay={getCloseOverlayType(selectionMode)}>\n {children}\n </Action>\n </Action>\n </PropsContextProvider>\n </Aria.MenuSection>\n );\n },\n { type: \"layout\" },\n);\n\nexport default ContextMenuSection;\n"],"names":[],"mappings":";;;;;;;;;AA0BO,MAAM,kBAAA,GAAqB,aAAA;AAAA,EAChC,oBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,QAAA,EAAU,aAAA,EAAe,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAElD,IAAA,MAAM,gBAAA,GAAmB,4BAA4B,aAAa,CAAA;AAElE,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,OAAA,EAAS;AAAA,QACP,KAAA,EAAO,CAAA;AAAA,QACP,QAAA,kBAAU,GAAA,CAAC,IAAA,CAAK,MAAA,EAAL,EAAY;AAAA,OACzB;AAAA,MACA,QAAA,EAAU;AAAA,QACR;AAAA;AACF,KACF;AAEA,IAAA,uBACE,GAAA;AAAA,MAAC,IAAA,CAAK,WAAA;AAAA,MAAL;AAAA,QACC,GAAA;AAAA,QACC,GAAG,IAAA;AAAA,QACJ,aAAA,EAAe,qBAAqB,aAAa,CAAA;AAAA,QACjD,WAAW,MAAA,CAAO,OAAA;AAAA,QAElB,8BAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,UAAO,IAAA,EAAI,IAAA,EACV,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,cAAc,mBAAA,CAAoB,aAAa,CAAA,EACpD,QAAA,EACH,GACF,CAAA,EACF;AAAA;AAAA,KACF;AAAA,EAEJ,CAAA;AAAA,EACA,EAAE,MAAM,QAAA;AACV;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { Popover } from '../Popover/Popover.mjs';
|
|
5
5
|
import styles from './ContextualHelp.module.scss.mjs';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
9
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextualHelp.mjs","sources":["../../../../../../../src/components/ContextualHelp/ContextualHelp.tsx"],"sourcesContent":["import type { PopoverProps } from \"@/components/Popover/Popover\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport styles from \"./ContextualHelp.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\n\nexport type ContextualHelpProps = Omit<PopoverProps, \"withTip\">;\n\n/** @flr-generate all */\nexport const ContextualHelp = flowComponent(\"ContextualHelp\", (props) => {\n const {\n children,\n controller: controllerFromProps,\n ref: ignoredRef,\n ...rest\n } = props;\n\n const controllerFromContext = useOverlayController(\"ContextualHelp\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const propsContext: PropsContext = {\n // A contextual help holds a single, simple explanation — it does not need\n // its own heading structure. A heading is rendered as a bold text label\n // instead of an actual heading element.\n Heading: {\n level: 5,\n elementType: \"span\",\n },\n };\n\n return (\n <Popover withTip {...rest} controller={controller}>\n <PropsContextProvider props={propsContext}>\n <div className={styles.contextualHelp}>{children}</div>\n </PropsContextProvider>\n </Popover>\n );\n});\n\nexport default ContextualHelp;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextualHelp.mjs","sources":["../../../../../../../src/components/ContextualHelp/ContextualHelp.tsx"],"sourcesContent":["import type { PopoverProps } from \"@/components/Popover/Popover\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport styles from \"./ContextualHelp.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useOverlayController } from \"@/lib/controller\";\n\nexport type ContextualHelpProps = Omit<PopoverProps, \"withTip\">;\n\n/** @flr-generate all */\nexport const ContextualHelp = flowComponent(\"ContextualHelp\", (props) => {\n const {\n children,\n controller: controllerFromProps,\n ref: ignoredRef,\n ...rest\n } = props;\n\n const controllerFromContext = useOverlayController(\"ContextualHelp\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const propsContext: PropsContext = {\n // A contextual help holds a single, simple explanation — it does not need\n // its own heading structure. A heading is rendered as a bold text label\n // instead of an actual heading element.\n Heading: {\n level: 5,\n elementType: \"span\",\n },\n };\n\n return (\n <Popover withTip {...rest} controller={controller}>\n <PropsContextProvider props={propsContext}>\n <div className={styles.contextualHelp}>{children}</div>\n </PropsContextProvider>\n </Popover>\n );\n});\n\nexport default ContextualHelp;\n"],"names":[],"mappings":";;;;;;;;AAWO,MAAM,cAAA,GAAiB,aAAA,CAAc,gBAAA,EAAkB,CAAC,KAAA,KAAU;AACvE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,UAAA,EAAY,mBAAA;AAAA,IACZ,GAAA,EAAK,UAAA;AAAA,IACL,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,qBAAA,GAAwB,qBAAqB,gBAAA,EAAkB;AAAA,IACnE,0BAAA,EAA4B;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,aAAa,mBAAA,IAAuB,qBAAA;AAE1C,EAAA,MAAM,YAAA,GAA6B;AAAA;AAAA;AAAA;AAAA,IAIjC,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,CAAA;AAAA,MACP,WAAA,EAAa;AAAA;AACf,GACF;AAEA,EAAA,2BACG,OAAA,EAAA,EAAQ,OAAA,EAAO,MAAE,GAAG,IAAA,EAAM,YACzB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC3B,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,cAAA,EAAiB,QAAA,EAAS,GACnD,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import * as Aria from 'react-aria-components';
|
|
5
5
|
import { OverlayTrigger } from '../../../OverlayTrigger/OverlayTrigger.mjs';
|
|
6
|
+
import '../../../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import locales from '../../../../../../../_virtual/_.locale.json@df0c8534e2e4f7c6c3d4365218df7347.mjs';
|
|
8
9
|
import { useLocalizedStringFormatter } from '../../../TranslationProvider/useLocalizedStringFormatter.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextualHelpTrigger.mjs","sources":["../../../../../../../../../src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { OverlayTriggerProps } from \"@/components/OverlayTrigger\";\nimport { OverlayTrigger } from \"@/components/OverlayTrigger\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { IconInfo } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface ContextualHelpTriggerProps extends OverlayTriggerProps {\n /**\n * The subject the contextual help is about — not a complete accessibility\n * label. It is inserted into the localized template \"More information about\n * {subject}\", which becomes the accessibility label of the trigger.\n */\n subject?: string;\n /**\n * A complete accessibility label for the trigger, replacing the label built\n * from `subject`. Prefer `subject`, which stays localized — reach for this\n * only when the template does not fit.\n */\n \"aria-label\"?: string;\n}\n\n/** @flr-generate all */\nexport const ContextualHelpTrigger = flowComponent(\n \"ContextualHelpTrigger\",\n (props) => {\n const {\n children,\n subject,\n \"aria-label\": ariaLabelFromProps,\n ...triggerProps\n } = props;\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"ContextualHelpTrigger\",\n );\n\n const ariaLabel =\n ariaLabelFromProps ??\n (subject === undefined\n ? stringFormatter.format(\"moreInformation\")\n : stringFormatter.format(\"moreInformationAbout\", { subject }));\n\n const propsContext: PropsContext = {\n Button: {\n \"aria-label\": ariaLabel,\n children: <IconInfo />,\n size: \"s\",\n variant: \"plain\",\n ariaSlot: null,\n },\n };\n\n return (\n <OverlayTrigger\n overlayType=\"ContextualHelp\"\n {...triggerProps}\n component={Aria.DialogTrigger}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </OverlayTrigger>\n );\n },\n { type: \"provider\" },\n);\n\nexport default ContextualHelpTrigger;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextualHelpTrigger.mjs","sources":["../../../../../../../../../src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { OverlayTriggerProps } from \"@/components/OverlayTrigger\";\nimport { OverlayTrigger } from \"@/components/OverlayTrigger\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { IconInfo } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface ContextualHelpTriggerProps extends OverlayTriggerProps {\n /**\n * The subject the contextual help is about — not a complete accessibility\n * label. It is inserted into the localized template \"More information about\n * {subject}\", which becomes the accessibility label of the trigger.\n */\n subject?: string;\n /**\n * A complete accessibility label for the trigger, replacing the label built\n * from `subject`. Prefer `subject`, which stays localized — reach for this\n * only when the template does not fit.\n */\n \"aria-label\"?: string;\n}\n\n/** @flr-generate all */\nexport const ContextualHelpTrigger = flowComponent(\n \"ContextualHelpTrigger\",\n (props) => {\n const {\n children,\n subject,\n \"aria-label\": ariaLabelFromProps,\n ...triggerProps\n } = props;\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"ContextualHelpTrigger\",\n );\n\n const ariaLabel =\n ariaLabelFromProps ??\n (subject === undefined\n ? stringFormatter.format(\"moreInformation\")\n : stringFormatter.format(\"moreInformationAbout\", { subject }));\n\n const propsContext: PropsContext = {\n Button: {\n \"aria-label\": ariaLabel,\n children: <IconInfo />,\n size: \"s\",\n variant: \"plain\",\n ariaSlot: null,\n },\n };\n\n return (\n <OverlayTrigger\n overlayType=\"ContextualHelp\"\n {...triggerProps}\n component={Aria.DialogTrigger}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </OverlayTrigger>\n );\n },\n { type: \"provider\" },\n);\n\nexport default ContextualHelpTrigger;\n"],"names":[],"mappings":";;;;;;;;;;AA0BO,MAAM,qBAAA,GAAwB,aAAA;AAAA,EACnC,uBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,OAAA;AAAA,MACA,YAAA,EAAc,kBAAA;AAAA,MACd,GAAG;AAAA,KACL,GAAI,KAAA;AACJ,IAAA,MAAM,eAAA,GAAkB,2BAAA;AAAA,MACtB,OAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,SAAA,GACJ,kBAAA,KACC,OAAA,KAAY,MAAA,GACT,eAAA,CAAgB,MAAA,CAAO,iBAAiB,CAAA,GACxC,eAAA,CAAgB,MAAA,CAAO,sBAAA,EAAwB,EAAE,SAAS,CAAA,CAAA;AAEhE,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,MAAA,EAAQ;AAAA,QACN,YAAA,EAAc,SAAA;AAAA,QACd,QAAA,sBAAW,QAAA,EAAA,EAAS,CAAA;AAAA,QACpB,IAAA,EAAM,GAAA;AAAA,QACN,OAAA,EAAS,OAAA;AAAA,QACT,QAAA,EAAU;AAAA;AACZ,KACF;AAEA,IAAA,uBACE,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,WAAA,EAAY,gBAAA;AAAA,QACX,GAAG,YAAA;AAAA,QACJ,WAAW,IAAA,CAAK,aAAA;AAAA,QAEhB,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH;AAAA;AAAA,KACF;AAAA,EAEJ,CAAA;AAAA,EACA,EAAE,MAAM,UAAA;AACV;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
6
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
7
8
|
import * as Aria from 'react-aria-components';
|
|
8
9
|
import { Popover } from '../Popover/Popover.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const popoverController = useOverlayController(\"Popover\");\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"DatePicker\");\n\n const rootClassName = clsx(fieldProps.className, className);\n\n return (\n <Aria.DatePicker\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.mjs","sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest } = props;\n\n const popoverController = useOverlayController(\"Popover\");\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"DatePicker\");\n\n const rootClassName = clsx(fieldProps.className, className);\n\n return (\n <Aria.DatePicker\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBO,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,EAAc,CAAC,KAAA,KAAU;AAC/D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,UAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAExD,EAAA,MAAM,iBAAA,GAAoB,qBAAqB,SAAS,CAAA;AACxD,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,YAAY,CAAA;AAEzC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,UAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,SAAA,EAAW,aAAA;AAAA,MACX,YAAA,EAAc,CAAC,CAAA,KAAM,iBAAA,CAAkB,QAAQ,CAAC,CAAA;AAAA,MAChD,QAAQ,iBAAA,CAAkB,MAAA;AAAA,MAC1B,QAAA,EAAU,CAAC,KAAA,KAAU;AACnB,QAAA,IAAI,QAAA,EAAU;AACZ,UAAA,QAAA,CAAS,KAAK,CAAA;AAAA,QAChB;AACA,QAAA,iBAAA,CAAkB,KAAA,EAAM;AAAA,MAC1B,CAAA;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,SAAA,EAAA,EAAU,UAAA,EAAY,KAAA,CAAM,UAAA,EAAY,GAAA,EAAU,CAAA;AAAA,0BACnD,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,YAAA;AAAA,cACV,eAAA,EAAe,IAAA;AAAA,cACf,UAAA,EAAY,iBAAA;AAAA,cAEZ,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,SAAA,EAAW,MAAA,CAAO,QAAA,EAAU;AAAA;AAAA;AACxC,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
5
6
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
6
7
|
import * as Aria from 'react-aria-components';
|
|
7
8
|
import { Popover } from '../Popover/Popover.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover\";\nimport { type DateRangePresets, RangeCalendar } from \"@/components/Calendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport type { RangeValue } from \"react-aria\";\nimport type { DateValue } from \"@internationalized/date\";\nimport styles from \"./DateRangePicker.module.scss\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {\n withDatePickerPresets?: boolean | DateRangePresets;\n}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n const {\n children,\n className,\n onChange,\n ref,\n withDatePickerPresets = false,\n ...rest\n } = useControlledHostValueProps(props);\n\n const popoverController = useOverlayController(\"Popover\");\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"DateRangePicker\");\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const onDatePickerChange = (value: RangeValue<DateValue> | null) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n };\n\n return (\n <Aria.DateRangePicker\n {...rest}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={onDatePickerChange}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar\n withDatePickerPresets={withDatePickerPresets}\n className={styles.calendar}\n />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateRangePicker.mjs","sources":["../../../../../../../src/components/DateRangePicker/DateRangePicker.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { Popover } from \"@/components/Popover\";\nimport { type DateRangePresets, RangeCalendar } from \"@/components/Calendar\";\nimport { DateRangeInput } from \"./components/DateRangeInput\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport type { RangeValue } from \"react-aria\";\nimport type { DateValue } from \"@internationalized/date\";\nimport styles from \"./DateRangePicker.module.scss\";\n\nexport interface DateRangePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DateRangePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {\n withDatePickerPresets?: boolean | DateRangePresets;\n}\n\n/** @flr-generate all */\nexport const DateRangePicker = flowComponent(\"DateRangePicker\", (props) => {\n const {\n children,\n className,\n onChange,\n ref,\n withDatePickerPresets = false,\n ...rest\n } = useControlledHostValueProps(props);\n\n const popoverController = useOverlayController(\"Popover\");\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"DateRangePicker\");\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const onDatePickerChange = (value: RangeValue<DateValue> | null) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n };\n\n return (\n <Aria.DateRangePicker\n {...rest}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={onDatePickerChange}\n >\n <FieldErrorCaptureContext>\n <DateRangeInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <RangeCalendar\n withDatePickerPresets={withDatePickerPresets}\n className={styles.calendar}\n />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DateRangePicker>\n );\n});\n\nexport default DateRangePicker;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA0BO,MAAM,eAAA,GAAkB,aAAA,CAAc,iBAAA,EAAmB,CAAC,KAAA,KAAU;AACzE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAA;AAAA,IACA,qBAAA,GAAwB,KAAA;AAAA,IACxB,GAAG;AAAA,GACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,EAAA,MAAM,iBAAA,GAAoB,qBAAqB,SAAS,CAAA;AACxD,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,iBAAiB,CAAA;AAE9C,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,EAAA,MAAM,kBAAA,GAAqB,CAAC,KAAA,KAAwC;AAClE,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,QAAA,CAAS,KAAK,CAAA;AAAA,IAChB;AACA,IAAA,iBAAA,CAAkB,KAAA,EAAM;AAAA,EAC1B,CAAA;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,eAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,aAAA;AAAA,MACX,YAAA,EAAc,CAAC,CAAA,KAAM,iBAAA,CAAkB,QAAQ,CAAC,CAAA;AAAA,MAChD,QAAQ,iBAAA,CAAkB,MAAA;AAAA,MAC1B,QAAA,EAAU,kBAAA;AAAA,MAEV,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAY,KAAA,CAAM,UAAA,EAAY,GAAA,EAAU,CAAA;AAAA,0BACxD,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAU,YAAA;AAAA,cACV,eAAA,EAAe,IAAA;AAAA,cACf,UAAA,EAAY,iBAAA;AAAA,cAEZ,QAAA,kBAAA,GAAA;AAAA,gBAAC,aAAA;AAAA,gBAAA;AAAA,kBACC,qBAAA;AAAA,kBACA,WAAW,MAAA,CAAO;AAAA;AAAA;AACpB;AAAA;AACF,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA;AAAA;AAAA,GAClB;AAEJ,CAAC;;;;"}
|
|
@@ -9,6 +9,7 @@ import { FileSizeText } from './components/FileSizeText/FileSizeText.mjs';
|
|
|
9
9
|
import { Link } from '../Link/Link.mjs';
|
|
10
10
|
import { Wrap } from '../Wrap/Wrap.mjs';
|
|
11
11
|
import { DeleteButton } from './components/DeleteButton/DeleteButton.mjs';
|
|
12
|
+
import '../../lib/propsContext/propsContext.mjs';
|
|
12
13
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
13
14
|
import { OptionsButton } from '../List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs';
|
|
14
15
|
import { UiComponentTunnelExit } from '../UiComponentTunnel/UiComponentTunnelExit.mjs';
|