@mittwald/flow-react-components 1.6.0-next.5 → 1.6.0-next.50
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 +132 -88
- package/USAGE.md +7 -2
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_18.locale.mjs +14 -0
- package/dist/js/default.mjs +4 -3
- package/dist/js/flr-universal.mjs +2 -1
- package/dist/js/node_modules/.pnpm/{@lezer_lr@1.4.10 → @lezer_lr@1.4.11}/node_modules/@lezer/lr/dist/index.mjs +40 -28
- package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.mjs.map +1 -0
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
- package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Action/models/ActionState.mjs +2 -2
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +3 -3
- package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Activity/Activity.mjs +1 -1
- package/dist/js/packages/components/src/components/Activity/Activity.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
- package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs +1 -1
- package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +2 -2
- package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -8
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +3 -3
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +41 -12
- package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs +29 -16
- package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeEditor/languages/dotEnv/dotEnv.mjs +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +3 -2
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +5 -1
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
- package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs +40 -8
- package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
- package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
- package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +0 -4
- package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.mjs +27 -23
- package/dist/js/packages/components/src/components/List/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +5 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +2 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +5 -3
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +16 -9
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +4 -2
- 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/Items.mjs +27 -1
- package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -2
- 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/Items/views/GridList/GridList.mjs +3 -0
- package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +46 -44
- 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 +25 -25
- 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/components/ListSummary/ListSummary.mjs +5 -9
- package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +29 -13
- package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs +31 -0
- package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs +21 -0
- package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/hooks/useListSelector.mjs +18 -0
- package/dist/js/packages/components/src/components/List/hooks/useListSelector.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/listContext.mjs +32 -2
- package/dist/js/packages/components/src/components/List/listContext.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/List.mjs +1 -0
- package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/ListViewMode.mjs +2 -2
- package/dist/js/packages/components/src/components/List/model/ReactTable.mjs +2 -2
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
- package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
- package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +20 -7
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoaderState.mjs +2 -2
- package/dist/js/packages/components/src/components/List/model/table/Table.mjs +11 -1
- package/dist/js/packages/components/src/components/List/model/table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableBody.mjs +5 -1
- package/dist/js/packages/components/src/components/List/model/table/TableBody.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableColumn.mjs +4 -0
- package/dist/js/packages/components/src/components/List/model/table/TableColumn.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableHeader.mjs +8 -1
- package/dist/js/packages/components/src/components/List/model/table/TableHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs +28 -1
- package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/Markdown.mjs +25 -7
- package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs +1 -1
- package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs +8 -0
- package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs.map +1 -0
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +32 -3
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
- package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +1 -3
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -1
- package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +9 -2
- package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +1 -3
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +2 -3
- package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Option/Option.module.mjs +1 -3
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +3 -3
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
- package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs +5 -4
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs.map +1 -1
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +2 -3
- package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Rating/Rating.mjs +12 -11
- package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +2 -3
- package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.mjs +9 -5
- 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 +0 -4
- package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
- package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +2 -3
- package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Select/Select.mjs +2 -3
- package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Slider/Slider.mjs +47 -41
- package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
- package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs +5 -12
- package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +4 -2
- package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs +7 -1
- package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs +14 -0
- package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Tabs/Tabs.mjs +6 -8
- package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/Tabs.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Text/Text.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextField/TextField.mjs +11 -8
- package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +15 -2
- package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Wrap/Wrap.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs +4 -1
- 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/FormRootError/FormRootError.mjs +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs +10 -158
- package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs +1 -0
- package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs +8 -4
- package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/object/isPlainObjectDeepEqual.mjs +29 -0
- package/dist/js/packages/components/src/lib/object/isPlainObjectDeepEqual.mjs.map +1 -0
- package/dist/js/packages/components/src/lib/propsContext/components/ClearPropsContext.mjs +2 -1
- package/dist/js/packages/components/src/lib/propsContext/components/ClearPropsContext.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/propsContext/components/PropsContextProvider.mjs +14 -3
- package/dist/js/packages/components/src/lib/propsContext/components/PropsContextProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/slotContext/SlotContextProvider.mjs +9 -4
- package/dist/js/packages/components/src/lib/slotContext/SlotContextProvider.mjs.map +1 -1
- package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
- package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
- package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
- package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
- package/dist/js/packages/components-base/src/index.mjs +5 -2
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
- package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
- package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
- package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
- package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
- package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
- package/dist/js/packages/components-base/src/list/loading/ListLoaderState.mjs +10 -5
- package/dist/js/packages/components-base/src/list/loading/ListLoaderState.mjs.map +1 -1
- package/dist/js/packages/components-base/src/overlay/OverlayState.mjs +196 -0
- package/dist/js/packages/components-base/src/overlay/OverlayState.mjs.map +1 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/_bundled/flow-components-base/index.d.ts +4 -1
- package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
- package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
- package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
- package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
- package/dist/types/_bundled/flow-components-base/list/loading/ListLoaderState.d.ts +5 -0
- package/dist/types/_bundled/flow-components-base/overlay/OverlayState.d.ts +94 -0
- package/dist/types/components/AlertBadge/AlertBadge.d.ts +2 -2
- package/dist/types/components/Badge/Badge.d.ts +2 -2
- package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/types/components/DonutChart/DonutChart.d.ts +1 -4
- package/dist/types/components/Link/Link.d.ts +1 -1
- package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
- package/dist/types/components/List/components/Items/components/Item/Item.d.ts +2 -0
- package/dist/types/components/List/components/Items/components/Item/hooks/useGridItemProps.d.ts +1 -0
- package/dist/types/components/List/components/ListSummary/ListSummary.d.ts +3 -2
- package/dist/types/components/List/components/Table/components/Row.d.ts +13 -0
- package/dist/types/components/List/hooks/useLatestOnAction.d.ts +7 -0
- package/dist/types/components/List/hooks/useListSelector.d.ts +6 -0
- package/dist/types/components/List/index.d.ts +2 -0
- package/dist/types/components/List/listContext.d.ts +16 -0
- package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
- package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
- package/dist/types/components/List/model/filter/types.d.ts +23 -1
- package/dist/types/components/List/model/item/ItemView.d.ts +34 -11
- package/dist/types/components/List/model/table/Table.d.ts +7 -0
- package/dist/types/components/List/model/table/TableBody.d.ts +1 -0
- package/dist/types/components/List/model/table/TableColumn.d.ts +1 -0
- package/dist/types/components/List/model/table/TableHeader.d.ts +1 -0
- package/dist/types/components/List/model/table/TableRow.d.ts +14 -0
- package/dist/types/components/List/model/table/types.d.ts +17 -1
- package/dist/types/components/List/typedList.d.ts +1 -0
- package/dist/types/components/Markdown/lib/isExternalHref.d.ts +1 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -4
- package/dist/types/components/Rating/Rating.d.ts +5 -5
- package/dist/types/components/Section/context.d.ts +28 -0
- package/dist/types/components/Table/components/TableCell/TableCell.d.ts +4 -1
- package/dist/types/components/Table/components/TableHeader/context.d.ts +6 -0
- package/dist/types/components/Wrap/Wrap.d.ts +5 -0
- package/dist/types/index/flr-universal.d.ts +1 -1
- package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.d.ts +7 -1
- package/dist/types/lib/controller/overlay/OverlayController.d.ts +8 -74
- package/dist/types/lib/dev/hydrateServerMarkup.d.ts +2 -0
- package/dist/types/lib/hooks/dom/useVirtualKeyboardVisible.d.ts +4 -1
- package/dist/types/lib/object/isPlainObjectDeepEqual.d.ts +8 -0
- package/package.json +12 -12
- package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.mjs.map +0 -1
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
- package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
- package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
- package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.mjs","names":["styles","locales","_Fragment"],"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 \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\n\nexport interface SliderProps\n extends\n FlowComponentProps<HTMLInputElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n /** Whether the marker for the initial value should be visible */\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n /** Whether the component is invalid. */\n isInvalid?: boolean;\n /** Hide Buttons, Label and Value */\n sliderOnly?: 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 step,\n sliderOnly,\n // Reaches the thumb through `controlProps` – react-aria would add it a\n // second time from the slider.\n \"aria-describedby\": ignoredAriaDescribedBy,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Slider\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Slider\");\n\n const objectRef = useObjectRef(ref);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n tunnel: {\n id: \"label\",\n component: \"Slider\",\n },\n ...fieldPropsContext.Label,\n className: styles.label,\n },\n };\n\n
|
|
1
|
+
{"version":3,"file":"Slider.mjs","names":["styles","locales","_Fragment"],"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 \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { SkeletonTextContent } from \"@/components/SkeletonMode/components/SkeletonTextContent\";\n\nexport interface SliderProps\n extends\n FlowComponentProps<HTMLInputElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n /** Whether the marker for the initial value should be visible */\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n /** Whether the component is invalid. */\n isInvalid?: boolean;\n /** Hide Buttons, Label and Value */\n sliderOnly?: 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 step,\n sliderOnly,\n // Reaches the thumb through `controlProps` – react-aria would add it a\n // second time from the slider.\n \"aria-describedby\": ignoredAriaDescribedBy,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Slider\");\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Slider\");\n\n const objectRef = useObjectRef(ref);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n tunnel: {\n id: \"label\",\n component: \"Slider\",\n },\n ...fieldPropsContext.Label,\n className: styles.label,\n },\n };\n\n const trackPropsContext: PropsContext = {\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 size: \"s\",\n },\n };\n\n const renderTrack = ({ state }: Aria.SliderTrackRenderProps) => {\n const stepButtons = (\n <>\n <Button\n onPress={() => state.decrementThumb(0, step)}\n aria-label={stringFormatter.format(\"decrement\")}\n className={styles.decrement}\n >\n <IconMinus />\n </Button>\n <Button\n onPress={() => state.incrementThumb(0, step)}\n aria-label={stringFormatter.format(\"increment\")}\n className={styles.increment}\n >\n <IconPlus />\n </Button>\n </>\n );\n\n const initialMarker = showInitialMarker &&\n typeof defaultValue === \"number\" && (\n <div\n className={styles.initialMarker}\n style={{\n \"--slider--initial-value\": state.getValuePercent(defaultValue),\n }}\n />\n );\n\n return (\n <PropsContextProvider props={trackPropsContext}>\n {!sliderOnly && stepButtons}\n\n <div\n className={styles.fill}\n style={{\n \"--slider--value\": state.getThumbPercent(0),\n }}\n />\n\n {initialMarker}\n <Aria.SliderThumb\n inputRef={objectRef}\n aria-describedby={controlProps[\"aria-describedby\"]}\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </PropsContextProvider>\n );\n };\n\n return (\n <div {...skeletonProps} className={wrapperProps.className}>\n <Aria.Slider\n {...rest}\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n step={step}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n\n {!sliderOnly && (\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value}>\n {({ defaultChildren }) => (\n <SkeletonTextContent defaultWidth=\"2em\">\n {defaultChildren}\n </SkeletonTextContent>\n )}\n </Aria.SliderOutput>{\" \"}\n <UiComponentTunnelExit id=\"label\" component=\"Slider\" />\n </div>\n )}\n\n <Aria.SliderTrack className={styles.track}>\n {renderTrack}\n </Aria.SliderTrack>\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.Slider>\n </div>\n );\n});\n\nexport default Slider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,IAAa,SAAS,cAAc,WAAW,UAAU;CACvD,MAAM,EACJ,WACA,UACA,MACA,YACA,cACA,mBACA,YACA,KACA,MACA,YAGA,oBAAoB,wBACpB,GAAG,SACD;CAEJ,MAAM,gBAAgB,KACpBA,sBAAO,QACP,cAAcA,sBAAO,UACrB,SACF;CAEA,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,QAAQ;CAErC,MAAM,kBAAkB,4BAA4BC,kBAAS,QAAQ;CAErE,MAAM,YAAY,aAAa,GAAG;CAElC,MAAM,eAA6B;EACjC,GAAG;EACH,OAAO;GACL,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;GACA,GAAG,kBAAkB;GACrB,WAAWD,sBAAO;EACpB;CACF;CAEA,MAAM,oBAAkC,EACtC,QAAQ;EACN,WAAW;EACX,UAAU;EACV,aAAa;EACD;EACZ,qBAAqB;EACrB;EACA,SAAS;EACT,OAAO;EACP,MAAM;CACR,EACF;CAEA,MAAM,eAAe,EAAE,YAAyC;EAC9D,MAAM,cACJ,qBAAAE,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GACE,eAAe,MAAM,eAAe,GAAG,IAAI;GAC3C,cAAY,gBAAgB,OAAO,WAAW;GAC9C,WAAWF,sBAAO;GAElB,UAAA,oBAAC,WAAD,CAAY,CAAA;EACN,CAAA,GACR,oBAAC,QAAD;GACE,eAAe,MAAM,eAAe,GAAG,IAAI;GAC3C,cAAY,gBAAgB,OAAO,WAAW;GAC9C,WAAWA,sBAAO;GAElB,UAAA,oBAAC,UAAD,CAAW,CAAA;EACL,CAAA,CACR,EAAA,CAAA;EAGJ,MAAM,gBAAgB,qBACpB,OAAO,iBAAiB,YACtB,oBAAC,OAAD;GACE,WAAWA,sBAAO;GAClB,OAAO,EACL,2BAA2B,MAAM,gBAAgB,YAAY,EAC/D;EACD,CAAA;EAGL,OACE,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA;IACG,CAAC,cAAc;IAEhB,oBAAC,OAAD;KACE,WAAWA,sBAAO;KAClB,OAAO,EACL,mBAAmB,MAAM,gBAAgB,CAAC,EAC5C;IACD,CAAA;IAEA;IACD,oBAAC,KAAK,aAAN;KACE,UAAU;KACV,oBAAkB,aAAa;KACzB;KACN,WAAWA,sBAAO;KAClB,YAAY;IACb,CAAA;GACmB;;CAE1B;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAe,WAAW,aAAa;EAC9C,UAAA,oBAAC,KAAK,QAAN;GACE,GAAI;GACJ,WAAW;GACC;GACE;GACR;GAEN,UAAA,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA;KACE,oBAAC,0BAAD,EAA2B,SAAmC,CAAA;KAE7D,CAAC,cACA,qBAAC,OAAD;MAAK,WAAWA,sBAAO;MAAvB,UAAA;OACE,oBAAC,KAAK,cAAN;QAAmB,WAAWA,sBAAO;QACjC,WAAA,EAAE,sBACF,oBAAC,qBAAD;SAAqB,cAAa;SAC/B,UAAA;QACkB,CAAA;OAEN,CAAA;OAAE;OACrB,oBAAC,uBAAD;QAAuB,IAAG;QAAQ,WAAU;OAAU,CAAA;MACnD;;KAGP,oBAAC,KAAK,aAAN;MAAkB,WAAWA,sBAAO;MACjC,UAAA;KACe,CAAA;KAClB,oBAAC,gBAAD,CAAiB,CAAA;IACG;;EACX,CAAA;CACV,CAAA;AAET,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
+
import { useLabelledBySectionHeading } from "../Section/context.mjs";
|
|
3
4
|
import Table_module_default from "./Table.module.mjs";
|
|
4
5
|
import clsx from "clsx";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -8,6 +9,7 @@ import * as Aria from "react-aria-components";
|
|
|
8
9
|
/** @flr-generate all */
|
|
9
10
|
var Table = (props) => {
|
|
10
11
|
const { children, className, verticalAlign = "top", layout = "auto", minWidth, ...rest } = props;
|
|
12
|
+
const ariaLabelledBy = useLabelledBySectionHeading(rest);
|
|
11
13
|
const rootClassName = clsx(Table_module_default.table, verticalAlign !== "top" && Table_module_default[`vertical-align-${verticalAlign}`], Table_module_default[`layout-${layout}`], className);
|
|
12
14
|
return /* @__PURE__ */ jsx("div", {
|
|
13
15
|
className: Table_module_default.tableContainer,
|
|
@@ -17,6 +19,7 @@ var Table = (props) => {
|
|
|
17
19
|
children: /* @__PURE__ */ jsx(Aria.Table, {
|
|
18
20
|
className: rootClassName,
|
|
19
21
|
...rest,
|
|
22
|
+
"aria-labelledby": ariaLabelledBy,
|
|
20
23
|
children
|
|
21
24
|
})
|
|
22
25
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","names":["styles"],"sources":["../../../../../../../src/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Table.module.scss\";\n\nexport type TableProps = Omit<\n Aria.TableProps,\n \"render\" | \"className\" | \"style\"\n> & {\n /** The vertical alignment of the table cells content. */\n verticalAlign?: \"top\" | \"middle\";\n /**\n * The column-sizing algorithm of the table. Use \"fixed\" together with column\n * widths to enforce exact widths. @default \"auto\"\n */\n layout?: \"auto\" | \"fixed\";\n /**\n * The minimum width of the table. Below this width the table scrolls\n * horizontally instead of shrinking its columns.\n */\n minWidth?: number | string;\n /** The elements class name. */\n className?: string;\n};\n\n/** @flr-generate all */\nexport const Table: FC<TableProps> = (props) => {\n const {\n children,\n className,\n verticalAlign = \"top\",\n layout = \"auto\",\n minWidth,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.table,\n verticalAlign !== \"top\" && styles[`vertical-align-${verticalAlign}`],\n styles[`layout-${layout}`],\n className,\n );\n\n return (\n <div className={styles.tableContainer}>\n <div className={styles.tableScrollArea} style={{ minWidth }}>\n <Aria.Table
|
|
1
|
+
{"version":3,"file":"Table.mjs","names":["styles"],"sources":["../../../../../../../src/components/Table/Table.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Table.module.scss\";\nimport { useLabelledBySectionHeading } from \"@/components/Section/context\";\n\nexport type TableProps = Omit<\n Aria.TableProps,\n \"render\" | \"className\" | \"style\"\n> & {\n /** The vertical alignment of the table cells content. */\n verticalAlign?: \"top\" | \"middle\";\n /**\n * The column-sizing algorithm of the table. Use \"fixed\" together with column\n * widths to enforce exact widths. @default \"auto\"\n */\n layout?: \"auto\" | \"fixed\";\n /**\n * The minimum width of the table. Below this width the table scrolls\n * horizontally instead of shrinking its columns.\n */\n minWidth?: number | string;\n /** The elements class name. */\n className?: string;\n};\n\n/** @flr-generate all */\nexport const Table: FC<TableProps> = (props) => {\n const {\n children,\n className,\n verticalAlign = \"top\",\n layout = \"auto\",\n minWidth,\n ...rest\n } = props;\n\n const ariaLabelledBy = useLabelledBySectionHeading(rest);\n\n const rootClassName = clsx(\n styles.table,\n verticalAlign !== \"top\" && styles[`vertical-align-${verticalAlign}`],\n styles[`layout-${layout}`],\n className,\n );\n\n return (\n <div className={styles.tableContainer}>\n <div className={styles.tableScrollArea} style={{ minWidth }}>\n <Aria.Table\n className={rootClassName}\n {...rest}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </Aria.Table>\n </div>\n </div>\n );\n};\n\nexport default Table;\n"],"mappings":";;;;;;;;;AA2BA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EACJ,UACA,WACA,gBAAgB,OAChB,SAAS,QACT,UACA,GAAG,SACD;CAEJ,MAAM,iBAAiB,4BAA4B,IAAI;CAEvD,MAAM,gBAAgB,KACpBA,qBAAO,OACP,kBAAkB,SAASA,qBAAO,kBAAkB,kBACpDA,qBAAO,UAAU,WACjB,SACF;CAEA,OACE,oBAAC,OAAD;EAAK,WAAWA,qBAAO;EACrB,UAAA,oBAAC,OAAD;GAAK,WAAWA,qBAAO;GAAiB,OAAO,EAAE,SAAS;GACxD,UAAA,oBAAC,KAAK,OAAN;IACE,WAAW;IACX,GAAI;IACJ,mBAAiB;IAEhB;GACS,CAAA;EACT,CAAA;CACF,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.module.mjs","names":[],"sources":["../../../../../../../src/components/Table/Table.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.tableContainer {\n @include scrollbar.scrollbar;\n\n width: 100%;\n overflow-x: auto;\n}\n\n.tableScrollArea {\n width: 100%;\n}\n\n.table {\n border-radius: var(--table--corner-radius);\n overflow: hidden;\n width: 100%;\n border-width: var(--table--border-width);\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-spacing: 0;\n background-color: var(--table--background-color);\n\n .column {\n font-weight: var(--table--header-font-weight);\n
|
|
1
|
+
{"version":3,"file":"Table.module.mjs","names":[],"sources":["../../../../../../../src/components/Table/Table.module.scss"],"sourcesContent":["@use \"@/styles/mixins/scrollbar\";\n\n.tableContainer {\n @include scrollbar.scrollbar;\n\n width: 100%;\n overflow-x: auto;\n}\n\n.tableScrollArea {\n width: 100%;\n}\n\n.table {\n border-radius: var(--table--corner-radius);\n overflow: hidden;\n width: 100%;\n border-width: var(--table--border-width);\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-spacing: 0;\n background-color: var(--table--background-color);\n\n .column {\n font-weight: var(--table--header-font-weight);\n }\n\n .cell,\n .column {\n padding-inline: var(--table--padding-x);\n padding-block: var(--table--padding-y);\n text-align: start;\n vertical-align: top;\n border-style: var(--table--border-style);\n border-color: var(--table--border-color);\n border-width: 0;\n\n // Cell content is the consumer's — a Flow icon or a raw `<svg>`.\n // stylelint-disable-next-line selector-max-type -- consumer content\n > svg {\n vertical-align: bottom;\n }\n\n &.horizontal-align-center {\n text-align: center;\n }\n\n &.horizontal-align-end {\n text-align: end;\n }\n }\n\n .header {\n .column {\n border-block-end-width: var(--table--header-border-width);\n }\n\n // Hide only an all-empty header: a hidden `<th>` shifts the next headings.\n &:not(:has(.column:not(:empty))) {\n display: none;\n }\n }\n\n :where(.body) {\n :where(.row) {\n &:where(:nth-of-type(odd):not(.footer)) {\n background-color: var(--table--background-color-accent);\n }\n\n &:not(:last-child) {\n .cell {\n border-block-end-width: var(--table--border-width);\n }\n }\n\n &.footer .cell {\n border-block-start-width: var(--table--border-width);\n }\n }\n }\n\n &.vertical-align-middle {\n .cell,\n .column {\n vertical-align: middle;\n }\n }\n\n &.layout-auto {\n table-layout: auto;\n }\n\n &.layout-fixed {\n table-layout: fixed;\n }\n}\n"],"mappings":""}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { SkeletonText } from "../../../SkeletonText/SkeletonText.mjs";
|
|
4
4
|
import { SkeletonRawText } from "../../../SkeletonMode/components/SkeletonRawText/SkeletonRawText.mjs";
|
|
5
5
|
import Table_module_default from "../../Table.module.mjs";
|
|
6
|
-
import { TableColumn } from "../TableColumn/TableColumn.mjs";
|
|
7
6
|
import clsx from "clsx";
|
|
8
7
|
import { Suspense } from "react";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -12,20 +11,14 @@ import * as Aria from "react-aria-components";
|
|
|
12
11
|
/** @flr-generate all */
|
|
13
12
|
var TableCell = (props) => {
|
|
14
13
|
const { children, className, rowHeader, horizontalAlign = "start", ...rest } = props;
|
|
15
|
-
const rootClassName = clsx(Table_module_default.cell, horizontalAlign !== "start" && Table_module_default[`horizontal-align-${horizontalAlign}`], className);
|
|
16
|
-
const content = /* @__PURE__ */ jsx(Suspense, {
|
|
17
|
-
fallback: /* @__PURE__ */ jsx(SkeletonText, { width: "100px" }),
|
|
18
|
-
children: /* @__PURE__ */ jsx(SkeletonRawText, { children })
|
|
19
|
-
});
|
|
20
|
-
if (rowHeader) return /* @__PURE__ */ jsx(TableColumn, {
|
|
21
|
-
className: rootClassName,
|
|
22
|
-
...rest,
|
|
23
|
-
children: content
|
|
24
|
-
});
|
|
14
|
+
const rootClassName = clsx(Table_module_default.cell, rowHeader && Table_module_default.column, horizontalAlign !== "start" && Table_module_default[`horizontal-align-${horizontalAlign}`], className);
|
|
25
15
|
return /* @__PURE__ */ jsx(Aria.Cell, {
|
|
26
16
|
className: rootClassName,
|
|
27
17
|
...rest,
|
|
28
|
-
children:
|
|
18
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
19
|
+
fallback: /* @__PURE__ */ jsx(SkeletonText, { width: "100px" }),
|
|
20
|
+
children: /* @__PURE__ */ jsx(SkeletonRawText, { children })
|
|
21
|
+
})
|
|
29
22
|
});
|
|
30
23
|
};
|
|
31
24
|
//#endregion
|
package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableCell/TableCell.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport {
|
|
1
|
+
{"version":3,"file":"TableCell.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableCell/TableCell.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\n\nexport interface TableCellProps\n extends\n Omit<Aria.CellProps, \"children\" | \"style\" | \"render\">,\n PropsWithChildren {\n /**\n * Styles the cell as a row header. Its semantics come from the column: the\n * first column, or the one with `isRowHeader`.\n */\n rowHeader?: boolean;\n /** Horizontal alignment of the cell content @default \"start\" */\n horizontalAlign?: \"start\" | \"center\" | \"end\";\n}\n\n/** @flr-generate all */\nexport const TableCell: FC<TableCellProps> = (props) => {\n const {\n children,\n className,\n rowHeader,\n horizontalAlign = \"start\",\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.cell,\n rowHeader && styles.column,\n horizontalAlign !== \"start\" &&\n styles[`horizontal-align-${horizontalAlign}`],\n className,\n );\n\n return (\n <Aria.Cell className={rootClassName} {...rest}>\n <Suspense fallback={<SkeletonText width=\"100px\" />}>\n <SkeletonRawText>{children}</SkeletonRawText>\n </Suspense>\n </Aria.Cell>\n );\n};\n\nexport default TableCell;\n"],"mappings":";;;;;;;;;;;AAsBA,IAAa,aAAiC,UAAU;CACtD,MAAM,EACJ,UACA,WACA,WACA,kBAAkB,SAClB,GAAG,SACD;CAEJ,MAAM,gBAAgB,KACpBA,qBAAO,MACP,aAAaA,qBAAO,QACpB,oBAAoB,WAClBA,qBAAO,oBAAoB,oBAC7B,SACF;CAEA,OACE,oBAAC,KAAK,MAAN;EAAW,WAAW;EAAe,GAAI;EACvC,UAAA,oBAAC,UAAD;GAAU,UAAU,oBAAC,cAAD,EAAc,OAAM,QAAS,CAAA;GAC/C,UAAA,oBAAC,iBAAD,EAAkB,SAA0B,CAAA;EACpC,CAAA;CACD,CAAA;AAEf"}
|
package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs
CHANGED
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
import { PropsContextProvider } from "../../../../lib/propsContext/components/PropsContextProvider.mjs";
|
|
4
4
|
import { SkeletonRawText } from "../../../SkeletonMode/components/SkeletonRawText/SkeletonRawText.mjs";
|
|
5
5
|
import Table_module_default from "../../Table.module.mjs";
|
|
6
|
+
import { useIsFirstColumn } from "../TableHeader/context.mjs";
|
|
6
7
|
import clsx from "clsx";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
import * as Aria from "react-aria-components";
|
|
9
10
|
//#region src/components/Table/components/TableColumn/TableColumn.tsx
|
|
10
11
|
/** @flr-generate all */
|
|
11
12
|
var TableColumn = (props) => {
|
|
12
|
-
const { children, className, horizontalAlign = "start", width, minWidth, ...rest } = props;
|
|
13
|
+
const { children, className, horizontalAlign = "start", width, minWidth, isRowHeader, ...rest } = props;
|
|
14
|
+
const isFirstColumn = useIsFirstColumn();
|
|
13
15
|
const rootClassName = clsx(Table_module_default.column, horizontalAlign !== "start" && Table_module_default[`horizontal-align-${horizontalAlign}`], className);
|
|
14
16
|
const propsContext = { Checkbox: { slot: null } };
|
|
15
17
|
return /* @__PURE__ */ jsx(Aria.Column, {
|
|
16
|
-
isRowHeader: true,
|
|
18
|
+
isRowHeader: isRowHeader ?? isFirstColumn ?? true,
|
|
17
19
|
className: rootClassName,
|
|
18
20
|
...rest,
|
|
19
21
|
style: {
|
package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableColumn.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableColumn/TableColumn.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\n\nexport interface TableColumnProps\n extends\n Omit<\n Aria.ColumnProps,\n \"children\" | \"width\" | \"minWidth\" | \"maxWidth\" | \"style\"\n >,\n PropsWithChildren {\n /** Horizontal alignment of the cell content @default \"start\" */\n horizontalAlign?: \"start\" | \"center\" | \"end\";\n /** The width of the column. */\n width?: number | string;\n /** The minimum width of the column. */\n minWidth?: number | string;\n}\n\n/** @flr-generate all */\nexport const TableColumn: FC<TableColumnProps> = (props) => {\n const {\n children,\n className,\n horizontalAlign = \"start\",\n width,\n minWidth,\n ...rest\n } = props;\n const rootClassName = clsx(\n styles.column,\n horizontalAlign !== \"start\" &&\n styles[`horizontal-align-${horizontalAlign}`],\n className,\n );\n\n const propsContext: PropsContext = { Checkbox: { slot: null } };\n\n return (\n <Aria.Column\n isRowHeader\n className={rootClassName}\n {...rest}\n style={{ width, minWidth }}\n >\n <PropsContextProvider props={propsContext}>\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n </Aria.Column>\n );\n};\n\nexport default TableColumn;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableColumn.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableColumn/TableColumn.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\nimport { useIsFirstColumn } from \"@/components/Table/components/TableHeader/context\";\n\nexport interface TableColumnProps\n extends\n Omit<\n Aria.ColumnProps,\n \"children\" | \"width\" | \"minWidth\" | \"maxWidth\" | \"style\"\n >,\n PropsWithChildren {\n /** Horizontal alignment of the cell content @default \"start\" */\n horizontalAlign?: \"start\" | \"center\" | \"end\";\n /** The width of the column. */\n width?: number | string;\n /** The minimum width of the column. */\n minWidth?: number | string;\n}\n\n/** @flr-generate all */\nexport const TableColumn: FC<TableColumnProps> = (props) => {\n const {\n children,\n className,\n horizontalAlign = \"start\",\n width,\n minWidth,\n isRowHeader,\n ...rest\n } = props;\n const isFirstColumn = useIsFirstColumn();\n\n const rootClassName = clsx(\n styles.column,\n horizontalAlign !== \"start\" &&\n styles[`horizontal-align-${horizontalAlign}`],\n className,\n );\n\n const propsContext: PropsContext = { Checkbox: { slot: null } };\n\n return (\n <Aria.Column\n isRowHeader={isRowHeader ?? isFirstColumn ?? true}\n className={rootClassName}\n {...rest}\n style={{ width, minWidth }}\n >\n <PropsContextProvider props={propsContext}>\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n </Aria.Column>\n );\n};\n\nexport default TableColumn;\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,eAAqC,UAAU;CAC1D,MAAM,EACJ,UACA,WACA,kBAAkB,SAClB,OACA,UACA,aACA,GAAG,SACD;CACJ,MAAM,gBAAgB,iBAAiB;CAEvC,MAAM,gBAAgB,KACpBA,qBAAO,QACP,oBAAoB,WAClBA,qBAAO,oBAAoB,oBAC7B,SACF;CAEA,MAAM,eAA6B,EAAE,UAAU,EAAE,MAAM,KAAK,EAAE;CAE9D,OACE,oBAAC,KAAK,QAAN;EACE,aAAa,eAAe,iBAAiB;EAC7C,WAAW;EACX,GAAI;EACJ,OAAO;GAAE;GAAO;EAAS;EAEzB,UAAA,oBAAC,sBAAD;GAAsB,OAAO;GAC3B,UAAA,oBAAC,iBAAD,EAAkB,SAA0B,CAAA;EACxB,CAAA;CACX,CAAA;AAEjB"}
|
package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import Table_module_default from "../../Table.module.mjs";
|
|
4
|
+
import { IsFirstColumnContext } from "./context.mjs";
|
|
4
5
|
import clsx from "clsx";
|
|
6
|
+
import { Children } from "react";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
import * as Aria from "react-aria-components";
|
|
7
9
|
//#region src/components/Table/components/TableHeader/TableHeader.tsx
|
|
@@ -9,10 +11,14 @@ import * as Aria from "react-aria-components";
|
|
|
9
11
|
var TableHeader = (props) => {
|
|
10
12
|
const { children, className, ...rest } = props;
|
|
11
13
|
const rootClassName = clsx(Table_module_default.header, className);
|
|
14
|
+
const columns = typeof children === "function" ? children : Children.toArray(children).map((column, index) => /* @__PURE__ */ jsx(IsFirstColumnContext, {
|
|
15
|
+
value: index === 0,
|
|
16
|
+
children: column
|
|
17
|
+
}, index));
|
|
12
18
|
return /* @__PURE__ */ jsx(Aria.TableHeader, {
|
|
13
19
|
className: rootClassName,
|
|
14
20
|
...rest,
|
|
15
|
-
children
|
|
21
|
+
children: columns
|
|
16
22
|
});
|
|
17
23
|
};
|
|
18
24
|
//#endregion
|
package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableHeader/TableHeader.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"TableHeader.mjs","names":["styles"],"sources":["../../../../../../../../../src/components/Table/components/TableHeader/TableHeader.tsx"],"sourcesContent":["import { Children, type FC } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { IsFirstColumnContext } from \"./context\";\n\nexport type TableHeaderProps = Aria.TableHeaderProps<never>;\n\n/** @flr-generate all */\nexport const TableHeader: FC<TableHeaderProps> = (props) => {\n const { children, className, ...rest } = props;\n\n const rootClassName = clsx(styles.header, className);\n\n // Assumes the first child renders a column; a wrapper that renders nothing\n // leaves the table without row header column, and react-aria throws.\n const columns =\n typeof children === \"function\"\n ? children\n : Children.toArray(children).map((column, index) => (\n <IsFirstColumnContext key={index} value={index === 0}>\n {column}\n </IsFirstColumnContext>\n ));\n\n return (\n <Aria.TableHeader className={rootClassName} {...rest}>\n {columns}\n </Aria.TableHeader>\n );\n};\n\nexport default TableHeader;\n"],"mappings":";;;;;;;;;;AASA,IAAa,eAAqC,UAAU;CAC1D,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CAEzC,MAAM,gBAAgB,KAAKA,qBAAO,QAAQ,SAAS;CAInD,MAAM,UACJ,OAAO,aAAa,aAChB,WACA,SAAS,QAAQ,QAAQ,CAAC,CAAC,KAAK,QAAQ,UACtC,oBAAC,sBAAD;EAAkC,OAAO,UAAU;EAChD,UAAA;CACmB,GAFK,KAEL,CACvB;CAEP,OACE,oBAAC,KAAK,aAAN;EAAkB,WAAW;EAAe,GAAI;EAC7C,UAAA;CACe,CAAA;AAEtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
//#region src/components/Table/components/TableHeader/context.ts
|
|
5
|
+
/**
|
|
6
|
+
* Whether a column is the first of its `TableHeader`. Undefined outside a
|
|
7
|
+
* header that can tell, e.g. with dynamic `columns`.
|
|
8
|
+
*/
|
|
9
|
+
var IsFirstColumnContext = createContext(void 0);
|
|
10
|
+
var useIsFirstColumn = () => useContext(IsFirstColumnContext);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { IsFirstColumnContext, useIsFirstColumn };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=context.mjs.map
|
package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../../../../../../../src/components/Table/components/TableHeader/context.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\n/**\n * Whether a column is the first of its `TableHeader`. Undefined outside a\n * header that can tell, e.g. with dynamic `columns`.\n */\nexport const IsFirstColumnContext = createContext<boolean | undefined>(\n undefined,\n);\n\nexport const useIsFirstColumn = () => useContext(IsFirstColumnContext);\n"],"mappings":";;;;;;;;AAMA,IAAa,uBAAuB,cAClC,KAAA,CACF;AAEA,IAAa,yBAAyB,WAAW,oBAAoB"}
|
|
@@ -18,15 +18,16 @@ var Tabs = flowComponent("Tabs", (props) => {
|
|
|
18
18
|
const [selectedKeyState, setSelectedKeyState] = useState(defaultSelectedKey);
|
|
19
19
|
const selectedKey = selectedKeyProps ?? selectedKeyState ?? null;
|
|
20
20
|
const isSsr = useIsSSR();
|
|
21
|
+
const handleSelectionChange = (key) => {
|
|
22
|
+
setSelectedKeyState(key);
|
|
23
|
+
onSelectionChange?.(key);
|
|
24
|
+
};
|
|
21
25
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsxs(Aria.Tabs, {
|
|
22
26
|
slot: null,
|
|
23
27
|
className: rootClassName,
|
|
24
28
|
...rest,
|
|
25
29
|
selectedKey,
|
|
26
|
-
onSelectionChange:
|
|
27
|
-
setSelectedKeyState(key);
|
|
28
|
-
if (onSelectionChange) onSelectionChange(key);
|
|
29
|
-
},
|
|
30
|
+
onSelectionChange: handleSelectionChange,
|
|
30
31
|
disabledKeys,
|
|
31
32
|
ref,
|
|
32
33
|
children: [
|
|
@@ -34,10 +35,7 @@ var Tabs = flowComponent("Tabs", (props) => {
|
|
|
34
35
|
"aria-label": ariaLabel,
|
|
35
36
|
"aria-labelledby": ariaLabelledby,
|
|
36
37
|
selection: selectedKey,
|
|
37
|
-
onContextMenuSelectionChange:
|
|
38
|
-
setSelectedKeyState(key);
|
|
39
|
-
if (onSelectionChange) onSelectionChange(key);
|
|
40
|
-
},
|
|
38
|
+
onContextMenuSelectionChange: handleSelectionChange,
|
|
41
39
|
disabledKeys
|
|
42
40
|
}),
|
|
43
41
|
/* @__PURE__ */ jsx(UiComponentTunnelExit, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import { TabList } from \"@/components/Tabs/components/TabList\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Tabs.module.scss\";\nimport { FallbackTab } from \"@/components/Tabs/components/FallbackTab\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useIsSSR } from \"react-aria\";\n\nexport interface TabsProps\n extends\n Omit<Aria.TabsProps, \"children\">,\n PropsWithChildren,\n FlowComponentProps {\n /**\n * An accessible name for the tab list. `Tabs` has no `Label` slot, so this is\n * how the group is named when the surrounding heading does not already do\n * it.\n */\n \"aria-label\"?: string;\n /** The id of an element that names the tab list. */\n \"aria-labelledby\"?: string;\n /**\n * The view rendered when the selected tab does not exist. Defaults to a\n * built-in IllustratedMessage.\n */\n tabNotFoundView?: ReactNode;\n}\n\n/** @flr-generate all */\nexport const Tabs = flowComponent(\"Tabs\", (props) => {\n const {\n children,\n className,\n defaultSelectedKey,\n selectedKey: selectedKeyProps,\n disabledKeys,\n ref,\n onSelectionChange,\n tabNotFoundView,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...rest\n } = props;\n\n const rootClassName = clsx(styles.tabs, className);\n const [selectedKeyState, setSelectedKeyState] = useState<\n Aria.Key | undefined\n >(defaultSelectedKey);\n\n /*\n * `null`, not `undefined`, keeps `Aria.Tabs` controlled while nothing is\n * selected yet — see the controlled-from-the-first-render convention in\n * AGENTS.md. `Aria.TabsProps` narrows `selectedKey` to `Key`, hence the cast\n * below.\n */\n const selectedKey = selectedKeyProps ?? selectedKeyState ?? null;\n\n const isSsr = useIsSSR();\n\n return (\n <>\n {children}\n <Aria.Tabs\n slot={null}\n className={rootClassName}\n {...rest}\n selectedKey={selectedKey as Aria.Key | undefined}\n onSelectionChange={
|
|
1
|
+
{"version":3,"file":"Tabs.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import { TabList } from \"@/components/Tabs/components/TabList\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Tabs.module.scss\";\nimport { FallbackTab } from \"@/components/Tabs/components/FallbackTab\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useIsSSR } from \"react-aria\";\n\nexport interface TabsProps\n extends\n Omit<Aria.TabsProps, \"children\">,\n PropsWithChildren,\n FlowComponentProps {\n /**\n * An accessible name for the tab list. `Tabs` has no `Label` slot, so this is\n * how the group is named when the surrounding heading does not already do\n * it.\n */\n \"aria-label\"?: string;\n /** The id of an element that names the tab list. */\n \"aria-labelledby\"?: string;\n /**\n * The view rendered when the selected tab does not exist. Defaults to a\n * built-in IllustratedMessage.\n */\n tabNotFoundView?: ReactNode;\n}\n\n/** @flr-generate all */\nexport const Tabs = flowComponent(\"Tabs\", (props) => {\n const {\n children,\n className,\n defaultSelectedKey,\n selectedKey: selectedKeyProps,\n disabledKeys,\n ref,\n onSelectionChange,\n tabNotFoundView,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...rest\n } = props;\n\n const rootClassName = clsx(styles.tabs, className);\n const [selectedKeyState, setSelectedKeyState] = useState<\n Aria.Key | undefined\n >(defaultSelectedKey);\n\n /*\n * `null`, not `undefined`, keeps `Aria.Tabs` controlled while nothing is\n * selected yet — see the controlled-from-the-first-render convention in\n * AGENTS.md. `Aria.TabsProps` narrows `selectedKey` to `Key`, hence the cast\n * below.\n */\n const selectedKey = selectedKeyProps ?? selectedKeyState ?? null;\n\n const isSsr = useIsSSR();\n\n const handleSelectionChange = (key: Aria.Key) => {\n setSelectedKeyState(key);\n onSelectionChange?.(key);\n };\n\n return (\n <>\n {children}\n <Aria.Tabs\n slot={null}\n className={rootClassName}\n {...rest}\n selectedKey={selectedKey as Aria.Key | undefined}\n onSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n ref={ref}\n >\n <TabList\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n selection={selectedKey}\n onContextMenuSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n />\n <UiComponentTunnelExit id=\"Panels\" component=\"Tabs\" />\n {!isSsr && <FallbackTab tabNotFoundView={tabNotFoundView} />}\n </Aria.Tabs>\n </>\n );\n});\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;;;AAiCA,IAAa,OAAO,cAAc,SAAS,UAAU;CACnD,MAAM,EACJ,UACA,WACA,oBACA,aAAa,kBACb,cACA,KACA,mBACA,iBACA,cAAc,WACd,mBAAmB,gBACnB,GAAG,SACD;CAEJ,MAAM,gBAAgB,KAAKA,oBAAO,MAAM,SAAS;CACjD,MAAM,CAAC,kBAAkB,uBAAuB,SAE9C,kBAAkB;CAQpB,MAAM,cAAc,oBAAoB,oBAAoB;CAE5D,MAAM,QAAQ,SAAS;CAEvB,MAAM,yBAAyB,QAAkB;EAC/C,oBAAoB,GAAG;EACvB,oBAAoB,GAAG;CACzB;CAEA,OACE,qBAAAC,YAAA,EAAA,UAAA,CACG,UACD,qBAAC,KAAK,MAAN;EACE,MAAM;EACN,WAAW;EACX,GAAI;EACS;EACb,mBAAmB;EACL;EACT;EAPP,UAAA;GASE,oBAAC,SAAD;IACE,cAAY;IACZ,mBAAiB;IACjB,WAAW;IACX,8BAA8B;IAChB;GACf,CAAA;GACD,oBAAC,uBAAD;IAAuB,IAAG;IAAS,WAAU;GAAQ,CAAA;GACpD,CAAC,SAAS,oBAAC,aAAD,EAA8B,gBAAkB,CAAA;EAClD;CACX,CAAA,CAAA,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.module.mjs","names":[],"sources":["../../../../../../../src/components/Tabs/Tabs.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabs {\n display: flex;\n flex-direction: column;\n\n .list {\n display: flex;\n flex-direction: row;\n }\n\n .fallbackTab {\n display: none;\n }\n\n &:not(:has(.tabPanel[id])) {\n .fallbackTab {\n display: flex;\n }\n }\n}\n\n.tabPanel {\n opacity: 0;\n height: 0;\n overflow: hidden;\n\n &[id] {\n padding-top: var(--section--spacing);\n opacity: 1;\n height: auto;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Tabs.module.mjs","names":[],"sources":["../../../../../../../src/components/Tabs/Tabs.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabs {\n display: flex;\n flex-direction: column;\n\n .list {\n display: flex;\n flex-direction: row;\n }\n\n .fallbackTab {\n display: none;\n }\n\n &:not(:has(.tabPanel[id])) {\n .fallbackTab {\n display: flex;\n }\n }\n}\n\n.tabPanel {\n opacity: 0;\n height: 0;\n overflow: hidden;\n\n &[id] {\n padding-top: var(--section--spacing);\n opacity: 1;\n height: auto;\n\n /* Only inactive panels clip, so focus rings and hover backgrounds can\n reach past the panel. */\n overflow: visible;\n }\n}\n"],"mappings":""}
|
package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTitle.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Tabs/components/TabTitle/TabTitle.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabTitle {\n position: relative;\n padding-block: var(--tabs--padding-y);\n padding-inline: var(--tabs--padding-x);\n color: var(--tabs--color--default);\n cursor: default;\n white-space: nowrap;\n transition-property: background-color;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 0;\n column-gap: var(--tabs--spacing);\n border-radius: var(--tabs--corner-radius);\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n /* The active indicator is painted below the titles (it precedes them in the\n tab list), so the selected title must not paint a background over it. */\n &:not([data-selected]) {\n &:hover {\n background-color: var(--tabs--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tabs--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n }\n\n &[aria-disabled=\"true\"] {\n color: var(--tabs--color--disabled);\n }\n\n .text {\n display: flex;\n align-items: center;\n column-gap: var(--tabs--spacing);\n }\n}\n\n/* selected tab */\n.tabTitle[data-selected] {\n font-weight: var(--tabs--font-weight--selected);\n}\n\n/* SkeletonMode: no tab shows as selected */\n.tabTitle.skeleton[data-selected] {\n font-weight: inherit;\n}\n\n.menuItem {\n // The tab's children are the consumer's
|
|
1
|
+
{"version":3,"file":"TabTitle.module.mjs","names":[],"sources":["../../../../../../../../../src/components/Tabs/components/TabTitle/TabTitle.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n\n.tabTitle {\n position: relative;\n padding-block: var(--tabs--padding-y);\n padding-inline: var(--tabs--padding-x);\n color: var(--tabs--color--default);\n cursor: default;\n white-space: nowrap;\n transition-property: background-color;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1 1 0;\n column-gap: var(--tabs--spacing);\n border-radius: var(--tabs--corner-radius);\n\n @include focus.focus;\n\n & {\n outline-offset: calc(var(--size-px--xs) * -1);\n }\n\n /* The active indicator is painted below the titles (it precedes them in the\n tab list), so the selected title must not paint a background over it. */\n &:not([data-selected]) {\n &:hover {\n background-color: var(--tabs--background-color--hover);\n transition-duration: var(--transition--duration--default);\n }\n\n &[data-pressed] {\n background-color: var(--tabs--background-color--pressed);\n transition-duration: var(--transition--duration--default);\n }\n }\n\n &[aria-disabled=\"true\"] {\n color: var(--tabs--color--disabled);\n }\n\n .text {\n display: flex;\n align-items: center;\n column-gap: var(--tabs--spacing);\n }\n}\n\n/* selected tab */\n.tabTitle[data-selected] {\n font-weight: var(--tabs--font-weight--selected);\n}\n\n/* SkeletonMode: no tab shows as selected */\n.tabTitle.skeleton[data-selected] {\n font-weight: inherit;\n}\n\n.menuItem {\n // The tab's children are the consumer's. Badges render a span, too.\n > :global(.flow--text) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n column-gap: var(--tabs--spacing);\n flex-grow: 1;\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.module.mjs","names":[],"sources":["../../../../../../../src/components/Text/Text.module.scss"],"sourcesContent":[".text {\n color: inherit;\n
|
|
1
|
+
{"version":3,"file":"Text.module.mjs","names":[],"sources":["../../../../../../../src/components/Text/Text.module.scss"],"sourcesContent":[".text {\n color: inherit;\n\n /* Alpha Colors */\n @mixin color($color) {\n &:where(.#{$color}) {\n color: var(--text--color--#{$color});\n }\n }\n\n @include color(dark);\n @include color(light);\n @include color(dark-static);\n @include color(light-static);\n\n /* `Text` styles raw HTML that its children bring along — `Markdown` nests\n bare `<ul>`/`<ol>`/`<blockquote>` inside a `Text`, and consumers write the\n same markup by hand. None of it is authored here, so none of it is classed. */\n // stylelint-disable selector-max-type -- children's raw HTML, see above\n ul,\n ol {\n padding-inline-start: var(--text--list-padding);\n }\n\n ul {\n li {\n list-style: initial;\n }\n }\n\n small {\n font-size: var(--font-size-text--s);\n }\n\n blockquote {\n border-inline-start: var(--text--blockquote-border-width)\n var(--text--blockquote-border-style) var(--text--blockquote-border-color);\n padding-inline-start: var(--text--blockquote-padding);\n }\n\n .icon {\n vertical-align: text-bottom;\n }\n\n small {\n .icon {\n width: var(--line-height-s);\n height: var(--line-height-s);\n }\n }\n // stylelint-enable selector-max-type\n\n &:where(.align-start) {\n text-align: start;\n }\n\n &:where(.align-center) {\n text-align: center;\n }\n\n &:where(.align-end) {\n text-align: end;\n }\n\n &:where(.wrap-wrap) {\n text-wrap: wrap;\n }\n\n &:where(.wrap-balance) {\n text-wrap: balance;\n }\n\n &:where(.wrap-pretty) {\n text-wrap: pretty;\n }\n\n &:where(.no-ligatures) {\n font-variant-ligatures: none;\n }\n}\n"],"mappings":""}
|
|
@@ -52,6 +52,16 @@ var TextField = flowComponent("TextField", (props) => {
|
|
|
52
52
|
count: charactersCount,
|
|
53
53
|
maxCount: props.maxLength ?? 0
|
|
54
54
|
});
|
|
55
|
+
const isPasswordHidden = type === "password";
|
|
56
|
+
const togglePasswordVisibility = () => setType(isPasswordHidden ? "text" : "password");
|
|
57
|
+
const passwordVisibilityButton = /* @__PURE__ */ jsx(Button, {
|
|
58
|
+
color: "secondary",
|
|
59
|
+
variant: "plain",
|
|
60
|
+
className: TextField_module_default.button,
|
|
61
|
+
onPress: togglePasswordVisibility,
|
|
62
|
+
"aria-label": translation.format(isPasswordHidden ? "password.show" : "password.hide"),
|
|
63
|
+
children: isPasswordHidden ? /* @__PURE__ */ jsx(IconShow, {}) : /* @__PURE__ */ jsx(IconHide, {})
|
|
64
|
+
});
|
|
55
65
|
return /* @__PURE__ */ jsx(Aria.TextField, {
|
|
56
66
|
...rest,
|
|
57
67
|
...controlProps,
|
|
@@ -76,14 +86,7 @@ var TextField = flowComponent("TextField", (props) => {
|
|
|
76
86
|
id: "button",
|
|
77
87
|
component: "TextField"
|
|
78
88
|
}),
|
|
79
|
-
typeFromProps === "password" &&
|
|
80
|
-
color: "secondary",
|
|
81
|
-
variant: "plain",
|
|
82
|
-
className: TextField_module_default.button,
|
|
83
|
-
onPress: () => setType(type === "password" ? "text" : "password"),
|
|
84
|
-
"aria-label": translation.format(`password.${type === "password" ? "show" : "hide"}`),
|
|
85
|
-
children: type === "password" ? /* @__PURE__ */ jsx(IconShow, {}) : /* @__PURE__ */ jsx(IconHide, {})
|
|
86
|
-
})
|
|
89
|
+
typeFromProps === "password" && passwordVisibilityButton
|
|
87
90
|
]
|
|
88
91
|
}),
|
|
89
92
|
showCharacterCount && /* @__PURE__ */ jsx(FieldDescription, { children: charactersCountDescription })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.mjs","names":["styles","locales"],"sources":["../../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { type PropsWithChildren, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./TextField.module.scss\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport locales from \"./locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport { IconHide, IconShow } from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface TextFieldProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.InputProps, \"placeholder\">,\n FlowComponentProps<HTMLInputElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const {\n className,\n showCharacterCount,\n form,\n placeholder,\n ref,\n type: typeFromProps,\n children,\n onChange,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const [type, setType] = useState(typeFromProps);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"TextField\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n const propsContext: PropsContext = {\n Button: {\n className: styles.button,\n variant: \"plain\",\n color: \"secondary\",\n tunnel: {\n id: \"button\",\n component: \"TextField\",\n },\n },\n CopyButton: {\n className: styles.button,\n tunnel: {\n id: \"button\",\n component: \"TextField\",\n },\n },\n ...fieldPropsContext,\n };\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales, \"TextField\");\n\n const charactersCountDescription = translation.format(\"characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n return (\n <Aria.TextField\n {...rest}\n {...controlProps}\n {...skeletonProps}\n className={rootClassName}\n onChange={handleChange}\n type={type}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n {children}\n <div className={styles.inputContainer}>\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.input}\n ref={ref}\n />\n <UiComponentTunnelExit id=\"button\" component=\"TextField\" />\n {typeFromProps === \"password\" &&
|
|
1
|
+
{"version":3,"file":"TextField.mjs","names":["styles","locales"],"sources":["../../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { type PropsWithChildren, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./TextField.module.scss\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport locales from \"./locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport { IconHide, IconShow } from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\n\nexport interface TextFieldProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.InputProps, \"placeholder\">,\n FlowComponentProps<HTMLInputElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const {\n className,\n showCharacterCount,\n form,\n placeholder,\n ref,\n type: typeFromProps,\n children,\n onChange,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const [type, setType] = useState(typeFromProps);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"TextField\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n const propsContext: PropsContext = {\n Button: {\n className: styles.button,\n variant: \"plain\",\n color: \"secondary\",\n tunnel: {\n id: \"button\",\n component: \"TextField\",\n },\n },\n CopyButton: {\n className: styles.button,\n tunnel: {\n id: \"button\",\n component: \"TextField\",\n },\n },\n ...fieldPropsContext,\n };\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales, \"TextField\");\n\n const charactersCountDescription = translation.format(\"characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n const isPasswordHidden = type === \"password\";\n\n const togglePasswordVisibility = () =>\n setType(isPasswordHidden ? \"text\" : \"password\");\n\n const passwordVisibilityButton = (\n <Button\n color=\"secondary\"\n variant=\"plain\"\n className={styles.button}\n onPress={togglePasswordVisibility}\n aria-label={translation.format(\n isPasswordHidden ? \"password.show\" : \"password.hide\",\n )}\n >\n {isPasswordHidden ? <IconShow /> : <IconHide />}\n </Button>\n );\n\n return (\n <Aria.TextField\n {...rest}\n {...controlProps}\n {...skeletonProps}\n className={rootClassName}\n onChange={handleChange}\n type={type}\n >\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n {children}\n <div className={styles.inputContainer}>\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.input}\n ref={ref}\n />\n <UiComponentTunnelExit id=\"button\" component=\"TextField\" />\n {typeFromProps === \"password\" && passwordVisibilityButton}\n </div>\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.TextField>\n );\n});\n\nexport default TextField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,YAAY,cAAc,cAAc,UAAU;CAC7D,MAAM,EACJ,WACA,oBACA,MACA,aACA,KACA,MAAM,eACN,UACA,UACA,GAAG,SACD,4BAA4B,OAAO,EAAE;CAEzC,MAAM,CAAC,iBAAiB,sBAAsB,SAC5C,MAAM,cAAc,UAAU,MAAM,OAAO,UAAU,CACvD;CAEA,MAAM,CAAC,MAAM,WAAW,SAAS,aAAa;CAE9C,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,WAAW;CAExC,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,MAAM,eAA6B;EACjC,QAAQ;GACN,WAAWA,yBAAO;GAClB,SAAS;GACT,OAAO;GACP,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;EACF;EACA,YAAY;GACV,WAAWA,yBAAO;GAClB,QAAQ;IACN,IAAI;IACJ,WAAW;GACb;EACF;EACA,GAAG;CACL;CAEA,MAAM,gBAAgB,MAAc;EAClC,IAAI,oBACF,mBAAmB,EAAE,MAAM;EAE7B,IAAI,UACF,SAAS,CAAC;CAEd;CAEA,MAAM,cAAc,4BAA4BC,kBAAS,WAAW;CAEpE,MAAM,6BAA6B,YAAY,OAAO,cAAc;EAClE,OAAO;EACP,UAAU,MAAM,aAAa;CAC/B,CAAC;CAED,MAAM,mBAAmB,SAAS;CAElC,MAAM,iCACJ,QAAQ,mBAAmB,SAAS,UAAU;CAEhD,MAAM,2BACJ,oBAAC,QAAD;EACE,OAAM;EACN,SAAQ;EACR,WAAWD,yBAAO;EAClB,SAAS;EACT,cAAY,YAAY,OACtB,mBAAmB,kBAAkB,eACvC;EAEC,UAAA,mBAAmB,oBAAC,UAAD,CAAW,CAAA,IAAI,oBAAC,UAAD,CAAW,CAAA;CACxC,CAAA;CAGV,OACE,oBAAC,KAAK,WAAN;EACE,GAAI;EACJ,GAAI;EACJ,GAAI;EACJ,WAAW;EACX,UAAU;EACJ;EAEN,UAAA,qBAAC,sBAAD;GAAsB,OAAO;GAA7B,UAAA,CACE,qBAAC,0BAAD,EAAA,UAAA;IACG;IACD,qBAAC,OAAD;KAAK,WAAWA,yBAAO;KAAvB,UAAA;MACE,oBAAC,KAAK,OAAN;OACQ;OACO;OACb,WAAWA,yBAAO;OACb;MACN,CAAA;MACD,oBAAC,uBAAD;OAAuB,IAAG;OAAS,WAAU;MAAa,CAAA;MACzD,kBAAkB,cAAc;KAC9B;;IACJ,sBACC,oBAAC,kBAAD,EAAA,UAAmB,2BAA6C,CAAA;GAE1C,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACG;;CACR,CAAA;AAEpB,CAAC"}
|
|
@@ -13,6 +13,20 @@ var pickComponentTranslations = (componentName, data) => {
|
|
|
13
13
|
return pick(components ?? {}, [componentName])[componentName] ?? {};
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
+
var compiledMessages = /* @__PURE__ */ new Map();
|
|
17
|
+
var getCompiledMessage = (message, locale) => {
|
|
18
|
+
let messagesOfLocale = compiledMessages.get(locale);
|
|
19
|
+
if (!messagesOfLocale) {
|
|
20
|
+
messagesOfLocale = /* @__PURE__ */ new Map();
|
|
21
|
+
compiledMessages.set(locale, messagesOfLocale);
|
|
22
|
+
}
|
|
23
|
+
let compiled = messagesOfLocale.get(message);
|
|
24
|
+
if (!compiled) {
|
|
25
|
+
compiled = new IntlMessageFormat(message, locale);
|
|
26
|
+
messagesOfLocale.set(message, compiled);
|
|
27
|
+
}
|
|
28
|
+
return compiled;
|
|
29
|
+
};
|
|
16
30
|
var useLocalizedStringFormatter = (strings, componentName) => {
|
|
17
31
|
const locale = useLanguage();
|
|
18
32
|
const { translations, translate } = useTranslationProvider();
|
|
@@ -31,8 +45,7 @@ var useLocalizedStringFormatter = (strings, componentName) => {
|
|
|
31
45
|
if (customTranslated !== void 0) return customTranslated;
|
|
32
46
|
}
|
|
33
47
|
const translationString = dictionary.getStringForLocale(key, locale);
|
|
34
|
-
|
|
35
|
-
return String(translationMessage.format(variables));
|
|
48
|
+
return String(getCompiledMessage(translationString, locale).format(variables));
|
|
36
49
|
}, [
|
|
37
50
|
translate,
|
|
38
51
|
locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalizedStringFormatter.mjs","names":[],"sources":["../../../../../../../src/components/TranslationProvider/useLocalizedStringFormatter.ts"],"sourcesContent":["import {\n type Translations,\n useTranslationProvider,\n} from \"@/components/TranslationProvider/TranslationProvider\";\nimport { mergeDeep } from \"remeda\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { mapValues, pick } from \"remeda\";\nimport type {\n Variables,\n LocalizedStrings as LocalizedStringsIntl,\n} from \"@internationalized/string\";\nimport IntlMessageFormat from \"intl-messageformat\";\nimport { useLocalizedStringDictionary } from \"@react-aria/i18n\";\nimport { useCallback, useMemo } from \"react\";\nimport { useLanguage } from \"@/lib/hooks/useLanguage\";\n\nexport type LocalizedStrings = LocalizedStringsIntl<string, string>;\nexport type LocalizedComponentName = FlowComponentName | string;\n\nexport type TranslationFunction = (\n key: string,\n variables: Variables,\n meta: {\n component: string;\n locale: string;\n },\n) => string | undefined;\n\nconst pickComponentTranslations = (\n componentName: LocalizedComponentName,\n data?: Translations,\n) => {\n if (!data) {\n return {};\n }\n\n return mapValues(data, (components) => {\n const picked = pick(components ?? {}, [componentName]);\n return picked[componentName] ?? {};\n });\n};\n\nexport const useLocalizedStringFormatter = (\n strings: LocalizedStrings,\n componentName: LocalizedComponentName,\n) => {\n const locale = useLanguage();\n const { translations, translate } = useTranslationProvider();\n\n const mergedStrings = useMemo(\n () =>\n mergeDeep(\n strings,\n pickComponentTranslations(componentName, translations),\n ),\n [strings, translations, componentName],\n );\n\n const dictionary = useLocalizedStringDictionary(mergedStrings, componentName);\n const formatFunction = useCallback(\n (key: string, variables?: Variables): string => {\n if (translate) {\n const customTranslated = translate(key, variables, {\n component: componentName,\n locale,\n });\n\n if (customTranslated !== undefined) {\n return customTranslated;\n }\n }\n\n const translationString = dictionary.getStringForLocale(key, locale);\n
|
|
1
|
+
{"version":3,"file":"useLocalizedStringFormatter.mjs","names":[],"sources":["../../../../../../../src/components/TranslationProvider/useLocalizedStringFormatter.ts"],"sourcesContent":["import {\n type Translations,\n useTranslationProvider,\n} from \"@/components/TranslationProvider/TranslationProvider\";\nimport { mergeDeep } from \"remeda\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { mapValues, pick } from \"remeda\";\nimport type {\n Variables,\n LocalizedStrings as LocalizedStringsIntl,\n} from \"@internationalized/string\";\nimport IntlMessageFormat from \"intl-messageformat\";\nimport { useLocalizedStringDictionary } from \"@react-aria/i18n\";\nimport { useCallback, useMemo } from \"react\";\nimport { useLanguage } from \"@/lib/hooks/useLanguage\";\n\nexport type LocalizedStrings = LocalizedStringsIntl<string, string>;\nexport type LocalizedComponentName = FlowComponentName | string;\n\nexport type TranslationFunction = (\n key: string,\n variables: Variables,\n meta: {\n component: string;\n locale: string;\n },\n) => string | undefined;\n\nconst pickComponentTranslations = (\n componentName: LocalizedComponentName,\n data?: Translations,\n) => {\n if (!data) {\n return {};\n }\n\n return mapValues(data, (components) => {\n const picked = pick(components ?? {}, [componentName]);\n return picked[componentName] ?? {};\n });\n};\n\n// Compiling parses the message — do it once per locale and message.\nconst compiledMessages = new Map<string, Map<string, IntlMessageFormat>>();\n\nconst getCompiledMessage = (message: string, locale: string) => {\n let messagesOfLocale = compiledMessages.get(locale);\n if (!messagesOfLocale) {\n messagesOfLocale = new Map();\n compiledMessages.set(locale, messagesOfLocale);\n }\n\n let compiled = messagesOfLocale.get(message);\n if (!compiled) {\n compiled = new IntlMessageFormat(message, locale);\n messagesOfLocale.set(message, compiled);\n }\n\n return compiled;\n};\n\nexport const useLocalizedStringFormatter = (\n strings: LocalizedStrings,\n componentName: LocalizedComponentName,\n) => {\n const locale = useLanguage();\n const { translations, translate } = useTranslationProvider();\n\n const mergedStrings = useMemo(\n () =>\n mergeDeep(\n strings,\n pickComponentTranslations(componentName, translations),\n ),\n [strings, translations, componentName],\n );\n\n const dictionary = useLocalizedStringDictionary(mergedStrings, componentName);\n const formatFunction = useCallback(\n (key: string, variables?: Variables): string => {\n if (translate) {\n const customTranslated = translate(key, variables, {\n component: componentName,\n locale,\n });\n\n if (customTranslated !== undefined) {\n return customTranslated;\n }\n }\n\n const translationString = dictionary.getStringForLocale(key, locale);\n return String(\n getCompiledMessage(translationString, locale).format(variables),\n );\n },\n [translate, locale, componentName, dictionary],\n );\n\n return useMemo(() => ({ format: formatFunction }), [formatFunction]);\n};\n"],"mappings":";;;;;;;;;AA4BA,IAAM,6BACJ,eACA,SACG;CACH,IAAI,CAAC,MACH,OAAO,CAAC;CAGV,OAAO,UAAU,OAAO,eAAe;EAErC,OADe,KAAK,cAAc,CAAC,GAAG,CAAC,aAAa,CAC7C,CAAA,CAAO,kBAAkB,CAAC;CACnC,CAAC;AACH;AAGA,IAAM,mCAAmB,IAAI,IAA4C;AAEzE,IAAM,sBAAsB,SAAiB,WAAmB;CAC9D,IAAI,mBAAmB,iBAAiB,IAAI,MAAM;CAClD,IAAI,CAAC,kBAAkB;EACrB,mCAAmB,IAAI,IAAI;EAC3B,iBAAiB,IAAI,QAAQ,gBAAgB;CAC/C;CAEA,IAAI,WAAW,iBAAiB,IAAI,OAAO;CAC3C,IAAI,CAAC,UAAU;EACb,WAAW,IAAI,kBAAkB,SAAS,MAAM;EAChD,iBAAiB,IAAI,SAAS,QAAQ;CACxC;CAEA,OAAO;AACT;AAEA,IAAa,+BACX,SACA,kBACG;CACH,MAAM,SAAS,YAAY;CAC3B,MAAM,EAAE,cAAc,cAAc,uBAAuB;CAE3D,MAAM,gBAAgB,cAElB,UACE,SACA,0BAA0B,eAAe,YAAY,CACvD,GACF;EAAC;EAAS;EAAc;CAAa,CACvC;CAEA,MAAM,aAAa,6BAA6B,eAAe,aAAa;CAC5E,MAAM,iBAAiB,aACpB,KAAa,cAAkC;EAC9C,IAAI,WAAW;GACb,MAAM,mBAAmB,UAAU,KAAK,WAAW;IACjD,WAAW;IACX;GACF,CAAC;GAED,IAAI,qBAAqB,KAAA,GACvB,OAAO;EAEX;EAEA,MAAM,oBAAoB,WAAW,mBAAmB,KAAK,MAAM;EACnE,OAAO,OACL,mBAAmB,mBAAmB,MAAM,CAAC,CAAC,OAAO,SAAS,CAChE;CACF,GACA;EAAC;EAAW;EAAQ;EAAe;CAAU,CAC/C;CAEA,OAAO,eAAe,EAAE,QAAQ,eAAe,IAAI,CAAC,cAAc,CAAC;AACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wrap.mjs","names":[],"sources":["../../../../../../../src/components/Wrap/Wrap.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, ReactElement } from \"react\";\n\nexport interface WrapProps {\n if: unknown;\n children: ReactElement<PropsWithChildren>;\n}\n\nexport const Wrap: FC<WrapProps> = (props) => {\n const { if: _if, children } = props;\n\n if (_if) {\n return children;\n }\n\n return children.props.children;\n};\n\nexport default Wrap;\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Wrap.mjs","names":[],"sources":["../../../../../../../src/components/Wrap/Wrap.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, ReactElement } from \"react\";\n\nexport interface WrapProps {\n /**\n * Whether the child element is rendered. Any truthy value keeps it, a falsy\n * one renders only its children.\n */\n if: unknown;\n /** The element that wraps the content, with the content as its children. */\n children: ReactElement<PropsWithChildren>;\n}\n\nexport const Wrap: FC<WrapProps> = (props) => {\n const { if: _if, children } = props;\n\n if (_if) {\n return children;\n }\n\n return children.props.children;\n};\n\nexport default Wrap;\n"],"mappings":";;;AAYA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EAAE,IAAI,KAAK,aAAa;CAE9B,IAAI,KACF,OAAO;CAGT,OAAO,SAAS,MAAM;AACxB"}
|
package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { PropsContextProvider } from "../../../../lib/propsContext/components/PropsContextProvider.mjs";
|
|
4
4
|
import dynamic from "../../../../lib/propsContext/dynamicProps/dynamic.mjs";
|
|
5
5
|
import { useLocalizedStringFormatter } from "../../../../components/TranslationProvider/useLocalizedStringFormatter.mjs";
|
|
6
|
+
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
6
7
|
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
7
8
|
import __locale_default from "../../../../../../../_virtual/_36.locale.mjs";
|
|
8
|
-
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
9
9
|
import { useUpdateFormDefaultValue } from "./hooks/useUpdateFormDefaultValue.mjs";
|
|
10
10
|
import "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs
CHANGED
|
@@ -51,7 +51,10 @@ function Form(props) {
|
|
|
51
51
|
if (autoResetOptions?.onAfterModalClose) form.reset();
|
|
52
52
|
});
|
|
53
53
|
const { submitInterceptor } = useFormSettings();
|
|
54
|
-
const onSubmit = submitInterceptor ? (values) => submitInterceptor(onSubmitProp, values, {
|
|
54
|
+
const onSubmit = submitInterceptor ? (values, event) => submitInterceptor(onSubmitProp, values, {
|
|
55
|
+
form,
|
|
56
|
+
event
|
|
57
|
+
}) : onSubmitProp;
|
|
55
58
|
const handleSubmitResult = (result) => {
|
|
56
59
|
if (typeof result === "function") afterSubmitCallback.current = result;
|
|
57
60
|
const rootError = form.getFieldState("root")?.error;
|
package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.mjs","names":["RhfFormContextProvider"],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport { useComponentDefaults } from \"@/components/ComponentDefaultsProvider\";\nimport { type OverlayController, useModalController } from \"@/lib/controller\";\nimport {\n type BaseSyntheticEvent,\n type ComponentProps,\n type FC,\n type PropsWithChildren,\n type Ref,\n type SubmitEventHandler,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport type {\n FieldValues,\n Path,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport { useFormRootErrorController } from \"../FormRootError/useFormRootErrorController\";\nimport { FormRootError } from \"../../lib/FormRootError\";\nimport { useFormSettings } from \"../FormSettingsProvider/FormSettingsProvider\";\nimport {\n useFormSubmitController,\n type WithFormSubmitControllerProps,\n} from \"@/integrations/react-hook-form/components/Form/hooks/useFormSubmitController\";\nimport { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/hooks/useHotkeySubmit\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\nexport type AfterFormSubmitCallback = (...unknownArgs: unknown[]) => unknown;\n\nexport interface FormAutoResetOptions {\n /**\n * Whether the form is reset to its default values after the surrounding modal\n * has closed.\n *\n * @default true\n */\n onAfterModalClose?: boolean;\n}\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: SubmitEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends\n Omit<ComponentProps<\"form\">, \"onSubmit\">,\n PropsWithChildren,\n WithFormSubmitControllerProps {\n /** The react-hook-form instance returned by `useForm()`. */\n form: UseFormReturn<F>;\n /**\n * Called with the validated form values when the form is submitted. Returning\n * a promise keeps the submit button pending until it settles.\n */\n onSubmit: FormOnSubmitHandler<F>;\n /**\n * The component rendered as the form element. Use it to render the form with\n * a routers form component. Defaults to a plain `<form />`.\n */\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n /**\n * Whether all fields of the form can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * When the form is reset to its default values. `true` resets it after the\n * surrounding modal has closed, `false` never resets it.\n *\n * @default true\n */\n autoReset?: FormAutoResetOptions | boolean;\n /**\n * Whether closing the surrounding modal must be confirmed while the form has\n * unsaved changes. Overrides `Form.confirmModalCloseOnUnsavedChanges` of the\n * `ComponentDefaultsProvider`.\n *\n * @default true\n */\n confirmModalCloseOnUnsavedChanges?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\n/**\n * Runs `operation` while closing the surrounding Modal is allowed without a\n * confirmation, and drops that permission again as soon as the operation has\n * settled. Scoping it to the operation is what keeps a submit that only\n * advances a wizard step from disarming the confirmation for good (#2775).\n */\nconst runWithGrantedModalClose = (\n modalController: OverlayController,\n operation: () => unknown,\n): unknown => {\n const releaseGrant = modalController.grantCloseWithoutConfirmation();\n\n let result: unknown;\n try {\n result = operation();\n } catch (error) {\n releaseGrant();\n throw error;\n }\n\n if (result instanceof Promise) {\n return result.finally(releaseGrant);\n }\n releaseGrant();\n return result;\n};\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit: onSubmitProp,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n autoReset = true,\n confirmModalCloseOnUnsavedChanges: confirmModalCloseOnUnsavedChangesProp,\n submitController: submitControllerFromProps,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n const afterSubmitCallback = useRef<AfterFormSubmitCallback>(undefined);\n const { isDirty } = form.formState;\n const rootErrorController = useFormRootErrorController();\n\n const defaultSubmitController = useFormSubmitController();\n const submitController = submitControllerFromProps\n ? submitControllerFromProps.submit.extend(defaultSubmitController)\n : defaultSubmitController;\n\n const autoResetOptions =\n typeof autoReset === \"boolean\"\n ? { onAfterModalClose: autoReset }\n : autoReset;\n\n const defaults = useComponentDefaults(\"Form\");\n const confirmModalCloseOnUnsavedChanges =\n confirmModalCloseOnUnsavedChangesProp ??\n defaults.confirmModalCloseOnUnsavedChanges;\n\n const modalController = useModalController();\n modalController.useUpdateOptions({\n // A dirty Form contributes one close confirmation source to the surrounding\n // Modal; sources are combined, so a clean Form does not overrule a\n // `<Modal confirmOnClose>`. The Modal renders the confirmation dialog.\n // A Form that switched it off contributes nothing at all.\n confirmOnClose: confirmModalCloseOnUnsavedChanges ? isDirty : undefined,\n });\n modalController.useOnClosed(() => {\n if (autoResetOptions?.onAfterModalClose) {\n form.reset();\n }\n });\n\n const { submitInterceptor } = useFormSettings();\n const onSubmit = submitInterceptor\n ? (values: F) => submitInterceptor<F>(onSubmitProp, values, { form })\n : onSubmitProp;\n\n const handleSubmitResult = (result: unknown) => {\n if (typeof result === \"function\") {\n afterSubmitCallback.current = result as AfterFormSubmitCallback;\n }\n const rootError = form.getFieldState(\"root\" as Path<F>)?.error;\n if (rootError && !rootErrorController.errorComponentMounted) {\n throw new FormRootError(rootError);\n }\n };\n\n const handleSubmit = async (e?: BaseSyntheticEvent | F): Promise<void> => {\n const formEvent =\n e && \"nativeEvent\" in e ? (e as BaseSyntheticEvent) : undefined;\n formEvent?.stopPropagation();\n\n // react-hook-form's submit handler resolves with an unknown value; the\n // submit controller only awaits it, so drop the result.\n await form.handleSubmit((values, event) =>\n runWithGrantedModalClose(modalController, () => {\n const submitResult = onSubmit(values, event);\n if (submitResult instanceof Promise) {\n return submitResult.then(handleSubmitResult);\n }\n handleSubmitResult(submitResult);\n }),\n )(formEvent);\n };\n submitController.submit.set(handleSubmit);\n\n const onAfterSuccessFeedback = () => {\n const callback = afterSubmitCallback.current;\n if (!callback) {\n return;\n }\n // The callback runs after the submit itself has finished (and after\n // SubmitButton's success feedback), so it needs its own permission to close\n // the Modal.\n runWithGrantedModalClose(modalController, callback);\n };\n\n const refWithHotkeySubmit = useHotkeySubmit({\n ref,\n submitController,\n });\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n form={form as UseFormReturn}\n isReadOnly={isReadOnly}\n id={formId}\n onAfterSuccessFeedback={onAfterSuccessFeedback}\n rootErrorController={rootErrorController}\n >\n <FormComponent\n {...formProps}\n ref={refWithHotkeySubmit}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\n </FormComponent>\n </FormContextProvider>\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AA4FA,IAAM,wBAA2C,MAAM,oBAAC,QAAD,EAAM,GAAI,EAAI,CAAA;;;;;;;AAQrE,IAAM,4BACJ,iBACA,cACY;CACZ,MAAM,eAAe,gBAAgB,8BAA8B;CAEnE,IAAI;CACJ,IAAI;EACF,SAAS,UAAU;CACrB,SAAS,OAAO;EACd,aAAa;EACb,MAAM;CACR;CAEA,IAAI,kBAAkB,SACpB,OAAO,OAAO,QAAQ,YAAY;CAEpC,aAAa;CACb,OAAO;AACT;AAEA,SAAgB,KAA4B,OAAqB;CAC/D,MAAM,EACJ,MACA,UACA,UAAU,cACV,gBAAgB,sBAChB,YACA,KACA,IAAI,QACJ,YAAY,MACZ,mCAAmC,uCACnC,kBAAkB,2BAClB,GAAG,cACD;CAEJ,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,UAAU;CACzB,MAAM,gBAAgB,cAAc,eAAe,CAAC,MAAM,CAAC;CAC3D,MAAM,sBAAsB,OAAgC,KAAA,CAAS;CACrE,MAAM,EAAE,YAAY,KAAK;CACzB,MAAM,sBAAsB,2BAA2B;CAEvD,MAAM,0BAA0B,wBAAwB;CACxD,MAAM,mBAAmB,4BACrB,0BAA0B,OAAO,OAAO,uBAAuB,IAC/D;CAEJ,MAAM,mBACJ,OAAO,cAAc,YACjB,EAAE,mBAAmB,UAAU,IAC/B;CAEN,MAAM,WAAW,qBAAqB,MAAM;CAC5C,MAAM,oCACJ,yCACA,SAAS;CAEX,MAAM,kBAAkB,mBAAmB;CAC3C,gBAAgB,iBAAiB,EAK/B,gBAAgB,oCAAoC,UAAU,KAAA,EAChE,CAAC;CACD,gBAAgB,kBAAkB;EAChC,IAAI,kBAAkB,mBACpB,KAAK,MAAM;CAEf,CAAC;CAED,MAAM,EAAE,sBAAsB,gBAAgB;CAC9C,MAAM,WAAW,qBACZ,WAAc,kBAAqB,cAAc,QAAQ,EAAE,KAAK,CAAC,IAClE;CAEJ,MAAM,sBAAsB,WAAoB;EAC9C,IAAI,OAAO,WAAW,YACpB,oBAAoB,UAAU;EAEhC,MAAM,YAAY,KAAK,cAAc,MAAiB,CAAC,EAAE;EACzD,IAAI,aAAa,CAAC,oBAAoB,uBACpC,MAAM,IAAI,cAAc,SAAS;CAErC;CAEA,MAAM,eAAe,OAAO,MAA8C;EACxE,MAAM,YACJ,KAAK,iBAAiB,IAAK,IAA2B,KAAA;EACxD,WAAW,gBAAgB;EAI3B,MAAM,KAAK,cAAc,QAAQ,UAC/B,yBAAyB,uBAAuB;GAC9C,MAAM,eAAe,SAAS,QAAQ,KAAK;GAC3C,IAAI,wBAAwB,SAC1B,OAAO,aAAa,KAAK,kBAAkB;GAE7C,mBAAmB,YAAY;EACjC,CAAC,CACH,CAAC,CAAC,SAAS;CACb;CACA,iBAAiB,OAAO,IAAI,YAAY;CAExC,MAAM,+BAA+B;EACnC,MAAM,WAAW,oBAAoB;EACrC,IAAI,CAAC,UACH;EAKF,yBAAyB,iBAAiB,QAAQ;CACpD;CAEA,MAAM,sBAAsB,gBAAgB;EAC1C;EACA;CACF,CAAC;CAED,OACE,oBAACA,cAAD;EAAwB,GAAI;EAC1B,UAAA,oBAAC,qBAAD;GACQ;GACM;GACZ,IAAI;GACoB;GACH;GAErB,UAAA,oBAAC,eAAD;IACE,GAAI;IACJ,KAAK;IACL,IAAI;IACJ,UAAU;IAET;GACY,CAAA;EACI,CAAA;CACC,CAAA;AAE5B"}
|
|
1
|
+
{"version":3,"file":"Form.mjs","names":["RhfFormContextProvider"],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { FormContextProvider } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport { useComponentDefaults } from \"@/components/ComponentDefaultsProvider\";\nimport { type OverlayController, useModalController } from \"@/lib/controller\";\nimport {\n type BaseSyntheticEvent,\n type ComponentProps,\n type FC,\n type PropsWithChildren,\n type Ref,\n type SubmitEventHandler,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport type {\n FieldValues,\n Path,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport { useFormRootErrorController } from \"../FormRootError/useFormRootErrorController\";\nimport { FormRootError } from \"../../lib/FormRootError\";\nimport { useFormSettings } from \"../FormSettingsProvider/FormSettingsProvider\";\nimport {\n useFormSubmitController,\n type WithFormSubmitControllerProps,\n} from \"@/integrations/react-hook-form/components/Form/hooks/useFormSubmitController\";\nimport { useHotkeySubmit } from \"@/integrations/react-hook-form/components/Form/hooks/useHotkeySubmit\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\nexport type AfterFormSubmitCallback = (...unknownArgs: unknown[]) => unknown;\n\nexport interface FormAutoResetOptions {\n /**\n * Whether the form is reset to its default values after the surrounding modal\n * has closed.\n *\n * @default true\n */\n onAfterModalClose?: boolean;\n}\n\ntype FormComponentType = FC<\n PropsWithChildren<{\n id: string;\n onSubmit?: SubmitEventHandler | FormOnSubmitHandler<never>;\n ref?: Ref<HTMLFormElement>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends\n Omit<ComponentProps<\"form\">, \"onSubmit\">,\n PropsWithChildren,\n WithFormSubmitControllerProps {\n /** The react-hook-form instance returned by `useForm()`. */\n form: UseFormReturn<F>;\n /**\n * Called with the validated form values when the form is submitted. Returning\n * a promise keeps the submit button pending until it settles.\n */\n onSubmit: FormOnSubmitHandler<F>;\n /**\n * The component rendered as the form element. Use it to render the form with\n * a routers form component. Defaults to a plain `<form />`.\n */\n formComponent?: FC<Omit<FormComponentType, \"ref\">>;\n /**\n * Whether all fields of the form can be read but not edited.\n *\n * @default false\n */\n isReadOnly?: boolean;\n /**\n * When the form is reset to its default values. `true` resets it after the\n * surrounding modal has closed, `false` never resets it.\n *\n * @default true\n */\n autoReset?: FormAutoResetOptions | boolean;\n /**\n * Whether closing the surrounding modal must be confirmed while the form has\n * unsaved changes. Overrides `Form.confirmModalCloseOnUnsavedChanges` of the\n * `ComponentDefaultsProvider`.\n *\n * @default true\n */\n confirmModalCloseOnUnsavedChanges?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\n/**\n * Runs `operation` while closing the surrounding Modal is allowed without a\n * confirmation, and drops that permission again as soon as the operation has\n * settled. Scoping it to the operation is what keeps a submit that only\n * advances a wizard step from disarming the confirmation for good (#2775).\n */\nconst runWithGrantedModalClose = (\n modalController: OverlayController,\n operation: () => unknown,\n): unknown => {\n const releaseGrant = modalController.grantCloseWithoutConfirmation();\n\n let result: unknown;\n try {\n result = operation();\n } catch (error) {\n releaseGrant();\n throw error;\n }\n\n if (result instanceof Promise) {\n return result.finally(releaseGrant);\n }\n releaseGrant();\n return result;\n};\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit: onSubmitProp,\n formComponent = DefaultFormComponent,\n isReadOnly,\n ref,\n id: idProp,\n autoReset = true,\n confirmModalCloseOnUnsavedChanges: confirmModalCloseOnUnsavedChangesProp,\n submitController: submitControllerFromProps,\n ...formProps\n } = props;\n\n const newFormId = useId();\n const formId = idProp ?? newFormId;\n const FormComponent = useMemo(() => formComponent, [formId]);\n const afterSubmitCallback = useRef<AfterFormSubmitCallback>(undefined);\n const { isDirty } = form.formState;\n const rootErrorController = useFormRootErrorController();\n\n const defaultSubmitController = useFormSubmitController();\n const submitController = submitControllerFromProps\n ? submitControllerFromProps.submit.extend(defaultSubmitController)\n : defaultSubmitController;\n\n const autoResetOptions =\n typeof autoReset === \"boolean\"\n ? { onAfterModalClose: autoReset }\n : autoReset;\n\n const defaults = useComponentDefaults(\"Form\");\n const confirmModalCloseOnUnsavedChanges =\n confirmModalCloseOnUnsavedChangesProp ??\n defaults.confirmModalCloseOnUnsavedChanges;\n\n const modalController = useModalController();\n modalController.useUpdateOptions({\n // A dirty Form contributes one close confirmation source to the surrounding\n // Modal; sources are combined, so a clean Form does not overrule a\n // `<Modal confirmOnClose>`. The Modal renders the confirmation dialog.\n // A Form that switched it off contributes nothing at all.\n confirmOnClose: confirmModalCloseOnUnsavedChanges ? isDirty : undefined,\n });\n modalController.useOnClosed(() => {\n if (autoResetOptions?.onAfterModalClose) {\n form.reset();\n }\n });\n\n const { submitInterceptor } = useFormSettings();\n const onSubmit = submitInterceptor\n ? (values: F, event?: BaseSyntheticEvent) =>\n submitInterceptor<F>(onSubmitProp, values, { form, event })\n : onSubmitProp;\n\n const handleSubmitResult = (result: unknown) => {\n if (typeof result === \"function\") {\n afterSubmitCallback.current = result as AfterFormSubmitCallback;\n }\n const rootError = form.getFieldState(\"root\" as Path<F>)?.error;\n if (rootError && !rootErrorController.errorComponentMounted) {\n throw new FormRootError(rootError);\n }\n };\n\n const handleSubmit = async (e?: BaseSyntheticEvent | F): Promise<void> => {\n const formEvent =\n e && \"nativeEvent\" in e ? (e as BaseSyntheticEvent) : undefined;\n formEvent?.stopPropagation();\n\n // react-hook-form's submit handler resolves with an unknown value; the\n // submit controller only awaits it, so drop the result.\n await form.handleSubmit((values, event) =>\n runWithGrantedModalClose(modalController, () => {\n const submitResult = onSubmit(values, event);\n if (submitResult instanceof Promise) {\n return submitResult.then(handleSubmitResult);\n }\n handleSubmitResult(submitResult);\n }),\n )(formEvent);\n };\n submitController.submit.set(handleSubmit);\n\n const onAfterSuccessFeedback = () => {\n const callback = afterSubmitCallback.current;\n if (!callback) {\n return;\n }\n // The callback runs after the submit itself has finished (and after\n // SubmitButton's success feedback), so it needs its own permission to close\n // the Modal.\n runWithGrantedModalClose(modalController, callback);\n };\n\n const refWithHotkeySubmit = useHotkeySubmit({\n ref,\n submitController,\n });\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n form={form as UseFormReturn}\n isReadOnly={isReadOnly}\n id={formId}\n onAfterSuccessFeedback={onAfterSuccessFeedback}\n rootErrorController={rootErrorController}\n >\n <FormComponent\n {...formProps}\n ref={refWithHotkeySubmit}\n id={formId}\n onSubmit={handleSubmit}\n >\n {children}\n </FormComponent>\n </FormContextProvider>\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AA4FA,IAAM,wBAA2C,MAAM,oBAAC,QAAD,EAAM,GAAI,EAAI,CAAA;;;;;;;AAQrE,IAAM,4BACJ,iBACA,cACY;CACZ,MAAM,eAAe,gBAAgB,8BAA8B;CAEnE,IAAI;CACJ,IAAI;EACF,SAAS,UAAU;CACrB,SAAS,OAAO;EACd,aAAa;EACb,MAAM;CACR;CAEA,IAAI,kBAAkB,SACpB,OAAO,OAAO,QAAQ,YAAY;CAEpC,aAAa;CACb,OAAO;AACT;AAEA,SAAgB,KAA4B,OAAqB;CAC/D,MAAM,EACJ,MACA,UACA,UAAU,cACV,gBAAgB,sBAChB,YACA,KACA,IAAI,QACJ,YAAY,MACZ,mCAAmC,uCACnC,kBAAkB,2BAClB,GAAG,cACD;CAEJ,MAAM,YAAY,MAAM;CACxB,MAAM,SAAS,UAAU;CACzB,MAAM,gBAAgB,cAAc,eAAe,CAAC,MAAM,CAAC;CAC3D,MAAM,sBAAsB,OAAgC,KAAA,CAAS;CACrE,MAAM,EAAE,YAAY,KAAK;CACzB,MAAM,sBAAsB,2BAA2B;CAEvD,MAAM,0BAA0B,wBAAwB;CACxD,MAAM,mBAAmB,4BACrB,0BAA0B,OAAO,OAAO,uBAAuB,IAC/D;CAEJ,MAAM,mBACJ,OAAO,cAAc,YACjB,EAAE,mBAAmB,UAAU,IAC/B;CAEN,MAAM,WAAW,qBAAqB,MAAM;CAC5C,MAAM,oCACJ,yCACA,SAAS;CAEX,MAAM,kBAAkB,mBAAmB;CAC3C,gBAAgB,iBAAiB,EAK/B,gBAAgB,oCAAoC,UAAU,KAAA,EAChE,CAAC;CACD,gBAAgB,kBAAkB;EAChC,IAAI,kBAAkB,mBACpB,KAAK,MAAM;CAEf,CAAC;CAED,MAAM,EAAE,sBAAsB,gBAAgB;CAC9C,MAAM,WAAW,qBACZ,QAAW,UACV,kBAAqB,cAAc,QAAQ;EAAE;EAAM;CAAM,CAAC,IAC5D;CAEJ,MAAM,sBAAsB,WAAoB;EAC9C,IAAI,OAAO,WAAW,YACpB,oBAAoB,UAAU;EAEhC,MAAM,YAAY,KAAK,cAAc,MAAiB,CAAC,EAAE;EACzD,IAAI,aAAa,CAAC,oBAAoB,uBACpC,MAAM,IAAI,cAAc,SAAS;CAErC;CAEA,MAAM,eAAe,OAAO,MAA8C;EACxE,MAAM,YACJ,KAAK,iBAAiB,IAAK,IAA2B,KAAA;EACxD,WAAW,gBAAgB;EAI3B,MAAM,KAAK,cAAc,QAAQ,UAC/B,yBAAyB,uBAAuB;GAC9C,MAAM,eAAe,SAAS,QAAQ,KAAK;GAC3C,IAAI,wBAAwB,SAC1B,OAAO,aAAa,KAAK,kBAAkB;GAE7C,mBAAmB,YAAY;EACjC,CAAC,CACH,CAAC,CAAC,SAAS;CACb;CACA,iBAAiB,OAAO,IAAI,YAAY;CAExC,MAAM,+BAA+B;EACnC,MAAM,WAAW,oBAAoB;EACrC,IAAI,CAAC,UACH;EAKF,yBAAyB,iBAAiB,QAAQ;CACpD;CAEA,MAAM,sBAAsB,gBAAgB;EAC1C;EACA;CACF,CAAC;CAED,OACE,oBAACA,cAAD;EAAwB,GAAI;EAC1B,UAAA,oBAAC,qBAAD;GACQ;GACM;GACZ,IAAI;GACoB;GACH;GAErB,UAAA,oBAAC,eAAD;IACE,GAAI;IACJ,KAAK;IACL,IAAI;IACJ,UAAU;IAET;GACY,CAAA;EACI,CAAA;CACC,CAAA;AAE5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
4
3
|
import FieldErrorView from "../../../../views/FieldErrorView.mjs";
|
|
4
|
+
import { useFormContext } from "../FormContextProvider/FormContextProvider.mjs";
|
|
5
5
|
import { useMountedFormRootErrorComponent } from "./useMountedFormRootErrorComponent.mjs";
|
|
6
6
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/integrations/react-hook-form/components/FormRootError/FormRootError.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSettingsProvider.mjs","names":[],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"FormSettingsProvider.mjs","names":[],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type BaseSyntheticEvent,\n type PropsWithChildren,\n} from \"react\";\nimport type { FieldValues, UseFormReturn } from \"react-hook-form\";\nimport type { FormOnSubmitHandler } from \"../Form/Form\";\n\nexport interface SubmitInterceptorContext<F extends FieldValues = FieldValues> {\n form: UseFormReturn<F>;\n /**\n * The submit event, if the form was submitted by one. Pass it on to `submit`\n * so the handler can read the pressed submit button\n * (`event.nativeEvent.submitter`).\n */\n event?: BaseSyntheticEvent;\n}\n\nexport type SubmitInterceptor = <F extends FieldValues = FieldValues>(\n submit: FormOnSubmitHandler<F>,\n values: F,\n context: SubmitInterceptorContext<F>,\n) => ReturnType<FormOnSubmitHandler<F>>;\n\ninterface Context {\n submitInterceptor?: SubmitInterceptor;\n}\n\nconst context = createContext<Context>({});\n\nexport type FormSettingsProviderProps = Context & PropsWithChildren;\n\nexport function FormSettingsProvider(props: FormSettingsProviderProps) {\n return (\n <context.Provider value={props as Context}>\n {props.children}\n </context.Provider>\n );\n}\n\nexport const useFormSettings = () => useContext(context);\n"],"mappings":";;;;;AA6BA,IAAM,UAAU,cAAuB,CAAC,CAAC;AAIzC,SAAgB,qBAAqB,OAAkC;CACrE,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EACtB,UAAA,MAAM;CACS,CAAA;AAEtB;AAEA,IAAa,wBAAwB,WAAW,OAAO"}
|