@mittwald/flow-react-components 0.2.0-alpha.567 → 0.2.0-alpha.569
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/CHANGELOG.md +8 -0
- package/dist/assets/doc-properties.json +2065 -878
- package/dist/css/all.css +1 -1
- package/dist/js/components/src/components/AccentBox/AccentBox.mjs +22 -21
- package/dist/js/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/components/src/components/ActionGroup/ActionGroup.mjs +37 -31
- package/dist/js/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/components/src/components/Align/Align.mjs +22 -16
- package/dist/js/components/src/components/Align/Align.mjs.map +1 -1
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs +61 -50
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/components/src/components/BrowserOnly/BrowserOnly.mjs +7 -0
- package/dist/js/components/src/components/BrowserOnly/BrowserOnly.mjs.map +1 -1
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs +5 -2
- package/dist/js/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/components/src/components/Checkbox/Checkbox.mjs +4 -11
- package/dist/js/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/components/src/components/CheckboxButton/CheckboxButton.mjs +2 -19
- package/dist/js/components/src/components/CheckboxButton/CheckboxButton.mjs.map +1 -1
- package/dist/js/components/src/components/CheckboxGroup/CheckboxGroup.mjs +4 -4
- package/dist/js/components/src/components/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/dist/js/components/src/components/ColumnLayout/ColumnLayout.mjs +64 -58
- package/dist/js/components/src/components/ColumnLayout/ColumnLayout.mjs.map +1 -1
- package/dist/js/components/src/components/ComboBox/ComboBox.mjs +11 -37
- package/dist/js/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs +2 -1
- package/dist/js/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs.map +1 -1
- package/dist/js/components/src/components/DateInput/DateInput.mjs +20 -0
- package/dist/js/components/src/components/DateInput/DateInput.mjs.map +1 -0
- package/dist/js/components/src/components/DatePicker/DatePicker.mjs +1 -6
- package/dist/js/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/components/src/components/DatePicker/components/DateInput/DateInput.mjs +3 -2
- package/dist/js/components/src/components/DatePicker/components/DateInput/DateInput.mjs.map +1 -1
- package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs +1 -6
- package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs +4 -3
- package/dist/js/components/src/components/DateRangePicker/components/DateRangeInput/DateRangeInput.mjs.map +1 -1
- package/dist/js/components/src/components/FileField/FileField.mjs +4 -10
- package/dist/js/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/components/src/components/Header/Header.mjs +20 -15
- package/dist/js/components/src/components/Header/Header.mjs.map +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs +1 -1
- package/dist/js/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/components/src/components/LayoutCard/LayoutCard.mjs +16 -12
- package/dist/js/components/src/components/LayoutCard/LayoutCard.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +5 -2
- package/dist/js/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
- package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +6 -0
- package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +5 -2
- package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs.map +1 -1
- package/dist/js/components/src/components/Markdown/Markdown.mjs.map +1 -1
- package/dist/js/components/src/components/MarkdownEditor/MarkdownEditor.mjs +19 -24
- package/dist/js/components/src/components/MarkdownEditor/MarkdownEditor.mjs.map +1 -1
- package/dist/js/components/src/components/MarkdownEditor/lib/modifyValueByMarkdownSyntax.mjs +2 -2
- package/dist/js/components/src/components/MarkdownEditor/lib/modifyValueByMarkdownSyntax.mjs.map +1 -1
- package/dist/js/components/src/components/MarkdownEditor/lib/modifyValueByType.mjs +1 -1
- package/dist/js/components/src/components/MarkdownEditor/lib/modifyValueByType.mjs.map +1 -1
- package/dist/js/components/src/components/Modal/Modal.mjs +70 -76
- package/dist/js/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/components/src/components/Modal/components/OffCanvasSuspenseFallback/OffCanvasSuspenseFallback.mjs +5 -2
- package/dist/js/components/src/components/Modal/components/OffCanvasSuspenseFallback/OffCanvasSuspenseFallback.mjs.map +1 -1
- package/dist/js/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs +1 -4
- package/dist/js/components/src/components/Navigation/components/NavigationGroup/NavigationGroup.mjs.map +1 -1
- package/dist/js/components/src/components/NumberField/NumberField.mjs +4 -22
- package/dist/js/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/components/src/components/Overlay/Overlay.mjs +2 -104
- package/dist/js/components/src/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/js/components/src/components/Overlay/components/OverlaySuspenseFallback.mjs +5 -2
- package/dist/js/components/src/components/Overlay/components/OverlaySuspenseFallback.mjs.map +1 -1
- package/dist/js/components/src/components/PasswordCreationField/PasswordCreationField.mjs +10 -16
- package/dist/js/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/components/src/components/Popover/Popover.mjs +2 -106
- package/dist/js/components/src/components/Popover/Popover.mjs.map +1 -1
- package/dist/js/components/src/components/RadioGroup/RadioGroup.mjs +1 -1
- package/dist/js/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/js/components/src/components/SearchField/SearchField.mjs +6 -13
- package/dist/js/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/components/src/components/Section/Section.mjs +41 -35
- package/dist/js/components/src/components/Section/Section.mjs.map +1 -1
- package/dist/js/components/src/components/SegmentedControl/SegmentedControl.mjs +3 -3
- package/dist/js/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/components/src/components/Select/Select.mjs +5 -16
- package/dist/js/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/components/src/components/Slider/Slider.mjs +2 -9
- package/dist/js/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/components/src/components/Switch/Switch.mjs +6 -21
- package/dist/js/components/src/components/Switch/Switch.mjs.map +1 -1
- package/dist/js/components/src/components/TextArea/TextArea.mjs +13 -20
- package/dist/js/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/components/src/components/TextField/TextField.mjs +4 -11
- package/dist/js/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/components/src/components/TextFieldBase/TextFieldBase.mjs +9 -23
- package/dist/js/components/src/components/TextFieldBase/TextFieldBase.mjs.map +1 -1
- package/dist/js/components/src/components/TimeField/TimeField.mjs +3 -6
- package/dist/js/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/dist/js/components/src/components/Tooltip/Tooltip.mjs +6 -2
- package/dist/js/components/src/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +6 -7
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs +4 -6
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs +1 -3
- package/dist/js/components/src/integrations/react-hook-form/components/ResetButton/ResetButton.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/SubmitButton/SubmitButton.mjs +2 -2
- package/dist/js/components/src/lib/componentFactory/flowComponent.mjs +7 -23
- package/dist/js/components/src/lib/componentFactory/flowComponent.mjs.map +1 -1
- package/dist/js/components/src/lib/controller/overlay/OverlayController.mjs +6 -0
- package/dist/js/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
- package/dist/js/components/src/lib/form/isFocused.mjs +8 -0
- package/dist/js/components/src/lib/form/isFocused.mjs.map +1 -0
- package/dist/js/components/src/lib/hooks/useFieldError.mjs +1 -2
- package/dist/js/components/src/lib/hooks/useFieldError.mjs.map +1 -1
- package/dist/js/components/src/lib/hooks/useProps.mjs +1 -2
- package/dist/js/components/src/lib/hooks/useProps.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs +4 -10
- package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/components/ComponentPropsContextProvider.mjs +2 -2
- package/dist/js/components/src/lib/propsContext/components/ComponentPropsContextProvider.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/components/PropsContextProvider.mjs +7 -22
- package/dist/js/components/src/lib/propsContext/components/PropsContextProvider.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs +22 -30
- package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/nestedPropsContext/lib.mjs +27 -7
- package/dist/js/components/src/lib/propsContext/nestedPropsContext/lib.mjs.map +1 -1
- package/dist/js/components/src/lib/react/getPropsMerger.mjs +7 -2
- package/dist/js/components/src/lib/react/getPropsMerger.mjs.map +1 -1
- package/dist/js/components/src/lib/remote/eventHandlerContext.mjs +9 -0
- package/dist/js/components/src/lib/remote/eventHandlerContext.mjs.map +1 -0
- package/dist/js/components/src/lib/remote/useControlledHostValueProps.mjs +31 -0
- package/dist/js/components/src/lib/remote/useControlledHostValueProps.mjs.map +1 -0
- package/dist/js/components/src/lib/remote/useControlledRemoteValueProps.mjs +20 -0
- package/dist/js/components/src/lib/remote/useControlledRemoteValueProps.mjs.map +1 -0
- package/dist/js/default.mjs +2 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +2 -2
- package/dist/types/components/AccentBox/AccentBox.d.ts.map +1 -1
- package/dist/types/components/AccentBox/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/AccentBox/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/ActionGroup/ActionGroup.d.ts.map +1 -1
- package/dist/types/components/Align/Align.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +3 -4
- package/dist/types/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/CheckboxButton/CheckboxButton.d.ts +2 -4
- package/dist/types/components/CheckboxButton/CheckboxButton.d.ts.map +1 -1
- package/dist/types/components/ColumnLayout/ColumnLayout.d.ts.map +1 -1
- package/dist/types/components/ComboBox/ComboBox.d.ts +3 -6
- package/dist/types/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/types/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.d.ts.map +1 -1
- package/dist/types/components/DateInput/DateInput.d.ts +8 -0
- package/dist/types/components/DateInput/DateInput.d.ts.map +1 -0
- package/dist/types/components/DateInput/index.d.ts +3 -0
- package/dist/types/components/DateInput/index.d.ts.map +1 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/types/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/DatePicker/components/DateInput/DateInput.d.ts +2 -1
- package/dist/types/components/DatePicker/components/DateInput/DateInput.d.ts.map +1 -1
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/types/components/DateRangePicker/components/DateRangeInput/DateRangeInput.d.ts +2 -1
- package/dist/types/components/DateRangePicker/components/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/types/components/FileField/FileField.d.ts +1 -2
- package/dist/types/components/FileField/FileField.d.ts.map +1 -1
- package/dist/types/components/Header/Header.d.ts +2 -2
- package/dist/types/components/Header/Header.d.ts.map +1 -1
- package/dist/types/components/LayoutCard/LayoutCard.d.ts.map +1 -1
- package/dist/types/components/List/typedList.d.ts +2 -2
- package/dist/types/components/Markdown/Markdown.d.ts +2 -2
- package/dist/types/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +3 -7
- package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
- package/dist/types/components/MarkdownEditor/lib/modifyValueByMarkdownSyntax.d.ts +2 -2
- package/dist/types/components/MarkdownEditor/lib/modifyValueByMarkdownSyntax.d.ts.map +1 -1
- package/dist/types/components/MarkdownEditor/lib/modifyValueByType.d.ts +1 -1
- package/dist/types/components/MarkdownEditor/lib/modifyValueByType.d.ts.map +1 -1
- package/dist/types/components/Message/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/Modal/Modal.d.ts.map +1 -1
- package/dist/types/components/Navigation/components/NavigationGroup/NavigationGroup.d.ts.map +1 -1
- package/dist/types/components/NumberField/NumberField.d.ts +3 -4
- package/dist/types/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/types/components/Overlay/Overlay.d.ts.map +1 -1
- package/dist/types/components/PasswordCreationField/PasswordCreationField.d.ts.map +1 -1
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.d.ts.map +1 -1
- package/dist/types/components/Section/Section.d.ts.map +1 -1
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts +3 -3
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/types/components/Select/Select.d.ts +2 -5
- package/dist/types/components/Select/Select.d.ts.map +1 -1
- package/dist/types/components/Slider/Slider.d.ts +3 -3
- package/dist/types/components/Slider/Slider.d.ts.map +1 -1
- package/dist/types/components/Switch/Switch.d.ts +2 -2
- package/dist/types/components/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/types/components/TextField/TextField.d.ts.map +1 -1
- package/dist/types/components/TextFieldBase/TextFieldBase.d.ts.map +1 -1
- package/dist/types/components/TimeField/TimeField.d.ts +3 -3
- package/dist/types/components/TimeField/TimeField.d.ts.map +1 -1
- package/dist/types/index/default.d.ts +2 -0
- package/dist/types/index/default.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts +2 -2
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts +1 -1
- package/dist/types/integrations/react-hook-form/components/ResetButton/ResetButton.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/SubmitButton/SubmitButton.d.ts +1 -1
- package/dist/types/lib/componentFactory/flowComponent.d.ts +1 -1
- package/dist/types/lib/componentFactory/flowComponent.d.ts.map +1 -1
- package/dist/types/lib/controller/overlay/OverlayController.d.ts.map +1 -1
- package/dist/types/lib/form/isFocused.d.ts +2 -0
- package/dist/types/lib/form/isFocused.d.ts.map +1 -0
- package/dist/types/lib/hooks/useFieldError.d.ts.map +1 -1
- package/dist/types/lib/hooks/useProps.d.ts.map +1 -1
- package/dist/types/lib/propsContext/components/ClearPropsContext.d.ts +1 -5
- package/dist/types/lib/propsContext/components/ClearPropsContext.d.ts.map +1 -1
- package/dist/types/lib/propsContext/components/ComponentPropsContextProvider.d.ts +0 -2
- package/dist/types/lib/propsContext/components/ComponentPropsContextProvider.d.ts.map +1 -1
- package/dist/types/lib/propsContext/components/PropsContextProvider.d.ts +0 -3
- package/dist/types/lib/propsContext/components/PropsContextProvider.d.ts.map +1 -1
- package/dist/types/lib/propsContext/mergePropsContext.d.ts +1 -1
- package/dist/types/lib/propsContext/mergePropsContext.d.ts.map +1 -1
- package/dist/types/lib/propsContext/nestedPropsContext/lib.d.ts +3 -84
- package/dist/types/lib/propsContext/nestedPropsContext/lib.d.ts.map +1 -1
- package/dist/types/lib/propsContext/types.d.ts +1 -2
- package/dist/types/lib/propsContext/types.d.ts.map +1 -1
- package/dist/types/lib/react/getPropsMerger.d.ts.map +1 -1
- package/dist/types/lib/remote/eventHandlerContext.d.ts +11 -0
- package/dist/types/lib/remote/eventHandlerContext.d.ts.map +1 -0
- package/dist/types/lib/remote/types.d.ts +6 -0
- package/dist/types/lib/remote/types.d.ts.map +1 -0
- package/dist/types/lib/remote/useControlledHostValueProps.d.ts +18 -0
- package/dist/types/lib/remote/useControlledHostValueProps.d.ts.map +1 -0
- package/dist/types/lib/remote/useControlledRemoteValueProps.d.ts +11 -0
- package/dist/types/lib/remote/useControlledRemoteValueProps.d.ts.map +1 -0
- package/package.json +5 -4
- package/dist/js/components/src/lib/hooks/useManagedValue.mjs +0 -27
- package/dist/js/components/src/lib/hooks/useManagedValue.mjs.map +0 -1
- package/dist/js/components/src/lib/propsContext/inherit/PropsContextLevelProvider.mjs +0 -20
- package/dist/js/components/src/lib/propsContext/inherit/PropsContextLevelProvider.mjs.map +0 -1
- package/dist/js/components/src/lib/propsContext/inherit/lib.mjs +0 -39
- package/dist/js/components/src/lib/propsContext/inherit/lib.mjs.map +0 -1
- package/dist/js/components/src/lib/propsContext/inherit/propsContextLevel.mjs +0 -13
- package/dist/js/components/src/lib/propsContext/inherit/propsContextLevel.mjs.map +0 -1
- package/dist/js/components/src/lib/propsContext/inherit/types.mjs +0 -6
- package/dist/js/components/src/lib/propsContext/inherit/types.mjs.map +0 -1
- package/dist/js/components/src/lib/react/ReactAriaControlledValueFix.mjs +0 -65
- package/dist/js/components/src/lib/react/ReactAriaControlledValueFix.mjs.map +0 -1
- package/dist/js/components/src/lib/react/emitElementValueChange.mjs +0 -22
- package/dist/js/components/src/lib/react/emitElementValueChange.mjs.map +0 -1
- package/dist/types/lib/hooks/useManagedValue.d.ts +0 -13
- package/dist/types/lib/hooks/useManagedValue.d.ts.map +0 -1
- package/dist/types/lib/propsContext/inherit/PropsContextLevelProvider.d.ts +0 -8
- package/dist/types/lib/propsContext/inherit/PropsContextLevelProvider.d.ts.map +0 -1
- package/dist/types/lib/propsContext/inherit/lib.d.ts +0 -8
- package/dist/types/lib/propsContext/inherit/lib.d.ts.map +0 -1
- package/dist/types/lib/propsContext/inherit/propsContextLevel.d.ts +0 -4
- package/dist/types/lib/propsContext/inherit/propsContextLevel.d.ts.map +0 -1
- package/dist/types/lib/propsContext/inherit/types.d.ts +0 -6
- package/dist/types/lib/propsContext/inherit/types.d.ts.map +0 -1
- package/dist/types/lib/react/ReactAriaControlledValueFix.d.ts +0 -16
- package/dist/types/lib/react/ReactAriaControlledValueFix.d.ts.map +0 -1
- package/dist/types/lib/react/ReactAriaControlledValueFix.test.d.ts +0 -2
- package/dist/types/lib/react/ReactAriaControlledValueFix.test.d.ts.map +0 -1
- package/dist/types/lib/react/emitElementValueChange.d.ts +0 -6
- package/dist/types/lib/react/emitElementValueChange.d.ts.map +0 -1
|
@@ -9,42 +9,48 @@ import { PropsContextProvider } from '../../lib/propsContext/components/PropsCon
|
|
|
9
9
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
10
10
|
import ContextMenuSectionView from '../../views/ContextMenuSectionView.mjs';
|
|
11
11
|
|
|
12
|
-
const Section = flowComponent(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ jsx(ContextMenuSectionView, { ref, children });
|
|
26
|
-
}
|
|
27
|
-
const rootClassName = clsx(
|
|
28
|
-
styles.section,
|
|
29
|
-
className,
|
|
30
|
-
hideSeparator && styles.hideSeparator
|
|
31
|
-
);
|
|
32
|
-
const headingId = useId();
|
|
33
|
-
const propsContext = {
|
|
34
|
-
Heading: {
|
|
35
|
-
level: 2,
|
|
36
|
-
id: headingId,
|
|
37
|
-
className: styles.heading
|
|
38
|
-
},
|
|
39
|
-
Header: {
|
|
40
|
-
renderSectionHeader: true
|
|
41
|
-
},
|
|
42
|
-
List: {
|
|
43
|
-
"aria-labelledby": headingId
|
|
12
|
+
const Section = flowComponent(
|
|
13
|
+
"Section",
|
|
14
|
+
(props) => {
|
|
15
|
+
const {
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
ref,
|
|
19
|
+
renderContextMenuSection,
|
|
20
|
+
hideSeparator,
|
|
21
|
+
...rest
|
|
22
|
+
} = props;
|
|
23
|
+
if (!children) {
|
|
24
|
+
return null;
|
|
44
25
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
26
|
+
if (renderContextMenuSection) {
|
|
27
|
+
return /* @__PURE__ */ jsx(ContextMenuSectionView, { ref, children });
|
|
28
|
+
}
|
|
29
|
+
const rootClassName = clsx(
|
|
30
|
+
styles.section,
|
|
31
|
+
className,
|
|
32
|
+
hideSeparator && styles.hideSeparator
|
|
33
|
+
);
|
|
34
|
+
const headingId = useId();
|
|
35
|
+
const propsContext = {
|
|
36
|
+
Heading: {
|
|
37
|
+
level: 2,
|
|
38
|
+
id: headingId,
|
|
39
|
+
className: styles.heading
|
|
40
|
+
},
|
|
41
|
+
Header: {
|
|
42
|
+
renderSectionHeader: true
|
|
43
|
+
},
|
|
44
|
+
List: {
|
|
45
|
+
"aria-labelledby": headingId
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ jsx("section", { ...rest, className: rootClassName, ref, children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children }) });
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "layout"
|
|
52
|
+
}
|
|
53
|
+
);
|
|
48
54
|
|
|
49
55
|
export { Section, Section as default };
|
|
50
56
|
//# sourceMappingURL=Section.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.mjs","sources":["../../../../../../src/components/Section/Section.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport { useId } from \"react\";\nimport styles from \"./Section.module.scss\";\nimport clsx from \"clsx\";\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 ContextMenuSectionView from \"@/views/ContextMenuSectionView\";\n\nexport interface SectionProps\n extends PropsWithChildren<ComponentProps<\"section\">>,\n FlowComponentProps<HTMLElement> {\n /** @internal */\n renderContextMenuSection?: boolean;\n /** @internal */\n hideSeparator?: boolean;\n}\n\n/** @flr-generate all */\nexport const Section = flowComponent(\"Section\"
|
|
1
|
+
{"version":3,"file":"Section.mjs","sources":["../../../../../../src/components/Section/Section.tsx"],"sourcesContent":["import type { ComponentProps, PropsWithChildren } from \"react\";\nimport { useId } from \"react\";\nimport styles from \"./Section.module.scss\";\nimport clsx from \"clsx\";\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 ContextMenuSectionView from \"@/views/ContextMenuSectionView\";\n\nexport interface SectionProps\n extends PropsWithChildren<ComponentProps<\"section\">>,\n FlowComponentProps<HTMLElement> {\n /** @internal */\n renderContextMenuSection?: boolean;\n /** @internal */\n hideSeparator?: boolean;\n}\n\n/** @flr-generate all */\nexport const Section = flowComponent(\n \"Section\",\n (props) => {\n const {\n children,\n className,\n ref,\n renderContextMenuSection,\n hideSeparator,\n ...rest\n } = props;\n\n if (!children) {\n return null;\n }\n\n if (renderContextMenuSection) {\n return (\n <ContextMenuSectionView ref={ref as never}>\n {children}\n </ContextMenuSectionView>\n );\n }\n\n const rootClassName = clsx(\n styles.section,\n className,\n hideSeparator && styles.hideSeparator,\n );\n\n const headingId = useId();\n\n const propsContext: PropsContext = {\n Heading: {\n level: 2,\n id: headingId,\n className: styles.heading,\n },\n Header: {\n renderSectionHeader: true,\n },\n List: {\n \"aria-labelledby\": headingId,\n },\n };\n\n return (\n <section {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </section>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Section;\n"],"names":[],"mappings":";;;;;;;;;AAoBO,MAAM,OAAA,GAAU,aAAA;AAAA,EACrB,SAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM;AAAA,MACJ,QAAA;AAAA,MACA,SAAA;AAAA,MACA,GAAA;AAAA,MACA,wBAAA;AAAA,MACA,aAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,IAAI,CAAC,QAAA,EAAU;AACb,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,IAAI,wBAAA,EAA0B;AAC5B,MAAA,uBACE,GAAA,CAAC,sBAAA,EAAA,EAAuB,GAAA,EACrB,QAAA,EACH,CAAA;AAAA,IAEJ;AAEA,IAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,MACpB,MAAA,CAAO,OAAA;AAAA,MACP,SAAA;AAAA,MACA,iBAAiB,MAAA,CAAO;AAAA,KAC1B;AAEA,IAAA,MAAM,YAAY,KAAA,EAAM;AAExB,IAAA,MAAM,YAAA,GAA6B;AAAA,MACjC,OAAA,EAAS;AAAA,QACP,KAAA,EAAO,CAAA;AAAA,QACP,EAAA,EAAI,SAAA;AAAA,QACJ,WAAW,MAAA,CAAO;AAAA,OACpB;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,mBAAA,EAAqB;AAAA,OACvB;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,iBAAA,EAAmB;AAAA;AACrB,KACF;AAEA,IAAA,uBACE,GAAA,CAAC,SAAA,EAAA,EAAS,GAAG,IAAA,EAAM,SAAA,EAAW,aAAA,EAAe,GAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EACH,CAAA,EACF,CAAA;AAAA,EAEJ,CAAA;AAAA,EACA;AAAA,IACE,IAAA,EAAM;AAAA;AAEV;;;;"}
|
|
@@ -42,14 +42,14 @@ const SegmentedControl = flowComponent("SegmentedControl", (props) => {
|
|
|
42
42
|
},
|
|
43
43
|
...fieldPropsContext
|
|
44
44
|
};
|
|
45
|
-
const
|
|
46
|
-
useMakeFocusable(
|
|
45
|
+
const objectRef = useObjectRef(ref);
|
|
46
|
+
useMakeFocusable(objectRef);
|
|
47
47
|
return /* @__PURE__ */ jsx(
|
|
48
48
|
Aria.RadioGroup,
|
|
49
49
|
{
|
|
50
50
|
...rest,
|
|
51
51
|
className: clsx(rootClassName, fieldProps.className),
|
|
52
|
-
ref:
|
|
52
|
+
ref: objectRef,
|
|
53
53
|
children: /* @__PURE__ */ jsxs(TunnelProvider, { children: [
|
|
54
54
|
/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsxs(PropsContextProvider, { dependencies: ["segment"], props: propsContext, children: [
|
|
55
55
|
/* @__PURE__ */ jsx("div", { className: styles.segmentedControl, children: /* @__PURE__ */ jsx("div", { className: styles.segments, children: /* @__PURE__ */ jsx(TunnelExit, { id: "segments" }) }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.mjs","sources":["../../../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithContainerBreakpointSize } from \"@/lib/types/props\";\nimport
|
|
1
|
+
{"version":3,"file":"SegmentedControl.mjs","sources":["../../../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithContainerBreakpointSize } from \"@/lib/types/props\";\nimport { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./SegmentedControl.module.scss\";\nimport { getContainerBreakpointSizeClassName } from \"@/lib/getContainerBreakpointSizeClassName\";\nimport { type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport clsx from \"clsx\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface SegmentedControlProps\n extends PropsWithChildren<Omit<Aria.RadioGroupProps, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLDivElement>,\n PropsWithContainerBreakpointSize {}\n\n/** @flr-generate all */\nexport const SegmentedControl = flowComponent(\"SegmentedControl\", (props) => {\n const {\n children,\n className,\n containerBreakpointSize = \"m\",\n ref,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(\n formFieldStyles.formField,\n styles.segmentedControlContainer,\n className,\n styles[getContainerBreakpointSizeClassName(containerBreakpointSize)],\n );\n\n const propsContext: PropsContext = {\n Segment: {\n tunnelId: \"segments\",\n className: styles.segment,\n },\n ...fieldPropsContext,\n };\n\n const objectRef = useObjectRef(ref);\n useMakeFocusable(objectRef);\n\n return (\n <Aria.RadioGroup\n {...rest}\n className={clsx(rootClassName, fieldProps.className)}\n ref={objectRef}\n >\n <TunnelProvider>\n <FieldErrorCaptureContext>\n <PropsContextProvider dependencies={[\"segment\"]} props={propsContext}>\n <div className={styles.segmentedControl}>\n <div className={styles.segments}>\n <TunnelExit id=\"segments\" />\n </div>\n </div>\n {children}\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </TunnelProvider>\n </Aria.RadioGroup>\n );\n});\n\nexport default SegmentedControl;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,aAAA,CAAc,kBAAA,EAAoB,CAAC,KAAA,KAAU;AAC3E,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAAA,GAA0B,GAAA;AAAA,IAC1B,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,eAAA,CAAgB,SAAA;AAAA,IAChB,MAAA,CAAO,yBAAA;AAAA,IACP,SAAA;AAAA,IACA,MAAA,CAAO,mCAAA,CAAoC,uBAAuB,CAAC;AAAA,GACrE;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,UAAA;AAAA,MACV,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,SAAA,GAAY,aAAa,GAAG,CAAA;AAClC,EAAA,gBAAA,CAAiB,SAAS,CAAA;AAE1B,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA,CAAK,UAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,IAAA,CAAK,aAAA,EAAe,UAAA,CAAW,SAAS,CAAA;AAAA,MACnD,GAAA,EAAK,SAAA;AAAA,MAEL,+BAAC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,wBAAA,EAAA,EACC,+BAAC,oBAAA,EAAA,EAAqB,YAAA,EAAc,CAAC,SAAS,CAAA,EAAG,OAAO,YAAA,EACtD,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,gBAAA,EACrB,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,QAAA,EACrB,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,UAAA,EAAW,GAC5B,CAAA,EACF,CAAA;AAAA,UACC;AAAA,SAAA,EACH,CAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import 'react';
|
|
5
5
|
import * as Aria from 'react-aria-components';
|
|
6
6
|
import '../../lib/propsContext/propsContext.mjs';
|
|
7
7
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
@@ -17,8 +17,6 @@ import { Options } from '../Options/Options.mjs';
|
|
|
17
17
|
import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
|
|
18
18
|
import 'mobx';
|
|
19
19
|
import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
|
|
20
|
-
import { useObjectRef } from '@react-aria/utils';
|
|
21
|
-
import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
|
|
22
20
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
23
21
|
|
|
24
22
|
const Select = flowComponent("Select", (props) => {
|
|
@@ -27,9 +25,8 @@ const Select = flowComponent("Select", (props) => {
|
|
|
27
25
|
className,
|
|
28
26
|
onChange,
|
|
29
27
|
onSelectionChange,
|
|
30
|
-
controller: controllerFromProps,
|
|
31
|
-
ref,
|
|
32
28
|
isReadOnly,
|
|
29
|
+
ref,
|
|
33
30
|
...rest
|
|
34
31
|
} = props;
|
|
35
32
|
const {
|
|
@@ -49,16 +46,9 @@ const Select = flowComponent("Select", (props) => {
|
|
|
49
46
|
},
|
|
50
47
|
...fieldPropsContext
|
|
51
48
|
};
|
|
52
|
-
const
|
|
53
|
-
reuseControllerFromContext:
|
|
54
|
-
});
|
|
55
|
-
const localSelectRef = useObjectRef(ref);
|
|
56
|
-
const localButtonRef = useRef(null);
|
|
57
|
-
useMakeFocusable(localSelectRef, () => {
|
|
58
|
-
localButtonRef.current?.focus();
|
|
59
|
-
controller.setOpen(true);
|
|
49
|
+
const controller = useOverlayController("Select", {
|
|
50
|
+
reuseControllerFromContext: false
|
|
60
51
|
});
|
|
61
|
-
const controller = controllerFromProps ?? controllerFromContext;
|
|
62
52
|
const isOpen = controller.useIsOpen();
|
|
63
53
|
return /* @__PURE__ */ jsx(
|
|
64
54
|
Aria.Select,
|
|
@@ -66,7 +56,6 @@ const Select = flowComponent("Select", (props) => {
|
|
|
66
56
|
...rest,
|
|
67
57
|
...fieldProps,
|
|
68
58
|
className: clsx(rootClassName, fieldProps.className),
|
|
69
|
-
ref: localSelectRef,
|
|
70
59
|
onChange: (value) => {
|
|
71
60
|
if (!isReadOnly) {
|
|
72
61
|
onChange?.(value);
|
|
@@ -81,9 +70,9 @@ const Select = flowComponent("Select", (props) => {
|
|
|
81
70
|
/* @__PURE__ */ jsxs(
|
|
82
71
|
Aria.Button,
|
|
83
72
|
{
|
|
84
|
-
ref: localButtonRef,
|
|
85
73
|
"data-readonly": isReadOnly,
|
|
86
74
|
className: styles.toggle,
|
|
75
|
+
ref,
|
|
87
76
|
children: [
|
|
88
77
|
/* @__PURE__ */ jsx(Aria.SelectValue, {}),
|
|
89
78
|
/* @__PURE__ */ jsx(IconChevronDown, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.mjs","sources":["../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import { type PropsWithChildren
|
|
1
|
+
{"version":3,"file":"Select.mjs","sources":["../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./Select.module.scss\";\nimport clsx from \"clsx\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Options } from \"@/components/Options\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface SelectProps\n extends PropsWithChildren<\n Omit<Aria.SelectProps, \"children\" | \"className\" | \"ref\">\n >,\n FlowComponentProps<HTMLButtonElement>,\n PropsWithClassName {\n /** Handler that is called when the selected value changes. */\n onChange?: (value: Key | null) => void;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Select = flowComponent(\"Select\", (props) => {\n const {\n children,\n className,\n onChange,\n onSelectionChange,\n isReadOnly,\n ref,\n ...rest\n } = props;\n\n const {\n FieldErrorView,\n fieldPropsContext,\n fieldProps,\n FieldErrorCaptureContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(\n styles.select,\n formFieldStyles.formField,\n className,\n );\n\n const propsContext: PropsContext = {\n Option: {\n tunnelId: \"options\",\n },\n ...fieldPropsContext,\n };\n\n const controller = useOverlayController(\"Select\", {\n reuseControllerFromContext: false,\n });\n const isOpen = controller.useIsOpen();\n\n return (\n <Aria.Select\n {...rest}\n {...fieldProps}\n className={clsx(rootClassName, fieldProps.className)}\n onChange={(value) => {\n if (!isReadOnly) {\n onChange?.(value);\n onSelectionChange?.(value);\n }\n }}\n onOpenChange={(isOpen) => !isReadOnly && controller.setOpen(isOpen)}\n isOpen={isOpen}\n data-readonly={isReadOnly}\n >\n <TunnelProvider>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={propsContext}>\n <Aria.Button\n data-readonly={isReadOnly}\n className={styles.toggle}\n ref={ref}\n >\n <Aria.SelectValue />\n <IconChevronDown />\n </Aria.Button>\n {children}\n <Options controller={controller}>\n <TunnelExit id=\"options\" />\n </Options>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </TunnelProvider>\n </Aria.Select>\n );\n});\n\nexport default Select;\n"],"names":["isOpen"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,MAAA;AAAA,IACP,eAAA,CAAgB,SAAA;AAAA,IAChB;AAAA,GACF;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,MAAA,EAAQ;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AA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AC3B;AAAA,SAAA,EACF,CAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -18,7 +18,6 @@ import locales from '../../../../_virtual/_.locale.json@3ed2dc50f997451bdd85a713
|
|
|
18
18
|
import { useLocalizedStringFormatter } from 'react-aria';
|
|
19
19
|
import { TunnelExit } from '@mittwald/react-tunnel';
|
|
20
20
|
import { useObjectRef } from '@react-aria/utils';
|
|
21
|
-
import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
|
|
22
21
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
23
22
|
|
|
24
23
|
const Slider = flowComponent("Slider", (props) => {
|
|
@@ -31,7 +30,6 @@ const Slider = flowComponent("Slider", (props) => {
|
|
|
31
30
|
showInitialMarker,
|
|
32
31
|
isReadOnly,
|
|
33
32
|
ref,
|
|
34
|
-
inputRef,
|
|
35
33
|
...rest
|
|
36
34
|
} = props;
|
|
37
35
|
const rootClassName = clsx(
|
|
@@ -41,11 +39,7 @@ const Slider = flowComponent("Slider", (props) => {
|
|
|
41
39
|
);
|
|
42
40
|
const { FieldErrorView, fieldPropsContext, fieldProps } = useFieldComponent(props);
|
|
43
41
|
const stringFormatter = useLocalizedStringFormatter(locales);
|
|
44
|
-
const
|
|
45
|
-
const localInputRef = useObjectRef(inputRef);
|
|
46
|
-
useMakeFocusable(localSliderRef, () => {
|
|
47
|
-
localInputRef.current?.focus();
|
|
48
|
-
});
|
|
42
|
+
const objectRef = useObjectRef(ref);
|
|
49
43
|
const propsContext = {
|
|
50
44
|
...fieldPropsContext,
|
|
51
45
|
Label: {
|
|
@@ -58,7 +52,6 @@ const Slider = flowComponent("Slider", (props) => {
|
|
|
58
52
|
Aria.Slider,
|
|
59
53
|
{
|
|
60
54
|
...rest,
|
|
61
|
-
ref: localSliderRef,
|
|
62
55
|
className: rootClassName,
|
|
63
56
|
isDisabled,
|
|
64
57
|
defaultValue,
|
|
@@ -120,7 +113,7 @@ const Slider = flowComponent("Slider", (props) => {
|
|
|
120
113
|
/* @__PURE__ */ jsx(
|
|
121
114
|
Aria.SliderThumb,
|
|
122
115
|
{
|
|
123
|
-
inputRef:
|
|
116
|
+
inputRef: objectRef,
|
|
124
117
|
name,
|
|
125
118
|
className: styles.handle,
|
|
126
119
|
isDisabled: isReadOnly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.mjs","sources":["../../../../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"Slider.mjs","sources":["../../../../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Slider.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconMinus, IconPlus } from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { TunnelExit } from \"@mittwald/react-tunnel\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface SliderProps\n extends FlowComponentProps<HTMLInputElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n isInvalid?: boolean;\n}\n\n/** @flr-generate all */\nexport const Slider = flowComponent(\"Slider\", (props) => {\n const {\n className,\n children,\n name,\n isDisabled,\n defaultValue,\n showInitialMarker,\n isReadOnly,\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const { FieldErrorView, fieldPropsContext, fieldProps } =\n useFieldComponent(props);\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const objectRef = useObjectRef(ref);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n unstyled: true,\n tunnelId: \"label\",\n ...fieldPropsContext.Label,\n },\n };\n\n return (\n <div {...fieldProps}>\n <Aria.Slider\n {...rest}\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n >\n <PropsContextProvider props={propsContext}>\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value} />\n <TunnelExit id=\"label\" />\n </div>\n\n <Aria.SliderTrack className={styles.track}>\n {({ state }) => (\n <PropsContextProvider\n props={{\n Button: {\n isPending: false,\n isFailed: false,\n isSucceeded: false,\n isReadOnly: isReadOnly,\n excludeFromTabOrder: true,\n isDisabled,\n variant: \"plain\",\n color: \"secondary\",\n },\n }}\n >\n <Button\n onPress={() => state.decrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.decrement\")}\n className={styles.decrement}\n >\n <IconMinus />\n </Button>\n\n <Button\n onPress={() => state.incrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.increment\")}\n className={styles.increment}\n >\n <IconPlus />\n </Button>\n\n <div\n className={styles.fill}\n style={{ width: state.getThumbPercent(0) * 100 + \"%\" }}\n />\n\n {showInitialMarker &&\n defaultValue &&\n typeof defaultValue === \"number\" && (\n <div\n className={styles.initialMarker}\n style={{\n left: `calc(${state.getValuePercent(defaultValue) * 100}% - 2px)`,\n }}\n />\n )}\n <Aria.SliderThumb\n inputRef={objectRef}\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </PropsContextProvider>\n )}\n </Aria.SliderTrack>\n {children}\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.Slider>\n </div>\n );\n});\n\nexport default Slider;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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AA,kBAClB,KAAA,EAAO,EAAE,KAAA,EAAO,KAAA,CAAM,gBAAgB,CAAC,CAAA,GAAI,MAAM,GAAA;AAAI;AAAA,eACvD;AAAA,cAEC,iBAAA,IACC,YAAA,IACA,OAAO,YAAA,KAAiB,QAAA,oBACtB,GAAA;AAAA,gBAAC,KAAA;AAAA,gBAAA;AAAA,kBACC,WAAW,MAAA,CAAO,aAAA;AAAA,kBAClB,KAAA,EAAO;AAAA,oBACL,MAAM,CAAA,KAAA,EAAQ,KAAA,CAAM,eAAA,CAAgB,YAAY,IAAI,GAAG,CAAA,QAAA;AAAA;AACzD;AAAA,eACF;AAAA,8BAEJ,GAAA;AAAA,gBAAC,IAAA,CAAK,WAAA;AAAA,gBAAL;AAAA,kBACC,QAAA,EAAU,SAAA;AAAA,kBACV,IAAA;AAAA,kBACA,WAAW,MAAA,CAAO,MAAA;AAAA,kBAClB,UAAA,EAAY;AAAA;AAAA;AACd;AAAA;AAAA,SACF,EAEJ,CAAA;AAAA,QACC,QAAA;AAAA,4BACA,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -14,9 +14,8 @@ import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
|
14
14
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
15
15
|
import '../../lib/propsContext/propsContext.mjs';
|
|
16
16
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
17
|
-
import { useObjectRef } from '@react-aria/utils';
|
|
18
17
|
import styles$1 from '../Label/Label.module.scss.mjs';
|
|
19
|
-
import {
|
|
18
|
+
import { useObjectRef } from 'react-aria';
|
|
20
19
|
|
|
21
20
|
const Switch = flowComponent("Switch", (props) => {
|
|
22
21
|
const {
|
|
@@ -24,7 +23,6 @@ const Switch = flowComponent("Switch", (props) => {
|
|
|
24
23
|
className,
|
|
25
24
|
labelPosition = "trailing",
|
|
26
25
|
ref,
|
|
27
|
-
inputRef,
|
|
28
26
|
...rest
|
|
29
27
|
} = props;
|
|
30
28
|
const rootClassName = clsx(
|
|
@@ -32,11 +30,7 @@ const Switch = flowComponent("Switch", (props) => {
|
|
|
32
30
|
className,
|
|
33
31
|
styles[`label-${labelPosition}`]
|
|
34
32
|
);
|
|
35
|
-
const
|
|
36
|
-
const localInputRef = useObjectRef(inputRef);
|
|
37
|
-
useMakeFocusable(localSwitchRef, () => {
|
|
38
|
-
localInputRef.current?.focus();
|
|
39
|
-
});
|
|
33
|
+
const objectRef = useObjectRef(ref);
|
|
40
34
|
const {
|
|
41
35
|
FieldErrorView,
|
|
42
36
|
FieldErrorCaptureContext,
|
|
@@ -51,19 +45,10 @@ const Switch = flowComponent("Switch", (props) => {
|
|
|
51
45
|
}
|
|
52
46
|
};
|
|
53
47
|
return /* @__PURE__ */ jsxs("div", { ...fieldProps, children: [
|
|
54
|
-
/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsx(
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
className: rootClassName,
|
|
59
|
-
ref: localSwitchRef,
|
|
60
|
-
inputRef: localInputRef,
|
|
61
|
-
children: ({ isSelected }) => /* @__PURE__ */ jsxs(PropsContextProvider, { props: propsContext, children: [
|
|
62
|
-
/* @__PURE__ */ jsx("div", { className: styles.track, children: /* @__PURE__ */ jsx("div", { className: styles.handle, children: isSelected ? /* @__PURE__ */ jsx(IconCheck, { size: "s" }) : /* @__PURE__ */ jsx(IconClose, { size: "s" }) }) }),
|
|
63
|
-
/* @__PURE__ */ jsx("div", { className: styles$1.label, children })
|
|
64
|
-
] })
|
|
65
|
-
}
|
|
66
|
-
) }),
|
|
48
|
+
/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsx(Aria.Switch, { ...rest, className: rootClassName, inputRef: objectRef, children: ({ isSelected }) => /* @__PURE__ */ jsxs(PropsContextProvider, { props: propsContext, children: [
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: styles.track, children: /* @__PURE__ */ jsx("div", { className: styles.handle, children: isSelected ? /* @__PURE__ */ jsx(IconCheck, { size: "s" }) : /* @__PURE__ */ jsx(IconClose, { size: "s" }) }) }),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: styles$1.label, children })
|
|
51
|
+
] }) }) }),
|
|
67
52
|
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
68
53
|
] });
|
|
69
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","sources":["../../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Switch.module.scss\";\nimport clsx from \"clsx\";\nimport { IconCheck, IconClose } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport
|
|
1
|
+
{"version":3,"file":"Switch.mjs","sources":["../../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Switch.module.scss\";\nimport clsx from \"clsx\";\nimport { IconCheck, IconClose } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport labelStyles from \"../Label/Label.module.scss\";\nimport { useObjectRef } from \"react-aria\";\n\nexport interface SwitchProps\n extends PropsWithChildren<Omit<Aria.SwitchProps, \"children\" | \"inputRef\">>,\n FlowComponentProps<HTMLInputElement> {\n /**\n * Whether the label should appear before or after the switch. @default\n * \"trailing\"\n */\n labelPosition?: \"leading\" | \"trailing\";\n}\n\n/** @flr-generate all */\nexport const Switch = flowComponent(\"Switch\", (props) => {\n const {\n children,\n className,\n labelPosition = \"trailing\",\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.switch,\n className,\n styles[`label-${labelPosition}`],\n );\n\n const objectRef = useObjectRef(ref);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n ...fieldPropsContext.Label,\n optional: false,\n },\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <Aria.Switch {...rest} className={rootClassName} inputRef={objectRef}>\n {({ isSelected }) => (\n <PropsContextProvider props={propsContext}>\n <div className={styles.track}>\n <div className={styles.handle}>\n {isSelected ? <IconCheck size=\"s\" /> : <IconClose size=\"s\" />}\n </div>\n </div>\n <div className={labelStyles.label}>{children}</div>\n </PropsContextProvider>\n )}\n </Aria.Switch>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Switch;\n"],"names":["labelStyles"],"mappings":";;;;;;;;;;;;;;;;;AAuBO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA,GAAgB,UAAA;AAAA,IAChB,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,MAAA;AAAA,IACP,SAAA;AAAA,IACA,MAAA,CAAO,CAAA,MAAA,EAAS,aAAa,CAAA,CAAE;AAAA,GACjC;AAEA,EAAA,MAAM,SAAA,GAAY,aAAa,GAAG,CAAA;AAElC,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,GAAG,iBAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,GAAG,iBAAA,CAAkB,KAAA;AAAA,MACrB,QAAA,EAAU;AAAA;AACZ,GACF;AAEA,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAK,GAAG,UAAA,EACP,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,4BACC,QAAA,kBAAA,GAAA,CAAC,IAAA,CAAK,QAAL,EAAa,GAAG,MAAM,SAAA,EAAW,aAAA,EAAe,QAAA,EAAU,SAAA,EACxD,WAAC,EAAE,UAAA,uBACF,IAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,YAAA,EAC3B,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,MAAA,CAAO,KAAA,EACrB,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,MAAA,EACpB,QAAA,EAAA,UAAA,uBAAc,SAAA,EAAA,EAAU,IAAA,EAAK,KAAI,CAAA,mBAAK,GAAA,CAAC,aAAU,IAAA,EAAK,GAAA,EAAI,GAC7D,CAAA,EACF,CAAA;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAWA,QAAA,CAAY,OAAQ,QAAA,EAAS;AAAA,KAAA,EAC/C,GAEJ,CAAA,EACF,CAAA;AAAA,wBACC,cAAA,EAAA,EAAe;AAAA,GAAA,EAClB,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -6,12 +6,12 @@ import { TextFieldBase } from '../TextFieldBase/TextFieldBase.mjs';
|
|
|
6
6
|
import styles from './TextArea.module.scss.mjs';
|
|
7
7
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
8
|
import { useObjectRef } from '@react-aria/utils';
|
|
9
|
-
import { ReactAriaControlledValueFix } from '../../lib/react/ReactAriaControlledValueFix.mjs';
|
|
10
9
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
11
10
|
import '../../lib/propsContext/propsContext.mjs';
|
|
12
11
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
13
12
|
import clsx from 'clsx';
|
|
14
13
|
import { useState, useEffect } from 'react';
|
|
14
|
+
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
15
15
|
|
|
16
16
|
const TextArea = flowComponent("TextArea", (props) => {
|
|
17
17
|
const {
|
|
@@ -23,7 +23,7 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
23
23
|
allowVerticalResize,
|
|
24
24
|
allowHorizontalResize,
|
|
25
25
|
...rest
|
|
26
|
-
} = props;
|
|
26
|
+
} = useControlledHostValueProps(props);
|
|
27
27
|
let { allowResize } = props;
|
|
28
28
|
if (allowVerticalResize) {
|
|
29
29
|
allowResize = "vertical";
|
|
@@ -78,25 +78,18 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
const input = /* @__PURE__ */ jsx(
|
|
81
|
-
|
|
81
|
+
Aria.TextArea,
|
|
82
82
|
{
|
|
83
|
-
|
|
84
|
-
props,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
onChange: updateHeight,
|
|
94
|
-
style: {
|
|
95
|
-
minHeight: getHeight(rows),
|
|
96
|
-
maxHeight: verticallyResizable ? void 0 : getHeight(autoResizeMaxRows)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
)
|
|
83
|
+
rows,
|
|
84
|
+
"aria-hidden": props["aria-hidden"],
|
|
85
|
+
placeholder,
|
|
86
|
+
className: rootClassName,
|
|
87
|
+
ref: localRef,
|
|
88
|
+
onChange: updateHeight,
|
|
89
|
+
style: {
|
|
90
|
+
minHeight: getHeight(rows),
|
|
91
|
+
maxHeight: verticallyResizable ? void 0 : getHeight(autoResizeMaxRows)
|
|
92
|
+
}
|
|
100
93
|
}
|
|
101
94
|
);
|
|
102
95
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { TextFieldBaseProps } from \"@/components/TextFieldBase\";\nimport { TextFieldBase } from \"@/components/TextFieldBase\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport {
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport type { TextFieldBaseProps } from \"@/components/TextFieldBase\";\nimport { TextFieldBase } from \"@/components/TextFieldBase\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport { useEffect, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface TextAreaProps\n extends Omit<\n TextFieldBaseProps,\n \"FieldErrorView\" | \"FieldErrorCaptureContext\" | \"input\" | \"ref\"\n >,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\" | \"aria-hidden\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n /** Allows the user to manually resize the textArea horizontally. */\n allowResize?: boolean | \"horizontal\" | \"vertical\";\n\n /** @deprecated Use `allowResize` instead. */\n allowHorizontalResize?: boolean;\n /** @deprecated Use `allowResize` instead. */\n allowVerticalResize?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n allowVerticalResize,\n allowHorizontalResize,\n ...rest\n } = useControlledHostValueProps(props);\n\n let { allowResize } = props;\n if (allowVerticalResize) {\n allowResize = \"vertical\";\n } else if (allowHorizontalResize) {\n allowResize = \"horizontal\";\n }\n\n const rootClassName = clsx(\n styles.textArea,\n typeof allowResize === \"boolean\" && allowResize ? styles.resize : null,\n allowResize === \"horizontal\"\n ? styles.horizontalResize\n : allowResize === \"vertical\"\n ? styles.verticalResize\n : null,\n );\n\n const localRef = useObjectRef(ref);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height--m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const [resized, setResized] = useState(false);\n\n const autoResizable = rows !== autoResizeMaxRows;\n\n const verticallyResizable =\n allowResize && (!autoResizable || (autoResizable && resized));\n\n useEffect(() => {\n const textarea = localRef.current;\n if (!textarea) return;\n\n const startHeight = textarea.offsetHeight;\n let tracking = false;\n\n const handleMouseDown = () => {\n tracking = true;\n };\n\n const handleMouseMove = () => {\n if (!tracking || resized) return;\n\n const currentHeight = textarea.offsetHeight;\n\n if (currentHeight !== startHeight) {\n setResized(true);\n tracking = false;\n }\n };\n\n const handleMouseUp = () => {\n tracking = false;\n };\n\n window.addEventListener(\"mousedown\", handleMouseDown);\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [resized]);\n\n const updateHeight = () => {\n if (localRef.current && autoResizable && !verticallyResizable) {\n // https://stackoverflow.com/a/60795884\n localRef.current.style.height = \"0px\";\n const scrollHeight = localRef.current.scrollHeight;\n // + 2 to add border height\n localRef.current.style.height = scrollHeight + 2 + \"px\";\n }\n };\n\n const input = (\n <Aria.TextArea\n rows={rows}\n aria-hidden={props[\"aria-hidden\"]}\n placeholder={placeholder}\n className={rootClassName}\n ref={localRef}\n onChange={updateHeight}\n style={{\n minHeight: getHeight(rows),\n maxHeight: verticallyResizable\n ? undefined\n : getHeight(autoResizeMaxRows),\n }}\n />\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n return (\n <TextFieldBase\n {...rest}\n {...fieldProps}\n className={clsx(rest.className, fieldProps.className)}\n FieldErrorView={FieldErrorView}\n FieldErrorCaptureContext={FieldErrorCaptureContext}\n input={input}\n >\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n </TextFieldBase>\n );\n});\n\nexport default TextArea;\n"],"names":["rows"],"mappings":";;;;;;;;;;;;;AAmCO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA,GAAO,CAAA;AAAA,IACP,iBAAA,GAAoB,IAAA;AAAA,IACpB,GAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,EAAA,IAAI,EAAE,aAAY,GAAI,KAAA;AACtB,EAAA,IAAI,mBAAA,EAAqB;AACvB,IAAA,WAAA,GAAc,UAAA;AAAA,EAChB,WAAW,qBAAA,EAAuB;AAChC,IAAA,WAAA,GAAc,YAAA;AAAA,EAChB;AAEA,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,QAAA;AAAA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,uBACE,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,SAAA,EAAW,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,WAAW,SAAS,CAAA;AAAA,MACpD,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,KAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -5,21 +5,14 @@ import * as Aria from 'react-aria-components';
|
|
|
5
5
|
import { TextFieldBase } from '../TextFieldBase/TextFieldBase.mjs';
|
|
6
6
|
import styles from './TextField.module.scss.mjs';
|
|
7
7
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
|
-
import { ReactAriaControlledValueFix } from '../../lib/react/ReactAriaControlledValueFix.mjs';
|
|
9
8
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
10
9
|
import '../../lib/propsContext/propsContext.mjs';
|
|
11
10
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
|
+
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
12
12
|
|
|
13
13
|
const TextField = flowComponent("TextField", (props) => {
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
placeholder,
|
|
17
|
-
ref,
|
|
18
|
-
form,
|
|
19
|
-
inputContext = Aria.TextFieldContext,
|
|
20
|
-
...rest
|
|
21
|
-
} = props;
|
|
22
|
-
const input = /* @__PURE__ */ jsx(ReactAriaControlledValueFix, { inputContext, props, children: /* @__PURE__ */ jsx(
|
|
14
|
+
const { children, placeholder, form, ref, ...rest } = useControlledHostValueProps(props);
|
|
15
|
+
const input = /* @__PURE__ */ jsx(
|
|
23
16
|
Aria.Input,
|
|
24
17
|
{
|
|
25
18
|
form,
|
|
@@ -27,7 +20,7 @@ const TextField = flowComponent("TextField", (props) => {
|
|
|
27
20
|
className: styles.textField,
|
|
28
21
|
ref
|
|
29
22
|
}
|
|
30
|
-
)
|
|
23
|
+
);
|
|
31
24
|
const {
|
|
32
25
|
FieldErrorView,
|
|
33
26
|
FieldErrorCaptureContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.mjs","sources":["../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport {\n TextFieldBase,\n type TextFieldBaseProps,\n} from \"@/components/TextFieldBase\";\nimport styles from \"./TextField.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport {
|
|
1
|
+
{"version":3,"file":"TextField.mjs","sources":["../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport {\n TextFieldBase,\n type TextFieldBaseProps,\n} from \"@/components/TextFieldBase\";\nimport styles from \"./TextField.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface TextFieldProps\n extends Omit<\n TextFieldBaseProps,\n \"FieldErrorView\" | \"FieldErrorCaptureContext\" | \"input\" | \"className\"\n >,\n Pick<Aria.InputProps, \"placeholder\" | \"form\">,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement> {}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const { children, placeholder, form, ref, ...rest } =\n useControlledHostValueProps(props);\n\n const input = (\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.textField}\n ref={ref}\n />\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n return (\n <TextFieldBase\n {...rest}\n {...fieldProps}\n FieldErrorView={FieldErrorView}\n FieldErrorCaptureContext={FieldErrorCaptureContext}\n input={input}\n >\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n </TextFieldBase>\n );\n});\n\nexport default TextField;\n"],"names":[],"mappings":";;;;;;;;;;AAuBO,MAAM,SAAA,GAAY,aAAA,CAAc,WAAA,EAAa,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM,EAAE,UAAU,WAAA,EAAa,IAAA,EAAM,KAAK,GAAG,IAAA,EAAK,GAChD,2BAAA,CAA4B,KAAK,CAAA;AAEnC,EAAA,MAAM,KAAA,mBACJ,GAAA;AAAA,IAAC,IAAA,CAAK,KAAA;AAAA,IAAL;AAAA,MACC,IAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAW,MAAA,CAAO,SAAA;AAAA,MAClB;AAAA;AAAA,GACF;AAGF,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,uBACE,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,cAAA;AAAA,MACA,wBAAA;AAAA,MACA,KAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC1B,QAAA,EACH;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -14,7 +14,6 @@ const TextFieldBase = (props) => {
|
|
|
14
14
|
className,
|
|
15
15
|
input,
|
|
16
16
|
showCharacterCount,
|
|
17
|
-
ref,
|
|
18
17
|
FieldErrorView,
|
|
19
18
|
FieldErrorCaptureContext,
|
|
20
19
|
...rest
|
|
@@ -23,7 +22,7 @@ const TextFieldBase = (props) => {
|
|
|
23
22
|
props.defaultValue?.length ?? props.value?.length ?? 0
|
|
24
23
|
);
|
|
25
24
|
const translation = useLocalizedStringFormatter(locales);
|
|
26
|
-
const
|
|
25
|
+
const handleChange = (v) => {
|
|
27
26
|
if (showCharacterCount) {
|
|
28
27
|
setCharactersCount(v.length);
|
|
29
28
|
}
|
|
@@ -38,27 +37,14 @@ const TextFieldBase = (props) => {
|
|
|
38
37
|
maxCount: props.maxLength ?? 0
|
|
39
38
|
}
|
|
40
39
|
);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
className,
|
|
50
|
-
onChange: handleOnChange,
|
|
51
|
-
...propsWithOptionalStringValue,
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ jsxs(FieldErrorCaptureContext, { children: [
|
|
54
|
-
children,
|
|
55
|
-
input,
|
|
56
|
-
showCharacterCount && /* @__PURE__ */ jsx(FieldDescription, { className: formFieldStyles.fieldDescription, children: charactersCountDescription })
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
);
|
|
40
|
+
return /* @__PURE__ */ jsxs(Aria.TextField, { ...rest, className, onChange: handleChange, children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(FieldErrorCaptureContext, { children: [
|
|
42
|
+
children,
|
|
43
|
+
input,
|
|
44
|
+
showCharacterCount && /* @__PURE__ */ jsx(FieldDescription, { className: formFieldStyles.fieldDescription, children: charactersCountDescription })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
47
|
+
] });
|
|
62
48
|
};
|
|
63
49
|
|
|
64
50
|
export { TextFieldBase, TextFieldBase as default };
|