@ostack.tech/ui 0.1.2 → 0.2.1
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/dist/chunks/en-lyNzumTm.js +105 -0
- package/dist/chunks/en-lyNzumTm.js.map +1 -0
- package/dist/locales/en-GB.js +16 -0
- package/dist/locales/en-GB.js.map +1 -0
- package/dist/locales/en-US.js +16 -0
- package/dist/locales/en-US.js.map +1 -0
- package/dist/locales/fr.js +110 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/pt.js +110 -0
- package/dist/locales/pt.js.map +1 -0
- package/dist/ostack-ui.js +6151 -6401
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +9 -9
- package/dist/types/components/Alert/AlertTitle.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogAction.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogBody.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogCancel.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogContent.d.ts +5 -5
- package/dist/types/components/AlertDialog/AlertDialogDescription.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogFooter.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogHeader.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogTitle.d.ts +3 -3
- package/dist/types/components/AlertDialog/AlertDialogTrigger.d.ts +3 -3
- package/dist/types/components/Button/Button.d.ts +7 -7
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
- package/dist/types/components/Calendar/Calendar.d.ts +6 -6
- package/dist/types/components/Calendar/CalendarContext.d.ts +1 -2
- package/dist/types/components/Calendar/CalendarDay.d.ts +2 -3
- package/dist/types/components/Calendar/CalendarMonthCaption.d.ts +2 -3
- package/dist/types/components/Card/Card.d.ts +3 -3
- package/dist/types/components/Card/CardBody.d.ts +3 -3
- package/dist/types/components/Card/CardFooter.d.ts +3 -3
- package/dist/types/components/Card/CardHeader.d.ts +3 -3
- package/dist/types/components/Card/CardTitle.d.ts +3 -3
- package/dist/types/components/Checkbox/Checkbox.d.ts +11 -11
- package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +9 -9
- package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +1 -2
- package/dist/types/components/ClearContexts/ClearContexts.d.ts +3 -3
- package/dist/types/components/CloseButton/CloseButton.d.ts +3 -3
- package/dist/types/components/Code/Code.d.ts +3 -3
- package/dist/types/components/Collapsible/Collapsible.d.ts +3 -3
- package/dist/types/components/Collapsible/CollapsibleContent.d.ts +3 -3
- package/dist/types/components/Collapsible/CollapsibleContext.d.ts +1 -2
- package/dist/types/components/Collapsible/CollapsibleTrigger.d.ts +4 -4
- package/dist/types/components/CommandMenu/CommandMenu.d.ts +11 -11
- package/dist/types/components/CommandMenu/CommandMenuDialog.d.ts +7 -7
- package/dist/types/components/CommandMenu/CommandMenuGroup.d.ts +4 -4
- package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +3 -3
- package/dist/types/components/Container/Container.d.ts +3 -3
- package/dist/types/components/ControlAddon/ControlAddon.d.ts +3 -3
- package/dist/types/components/ControlCode/ControlCode.d.ts +4 -4
- package/dist/types/components/DataTable/DataTable.d.ts +11 -11
- package/dist/types/components/DataTable/DataTableApi.d.ts +2 -2
- package/dist/types/components/DataTable/DataTableBody.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableCell.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableColumn.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableContent.d.ts +9 -9
- package/dist/types/components/DataTable/DataTableContext.d.ts +19 -19
- package/dist/types/components/DataTable/DataTableFilter.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableFoot.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableHead.d.ts +3 -3
- package/dist/types/components/DataTable/DataTablePagination.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableRow.d.ts +3 -3
- package/dist/types/components/DataTable/DataTableRowsPerPage.d.ts +4 -4
- package/dist/types/components/DataTable/DataTableSelectionTrigger.d.ts +5 -5
- package/dist/types/components/DataTable/PagedDataTablePagination.d.ts +3 -3
- package/dist/types/components/DataTable/ScrolledDataTablePagination.d.ts +3 -3
- package/dist/types/components/DataTable/getRowKey.d.ts +2 -2
- package/dist/types/components/DateInput/DateInput.d.ts +5 -5
- package/dist/types/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +19 -19
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/types/components/Dialog/DialogBody.d.ts +3 -3
- package/dist/types/components/Dialog/DialogClose.d.ts +3 -3
- package/dist/types/components/Dialog/DialogContent.d.ts +5 -5
- package/dist/types/components/Dialog/DialogDescription.d.ts +3 -3
- package/dist/types/components/Dialog/DialogFooter.d.ts +3 -3
- package/dist/types/components/Dialog/DialogHeader.d.ts +4 -4
- package/dist/types/components/Dialog/DialogTitle.d.ts +3 -3
- package/dist/types/components/Dialog/DialogTrigger.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuContent.d.ts +6 -6
- package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +3 -3
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +3 -3
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +10 -10
- package/dist/types/components/Feedback/Feedback.d.ts +4 -4
- package/dist/types/components/FeedbackList/FeedbackList.d.ts +3 -3
- package/dist/types/components/FeedbackList/FeedbackListContext.d.ts +1 -2
- package/dist/types/components/FeedbackPopover/FeedbackPopover.d.ts +6 -6
- package/dist/types/components/FeedbackPopover/FeedbackPopoverContext.d.ts +1 -2
- package/dist/types/components/Field/Field.d.ts +3 -3
- package/dist/types/components/Field/FieldContext.d.ts +5 -5
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +3 -3
- package/dist/types/components/FieldGroup/FieldGroupBody.d.ts +3 -3
- package/dist/types/components/FieldGroup/FieldGroupContext.d.ts +4 -4
- package/dist/types/components/FieldGroup/FieldGroupHeader.d.ts +6 -6
- package/dist/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -3
- package/dist/types/components/Grid/Grid.d.ts +3 -3
- package/dist/types/components/Heading/Heading.d.ts +3 -3
- package/dist/types/components/HelperText/HelperText.d.ts +3 -3
- package/dist/types/components/Icon/Icon.d.ts +4 -4
- package/dist/types/components/IconButton/IconButton.d.ts +9 -9
- package/dist/types/components/Input/Input.d.ts +14 -14
- package/dist/types/components/Input/InputWithContainerRef.d.ts +4 -4
- package/dist/types/components/Keyboard/Keyboard.d.ts +3 -3
- package/dist/types/components/Label/Label.d.ts +10 -10
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/Link/LinkContext.d.ts +1 -2
- package/dist/types/components/Mark/Mark.d.ts +3 -3
- package/dist/types/components/MenuList/MenuList.d.ts +3 -3
- package/dist/types/components/MenuList/MenuListContext.d.ts +1 -2
- package/dist/types/components/MenuList/MenuListGroup.d.ts +7 -7
- package/dist/types/components/MenuList/MenuListItem.d.ts +13 -13
- package/dist/types/components/NumericInput/NumericInput.d.ts +3 -3
- package/dist/types/components/Output/Output.d.ts +3 -3
- package/dist/types/components/Overlay/Overlay.d.ts +3 -3
- package/dist/types/components/Popover/PopoverClose.d.ts +3 -3
- package/dist/types/components/Popover/PopoverContent.d.ts +5 -5
- package/dist/types/components/Popover/PopoverTrigger.d.ts +3 -3
- package/dist/types/components/Portal/Portal.d.ts +3 -3
- package/dist/types/components/Portal/PortalContext.d.ts +1 -2
- package/dist/types/components/RadioGroup/Radio.d.ts +10 -10
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +10 -10
- package/dist/types/components/Root/Root.d.ts +14 -10
- package/dist/types/components/Root/RootContext.d.ts +1 -2
- package/dist/types/components/Root/RootElement.d.ts +9 -0
- package/dist/types/components/Root/index.d.ts +1 -1
- package/dist/types/components/Select/Option.d.ts +3 -3
- package/dist/types/components/Select/OptionsGroup.d.ts +3 -3
- package/dist/types/components/Select/Select.d.ts +11 -11
- package/dist/types/components/Select/SelectContext.d.ts +6 -6
- package/dist/types/components/Separator/Separator.d.ts +3 -3
- package/dist/types/components/Slot/Slottable.d.ts +3 -3
- package/dist/types/components/Spinner/Spinner.d.ts +3 -3
- package/dist/types/components/Stack/Stack.d.ts +8 -8
- package/dist/types/components/Stepper/Step.d.ts +5 -5
- package/dist/types/components/Stepper/StepContent.d.ts +3 -3
- package/dist/types/components/Stepper/StepList.d.ts +3 -3
- package/dist/types/components/Stepper/Stepper.d.ts +5 -5
- package/dist/types/components/Stepper/StepperContext.d.ts +1 -2
- package/dist/types/components/Table/Table.d.ts +5 -5
- package/dist/types/components/Table/TableBody.d.ts +3 -3
- package/dist/types/components/Table/TableCell.d.ts +4 -4
- package/dist/types/components/Table/TableColumn.d.ts +14 -14
- package/dist/types/components/Table/TableContext.d.ts +4 -5
- package/dist/types/components/Table/TableFoot.d.ts +3 -3
- package/dist/types/components/Table/TableHead.d.ts +4 -4
- package/dist/types/components/Table/TableRow.d.ts +3 -3
- package/dist/types/components/Tabs/Tab.d.ts +4 -4
- package/dist/types/components/Tabs/TabContent.d.ts +3 -3
- package/dist/types/components/Tabs/TabList.d.ts +5 -5
- package/dist/types/components/Tabs/Tabs.d.ts +3 -3
- package/dist/types/components/Tabs/TabsContext.d.ts +1 -2
- package/dist/types/components/Tag/Tag.d.ts +7 -7
- package/dist/types/components/TextArea/TextArea.d.ts +3 -3
- package/dist/types/components/Toast/Toast.d.ts +11 -11
- package/dist/types/components/Toast/ToastProvider.d.ts +2 -2
- package/dist/types/components/Toast/ToastTitle.d.ts +3 -3
- package/dist/types/components/Toast/ToastViewport.d.ts +3 -3
- package/dist/types/components/Tooltip/Tooltip.d.ts +7 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/locales/en-GB.d.ts +3 -0
- package/dist/types/locales/en-US.d.ts +3 -0
- package/dist/types/{locale → locales}/en.d.ts +1 -1
- package/dist/types/locales/fr.d.ts +3 -0
- package/dist/types/locales/index.d.ts +4 -0
- package/dist/types/locales/pt.d.ts +3 -0
- package/dist/types/providers/AlertDialogProvider/AlertDialogProvider.d.ts +2 -2
- package/dist/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +17 -17
- package/dist/types/providers/DocumentTitleProvider/DocumentTitle.d.ts +2 -2
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProvider.d.ts +2 -2
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProviderContext.d.ts +2 -3
- package/dist/types/providers/ErrorReportingProvider/ErrorReport.d.ts +2 -2
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingContext.d.ts +3 -3
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +2 -2
- package/dist/types/providers/ErrorReportingProvider/useErrorReporter.d.ts +1 -2
- package/dist/types/providers/LocalizationProvider/LocalizationContext.d.ts +6 -4
- package/dist/types/{locale → providers/LocalizationProvider}/LocalizationObject.d.ts +18 -18
- package/dist/types/providers/LocalizationProvider/LocalizationProvider.d.ts +13 -5
- package/dist/types/providers/LocalizationProvider/index.d.ts +1 -0
- package/dist/types/providers/LocalizationProvider/useLocale.d.ts +6 -3
- package/dist/types/providers/PrefixProvider/PrefixContext.d.ts +1 -4
- package/dist/types/providers/PrefixProvider/PrefixProvider.d.ts +3 -3
- package/dist/types/providers/PrefixProvider/defaultPrefix.d.ts +12 -0
- package/dist/types/providers/PrefixProvider/index.d.ts +1 -0
- package/dist/types/providers/PrefixProvider/usePrefix.d.ts +1 -1
- package/dist/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +7 -7
- package/dist/types/providers/ToastManagerProvider/ToastManagerProvider.d.ts +2 -2
- package/dist/types/utils/control.d.ts +1 -2
- package/dist/types/utils/useCombinedRef.d.ts +2 -2
- package/dist/types/utils/useControllableState.d.ts +2 -2
- package/dist/types/utils/useLayoutEffect.d.ts +2 -2
- package/package.json +20 -4
- package/dist/ostack-ui.cjs +0 -11095
- package/dist/ostack-ui.cjs.map +0 -1
- package/dist/types/locale/defaultLocale.d.ts +0 -3
- package/dist/types/locale/en-GB.d.ts +0 -3
- package/dist/types/locale/en-US.d.ts +0 -3
- package/dist/types/locale/fr-FR.d.ts +0 -3
- package/dist/types/locale/index.d.ts +0 -6
- package/dist/types/locale/pt-PT.d.ts +0 -3
package/dist/ostack-ui.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ostack-ui.cjs","sources":["../src/locale/pt-PT.tsx","../src/locale/defaultLocale.ts","../src/providers/LocalizationProvider/LocalizationContext.ts","../src/providers/LocalizationProvider/LocalizationProvider.tsx","../src/providers/LocalizationProvider/useLocale.ts","../src/providers/PrefixProvider/PrefixContext.ts","../src/providers/PrefixProvider/PrefixProvider.tsx","../src/providers/PrefixProvider/usePrefix.ts","../src/utils/useControllableState.ts","../src/utils/boolDataAttr.ts","../src/utils/cx.ts","../src/components/Icon/Icon.tsx","../src/components/Slot/Slot.tsx","../src/components/Slot/Slottable.tsx","../src/components/Spinner/Spinner.tsx","../src/components/Button/Button.tsx","../src/utils/promiseUtils.ts","../src/utils/sorting.ts","../src/utils/useConstant.ts","../src/utils/useLatestValues.ts","../src/utils/zustandUtils.ts","../src/utils/control.ts","../src/utils/mergeAriaIds.ts","../src/utils/useCombinedRef.ts","../src/utils/useScrollPosition.ts","../src/components/Field/FieldContext.ts","../src/components/Field/Field.tsx","../src/components/Table/TableContext.ts","../src/components/Table/Table.tsx","../src/components/Table/TableBody.tsx","../src/utils/useCssVars.ts","../src/components/Table/TableCell.tsx","../src/components/Popover/Popover.tsx","../src/components/Popover/PopoverAnchor.tsx","../src/components/Popover/PopoverClose.tsx","../src/components/Portal/PortalContext.ts","../src/components/Portal/Portal.tsx","../src/components/Popover/PopoverContent.tsx","../src/components/Popover/PopoverTrigger.tsx","../src/utils/useMediaQuery.ts","../src/utils/breakpoints.ts","../src/utils/changeCase.ts","../src/utils/useResponsiveValues.ts","../src/utils/useSpacing.ts","../src/components/Stack/Stack.tsx","../src/components/Table/TableColumn.tsx","../src/components/Table/TableFoot.tsx","../src/utils/combineEventHandlers.ts","../src/components/VisuallyHidden/VisuallyHidden.tsx","../src/components/Table/TableRow.tsx","../src/components/Table/TableHead.tsx","../src/components/DataTable/DataTableApi.ts","../src/components/DataTable/DataTableCell.tsx","../src/utils/filtering.ts","../src/components/Mark/Mark.tsx","../src/components/DataTable/getRowKey.ts","../src/components/CheckboxGroup/CheckboxGroupContext.ts","../src/components/ControlCode/ControlCode.tsx","../src/utils/useScrollbarSize.ts","../src/components/DataTable/DataTableEmptyOrLoadingRows.tsx","../src/components/DataTable/PagedDataTableRows.tsx","../src/components/DataTable/ScrolledDataTableRows.tsx","../src/components/DataTable/DataTableBody.tsx","../src/utils/useLayoutEffect.ts","../src/utils/useMeasure.ts","../src/components/DataTable/DataTableFoot.tsx","../src/components/DataTable/DataTableHead.tsx","../src/components/DataTable/DataTableContent.tsx","../src/components/ControlAddon/ControlAddon.tsx","../src/utils/setNativeValue.ts","../src/components/CloseButton/CloseButton.tsx","../src/components/Input/Input.tsx","../src/components/Input/InputWithContainerRef.tsx","../src/components/DataTable/DataTableFilter.tsx","../src/components/MenuList/MenuListContext.ts","../src/components/MenuList/MenuList.tsx","../src/components/MenuList/MenuListItem.tsx","../src/components/CommandMenu/CommandMenu.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Card/Card.tsx","../src/components/Card/CardBody.tsx","../src/components/Card/CardFooter.tsx","../src/components/Card/CardHeader.tsx","../src/components/Heading/Heading.tsx","../src/components/Card/CardTitle.tsx","../src/components/Dialog/DialogBody.tsx","../src/components/Dialog/DialogClose.tsx","../src/components/Overlay/Overlay.tsx","../src/components/Dialog/DialogContent.tsx","../src/components/Dialog/DialogDescription.tsx","../src/components/Dialog/DialogFooter.tsx","../src/components/Dialog/DialogHeader.tsx","../src/components/Dialog/DialogTitle.tsx","../src/components/Dialog/DialogTrigger.tsx","../src/components/CommandMenu/CommandMenuDialog.tsx","../src/components/CommandMenu/CommandMenuGroup.tsx","../src/components/CommandMenu/CommandMenuItem.tsx","../src/components/Collapsible/CollapsibleContext.ts","../src/components/Collapsible/Collapsible.tsx","../src/components/Collapsible/CollapsibleContent.tsx","../src/components/Collapsible/CollapsibleTrigger.tsx","../src/components/Tag/Tag.tsx","../src/components/Tag/Badge.ts","../src/components/Select/SelectMultipleValue.tsx","../src/components/Select/SelectSingleValue.tsx","../src/components/Select/Select.tsx","../src/components/Select/SelectContext.ts","../src/components/Select/Option.tsx","../src/components/Select/OptionsGroup.tsx","../src/components/DataTable/PagedDataTablePagination.tsx","../src/components/DataTable/ScrolledDataTablePagination.tsx","../src/components/DataTable/DataTablePagination.tsx","../src/components/DataTable/DataTableRowsPerPage.tsx","../src/components/DataTable/DataTableSelectionTrigger.tsx","../src/utils/nativeControls.ts","../src/components/Label/Label.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/DataTable/useDataTableSelectionColumn.tsx","../src/components/DataTable/DataTableRow.tsx","../src/components/DataTable/DataTable.tsx","../src/components/DataTable/spliceWindow.ts","../src/components/DataTable/transformRows.ts","../src/components/DataTable/DataTableContext.ts","../src/components/Link/Link.tsx","../src/components/Link/LinkContext.ts","../src/components/ClearContexts/ClearContexts.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Tooltip/TooltipProvider.tsx","../src/components/IconButton/IconButton.tsx","../src/components/Calendar/CalendarContext.ts","../src/components/Calendar/CalendarDay.tsx","../src/components/Calendar/CalendarMonthCaption.tsx","../src/components/Calendar/Calendar.tsx","../src/utils/parseDateStrict.ts","../src/utils/useDateTransformer.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/DateInput/DateInput.tsx","../src/components/DateRangePicker/DateRangePicker.tsx","../src/components/DateRangeInput/DateRangeInput.tsx","../src/utils/stringHash.ts","../src/providers/ErrorReportingProvider/ErrorReport.ts","../src/providers/ErrorReportingProvider/ErrorReportingContext.ts","../src/providers/ErrorReportingProvider/ErrorReportingProvider.tsx","../src/providers/ErrorReportingProvider/useErrorReporter.ts","../src/components/Alert/Alert.tsx","../src/components/Alert/AlertTitle.tsx","../src/components/Code/Code.tsx","../src/components/ErrorBoundary/ErrorBoundary.tsx","../src/components/FeedbackList/FeedbackListContext.ts","../src/components/FeedbackList/FeedbackList.tsx","../src/components/FeedbackPopover/FeedbackPopoverContext.ts","../src/components/FeedbackPopover/FeedbackPopover.tsx","../src/components/Feedback/Feedback.tsx","../src/components/FieldGroup/FieldGroupContext.ts","../src/components/FieldGroup/FieldGroup.tsx","../src/components/FieldGroup/FieldGroupBody.tsx","../src/components/FieldGroup/FieldGroupHeader.tsx","../src/components/FieldGroup/FieldGroupTitle.tsx","../src/utils/numericStringUtils.ts","../src/utils/useNumericTransformer.tsx","../src/components/NumericInput/NumericInput.tsx","../src/components/Toast/Toast.tsx","../src/components/Toast/ToastDescription.tsx","../src/components/Toast/ToastProvider.tsx","../src/components/Toast/ToastTitle.tsx","../src/components/Toast/ToastViewport.tsx","../src/components/AlertDialog/AlertDialog.tsx","../src/components/AlertDialog/AlertDialogAction.tsx","../src/components/AlertDialog/AlertDialogBody.tsx","../src/components/AlertDialog/AlertDialogCancel.tsx","../src/components/AlertDialog/AlertDialogContent.tsx","../src/components/AlertDialog/AlertDialogDescription.tsx","../src/components/AlertDialog/AlertDialogFooter.tsx","../src/components/AlertDialog/AlertDialogHeader.tsx","../src/components/AlertDialog/AlertDialogTitle.tsx","../src/components/AlertDialog/AlertDialogTrigger.tsx","../src/providers/AlertDialogProvider/AlertDialogProviderContext.ts","../src/providers/AlertDialogProvider/AlertDialogProvider.tsx","../src/providers/AlertDialogProvider/useAlertDialog.tsx","../src/locale/en.tsx","../src/locale/en-GB.ts","../src/locale/en-US.ts","../src/locale/fr-FR.tsx","../src/providers/DocumentTitleProvider/DocumentTitleProviderContext.ts","../src/providers/DocumentTitleProvider/DocumentTitle.tsx","../src/providers/DocumentTitleProvider/DocumentTitleProvider.tsx","../src/providers/ToastManagerProvider/ToastManagerContext.ts","../src/providers/ToastManagerProvider/ToastManagerProvider.tsx","../src/providers/ToastManagerProvider/useToastManager.ts","../src/utils/warnOnce.ts","../src/components/Root/RootContext.ts","../src/components/Root/Root.tsx","../src/components/ButtonGroup/ButtonGroup.tsx","../src/components/CheckboxGroup/CheckboxGroup.tsx","../src/components/Container/Container.tsx","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx","../src/components/DropdownMenu/DropdownMenuContent.tsx","../src/components/MenuList/MenuListGroup.tsx","../src/components/DropdownMenu/DropdownMenuGroup.tsx","../src/components/DropdownMenu/DropdownMenuItem.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup.tsx","../src/components/DropdownMenu/DropdownMenuRadioItem.tsx","../src/components/DropdownMenu/DropdownMenuSub.tsx","../src/components/DropdownMenu/DropdownMenuSubContent.tsx","../src/components/DropdownMenu/DropdownMenuSubTrigger.tsx","../src/components/DropdownMenu/DropdownMenuTrigger.tsx","../src/components/Grid/Grid.tsx","../src/components/HelperText/HelperText.tsx","../src/components/Keyboard/Keyboard.tsx","../src/components/Output/Output.tsx","../src/components/RadioGroup/Radio.tsx","../src/components/RadioGroup/RadioGroup.tsx","../src/components/Separator/Separator.tsx","../src/components/Stepper/StepperContext.ts","../src/components/Stepper/Step.tsx","../src/components/Stepper/StepContent.tsx","../src/components/Stepper/StepList.tsx","../src/components/Stepper/Stepper.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Tabs/TabsContext.ts","../src/components/Tabs/Tab.tsx","../src/components/Tabs/TabContent.tsx","../src/components/Tabs/TabList.tsx","../src/components/TextArea/TextArea.tsx","../src/utils/keyboardShortcut.ts","../src/utils/useIntersectionObserver.ts"],"sourcesContent":["import { pt as dateFnsPt } from \"date-fns/locale\";\n\nimport { type LocalizationObject } from \"./LocalizationObject.ts\";\n\n/** `pt-PT` locale. */\nexport const ptPT: LocalizationObject = {\n languageTag: \"pt-PT\",\n dateFnsLocale: dateFnsPt,\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n previousMonthLabel: \"Mês anterior\",\n nextMonthLabel: \"Próximo mês\",\n },\n CloseButton: {\n \"aria-label\": \"Fechar\",\n },\n CommandMenu: {\n searchPlaceholder: \"Pesquisar…\",\n listLabel: \"Sugestões\",\n loadingLabel: \"A carregar…\",\n emptyMessage: \"Nenhum resultado encontrado.\",\n },\n CommandMenuDialog: {\n title: \"Paleta de comandos\",\n description: \"Pesquise por um comando…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancelar\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Campo\",\n },\n DataTable: {\n emptyMessage: \"Nada a mostrar.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Filtro da tabela\",\n placeholder: \"Filtrar\",\n },\n DataTablePagination: {\n rowsRange: (range, total) => (\n <>\n Linhas {range} de {total}\n </>\n ),\n previousPageButtonLabel: \"Página anterior\",\n nextPageButtonLabel: \"Próxima página\",\n },\n DataTableRowsPerPage: {\n label: \"Linhas por página\",\n },\n DateInput: {\n placeholder: \"dia/mês/ano\",\n formatDescription: \"Introduza a data no formato DD/MM/AAAA\",\n calendarButtonLabel: (selectedDate, editable) =>\n editable\n ? selectedDate\n ? `Abrir calendário para alterar data selecionada: ${selectedDate}`\n : \"Abrir calendário para selecionar data\"\n : selectedDate\n ? `Abrir calendário com data selecionada: ${selectedDate}`\n : \"Abrir calendário sem data selecionada\",\n },\n DateRangeInput: {\n startInputLabel: \"Data de início\",\n endInputLabel: \"Data de fim\",\n calendarButtonLabel: (selectedDateRange, editable) =>\n editable\n ? selectedDateRange\n ? `Abrir calendário para alterar intervalo de datas selecionado: ${selectedDateRange}`\n : \"Abrir calendário para selecionar intervalo de datas\"\n : selectedDateRange\n ? `Abrir calendário com intervalo de datas selecionado: ${selectedDateRange}`\n : \"Abrir calendário sem intervalo de datas selecionado\",\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Algo correu mal.\n <br />\n Pressione o botão à direita para tentar novamente. Se o problema\n persistir, volte a tentar mais tarde.\n </>\n ),\n resetButtonLabel: \"Tentar novamente\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\" ? \"Erro:\" : type === \"warning\" ? \"Alerta:\" : null,\n },\n FeedbackPopover: {\n label: \"Mostrar observações\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Grupo\",\n },\n Input: {\n clearButtonLabel: \"Limpar\",\n },\n Label: {\n requiredIconLabel: \"Requerido\",\n helperButtonLabel: \"Mostrar ajuda\",\n },\n NumericInput: {\n decimalSeparator: \",\",\n groupingStyle: \"thousand\",\n groupSeparator: \"\\u00A0\",\n },\n Select: {\n optionsLabel: \"Opções\",\n },\n TableColumn: {\n helperButtonLabel: \"Mostrar ajuda\",\n },\n TableHead: {\n sortByColumnDescription: (columnName, sortDirection) =>\n sortDirection === null\n ? `Deixar de ordenar tabela pela coluna “${columnName}”`\n : `Ordenar tabela pela coluna “${columnName}” em ordem ${\n sortDirection === \"asc\" ? \"ascendente\" : \"descendente\"\n }`,\n },\n ToastProvider: {\n label: \"Notificação\",\n },\n ToastViewport: {\n label: \"Notificações ({hotkey})\",\n },\n};\n","import { type LocalizationObject } from \"./LocalizationObject.ts\";\nimport { ptPT } from \"./pt-PT.tsx\";\n\n/** Default locale. */\nexport const defaultLocale: LocalizationObject = ptPT;\n","import * as React from \"react\";\n\nimport { defaultLocale } from \"../../locale/defaultLocale.ts\";\nimport { type LocalizationObject } from \"../../locale/LocalizationObject.ts\";\n\n/** Value of the localisation context. */\nexport type LocalizationContextValue = LocalizationObject;\n\n/** Localisation context. */\nexport const LocalizationContext =\n React.createContext<LocalizationContextValue>(defaultLocale);\n","import * as React from \"react\";\n\nimport { type LocalizationObject } from \"../../locale/LocalizationObject.ts\";\nimport { LocalizationContext } from \"./LocalizationContext.ts\";\n\n/** Properties of the localisation provider. */\nexport interface LocalizationProviderProps {\n /** Locale to use for the components. */\n locale?: LocalizationObject;\n children: React.ReactNode;\n}\n\n/** Localisation provider. */\nexport function LocalizationProvider({\n locale,\n children,\n}: LocalizationProviderProps) {\n return locale === undefined ? (\n children\n ) : (\n <LocalizationContext.Provider value={locale}>\n {children}\n </LocalizationContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport { type LocalizationObject } from \"../../locale/LocalizationObject.ts\";\nimport { LocalizationContext } from \"./LocalizationContext.ts\";\n\n/** Hook used to get the current locale. */\nexport function useLocale(): LocalizationObject {\n return React.useContext(LocalizationContext);\n}\n","import * as React from \"react\";\n\n/** Default library prefix. */\nexport const DEFAULT_PREFIX = \"o-ui-\";\n\n/** Prefix context. */\nexport const PrefixContext = React.createContext<string>(DEFAULT_PREFIX);\n","import * as React from \"react\";\n\nimport { PrefixContext } from \"./PrefixContext.ts\";\n\n/** Properties of the prefix provider. */\nexport interface PrefixProviderProps {\n /** Prefix to use. */\n prefix?: string;\n children: React.ReactNode;\n}\n\n/** Prefix provider. */\nexport function PrefixProvider({ prefix, children }: PrefixProviderProps) {\n return prefix === undefined ? (\n children\n ) : (\n <PrefixContext.Provider value={prefix}>{children}</PrefixContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport { PrefixContext } from \"./PrefixContext.ts\";\n\n/**\n * Function which prefixes the provided `toPrefix` string. If no argument is\n * provided, the prefix is returned as-is.\n */\nexport type PrefixFn = (toPrefix: string) => string;\n\n/**\n * Hook which returns a function which can be used to prefix a string with the\n * current prefix.\n */\nexport function usePrefix(): PrefixFn {\n const prefix = React.useContext(PrefixContext);\n return React.useCallback(\n (toPrefix: string) => `${prefix}${toPrefix}`,\n [prefix],\n );\n}\n","import * as React from \"react\";\n\n/** Helper hook to handle controlled or uncontrolled values. */\nexport function useControllableState<T>(\n initialValue: T | (() => T),\n controlledValue: T | undefined,\n): [T, React.Dispatch<React.SetStateAction<T>>] {\n const [uncontrolledValue, setUncontrolledValue] =\n React.useState(initialValue);\n const isControlled = controlledValue !== undefined;\n\n const setValue = React.useCallback(\n (nextValue: React.SetStateAction<T>) =>\n isControlled\n ? typeof nextValue === \"function\"\n ? setUncontrolledValue(\n (nextValue as (prevValue: T) => T)(controlledValue),\n )\n : setUncontrolledValue(controlledValue)\n : setUncontrolledValue(nextValue),\n [controlledValue, isControlled],\n );\n\n return [isControlled ? controlledValue : uncontrolledValue, setValue];\n}\n","/** Value for a data attribute given a condition. */\nexport function boolDataAttr(\n condition: boolean | null | undefined,\n): string | undefined {\n return condition ? \"\" : undefined;\n}\n\n/** Sets the provided data attribute on the provided element given a condition. */\nexport function setBoolDataAttr(\n element: HTMLElement | null,\n attr: string,\n condition: boolean | null | undefined,\n) {\n if (element == null) {\n return;\n }\n\n if (condition) {\n element.dataset[attr] = \"\";\n } else {\n delete element.dataset[attr];\n }\n}\n","/**\n * Utility function used to join class names together.\n *\n * @example\n *\n * ```typescript\n * cx(\"foo\", \"bar\", [false, \"baz\"]); // \"foo bar baz\"\n * cx({ foo: true, bar: false }, \"baz\"); // \"foo baz\"\n * ```\n *\n * @param args Class arguments to join.\n * @returns Joined class names.\n */\nexport function cx(...args: unknown[]): string | undefined {\n const classNames: string[] = [];\n for (const arg of args) {\n if (!arg) {\n continue;\n }\n if (Array.isArray(arg)) {\n const innerClassNames = cx(...arg);\n if (innerClassNames) {\n classNames.push(innerClassNames);\n }\n } else if (\n typeof arg === \"object\" &&\n arg.toString === Object.prototype.toString\n ) {\n for (const className of Object.keys(arg)) {\n if ((arg as Record<string, unknown>)[className]) {\n classNames.push(className);\n }\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n classNames.push(String(arg));\n }\n }\n return classNames.join(\" \") || undefined;\n}\n","import type { FlipProp, IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { AccessibleIcon as AccessibleIconPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\n\nexport type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\n\n/** Possible sizes of an icon. */\nexport type IconSize =\n | \"3xs\"\n | \"2xs\"\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"5xl\"\n | \"6xl\"\n | \"7xl\"\n | \"8xl\"\n | \"9xl\";\n\n/** Possible colours of an icon. */\nexport type IconColor = AccentColor;\n\n/** Properties of the icon component. */\nexport interface IconProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof FontAwesomeIcon>,\n \"icon\" | \"size\" | \"flip\"\n > {\n /** Icon to display. */\n icon: IconProp;\n /**\n * Size of the icon. By default, the icon will be sized according to the\n * current font size.\n */\n size?: IconSize;\n /**\n * Colour of the icon. By default, the icon will have the current font's\n * colour.\n */\n color?: IconColor;\n /**\n * Optional accessible label for the icon.\n *\n * When provided, a visually hidden label is added so that assistive\n * technologies correctly announce it.\n */\n label?: string;\n // FIXME: Upstream bug, `flip` can be a boolean (animated the icon), but that\n // isn't supported in the types.\n flip?: boolean | FlipProp;\n}\n\n/**\n * Icon component extending the FontAwesome's `FontAwesomeIcon` component.\n *\n * Properties supported by FontAwesome are also supported by this component. For\n * more information on all supported properties, see [FontAwesome's React\n * documentation](https://docs.fontawesome.com/v5/web/use-with/react).\n *\n * For a list of existing icons, consult:\n * https://fontawesome.com/search?ic=free.\n *\n * For tree-shaking purposes, we recommend importing icons individually from\n * their respective FontAwesome module.\n *\n * Example usage:\n *\n * ```tsx\n * import { faCat } from \"@fortawesome/free-solid-svg-icons\";\n * import { Icon } from \"@ostack.tech/ui\";\n *\n * function CatIcon() {\n * return <Icon icon={faCat} />;\n * }\n * ```\n */\nexport const Icon = React.memo(\n React.forwardRef<React.ComponentRef<typeof FontAwesomeIcon>, IconProps>(\n function Icon(\n { size, color, label, flip, className, ...otherProps },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const icon = (\n <FontAwesomeIcon\n className={cx(\n prefix(\"icon\"),\n size && prefix(`icon--${size}`),\n className,\n )}\n data-accent={color}\n flip={flip as never}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n\n return label ? (\n <AccessibleIconPrimitive.Root label={label}>\n {icon}\n </AccessibleIconPrimitive.Root>\n ) : (\n icon\n );\n },\n ),\n);\n","import { Slot as SlotPrimitive } from \"radix-ui\";\n\n/**\n * Component that merges its props onto its immediate child.\n *\n * Used to support components with an `asChild` property.\n */\nexport const Slot = SlotPrimitive.Root;\n","import { Slot as SlotPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\n/** Properties of the `Slottable` component. */\nexport interface SlottableProps {\n children?: React.ReactNode;\n}\n\n/**\n * Component that can be used a child of `Slot`, where the content shall be\n * rendered.\n */\nexport const Slottable =\n SlotPrimitive.Slottable as React.ComponentType<SlottableProps>;\n","import { AccessibleIcon as AccessibleIconPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Possible sizes of the spinner. */\nexport type SpinnerSize =\n | \"3xs\"\n | \"2xs\"\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"5xl\"\n | \"6xl\"\n | \"7xl\"\n | \"8xl\"\n | \"9xl\";\n\n/** Possible colours of the spinner. */\nexport type SpinnerColor = AccentColor;\n\n/** Properties of the spinner component. */\nexport interface SpinnerProps extends React.ComponentPropsWithoutRef<\"span\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Size of the spinner. By default, the spinner will be sized according to the\n * current font size.\n */\n size?: SpinnerSize;\n /**\n * Colour of the spinner. By default, the spinner will have the current font's\n * colour.\n */\n color?: SpinnerColor;\n /**\n * Optional accessible label for the spinner.\n *\n * When provided, a visually hidden label is added so that assistive\n * technologies correctly announce it.\n */\n label?: string;\n}\n\n/**\n * The spinner component provides a visual cue that an action is currently being\n * processed.\n *\n * Example usage:\n *\n * ```tsx\n * import { Spinner } from \"@ostack.tech/ui\";\n *\n * function Loading() {\n * return <Spinner />;\n * }\n * ```\n */\nexport const Spinner = React.forwardRef<\n React.ComponentRef<\"span\">,\n SpinnerProps\n>(function Spinner(\n { asChild, size, color, label, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"span\";\n const spinner = (\n <As\n className={cx(\n prefix(\"spinner\"),\n size && prefix(`spinner--${size}`),\n className,\n )}\n data-accent={color}\n role=\"status\"\n aria-hidden=\"true\"\n ref={forwardedRef}\n {...otherProps}\n />\n );\n return label ? (\n <AccessibleIconPrimitive.Root label={label}>\n {spinner}\n </AccessibleIconPrimitive.Root>\n ) : (\n spinner\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { Slot, Slottable } from \"../Slot\";\nimport { Spinner } from \"../Spinner\";\n\n/** Button variants. */\nexport type ButtonVariant = \"solid\" | \"subtle\" | \"outlined\" | \"ghost\";\n\n/** Button colours. */\nexport type ButtonColor = AccentColor;\n\n/** Button sizes. */\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Button's icon placement. */\nexport type ButtonIconPlacement = \"start\" | \"end\";\n\n/** Properties of the button component. */\nexport interface ButtonProps extends React.ComponentPropsWithoutRef<\"button\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Button's variant.\n *\n * @default solid\n */\n variant?: ButtonVariant;\n /**\n * Button's colour.\n *\n * @default neutral\n */\n color?: ButtonColor;\n /**\n * Size of the button.\n *\n * @default md\n */\n size?: ButtonSize;\n /**\n * Whether to display the button content vertically. This property should only\n * be set when an icon is also specified.\n *\n * @default false\n */\n vertical?: boolean;\n /**\n * Font Awesome icon to show within the button. The position of the icon may\n * be controlled via `iconPlacement`.\n *\n * @default null\n */\n icon?: IconProp | React.ReactElement | null;\n /**\n * Whether to display the icon at the start or end of the button. This\n * property also affects the placement of the spinner.\n *\n * @default start\n */\n iconPlacement?: ButtonIconPlacement;\n /**\n * Whether to display the button in \"active\" state.\n *\n * @default false\n */\n active?: boolean;\n /**\n * Whether to disable the button.\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Whether to display the button in \"loading\" state by presenting a spinner as\n * icon. The position of the spinner may be controlled via `iconPlacement`.\n *\n * Setting this property will automatically disable the button.\n *\n * @default false\n */\n loading?: boolean;\n /**\n * Whether the button should be enabled when `loading` is `true`.\n *\n * @default false\n */\n enabledWhenLoading?: boolean;\n /**\n * Content of the button when it is in \"loading\" state. If not provided, the\n * button content will remain unchanged.\n */\n loadingContent?: React.ReactNode;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the spinner component. */\n spinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;\n}\n\n/**\n * The button component is used to trigger actions or events, such as opening a\n * dialog or submitting a form.\n *\n * Example usage:\n *\n * ```tsx\n * import { Button } from \"@ostack.tech/ui\";\n *\n * function Launch() {\n * return <Button onClick={launchRocket}>Launch rocket</Button>;\n * }\n * ```\n */\nexport const Button = React.forwardRef<\n React.ComponentRef<\"button\">,\n ButtonProps\n>(function Button(\n {\n asChild,\n variant = \"solid\",\n color = \"neutral\",\n size = \"md\",\n vertical,\n icon = null,\n iconPlacement = \"start\",\n active,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n iconProps,\n spinnerProps,\n type,\n onClick,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const iconEl = React.useMemo(\n () =>\n icon && (\n <Slot\n className={cx(\n prefix(\"button__icon\"),\n prefix(`button__icon--${iconPlacement}`),\n iconProps?.className,\n )}\n >\n {React.isValidElement(icon) ? (\n icon\n ) : (\n <Icon icon={icon} {...iconProps} />\n )}\n </Slot>\n ),\n [icon, iconPlacement, iconProps, prefix],\n );\n const spinnerEl = React.useMemo(\n () => (\n <Spinner\n {...spinnerProps}\n className={cx(\n prefix(\"button__spinner\"),\n prefix(`button__spinner--${iconPlacement}`),\n spinnerProps?.className,\n )}\n />\n ),\n [iconPlacement, prefix, spinnerProps],\n );\n\n const content =\n loading && loadingContent\n ? asChild\n ? React.cloneElement(\n children as React.ReactElement,\n undefined,\n loadingContent,\n )\n : loadingContent\n : children;\n\n const handleClick = React.useCallback(\n (evt: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) {\n return evt.preventDefault();\n }\n return onClick?.(evt);\n },\n [disabled, onClick],\n );\n\n const shouldDisable = disabled || (loading && !enabledWhenLoading);\n const As = asChild ? Slot : \"button\";\n return (\n <As\n type={!asChild && !type ? \"button\" : type}\n className={cx(\n prefix(\"button\"),\n prefix(`button--${variant}`),\n prefix(`button--${size}`),\n vertical && prefix(\"button--vertical\"),\n className,\n )}\n onClick={handleClick}\n data-accent={color}\n disabled={shouldDisable}\n // Elements such as links don't support `disabled`\n data-disabled={boolDataAttr(asChild && shouldDisable)}\n aria-disabled={asChild && shouldDisable ? \"true\" : undefined}\n data-active={boolDataAttr(active)}\n // Prevent focus when disabled (and `asChild` is set)\n tabIndex={asChild && shouldDisable ? -1 : undefined}\n ref={forwardedRef}\n {...otherProps}\n >\n {loading && iconPlacement === \"start\" && spinnerEl}\n {!loading && iconPlacement === \"start\" && iconEl}\n <Slottable>{content}</Slottable>\n {!loading && iconPlacement === \"end\" && iconEl}\n {loading && iconPlacement === \"end\" && spinnerEl}\n </As>\n );\n});\n","/**\n * Whether a given value is [promise-like]{@link PromiseLike}.\n *\n * @param value Value to check if it is promise-like.\n * @returns Whether the provided value is like a promise.\n */\nexport function isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof (value as any)?.then === \"function\";\n}\n","import { isDate, isValid } from \"date-fns\";\n\n/** Sort direction (ascending or descending). */\nexport type SortDirection = \"asc\" | \"desc\";\n\n/** Stable sort implementation. */\nexport function stableSort<T>(\n array: T[],\n comparator: (v1: T, v2: T, i1: number, i2: number) => number = compare,\n sortDirection: SortDirection = \"asc\",\n) {\n const orderSign = sortDirection === \"asc\" ? 1 : -1;\n const arrayWithIndex = array.map((el, idx) => [el, idx] as [T, number]);\n arrayWithIndex.sort(\n (a, b) => (comparator(a[0], b[0], a[1], b[1]) || a[1] - b[1]) * orderSign,\n );\n return arrayWithIndex.map((el) => el[0]);\n}\n\n/**\n * Comparison function allowing comparison of values of multiple types,\n * including all primitive types, as well as dates.\n */\nexport function compare<T>(v1: T, v2: T): number {\n const t1 = customTypeOf(v1);\n const t2 = customTypeOf(v2);\n\n // Sort values of different types according to the order in `customTypes`\n // array\n if (t1 !== t2) {\n return customTypes.indexOf(t1) - customTypes.indexOf(t2);\n }\n // `undefined`/`null`\n if (t1 === \"null\") {\n return 0;\n }\n if (t1 === \"boolean\") {\n return +v1 - +v2;\n }\n if (t1 === \"numeric\") {\n // Order `NaN` before other numbers\n const v1IsNaN = Number.isNaN(v1);\n const v2IsNaN = Number.isNaN(v2);\n if (v1IsNaN || v2IsNaN) {\n return +v2IsNaN - +v1IsNaN;\n }\n // Compares numbers and bigints\n return v1 > v2 ? 1 : v1 < v2 ? -1 : 0;\n }\n if (t1 === \"date\") {\n // Order `Invalid Date`s before other dates\n const v1IsInvalid = !isValid(v1);\n const v2IsInvalid = !isValid(v2);\n if (v1IsInvalid || v2IsInvalid) {\n return +v2IsInvalid - +v1IsInvalid;\n }\n return +v1 - +v2;\n }\n return String(v1).localeCompare(String(v2));\n}\n\n// Supported \"custom\" types by the `compare` function.\nconst customTypes = [\n \"null\", // `null`/`undefined`\n \"boolean\",\n \"numeric\", // `number`/`bigint`\n \"date\", // `Date`\n \"string\",\n \"other\", // `object`, `function`, etc.\n] as const;\n\nfunction customTypeOf(value: unknown): (typeof customTypes)[number] {\n if (value == null) {\n return \"null\";\n }\n const t = typeof value;\n if (t === \"boolean\" || t === \"string\") {\n return t;\n }\n if (t === \"number\" || t === \"bigint\") {\n return \"numeric\";\n }\n if (isDate(value)) {\n return \"date\";\n }\n return \"other\";\n}\n","import * as React from \"react\";\n\n/**\n * Hook for creating a value exactly once.\n *\n * @param fn Function which created the value to return.\n * @returns Value created on the first render of the hook.\n */\nexport function useConstant<T>(fn: () => T): T {\n const ref = React.useRef<{ value: T }>(null);\n ref.current ??= { value: fn() };\n return ref.current.value;\n}\n","import * as React from \"react\";\n\n/**\n * Hook providing a stable identity object containing the latest values. These\n * values should **not** be accessed during render time.\n *\n * @param values Object containing all values.\n * @returns Stable identity object containing said values.\n */\nexport function useLatestValues<T extends Record<keyof T, unknown>>(\n values: T,\n): T {\n const valuesRef = React.useRef<T>({} as T);\n // eslint-disable-next-line react-hooks/refs\n Object.assign(valuesRef.current, values);\n // eslint-disable-next-line react-hooks/refs\n return valuesRef.current;\n}\n","import { createStore } from \"zustand\";\nimport { shallow } from \"zustand/shallow\";\n\n/** Empty Zustand store. */\n\nexport const EMPTY_STORE = createStore<any>(() => ({}));\n\n/** Function used within a Zustand store to hold computed state. */\nexport function computed<\n const TDeps extends readonly unknown[] = unknown[],\n TResult = unknown,\n>(depsFn: () => TDeps, computeFn: (...deps: TDeps) => TResult): () => TResult {\n let prevDeps: TDeps;\n let cachedResult: TResult;\n return () => {\n const deps = depsFn();\n if (prevDeps === undefined || !shallow(prevDeps, deps)) {\n prevDeps = deps;\n cachedResult = computeFn(...deps);\n }\n return cachedResult;\n };\n}\n","import * as React from \"react\";\n\nimport { type AccentColor } from \"./accent.ts\";\n\n/** Possible status of a control. */\nexport type ControlStatus = \"valid\" | \"invalid\" | \"warned\";\n\n/**\n * Style variants of a control.\n *\n * The `cell` variant should be used to display controls within table cells.\n */\nexport type ControlVariant = \"default\" | \"cell\";\n\n/** Value of the control context. */\nexport interface ControlContextValue {\n variant?: ControlVariant;\n status?: ControlStatus;\n disabled?: boolean;\n readOnly?: boolean;\n}\n\n/** Control context. */\nexport const ControlContext = React.createContext<ControlContextValue | null>(\n null,\n);\n\n/** Hook providing access to the control context. */\nexport function useControlContext(): ControlContextValue | null {\n return React.useContext(ControlContext);\n}\n\n/** Transforms a control status into a colour accent. */\nexport function controlStatusToAccent(\n status?: ControlStatus,\n defaultAccent?: AccentColor,\n): AccentColor | undefined {\n switch (status) {\n case \"valid\":\n return \"success\";\n case \"invalid\":\n return \"danger\";\n case \"warned\":\n return \"warning\";\n default:\n return defaultAccent;\n }\n}\n","/** Merges `aria` identifiers for usage in, for example, `aria-describedby`. */\nexport function mergeAriaIds(...args: unknown[]): string | undefined {\n const ids: string[] = [];\n for (const arg of args) {\n if (!arg) {\n continue;\n }\n if (Array.isArray(arg)) {\n const innerIds = mergeAriaIds(...arg);\n if (innerIds) {\n args.push(innerIds);\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n ids.push(String(arg));\n }\n }\n return ids.join(\" \") || undefined;\n}\n","import * as React from \"react\";\n\ntype Ref<T> = NonNullable<React.Ref<T>>;\ntype Cleanups<T> = Map<React.RefCallback<T>, () => void>;\n\n/**\n * Combines multiple references into a single stable callback reference while\n * respecting React's rules for references.\n *\n * @param refs References to combine.\n * @returns Stable callback reference.\n */\nexport function useCombinedRef<T>(\n ...refs: (React.Ref<T> | undefined)[]\n): React.RefCallback<T> {\n const curRefs = (React.useRef<Set<Ref<T>>>(null).current ??= new Set());\n const cleanupsRef = React.useRef<Cleanups<T>>(null);\n const valueRef = React.useRef<T>(null);\n\n for (const ref of curRefs) {\n // We could create a set with the new references and use `has` instead of\n // `includes`, but these arrays are likely so small that it is probably not\n // worth it\n if (!refs.includes(ref)) {\n curRefs.delete(ref);\n if (valueRef.current !== null) {\n unsetRef(ref, cleanupsRef);\n }\n }\n }\n for (const ref of refs) {\n if (ref != null && !curRefs.has(ref)) {\n curRefs.add(ref);\n if (valueRef.current !== null) {\n setRef(ref, valueRef.current, cleanupsRef);\n }\n }\n }\n\n return (React.useRef<React.RefCallback<T>>(null).current ??= (value: T) => {\n valueRef.current = value;\n for (const ref of curRefs) {\n setRef(ref, value, cleanupsRef);\n }\n\n return () => {\n valueRef.current = null;\n for (const ref of curRefs) {\n unsetRef(ref, cleanupsRef);\n }\n };\n });\n}\n\nfunction setRef<T>(\n ref: Ref<T>,\n value: T,\n cleanupsRef: React.RefObject<Cleanups<T> | null>,\n) {\n if (typeof ref === \"function\") {\n const cleanup = ref(value);\n if (typeof cleanup === \"function\") {\n (cleanupsRef.current ??= new Map()).set(ref, cleanup);\n }\n } else {\n ref.current = value;\n }\n}\n\nfunction unsetRef<T>(\n ref: Ref<T>,\n cleanupsRef: React.RefObject<Cleanups<T> | null>,\n) {\n if (typeof ref === \"function\") {\n const cleanup = cleanupsRef.current?.get(ref);\n if (cleanup) {\n cleanup();\n cleanupsRef.current!.delete(ref);\n } else {\n ref(null);\n }\n } else {\n ref.current = null;\n }\n}\n","import * as React from \"react\";\n\n/** Position of the scroll in relation to each direction. */\nexport interface ScrollPosition<T extends Element = Element> {\n target: T | null;\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\n/** Result of the `useScrollPosition` hook. */\nexport type UseScrollPositionResult<T extends Element = Element> = [\n setElement: (element: T) => void,\n scrollPosition: ScrollPosition | undefined,\n];\n\n/** Hook that tracks the position of an element's scroll. */\nexport function useScrollPosition<T extends Element = Element>(\n element: T | null,\n setScrollPosition: (scrollPosition: ScrollPosition | undefined) => void,\n) {\n React.useEffect(() => {\n if (!element) {\n setScrollPosition(undefined);\n return;\n }\n\n const handler = () =>\n setScrollPosition({\n target: element,\n top: element.scrollTop,\n right: element.scrollWidth - element.scrollLeft - element.clientWidth,\n bottom: element.scrollHeight - element.scrollTop - element.clientHeight,\n left: element.scrollLeft,\n });\n handler();\n\n const observer = new ResizeObserver(handler);\n observer.observe(element);\n element.addEventListener(\"scroll\", handler, {\n capture: false,\n passive: true,\n });\n\n return () => {\n observer.disconnect();\n element.removeEventListener(\"scroll\", handler);\n setScrollPosition(undefined);\n };\n }, [element, setScrollPosition]);\n}\n","import * as React from \"react\";\nimport { createStore, useStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { EMPTY_STORE } from \"../../utils/zustandUtils.ts\";\n\n/** Value of the field context. */\nexport type FieldContextValue = FieldStore;\n\n/** State of the field. */\nexport interface FieldState {\n controlId?: string;\n controlTagName?: string;\n controlFocused: boolean;\n controlHasCode: boolean;\n controlRequired: boolean;\n label?: React.ReactNode;\n labelId?: string;\n descriptionIds: string[];\n errorMessageIds: string[];\n actions: FieldActions;\n}\n\n/** Actions of the field. */\nexport interface FieldActions {\n addDescriptionId: (descriptionId: string) => void;\n removeDescriptionId: (descriptionId: string) => void;\n addErrorMessageId: (errorMessageId: string) => void;\n removeErrorMessageId: (errorMessageId: string) => void;\n}\n\n/** Field store. */\nexport type FieldStore = ReturnType<typeof useCreateFieldContext>;\n\n/** Field context. */\nexport const FieldContext = React.createContext<FieldContextValue | null>(null);\n\n/** Hook which creates the field context value. */\nexport function useCreateFieldContext() {\n return useConstant(() =>\n createStore<FieldState>()(\n subscribeWithSelector((set) => ({\n controlId: undefined,\n controlTagName: undefined,\n controlFocused: false,\n controlRequired: false,\n controlHasCode: false,\n label: undefined,\n labelId: undefined,\n descriptionIds: [],\n errorMessageIds: [],\n actions: {\n addDescriptionId: (descriptionId: string) =>\n set((state) => ({\n descriptionIds: [...state.descriptionIds, descriptionId],\n })),\n removeDescriptionId: (descriptionId: string) =>\n set((state) => ({\n descriptionIds: state.descriptionIds.filter(\n (id) => id !== descriptionId,\n ),\n })),\n addErrorMessageId: (errorMessageId: string) =>\n set((state) => ({\n errorMessageIds: [...state.errorMessageIds, errorMessageId],\n })),\n removeErrorMessageId: (errorMessageId: string) =>\n set((state) => ({\n errorMessageIds: state.errorMessageIds.filter(\n (id) => id !== errorMessageId,\n ),\n })),\n },\n })),\n ),\n );\n}\n\n/** Hook returning the field's context value. */\nfunction useFieldContext(): FieldContextValue | null {\n return React.useContext(FieldContext);\n}\n\n/** Hook that returns access to the field's store. */\nfunction useFieldStore<T>(selector: (state: Partial<FieldState>) => T): T {\n return useStore(useFieldContext() ?? EMPTY_STORE, selector);\n}\n\n/** Hook exposing the field control's id. */\nexport function useFieldControlId() {\n return useFieldStore((state) => state.controlId);\n}\n\n/** Hook exposing the field control's tag name. */\nexport function useFieldControlTagName() {\n return useFieldStore((state) => state.controlTagName);\n}\n\n/** Hook exposing whether the field's control is focused. */\nexport function useFieldControlFocused() {\n return useFieldStore((state) => state.controlFocused);\n}\n\n/** Hook exposing whether the field's control is required. */\nexport function useFieldControlRequired() {\n return useFieldStore((state) => state.controlRequired);\n}\n\n/** Hook exposing the field label's id. */\nexport function useFieldLabelId() {\n return useFieldStore((state) => state.labelId);\n}\n\n/** Hook exposing the field's description ids. */\nexport function useFieldDescriptionIds() {\n return useFieldStore((state) => state.descriptionIds);\n}\n\n/** Hook exposing the field's error message ids. */\nexport function useFieldErrorMessageIds() {\n return useFieldStore((state) => state.errorMessageIds);\n}\n\n/** Hook that makes a field aware of its control's information. */\nexport function useSetFieldControl(\n controlId: string | undefined,\n controlTagName: string | undefined,\n controlCodeId: string | undefined,\n controlHasCode: boolean | undefined = false,\n controlRequired: boolean | undefined = false,\n): {\n controlId: string;\n codeId: string | undefined;\n} {\n const prefix = usePrefix();\n const store = useFieldContext();\n\n const generatedId = React.useId();\n const actualControlId = controlId ?? prefix(`control-${generatedId}`);\n const actualCodeId = controlCodeId ?? prefix(`control-code-${generatedId}`);\n\n React.useEffect(() => {\n store?.setState({\n controlId: actualControlId,\n controlTagName,\n controlHasCode,\n controlRequired,\n });\n return () =>\n store?.setState?.({\n controlId: undefined,\n controlTagName: undefined,\n controlHasCode: false,\n controlRequired: false,\n });\n }, [actualControlId, controlTagName, controlHasCode, controlRequired, store]);\n\n return {\n controlId: actualControlId,\n codeId: controlHasCode ? actualCodeId : undefined,\n };\n}\n\n/**\n * Hook which returns a function that can be used to set the focus status of the\n * field's control.\n */\nexport function useSetFieldControlFocused() {\n const store = useFieldContext();\n return React.useCallback(\n (controlFocused: boolean) => store?.setState({ controlFocused }),\n [store],\n );\n}\n\n/** Hook that makes the field aware of its label. */\nexport function useSetFieldLabel(\n label: React.ReactNode,\n labelId: string | undefined,\n): string | undefined {\n const prefix = usePrefix();\n const store = useFieldContext();\n\n const generatedId = React.useId();\n const actualLabelId =\n labelId ?? (store ? prefix(`label-${generatedId}`) : undefined);\n\n React.useEffect(() => {\n store?.setState({ label, labelId: actualLabelId });\n return () => store?.setState({ label: undefined, labelId: undefined });\n }, [actualLabelId, label, store]);\n\n return actualLabelId;\n}\n\n/** Options available to the {@link useOnFieldLabelChange} hook. */\nexport interface UseOnFieldLabelChangeOptions {\n /**\n * Whether to run the callback immediately with the current label.\n *\n * @default true\n */\n fireImmediately?: boolean;\n}\n\n/** Hook which runs the provided callback whenever the field's label changes. */\nexport function useOnFieldLabelChange(\n cb: (label: React.ReactNode) => (() => void) | void,\n { fireImmediately = true }: UseOnFieldLabelChangeOptions = {},\n) {\n const store = useFieldContext();\n React.useEffect(() => {\n if (!store) {\n return;\n }\n let cleanup: (() => void) | void;\n const unsubscribe = store.subscribe(\n (state) => state.label,\n (label) => {\n cleanup = cb(label);\n },\n { fireImmediately },\n );\n return () => {\n unsubscribe();\n cleanup?.();\n };\n }, [cb, fireImmediately, store]);\n}\n\n/** Hook that makes the field aware of some helper text. */\nexport function useSetFieldHelperText(\n helperTextId: string | undefined,\n): string | undefined {\n const prefix = usePrefix();\n const { addDescriptionId, removeDescriptionId } =\n useFieldStore((state) => state.actions) ?? {};\n\n const generatedId = React.useId();\n const actualHelperTextId =\n helperTextId ??\n (addDescriptionId ? prefix(`helper-text-${generatedId}`) : undefined);\n\n React.useEffect(() => {\n addDescriptionId?.(actualHelperTextId!);\n return () => removeDescriptionId?.(actualHelperTextId!);\n }, [actualHelperTextId, addDescriptionId, removeDescriptionId]);\n\n return actualHelperTextId;\n}\n\n/** Hook that makes the field aware of some feedback. */\nexport function useSetFieldFeedback(\n feedbackId: string | undefined,\n isError: boolean,\n): string | undefined {\n const prefix = usePrefix();\n const {\n addDescriptionId,\n addErrorMessageId,\n removeDescriptionId,\n removeErrorMessageId,\n } = useFieldStore((state) => state.actions) ?? {};\n\n const addFeedbackId = isError ? addErrorMessageId : addDescriptionId;\n const removeFeedbackId = isError ? removeErrorMessageId : removeDescriptionId;\n\n const generatedId = React.useId();\n const actualFeedbackId =\n feedbackId ??\n (addFeedbackId ? prefix(`feedback-${generatedId}`) : undefined);\n\n React.useEffect(() => {\n addFeedbackId?.(actualFeedbackId!);\n return () => removeFeedbackId?.(actualFeedbackId!);\n }, [actualFeedbackId, addFeedbackId, removeFeedbackId]);\n\n return actualFeedbackId;\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { setBoolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { type ControlVariant } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { Slot } from \"../Slot\";\nimport { useIsInTableCell } from \"../Table\";\nimport { FieldContext, useCreateFieldContext } from \"./FieldContext.ts\";\n\n/** Properties of the field component. */\nexport interface FieldProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/**\n * The `Field` component groups form controls such as `Input`, `Select`,\n * `RadioButton`, `Checkbox`, and similar components that are used for user\n * input, with an associated `Label`, `HelperText`, and feedback such as errors\n * or validation messages.\n *\n * It provides automatic linking of the `Label` to the control, and marks the\n * control as \"required\" when requested by the control.\n */\nexport const Field = React.forwardRef<React.ComponentRef<\"div\">, FieldProps>(\n function Field({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n const store = useCreateFieldContext();\n const variant: ControlVariant = useIsInTableCell() ? \"cell\" : \"default\";\n\n // Set `has-code` data prop depending on whether the control has a code\n const fieldRef = React.useRef<HTMLDivElement | null>(null);\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.controlHasCode,\n (hasCode) => setBoolDataAttr(fieldRef.current, \"hasCode\", hasCode),\n { fireImmediately: true },\n ),\n [store],\n );\n\n const As = asChild ? Slot : \"div\";\n const combinedFieldRef = useCombinedRef(fieldRef, forwardedRef);\n return (\n <FieldContext.Provider value={store}>\n <As\n className={cx(prefix(\"field\"), className)}\n data-variant={variant}\n {...otherProps}\n ref={combinedFieldRef}\n />\n </FieldContext.Provider>\n );\n },\n);\n","import * as React from \"react\";\nimport { createStore, useStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { type ControlStatus } from \"../../utils/control.ts\";\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { type ScrollPosition } from \"../../utils/useScrollPosition.ts\";\nimport { type TableLayout } from \"./Table.tsx\";\n\n/** Value of the table context. */\nexport interface TableContextValue {\n editable: boolean;\n status?: ControlStatus;\n layout: TableLayout;\n defaultColumnWidth: number;\n store: TableStore;\n}\n\n/** State of the table. */\nexport interface TableState {\n scrollPosition?: ScrollPosition;\n numberOfColumns?: number;\n columnWidths?: (string | undefined)[];\n actions: TableActions;\n}\n\n/** Actions of the table. */\nexport interface TableActions {\n setTableMinWidth: (minWidth: string | undefined) => void;\n setTableMaxWidth: (maxWidth: string | undefined) => void;\n}\n\n/** Table store. */\nexport type TableStore = ReturnType<typeof useCreateTableContext>[\"store\"];\n\n/** Table context. */\nexport const TableContext = React.createContext<TableContextValue | null>(null);\n\n/** Hook which creates the table store. */\nexport function useCreateTableContext(\n editable: boolean,\n status: ControlStatus | undefined,\n layout: TableLayout,\n defaultColumnWidth: number,\n onTableMinWidthChange: (minWidth: string | undefined) => void,\n onTableMaxWidthChange: (maxWidth: string | undefined) => void,\n) {\n const store = useConstant(() =>\n createStore<TableState>()(\n subscribeWithSelector((_set) => ({\n scrollPosition: undefined,\n numberOfColumns: undefined,\n columnWidths: undefined,\n actions: {\n setTableMinWidth: onTableMinWidthChange,\n setTableMaxWidth: onTableMaxWidthChange,\n },\n })),\n ),\n );\n\n return React.useMemo(\n () => ({\n editable,\n status,\n layout,\n defaultColumnWidth,\n store,\n }),\n [defaultColumnWidth, editable, layout, status, store],\n );\n}\n\n/** Hook returning the table's context value. */\nexport function useTableContext(): TableContextValue {\n const tableContext = React.useContext(TableContext);\n if (!tableContext) {\n throw new Error(\"Table context not in scope.\");\n }\n return tableContext;\n}\n\n/** Hook returning the number of columns of the table. */\nexport function useTableNumberOfColumns(): number | undefined {\n const { store } = useTableContext();\n return useStore(store, (state) => state.numberOfColumns);\n}\n\n/** Table head context. */\nexport const TableHeadContext = React.createContext(false);\n\n/** Hook exposing whether a component is being rendered within a table head. */\nexport function useIsInTableHead(): boolean {\n return React.useContext(TableHeadContext);\n}\n\n/** Table foot context. */\nexport const TableFootContext = React.createContext(false);\n\n/** Hook exposing whether a component is being rendered within a table foot. */\nexport function useIsInTableFoot(): boolean {\n return React.useContext(TableFootContext);\n}\n\n/** Context present within a table cell. */\nexport const TableCellContext = React.createContext(false);\n\n/** Hook exposing whether a component is being rendered within a table cell. */\nexport function useIsInTableCell(): boolean {\n return React.useContext(TableCellContext);\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport {\n type ControlStatus,\n controlStatusToAccent,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useScrollPosition } from \"../../utils/useScrollPosition.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useFieldLabelId,\n useSetFieldControl,\n} from \"../Field\";\nimport {\n TableContext,\n useCreateTableContext,\n useTableContext,\n} from \"./TableContext.ts\";\n\n/** Default column width in `\"fixed\"` mode. */\nexport const DEFAULT_TABLE_COLUMN_WIDTH = 150;\n\n/** Table variant. */\nexport type TableVariant = \"default\" | \"control\";\n\n/** Possible table layouts. */\nexport type TableLayout = \"auto\" | \"fixed\";\n\n/** Properties of the table component. */\nexport interface TableProps extends React.ComponentPropsWithoutRef<\"table\"> {\n /**\n * Marks the table as being meant for editable content (cells containing form\n * controls).\n *\n * In effect, this changes the default table variant to `\"control\"` and\n * defaults all cells as `framed`, as well as all non-header cells as\n * `paddingless`.\n */\n editable?: boolean;\n /**\n * Table's style variant. The default variant should typically be used for\n * readable data, while the control variant (which resembles other form\n * controls) for writable data.\n *\n * Defaults to `\"default\"` for non-`editable` tables and to `\"control\"`\n * otherwise.\n */\n variant?: TableVariant;\n /** Sets the status of the table. */\n status?: ControlStatus;\n /**\n * How to lay out the table:\n *\n * - `\"auto\"` lets the browser automatically adjust the size of cells to fit\n * their content.\n * - `\"fixed\"` sizes each cell according to the width provided by each column.\n *\n * The table layout defaults to `\"auto\"` when the table isn't editable, and\n * `\"fixed\"` otherwise.\n */\n layout?: TableLayout;\n /** Marks the table as \"required\" when it is being used as a control. */\n required?: boolean;\n /**\n * When the table layout is set to `\"fixed\"`, this property specifies the\n * default minimum width of all columns (in pixels).\n *\n * @default 150\n */\n defaultColumnWidth?: number;\n /** Sets the maximum height of the table. */\n maxHeight?: React.CSSProperties[\"maxHeight\"];\n /** Properties to pass to the container element. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/**\n * Use the table component to display structured data in a tabular format.\n *\n * It composes the following subcomponents:\n *\n * - `TableHead`: Header of the table (corresponds to the\n * [`<thead>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/thead)\n * HTML element).\n * - `TableColumn`: Component used inside `TableHead` to represent a column of the\n * table.\n * - `TableBody`: Body of the table (corresponds to the\n * [`<tbody>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tbody)\n * HTML element).\n * - `TableFoot`: Footer of the table (corresponds to the\n * [`<tfoot>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tfoot)\n * HTML element).\n * - `TableRow`: Row of the table (corresponds to the\n * [`<tr>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tr)\n * HTML element).\n * - `TableCell`: Cell of the table (corresponds to the\n * [`<th>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/th)\n * and\n * [`<td>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/td)\n * HTML elements). Set the `header` property to switch from `td` to `th`.\n *\n * Example usage:\n *\n * ```tsx\n * import {\n * Table,\n * TableBody,\n * TableCell,\n * TableColumn,\n * TableFoot,\n * TableHead,\n * TableRow,\n * } from \"@ostack.tech/ui\";\n *\n * function PriceTable() {\n * return (\n * <Table>\n * <TableHead>\n * <TableColumn label=\"Item\" />\n * <TableColumn label=\"Price\" />\n * </TableHead>\n * <TableBody>\n * <TableRow>\n * <TableCell header>Olive oil</TableCell>\n * <TableCell>3,99 €</TableCell>\n * </TableRow>\n * <TableRow>\n * <TableCell header>Vinegar</TableCell>\n * <TableCell>0,95 €</TableCell>\n * </TableRow>\n * </TableBody>\n * <TableFoot>\n * <TableRow>\n * <TableCell header>Total</TableCell>\n * <TableCell>4,94 €</TableCell>\n * </TableRow>\n * </TableFoot>\n * </Table>\n * );\n * }\n * ```\n */\nexport const Table = React.forwardRef<React.ComponentRef<\"table\">, TableProps>(\n function Table(\n {\n editable = false,\n variant = editable ? \"control\" : \"default\",\n status,\n layout = editable ? \"fixed\" : \"auto\",\n required,\n defaultColumnWidth = DEFAULT_TABLE_COLUMN_WIDTH,\n maxHeight,\n containerProps,\n className,\n children,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const labelId = useFieldLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const { controlId, codeId } = useSetFieldControl(\n containerProps?.id,\n \"DIV\",\n undefined,\n false,\n required,\n );\n\n const tableRef = React.useRef<HTMLTableElement | null>(null);\n const [containerEl, setContainerEl] = React.useState<HTMLDivElement | null>(\n null,\n );\n const handleMinWidthChange = (minWidth?: string) => {\n if (tableRef.current) {\n tableRef.current.style.minWidth = minWidth ?? \"\";\n }\n };\n const handleMaxWidthChange = (maxWidth?: string) => {\n if (tableRef.current) {\n tableRef.current.style.maxWidth = maxWidth ?? \"\";\n }\n if (containerEl) {\n // eslint-disable-next-line react-hooks/immutability\n containerEl.style.maxWidth = maxWidth ?? \"\";\n }\n };\n const tableContextValue = useCreateTableContext(\n editable,\n status,\n layout,\n defaultColumnWidth,\n handleMinWidthChange,\n handleMaxWidthChange,\n );\n useScrollPosition(\n containerEl,\n React.useCallback(\n (scrollPosition) =>\n tableContextValue.store.setState({ scrollPosition }),\n [tableContextValue.store],\n ),\n );\n\n const combinedContainerRef = useCombinedRef(\n setContainerEl,\n containerProps?.ref,\n );\n const combinedTableRef = useCombinedRef(tableRef, forwardedRef);\n return (\n <ClearContexts>\n <TableContext.Provider value={tableContextValue}>\n {/* Table container (scrollable element) */}\n <div\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n tabIndex={0}\n {...containerProps}\n id={controlId}\n className={cx(\n prefix(\"table__container\"),\n prefix(`table__container--${variant}`),\n containerProps?.className,\n )}\n style={{\n maxHeight,\n // XXX: Disable Y overflow when a `max-height` isn't specified.\n // TODO: Investigate why we get a 1px Y overflow sometimes.\n overflowY:\n maxHeight != null || containerProps?.style?.maxHeight != null\n ? undefined\n : \"hidden\",\n ...containerProps?.style,\n }}\n ref={combinedContainerRef}\n >\n <table\n className={cx(\n prefix(\"table\"),\n prefix(`table--${variant}`),\n layout === \"fixed\" && prefix(\"table--fixed\"),\n className,\n )}\n data-status={status}\n aria-labelledby={mergeAriaIds(labelId, ariaLabelledBy)}\n aria-describedby={mergeAriaIds(\n codeId,\n descriptionIds,\n errorMessageIds,\n ariaDescribedBy,\n )}\n {...otherProps}\n ref={combinedTableRef}\n >\n <ColumnWidths />\n {children}\n </table>\n </div>\n </TableContext.Provider>\n </ClearContexts>\n );\n },\n);\n\n/** Table column widths. */\nfunction ColumnWidths() {\n const { store } = useTableContext();\n const columnWidths = useStore(store, (state) => state.columnWidths);\n return (\n columnWidths && (\n <colgroup>\n {columnWidths.map((width, i) => (\n <col key={i} style={width != null ? { width } : undefined} />\n ))}\n </colgroup>\n )\n );\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the table body component. */\nexport interface TableBodyProps\n extends React.ComponentPropsWithoutRef<\"tbody\"> {}\n\n/** Table body component. */\nexport const TableBody = React.forwardRef<\n React.ComponentRef<\"tbody\">,\n TableBodyProps\n>(function TableBody({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <tbody\n className={cx(prefix(\"table__body\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { type PrefixFn, usePrefix } from \"../providers/PrefixProvider\";\n\n/** Options available to the {@link useCssVars} hook. */\nexport interface UseCssVarsOptions {\n prefix?: PrefixFn;\n}\n\n/** Result of the {@link useCssVars} hook. */\nexport interface UseCssVarsResult {\n /**\n * Returns the name of a CSS variable prefixed by the component library's\n * prefix.\n *\n * @example\n *\n * ```typescript\n * cssVarName(\"color\"); // returns \"--[prefix]-color\"\n * ```\n */\n cssVarName: (name: string) => string;\n /**\n * Returns a CSS variable with the given name, prefixed by the component\n * library's prefix.\n *\n * @example\n *\n * ```typescript\n * cssVar(\"color\"); // returns \"var(--[prefix]-color)\"\n * cssVar(\"size\", \"10px\"); // returns \"var(--[prefix]-size, 10px)\"\n * ```\n */\n cssVar: (name: string, fallback?: unknown) => string;\n /**\n * Returns an object used to set a CSS variable with the given name, prefixed\n * by the component library's prefix.\n *\n * @example\n *\n * ```typescript\n * cssVarStyle(\"color\", \"red\"); // returns {\"--[prefix]-color\": \"red\"}\n * cssVarStyle(\"size\", undefined); // returns undefined\n * ```\n */\n cssVarStyle: (\n name: string,\n value: unknown,\n ) => Record<string, string> | undefined;\n /** Returns the name of a CSS variable to use for a CSS space toggle. */\n cssToggler: (value: boolean, customPrefix?: string) => string;\n}\n\n/** Hook providing access to CSS variable utilities. */\nexport function useCssVars(options?: UseCssVarsOptions): UseCssVarsResult {\n const contextPrefix = usePrefix();\n const prefix = options?.prefix ?? contextPrefix;\n\n const cssVarName = React.useCallback(\n (name: string) => `--${prefix(name)}`,\n [prefix],\n );\n const cssVar = React.useCallback(\n (name: string, fallback?: unknown) =>\n `var(${cssVarName(name)}${\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n fallback != null ? `, ${String(fallback)}` : \"\"\n })`,\n [cssVarName],\n );\n const cssVarStyle = React.useCallback(\n (name: string, value: unknown) =>\n value != null\n ? // eslint-disable-next-line @typescript-eslint/no-base-to-string\n { [cssVarName(name)]: String(value) }\n : undefined,\n [cssVarName],\n );\n const cssToggler = React.useCallback(\n (value: boolean) => cssVar(`toggler-${value}`, null),\n [cssVar],\n );\n\n return React.useMemo(\n () => ({ cssVarName, cssVar, cssVarStyle, cssToggler }),\n [cssToggler, cssVar, cssVarName, cssVarStyle],\n );\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr, setBoolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { type ControlStatus } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useCssVars } from \"../../utils/useCssVars.ts\";\nimport {\n TableCellContext,\n useIsInTableHead,\n useTableContext,\n} from \"./TableContext.ts\";\n\n/** Type of table cell. */\nexport type TableCellVariant = \"header\" | \"data\";\n\n/** Sticky position of the table cell. */\nexport type TableCellSticky = \"left\" | \"right\";\n\n/** Properties of the table row component. */\nexport interface TableCellProps\n extends Omit<React.ComponentPropsWithoutRef<\"td\" | \"th\">, \"align\"> {\n /**\n * Whether this cell should be rendered as a table header cell (`th` element).\n * By default, `true` within a `TableHead` component, and `false` otherwise.\n */\n header?: boolean;\n /**\n * Specifies how to align the cell's content. Numeric fields should typically\n * be right aligned.\n */\n align?: React.CSSProperties[\"textAlign\"];\n /**\n * Style variant to use. By default, defaults to `\"header\"` when the cell is a\n * `header`, and to `\"data\"` otherwise.\n */\n variant?: TableCellVariant;\n /**\n * Cell status, used to render the cell in the style of the given status, when\n * the table is of the \"control\" variant.\n *\n * By default, `header` cells inherit the `Table`'s `status`.\n */\n status?: ControlStatus | null;\n /**\n * Renders the cell with borders. This property defaults to `true` when the\n * table is editable and to `false` otherwise.\n */\n framed?: boolean;\n /**\n * Removes the cell's padding. This property defaults to `true` when the table\n * is editable and the cell is not a `header`, and to `false` otherwise.\n */\n paddingless?: boolean;\n /** Makes the table cell stick to one of the sides of table. */\n sticky?: TableCellSticky;\n}\n\n/** Table row component. */\nexport const TableCell = React.forwardRef<\n React.ComponentRef<\"td\" | \"th\">,\n TableCellProps\n>(function TableCell(\n {\n header,\n align,\n variant,\n status,\n framed,\n paddingless,\n sticky,\n className,\n style,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { cssVarStyle } = useCssVars();\n const {\n status: tableStatus,\n editable: isTableEditable,\n store,\n } = useTableContext();\n const isInTableHead = useIsInTableHead();\n\n header ??= isInTableHead;\n variant ??= header ? \"header\" : \"data\";\n // Setting the status to `null` overrides the automatic inheritance of the\n // table status for header cells\n if (status === undefined) {\n status = header ? tableStatus : undefined;\n }\n framed ??= isTableEditable;\n paddingless ??= !header && isTableEditable;\n\n // Set stuck data property on cell when appropriate\n const cellRef = React.useRef<HTMLTableCellElement | null>(null);\n React.useEffect(\n () =>\n store.subscribe(\n ({ scrollPosition }) =>\n sticky != null &&\n scrollPosition != null &&\n (sticky === \"left\"\n ? scrollPosition.left > 0\n : scrollPosition.right > 0),\n (isStuck) => setBoolDataAttr(cellRef.current, \"stuck\", isStuck),\n { fireImmediately: true },\n ),\n [sticky, store],\n );\n\n const As = header ? \"th\" : \"td\";\n const combinedCellRef = useCombinedRef(cellRef, forwardedRef);\n return (\n <TableCellContext.Provider value={true}>\n <As\n className={cx(prefix(\"table__cell\"), className)}\n style={{\n ...cssVarStyle(\"table-cell-align\", align),\n ...style,\n }}\n data-status={status ?? undefined}\n data-framed={boolDataAttr(framed)}\n data-paddingless={boolDataAttr(paddingless)}\n data-variant={variant}\n data-sticky={sticky}\n {...otherProps}\n ref={combinedCellRef}\n />\n </TableCellContext.Provider>\n );\n});\n","import { Popover as PopoverPrimitive } from \"radix-ui\";\n\n/**\n * Root popover component that provides an interactive and versatile overlay to\n * display additional content or actions in a contextual manner. It is ideal for\n * creating dynamic overlays that enhance user interactions by presenting\n * supplementary information or controls directly related to a trigger element.\n *\n * It composes the following subcomponents:\n *\n * - `PopoverAnchor`: A utility to anchor the popover to a specific element. It\n * ensures the popover aligns accurately with the anchor, allowing for dynamic\n * placement and responsiveness.\n * - `PopoverClose`: An interactive element that closes the popover when clicked.\n * It is used to provide a seamless and accessible way for users to dismiss\n * the popover.\n * - `PopoverContent`: The container for the content displayed within the popover.\n * It supports customization of appearance and behavior, including position\n * `side` and whether an arrow is shown `showArrow`.\n * - `PopoverTrigger`: An interactive element, such as a button, that toggles the\n * visibility of the popover. It acts as the primary control for opening and\n * closing the popover.\n *\n * For detailed information on these props, which do not have descriptions,\n * please refer to the\n * [docs](https://www.radix-ui.com/primitives/docs/components/popover).\n */\nexport const Popover = PopoverPrimitive.Root;\n","import { Popover as PopoverPrimitive } from \"radix-ui\";\n\n/**\n * An optional element to position the `PopoverContent` against. If this part is\n * not used, the content will position alongside the `PopoverTrigger`.\n */\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n","import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the popover close component. */\nexport interface PopoverCloseProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Close>,\n \"asChild\"\n > {}\n\n/** The button that closes an open popover. */\nexport const PopoverClose = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Close>,\n PopoverCloseProps\n>(function PopoverClose(props, forwardedRef) {\n return <PopoverPrimitive.Close {...props} asChild ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\n/** Value of the portal context. */\nexport interface PortalContextValue {\n /** Container where portals should render by default. */\n container?: Element | DocumentFragment | null;\n}\n\n/** Portal context. */\nexport const PortalContext = React.createContext<PortalContextValue | null>(\n null,\n);\n\n/** Hook providing access to the portal context. */\nexport function usePortalContext(): PortalContextValue | null {\n return React.useContext(PortalContext);\n}\n","import { Portal as PortalPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { Root } from \"../Root\";\nimport { usePortalContext } from \"./PortalContext.ts\";\n\n/** Properties of the portal component. */\nexport interface PortalProps\n extends React.ComponentPropsWithoutRef<typeof PortalPrimitive.Root> {}\n\n/**\n * Portal component used to render a React subtree in a different part of the\n * DOM.\n *\n * The rendered subtree is automatically wrapper in a `Root` component, so that\n * styles are rendered correctly.\n */\nexport const Portal = React.forwardRef<\n React.ComponentRef<typeof PortalPrimitive.Root>,\n PortalProps\n>(function Portal({ asChild, children, ...otherProps }, forwardedRef) {\n const portalContext = usePortalContext();\n\n return (\n <PortalPrimitive.Root\n asChild\n container={portalContext?.container}\n {...otherProps}\n ref={forwardedRef}\n >\n <Root asChild={asChild}>{children}</Root>\n </PortalPrimitive.Root>\n );\n});\n","import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\nimport { Slottable } from \"../Slot\";\n\n/** Properties of the popover content component. */\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /**\n * Whether to show an arrow pointing to the anchor.\n *\n * @default true\n */\n showArrow?: boolean;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof PopoverPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the arrow component. */\n arrowProps?: React.ComponentPropsWithRef<typeof PopoverPrimitive.Arrow>;\n}\n\n/** The component that pops out when the popover is open. */\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(function PopoverContent(\n {\n showArrow = true,\n sideOffset = 3,\n collisionPadding = 3,\n forceMount,\n className,\n portalProps,\n arrowProps,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const portalContext = usePortalContext();\n\n return (\n <ClearContexts>\n <PopoverPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n <PopoverPrimitive.Content\n className={cx(prefix(\"popover\"), className)}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n forceMount={forceMount}\n ref={forwardedRef}\n {...otherProps}\n >\n <Slottable>{children}</Slottable>\n {showArrow && (\n <PopoverPrimitive.Arrow\n width={12}\n height={6}\n {...arrowProps}\n className={cx(prefix(\"popover__arrow\"), arrowProps?.className)}\n />\n )}\n </PopoverPrimitive.Content>\n </Root>\n </PopoverPrimitive.Portal>\n </ClearContexts>\n );\n});\n","import { Popover as PopoverPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the popover trigger component. */\nexport interface PopoverTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>,\n \"asChild\"\n > {}\n\n/**\n * The button that toggles the popover. By default, the `PopoverContent` will\n * position itself against the trigger.\n */\nexport const PopoverTrigger = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Trigger>,\n PopoverTriggerProps\n>(function PopoverTrigger(props, forwardedRef) {\n return <PopoverPrimitive.Trigger {...props} asChild ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\n/** Options for the `useMediaQuery` hook. */\nexport interface UseMediaQueryOptions {\n /** Default match when `matchMedia` is unavailable. */\n defaultMatches?: boolean;\n /** `matchMedia` implementation (e.g. for tests). */\n matchMedia?: typeof window.matchMedia;\n}\n\n/**\n * Hook exposing a CSS media query to React. Returns whether the media query\n * matches or not.\n */\nexport function useMediaQuery(\n query: string,\n options?: UseMediaQueryOptions,\n): boolean {\n const matchMedia: typeof window.matchMedia | undefined =\n options?.matchMedia ??\n (typeof window !== \"undefined\" ? window.matchMedia : undefined);\n\n const getDefaultSnapshot = React.useCallback(\n () => options?.defaultMatches ?? false,\n [options?.defaultMatches],\n );\n const getServerSnapshot = React.useCallback(\n () => matchMedia?.(query).matches ?? getDefaultSnapshot(),\n [getDefaultSnapshot, matchMedia, query],\n );\n const { getSnapshot, subscribe } = React.useMemo(() => {\n if (!matchMedia) {\n return {\n getSnapshot: getDefaultSnapshot,\n subscribe: () => () => {},\n };\n }\n\n const queryList = matchMedia(query);\n return {\n getSnapshot: () => queryList.matches,\n subscribe: (notify: () => void) => {\n if (queryList.addEventListener) {\n queryList.addEventListener(\"change\", notify);\n } else {\n queryList.addListener(notify);\n }\n return () => {\n if (queryList.removeEventListener) {\n queryList.removeEventListener(\"change\", notify);\n } else {\n queryList.removeListener(notify);\n }\n };\n },\n };\n }, [getDefaultSnapshot, matchMedia, query]);\n\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n","import { useMediaQuery, type UseMediaQueryOptions } from \"./useMediaQuery.ts\";\n\n/** Available breakpoints. */\nexport const BREAKPOINTS = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400,\n} as const;\n\n/** Type of available breakpoints. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * Hook that returns `true` when the screen size is greater or equal than the\n * width of the provided breakpoint.\n *\n * @param breakpoint Breakpoint from which to match.\n * @param options Media query options.\n * @returns Whether the screen size is greater or equal than the width of the\n * provided breakpoint.\n */\nexport function useMediaBreakpointUp(\n breakpoint: Breakpoint,\n options?: UseMediaQueryOptions,\n) {\n return useMediaQuery(`(min-width:${BREAKPOINTS[breakpoint]}px)`, options);\n}\n\n/**\n * Hook that returns `true` when the screen size is less than the width of the\n * provided breakpoint.\n *\n * @param breakpoint Breakpoint to up to which to match.\n * @param options Media query options.\n * @returns Whether the screen size is less than the width of the provided\n * breakpoint.\n */\nexport function useMediaBreakpointDown(\n breakpoint: Breakpoint,\n options?: UseMediaQueryOptions,\n) {\n return useMediaQuery(\n `(max-width:${BREAKPOINTS[breakpoint] - 0.02}px)`,\n options,\n );\n}\n","/** Converts camel case to kebab case. */\nexport function camelToKebabCase(str: string): string {\n return str.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);\n}\n","import * as React from \"react\";\n\nimport { boolDataAttr } from \"./boolDataAttr.ts\";\nimport { type Breakpoint } from \"./breakpoints.ts\";\nimport { camelToKebabCase } from \"./changeCase.ts\";\nimport { useCssVars, type UseCssVarsOptions } from \"./useCssVars.ts\";\n\n/** Value allowing for different values depending on the current breakpoint. */\nexport type Responsive<T = unknown> = T | Partial<Record<Breakpoint, T>>;\n\n/** Options available to the {@link useResponsiveValues} hook. */\nexport type UseResponsiveValuesOptions = UseCssVarsOptions;\n\n/** Result of the {@link useResponsiveValues} hook. */\nexport interface UseResponsiveValuesResult {\n /**\n * Returns an object of CSS variables for multiple responsive values, together\n * with data attributes specifying which breakpoints of each value have an\n * associated CSS variable.\n */\n responsiveValuesToCssVarsAndDataAttrs: <\n T extends Record<string, unknown>,\n TMappers extends {\n [TKey in keyof T]: (\n value: T[TKey] extends Responsive<infer TValue> | undefined\n ? TValue\n : never,\n ) => unknown;\n },\n >(\n componentName: string,\n values: T,\n mappers?: Partial<TMappers>,\n ) => {\n cssVars: Record<string, string | undefined>;\n dataAttrs: Record<string, string | undefined>;\n };\n\n /**\n * Returns an object of CSS variables for a responsive value, together with\n * data attributes specifying which breakpoints have an associated CSS\n * variable.\n */\n responsiveValueToCssVarsAndDataAttrs: <T>(\n componentName: string,\n varName: string,\n value?: Responsive<T>,\n mapper?: (value: T) => unknown,\n ) => {\n cssVars: Record<string, string | undefined>;\n dataAttrs: Record<string, string | undefined>;\n };\n}\n\n/** Hook providing access to responsive value utilities. */\nexport function useResponsiveValues(\n options?: UseResponsiveValuesOptions,\n): UseResponsiveValuesResult {\n const { cssVarName } = useCssVars(options);\n\n const responsiveValueToCssVarsAndDataAttrs = React.useCallback(\n <T>(\n componentName: string,\n varName: string,\n value?: Responsive<T>,\n mapper?: (value: T) => unknown,\n ): {\n cssVars: Record<string, string | undefined>;\n dataAttrs: Record<string, string | undefined>;\n } => {\n varName = camelToKebabCase(varName);\n const cssVars: Record<string, string | undefined> = {};\n const dataAttrs: Record<string, string | undefined> = {};\n if (value != null) {\n const prefixedName = `${componentName}-${varName}`;\n if (typeof value !== \"object\") {\n const mappedValue = mapper ? mapper(value) : value;\n cssVars[cssVarName(prefixedName)] = mappedValue?.toString();\n } else {\n for (const [bp, bpValue] of Object.entries(value)) {\n const mappedBpValue =\n mapper && bpValue != null ? mapper(bpValue) : bpValue;\n cssVars[cssVarName(`${prefixedName}-${bp}`)] =\n mappedBpValue?.toString();\n dataAttrs[`data-has-${varName}-${bp}`] = boolDataAttr(\n mappedBpValue != null,\n );\n }\n }\n }\n return { cssVars, dataAttrs };\n },\n [cssVarName],\n );\n const responsiveValuesToCssVarsAndDataAttrs = React.useCallback(\n <\n T extends Record<string, unknown>,\n TMappers extends {\n [TKey in keyof T]: (\n value: T[TKey] extends Responsive<infer TValue> | undefined\n ? TValue\n : never,\n ) => unknown;\n },\n >(\n componentName: string,\n values: T,\n mappers?: Partial<TMappers>,\n ): {\n cssVars: Record<string, string | undefined>;\n dataAttrs: Record<string, string | undefined>;\n } => {\n const cssVars: Record<string, string | undefined> = {};\n const dataAttrs: Record<string, string | undefined> = {};\n for (const [valueName, value] of Object.entries(values)) {\n const cssVarsAndDataAttrs = responsiveValueToCssVarsAndDataAttrs(\n componentName,\n valueName,\n value as never,\n mappers?.[valueName],\n );\n Object.assign(cssVars, cssVarsAndDataAttrs.cssVars);\n Object.assign(dataAttrs, cssVarsAndDataAttrs.dataAttrs);\n }\n return { cssVars, dataAttrs };\n },\n [responsiveValueToCssVarsAndDataAttrs],\n );\n\n return React.useMemo(\n () => ({\n responsiveValueToCssVarsAndDataAttrs,\n responsiveValuesToCssVarsAndDataAttrs,\n }),\n [\n responsiveValueToCssVarsAndDataAttrs,\n responsiveValuesToCssVarsAndDataAttrs,\n ],\n );\n}\n","import * as React from \"react\";\n\nimport { useCssVars } from \"./useCssVars.ts\";\n\n/**\n * Function used to obtain a CSS values representing a size based on the theme's\n * “space” value.\n */\nexport type SpacingFn = (...values: number[]) => string;\n\n/** Returns a CSS value representing a size based on the theme's \"space\" value. */\nexport function useSpacing(): SpacingFn {\n const { cssVar } = useCssVars();\n return React.useCallback(\n (...values: number[]) =>\n values\n .map((v) =>\n v === 0\n ? \"0px\"\n : v === 1\n ? cssVar(\"space\")\n : `calc(${cssVar(\"space\")} * ${v})`,\n )\n .join(\" \"),\n [cssVar],\n );\n}\n","import * as React from \"react\";\n\nimport { type PrefixFn, usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCssVars } from \"../../utils/useCssVars.ts\";\nimport {\n type Responsive,\n useResponsiveValues,\n} from \"../../utils/useResponsiveValues.ts\";\nimport { useSpacing } from \"../../utils/useSpacing.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Value of the stack context. */\ninterface StackContextValue {\n direction: Responsive<FlexDirection> | undefined;\n gap: Responsive<number | string> | undefined;\n}\n\n/** Stack context. */\nconst StackContext = React.createContext<StackContextValue | null>(null);\n\n/** Possible stack directions. */\nexport type FlexDirection = \"column\" | \"column-reverse\" | \"row\" | \"row-reverse\";\n\n/** Properties of the stack component. */\nexport interface StackProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Direction of the stack.\n *\n * @default column\n */\n direction?: Responsive<FlexDirection>;\n /**\n * Spacing between items. When a number is provided, each unit corresponds to\n * `var(--o-ui-space)`.\n *\n * @default 5\n */\n gap?: Responsive<number | string>;\n /** Adds a divider between elements. */\n divider?: React.ReactElement;\n justifyContent?: Responsive<React.CSSProperties[\"justifyContent\"]>;\n alignItems?: Responsive<React.CSSProperties[\"alignItems\"]>;\n alignContent?: Responsive<React.CSSProperties[\"alignContent\"]>;\n wrap?: Responsive<React.CSSProperties[\"flexWrap\"]>; // TODO: use \"true\"/\"false\"/\"reverse\" as values\n}\n\n/**\n * The Stack component manages the layout of immediate children along the\n * vertical or horizontal axis with optional spacing and/or dividers between\n * each child.\n *\n * It uses a flex display together with a variant of the [lobotomised\n * owl](https://css-tricks.com/lobotomized-owls/) selector (`* + *`) for\n * spacing.\n */\nexport const Stack = React.forwardRef<React.ComponentRef<\"div\">, StackProps>(\n function Stack(\n {\n asChild,\n direction,\n gap,\n divider,\n justifyContent,\n alignItems,\n alignContent,\n wrap,\n className,\n style,\n children,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const { cssVar } = useCssVars();\n const spacing = useSpacing();\n const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();\n const stackContext = React.useContext(StackContext);\n\n // We support the nesting of stacks by having nested stacks handle their own\n // margin as necessary (as opposed to it being automatically set via the\n // lobotomised owl). This is necessary as otherwise nested stacks would use\n // their own gap as margin instead of the parent's gap due to the cascading\n // of CSS variables.\n\n // Map the stack direction to the margin that its children should have\n const childMarginMapper = (gapVar: string) => (d: FlexDirection) =>\n d === \"column\"\n ? `${cssVar(`stack-${gapVar}`)} 0 0 0`\n : d === \"column-reverse\"\n ? `0 0 ${cssVar(`stack-${gapVar}`)} 0`\n : d === \"row\"\n ? `0 0 0 ${cssVar(`stack-${gapVar}`)}`\n : `0 ${cssVar(`stack-${gapVar}`)} 0 0`;\n const gapMapper = (v: number | string) =>\n typeof v === \"number\" ? spacing(v) : v;\n\n const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(\n \"stack\",\n {\n ancestorChildMargin: stackContext?.direction,\n ancestorGap: stackContext?.gap,\n direction,\n gap,\n childMargin: direction,\n justifyContent,\n alignItems,\n alignContent,\n wrap,\n },\n {\n ancestorGap: gapMapper,\n ancestorChildMargin: childMarginMapper(\"ancestor-gap\"),\n gap: gapMapper,\n childMargin: childMarginMapper(\"gap\"),\n },\n );\n\n const As = asChild ? Slot : \"div\";\n return (\n <StackContext.Provider value={{ direction, gap }}>\n <As\n className={cx(prefix(\"stack\"), className)}\n style={{ ...cssVars, ...style }}\n {...dataAttrs}\n ref={forwardedRef}\n {...otherProps}\n >\n {divider ? divideChildren(children, divider, prefix) : children}\n </As>\n </StackContext.Provider>\n );\n },\n);\n\n/** Divides `children` by adding a `divider` in between them. */\nfunction divideChildren(\n children: React.ReactNode,\n divider: React.ReactElement,\n prefix: PrefixFn,\n): React.ReactNode {\n return React.Children.toArray(children)\n .filter(Boolean)\n .reduce<React.ReactNode[]>((dividedChildren, child, i, children) => {\n dividedChildren.push(child);\n if (i < children.length - 1) {\n dividedChildren.push(\n React.cloneElement(divider, { key: prefix(`stack-divider-${i}`) }),\n );\n }\n return dividedChildren;\n }, []);\n}\n","import * as React from \"react\";\n\nimport { type SortDirection } from \"../../utils/sorting.ts\";\nimport { type Button } from \"../Button\";\nimport { type Icon } from \"../Icon\";\nimport { type IconButton } from \"../IconButton\";\nimport { type Popover, type PopoverContent } from \"../Popover\";\nimport { type Stack } from \"../Stack\";\nimport { type TableCell } from \"./TableCell.tsx\";\n\n/** Properties of a table column. */\nexport interface TableColumnProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TableCell>,\n \"rowSpan\" | \"scope\"\n > {\n /** Column's label. */\n label?: React.ReactNode;\n /** String representation of the label (defaults to `label`). */\n labelText?: string;\n /** Optional helper text displayed as a popover triggered by an icon button. */\n helperText?: React.ReactNode;\n /** Label of the helper button announced to assistive technologies. */\n helperButtonLabel?: string;\n /**\n * Minimum width of a column (in pixels).\n *\n * In \"fixed\" layout, this property is only relevant when applied to \"leaf\"\n * columns (columns that don't contain other columns).\n *\n * An array may be provided (with a length matching `colSpan`) to specify the\n * `width` of each column that this column spans over.\n */\n width?: number | number[];\n /**\n * When the table has a \"fixed\" layout, this property specifies that a column\n * should not grow.\n */\n fixed?: boolean;\n /**\n * Marks the column as sortable by displaying a sorting icon and listening to\n * click events on it.\n */\n sortable?: boolean;\n /**\n * Direction to initially sort the column by when first clicking on the sort\n * button.\n *\n * @default asc\n */\n defaultSortDirection?: SortDirection;\n /**\n * Whether the data is currently sorted by this column and, if so, in which\n * direction.\n */\n sorted?: SortDirection;\n /**\n * Callback called when the sort button is clicked. The direction provided is\n * the new sort direction for the column or `null` when the table should no\n * longer be sorted by this column.\n */\n onSort?: (direction: SortDirection | null) => void;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<typeof Stack>;\n /** Properties to pass to the label component. */\n labelProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the sort button. */\n sortButtonProps?: React.ComponentPropsWithRef<typeof Button>;\n /** Properties to pass to the component containing the sort icons. */\n sortIconContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the sort ascending icon component. */\n sortAscIconProps?: React.ComponentPropsWithRef<typeof Icon>;\n /** Properties to pass to the sort descending icon component. */\n sortDescIconProps?: React.ComponentPropsWithRef<typeof Icon>;\n /** Properties to pass to the helper button component. */\n helperButtonProps?: Omit<\n React.ComponentPropsWithRef<typeof IconButton>,\n \"icon\"\n >;\n /** Properties to pass to the helper popover component. */\n helperPopoverProps?: React.ComponentPropsWithRef<typeof Popover>;\n /** Properties to pass to the helper popover content component. */\n helperPopoverContentProps?: React.ComponentPropsWithRef<\n typeof PopoverContent\n >;\n}\n\n/**\n * Table column component.\n *\n * This component doesn't actually render anything by itself; it is used by the\n * `TableHead` component to automatically create an appropriate header based on\n * the columns.\n */\nexport const TableColumn = React.forwardRef<\n React.ComponentRef<typeof TableCell>,\n TableColumnProps\n>(function TableColumn() {\n return null;\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr, setBoolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { TableFootContext, useTableContext } from \"./TableContext.ts\";\n\n/** Properties of the table foot component. */\nexport interface TableFootProps\n extends React.ComponentPropsWithoutRef<\"tfoot\"> {\n /**\n * Whether the table foot should be sticky.\n *\n * @default true\n */\n sticky?: boolean;\n}\n\n/** Table foot component. */\nexport const TableFoot = React.forwardRef<\n React.ComponentRef<\"tfoot\">,\n TableFootProps\n>(function TableFoot(\n { sticky = true, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { store } = useTableContext();\n\n // Set stuck data property on table foot when appropriate\n const tableFootRef = React.useRef<HTMLTableSectionElement | null>(null);\n React.useEffect(\n () =>\n store.subscribe(\n ({ scrollPosition }) =>\n sticky && scrollPosition != null && scrollPosition.bottom > 0,\n (isStuck) => setBoolDataAttr(tableFootRef.current, \"stuck\", isStuck),\n { fireImmediately: true },\n ),\n [sticky, store],\n );\n\n const combinedTableFootRef = useCombinedRef(tableFootRef, forwardedRef);\n return (\n <TableFootContext.Provider value={true}>\n <tfoot\n className={cx(prefix(\"table__foot\"), className)}\n data-sticky={boolDataAttr(sticky)}\n {...otherProps}\n ref={combinedTableFootRef}\n />\n </TableFootContext.Provider>\n );\n});\n","type EventHandler<T extends unknown[] = unknown[]> = (...args: T) => void;\n\nconst handlerCaches = new WeakMap<\n EventHandler<never>,\n WeakMap<EventHandler<never>, Partial<Record<\"true\" | \"false\", EventHandler>>>\n>();\n\n/** Options to pass to the `combineEventHandlers` function. */\nexport interface CombineEventHandlersOptions {\n /**\n * Whether to check whether an event's default behaviour has been cancelled\n * before running the second handler.\n *\n * @default false\n */\n checkDefaultPrevented?: boolean;\n}\n\n/**\n * Combines two event handlers into a single event handler.\n *\n * @param handler1 First event handler.\n * @param handler2 Second event handler.\n * @param options Options.\n * @returns Combined handler.\n */\nexport function combineEventHandlers<T extends unknown[] = unknown[]>(\n handler1: EventHandler<T>,\n handler2: EventHandler<T> | undefined,\n options?: CombineEventHandlersOptions,\n): EventHandler<T>;\nexport function combineEventHandlers<T extends unknown[] = unknown[]>(\n handler1: EventHandler<T> | undefined,\n handler2: EventHandler<T>,\n options?: CombineEventHandlersOptions,\n): EventHandler<T>;\nexport function combineEventHandlers(\n handler1: undefined,\n handler2: undefined,\n options?: CombineEventHandlersOptions,\n): undefined;\nexport function combineEventHandlers<T extends unknown[] = unknown[]>(\n handler1: EventHandler<T> | undefined,\n handler2: EventHandler<T> | undefined,\n options?: CombineEventHandlersOptions,\n): EventHandler<T> | undefined;\nexport function combineEventHandlers<T extends unknown[] = unknown[]>(\n handler1: EventHandler<T> | undefined,\n handler2: EventHandler<T> | undefined,\n { checkDefaultPrevented = false } = {},\n): EventHandler<T> | undefined {\n if (!handler1 || !handler2) {\n return handler1 ?? handler2;\n }\n\n let handler1Cache = handlerCaches.get(handler1);\n if (!handler1Cache) {\n handlerCaches.set(handler1, (handler1Cache = new WeakMap()));\n }\n let handler2Cache = handler1Cache.get(handler2);\n if (!handler2Cache) {\n handler1Cache.set(handler2, (handler2Cache = {}));\n }\n\n const checkDefaultPreventedStr = String(checkDefaultPrevented) as\n | \"true\"\n | \"false\";\n\n let combinedHandler = handler2Cache[checkDefaultPreventedStr];\n if (!combinedHandler) {\n handler2Cache[checkDefaultPreventedStr] = combinedHandler = (\n ...args: any\n ): void => {\n handler1(...args);\n if (!checkDefaultPrevented || !args[0]?.defaultPrevented) {\n handler2(...args);\n }\n };\n }\n\n return combinedHandler;\n}\n","import { VisuallyHidden as VisuallyHiddenPrimitive } from \"radix-ui\";\n\n/** Component that hides content from the screen in an accessible way. */\nexport const VisuallyHidden = VisuallyHiddenPrimitive.Root;\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Default table row height (with a single line of text or with form controls). */\nexport const DEFAULT_TABLE_ROW_HEIGHT = 41;\n\n/** Properties of the table row component. */\nexport interface TableRowProps extends React.ComponentPropsWithoutRef<\"tr\"> {\n /** Whether this row should be marked as being selected. */\n selected?: boolean;\n}\n\n/** Table row component. */\nexport const TableRow = React.forwardRef<\n React.ComponentRef<\"tr\">,\n TableRowProps\n>(function TableRow({ className, selected, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <tr\n className={cx(prefix(\"table__row\"), className)}\n data-selected={boolDataAttr(selected)}\n aria-selected={selected ? \"true\" : undefined}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import {\n faCircleQuestion,\n faSortDown,\n faSortUp,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr, setBoolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { controlStatusToAccent } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { type SortDirection } from \"../../utils/sorting.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { IconButton } from \"../IconButton\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport { Stack } from \"../Stack\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { TableCell } from \"./TableCell.tsx\";\nimport { TableColumn, type TableColumnProps } from \"./TableColumn.tsx\";\nimport { TableHeadContext, useTableContext } from \"./TableContext.ts\";\nimport { TableRow } from \"./TableRow.tsx\";\n\n/** Properties of the table head component. */\nexport interface TableHeadProps\n extends React.ComponentPropsWithoutRef<\"thead\"> {\n /**\n * Whether the table head should be sticky.\n *\n * @default true\n */\n sticky?: boolean;\n /**\n * Function that should return the description of the \"sort by\" button of each\n * column (passed to each sort button as `aria-description`).\n *\n * @param columnName Name of the column to sort.\n * @param direction Sort direction.\n */\n sortByColumnDescription?: (\n columnName: string,\n sortDirection: SortDirection | null,\n ) => string;\n /** Properties to pass to each row component. */\n rowProps?:\n | React.ComponentPropsWithoutRef<\"tr\">\n | ((index: number) => React.ComponentPropsWithoutRef<\"tr\">);\n}\n\n/** Table head component. */\nexport const TableHead = React.forwardRef<\n React.ComponentRef<\"thead\">,\n TableHeadProps\n>(function TableHead(\n {\n sticky = true,\n sortByColumnDescription,\n rowProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n sortByColumnDescription ??= locale.TableHead.sortByColumnDescription;\n const {\n status: tableStatus,\n layout,\n defaultColumnWidth,\n store,\n } = useTableContext();\n const columns = React.useMemo(\n () => columnsFromChildren(children),\n [children],\n );\n const nRows = React.useMemo(() => numberOfRows(columns), [columns]);\n const rows = React.useMemo(\n () => Array.from({ length: nRows }, (_, i) => columnsOfRow(columns, i)),\n [columns, nRows],\n );\n const generatedId = React.useId();\n\n // Set stuck data property on table head when appropriate\n const tableHeadRef = React.useRef<HTMLTableSectionElement | null>(null);\n React.useEffect(\n () =>\n store.subscribe(\n ({ scrollPosition }) =>\n sticky && scrollPosition != null && scrollPosition.top > 0,\n (isStuck) => setBoolDataAttr(tableHeadRef.current, \"stuck\", isStuck),\n { fireImmediately: true },\n ),\n [sticky, store],\n );\n\n // Update table state with column information\n React.useEffect(() => {\n const leaves = leafColumns(columns);\n store.setState({ numberOfColumns: leaves.length });\n if (layout === \"fixed\") {\n store.setState({\n columnWidths: columnWidths(leaves, defaultColumnWidth),\n });\n const { setTableMinWidth, setTableMaxWidth } = store.getState().actions;\n setTableMinWidth(tableMinWidth(leaves, defaultColumnWidth));\n setTableMaxWidth(tableMaxWidth(leaves, defaultColumnWidth));\n return () => store.setState({ columnWidths: undefined });\n }\n }, [columns, defaultColumnWidth, layout, store]);\n\n const leftMost = React.useMemo(() => leftMostColumns(columns), [columns]);\n const rightMost = React.useMemo(() => rightMostColumns(columns), [columns]);\n const combinedTableHeadRef = useCombinedRef(tableHeadRef, forwardedRef);\n return (\n <TableHeadContext.Provider value={true}>\n <thead\n className={cx(prefix(\"table__head\"), className)}\n data-sticky={boolDataAttr(sticky)}\n {...otherProps}\n ref={combinedTableHeadRef}\n >\n {rows.map((row, i) => (\n <TableRow\n key={i}\n {...(typeof rowProps === \"function\" ? rowProps(i) : rowProps)}\n >\n {row.map((column, j) => {\n const {\n label,\n labelText = typeof label === \"string\" ? label : \"\",\n helperText,\n helperButtonLabel = locale.TableColumn.helperButtonLabel,\n width,\n fixed: _fixed,\n header = true,\n align,\n sortable,\n defaultSortDirection = \"asc\",\n sorted,\n onSort,\n containerProps,\n labelProps,\n sortButtonProps,\n sortIconContainerProps,\n sortAscIconProps,\n sortDescIconProps,\n helperButtonProps,\n helperPopoverProps,\n helperPopoverContentProps,\n style,\n ...otherColumnProps\n } = column;\n\n const newSortDirection = !sorted\n ? defaultSortDirection\n : sorted === defaultSortDirection\n ? sorted === \"asc\"\n ? \"desc\"\n : \"asc\"\n : null;\n const sortDescriptionId = sortable\n ? prefix(`table-column-${j}-sort-description-${generatedId}`)\n : undefined;\n\n const helperTextEl = helperText && (\n <Popover modal={false} {...helperPopoverProps}>\n <PopoverTrigger>\n <IconButton\n variant=\"ghost\"\n icon={faCircleQuestion}\n color={controlStatusToAccent(tableStatus)}\n label={helperButtonLabel ?? \"\"}\n data-align={align}\n {...helperButtonProps}\n className={cx(\n prefix(\"table__column-helper-button\"),\n helperButtonProps?.className,\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n side=\"top\"\n {...helperPopoverContentProps}\n className={cx(\n prefix(\"table__column-helper-popover\"),\n helperPopoverContentProps?.className,\n )}\n >\n {helperText}\n </PopoverContent>\n </Popover>\n );\n\n return (\n <TableCell\n key={j}\n header={header}\n scope={\n header\n ? column.children.length > 0\n ? \"colgroup\"\n : \"col\"\n : undefined\n }\n align={align}\n rowSpan={numberOfRows([column]) > 1 ? 1 : nRows - i}\n colSpan={numberOfColumns([column])}\n style={{\n width:\n layout === \"fixed\" && width != null\n ? Array.isArray(width)\n ? width.reduce((sum, width) => sum + width, 0)\n : width\n : undefined,\n ...style,\n }}\n aria-sort={\n sorted === \"asc\"\n ? \"ascending\"\n : sorted === \"desc\"\n ? \"descending\"\n : undefined\n }\n {...otherColumnProps}\n data-left-most-column={boolDataAttr(\n leftMost.includes(column),\n )}\n data-right-most-column={boolDataAttr(\n rightMost.includes(column),\n )}\n >\n <Stack\n direction={align === \"right\" ? \"row-reverse\" : \"row\"}\n alignItems=\"center\"\n justifyContent={align === \"center\" ? \"center\" : undefined}\n gap={1.5}\n {...containerProps}\n >\n {!sortable && label && (\n <div\n data-align={align}\n {...labelProps}\n className={cx(\n prefix(\"table__column-label\"),\n labelProps?.className,\n )}\n >\n {label}\n </div>\n )}\n\n {sortable && (\n <Button\n variant=\"ghost\"\n data-align={align}\n {...sortButtonProps}\n className={cx(\n prefix(\"table__column-sort-button\"),\n sortButtonProps?.className,\n )}\n aria-describedby={mergeAriaIds(\n sortDescriptionId,\n sortButtonProps?.[\"aria-describedby\"],\n )}\n onClick={combineEventHandlers(\n sortButtonProps?.onClick,\n () => onSort?.(newSortDirection),\n { checkDefaultPrevented: true },\n )}\n >\n {label && (\n <div\n {...labelProps}\n className={cx(\n prefix(\"table__column-label\"),\n labelProps?.className,\n )}\n >\n {label}\n </div>\n )}\n\n {/* Sorting icons. */}\n {sortable && (\n <div\n {...sortIconContainerProps}\n className={cx(\n prefix(\"table__column-icon-container\"),\n \"fa-stack\",\n sortIconContainerProps?.className,\n )}\n >\n {/* Sort descending icon. */}\n <Icon\n data-state={\n sorted === \"desc\"\n ? \"active\"\n : (!sorted &&\n defaultSortDirection === \"desc\") ||\n (sorted && defaultSortDirection === \"asc\")\n ? \"next-active\"\n : \"inactive\"\n }\n {...sortDescIconProps}\n icon={faSortDown}\n className={cx(\n prefix(\"table__column-icon\"),\n \"fa-stack-1x\",\n sortDescIconProps?.className,\n )}\n />\n {/* Sort ascending icon. */}\n <Icon\n data-state={\n sorted === \"asc\"\n ? \"active\"\n : (!sorted &&\n defaultSortDirection === \"asc\") ||\n (sorted &&\n defaultSortDirection === \"desc\")\n ? \"next-active\"\n : \"inactive\"\n }\n {...sortAscIconProps}\n icon={faSortUp}\n className={cx(\n prefix(\"table__column-icon\"),\n \"fa-stack-1x\",\n sortAscIconProps?.className,\n )}\n />\n </div>\n )}\n\n {/* Hidden description of the sorting. */}\n {sortable && (\n <VisuallyHidden id={sortDescriptionId}>\n {sortByColumnDescription!(\n labelText,\n newSortDirection,\n )}\n </VisuallyHidden>\n )}\n </Button>\n )}\n\n {/* Helper text */}\n {helperTextEl}\n </Stack>\n </TableCell>\n );\n })}\n </TableRow>\n ))}\n {children}\n </thead>\n </TableHeadContext.Provider>\n );\n});\n\n/** Representation of a table column in object notation. */\ntype Column = Omit<\n TableColumnProps & React.RefAttributes<React.ComponentRef<typeof TableCell>>,\n \"children\"\n> & {\n children: Column[];\n};\n\n/** Gets the list of columns from the head's `children`. */\nfunction columnsFromChildren(children: React.ReactNode): Column[] {\n return (\n React.Children.toArray(children).filter(\n (child) => React.isValidElement(child) && child.type === TableColumn,\n ) as React.ReactElement<TableColumnProps, typeof TableColumn>[]\n ).map((child) => ({\n ...child.props,\n children: columnsFromChildren(child.props.children ?? null),\n }));\n}\n\n/** Total number of table rows of the head. */\nfunction numberOfRows(columns: Column[]): number {\n return columns.reduce(\n (n, column) => Math.max(n, numberOfRows(column.children) + 1),\n 0,\n );\n}\n\n/** Total number of (leaf) table cells of the head. */\nfunction numberOfColumns(columns: Column[]): number {\n return columns.reduce(\n (n, column) =>\n n + (column.children.length === 0 ? 1 : numberOfColumns(column.children)),\n 0,\n );\n}\n\n/** List of columns of the row with provided index. */\nfunction columnsOfRow(columns: Column[], index: number): Column[] {\n return index === 0\n ? columns\n : columns.reduce((rowColumns: Column[], column) => {\n rowColumns.push(...columnsOfRow(column.children, index - 1));\n return rowColumns;\n }, []);\n}\n\n/** List of \"leaf\" columns (columns with no children, i.e. the \"bottom\" ones). */\nfunction leafColumns(columns: Column[]): Column[] {\n return columns.reduce((leaves: Column[], column) => {\n leaves.push(\n ...(column.children.length === 0\n ? [column]\n : leafColumns(column.children)),\n );\n return leaves;\n }, []);\n}\n\n/** Minimum table width. */\nfunction tableMinWidth(leaves: Column[], defaultColumnWidth: number): string {\n return (\n leaves.reduce(\n (sum, column) => sum + columnWidth(column, defaultColumnWidth),\n 0,\n ) + \"px\"\n );\n}\n\n/** Maximum table width. */\nfunction tableMaxWidth(\n leaves: Column[],\n defaultColumnWidth: number,\n): string | undefined {\n return leaves.every((column) => column.fixed)\n ? tableMinWidth(leaves, defaultColumnWidth)\n : undefined;\n}\n\n/** Returns the widths of all columns when in \"fixed\" layout. */\nfunction columnWidths(leaves: Column[], defaultColumnWidth: number): string[] {\n // Columns not set as `fixed` should expand as necessary, as such we provide\n // them with widths that together add up to `100%`\n const dynamicWidthsSum = leaves.reduce(\n (sum, column) =>\n sum + (column.fixed ? 0 : columnWidth(column, defaultColumnWidth)),\n 0,\n );\n return leaves.reduce((widths: string[], column) => {\n const colSpan = column.colSpan ?? 1;\n // Determine the widths of each column being spanned by `column`\n const colWidths = Array.isArray(column.width)\n ? column.width\n : // Distribute the width amongst the columns being spanned\n [...Array(colSpan)].map(\n () => columnWidth(column, defaultColumnWidth) / colSpan,\n );\n for (let i = 0; i < colSpan; ++i) {\n // Columns will end up with a width of `0` when a `minWidth` array is\n // provided with length smaller than `colSpan`\n const colWidth = colWidths[i] ?? 0;\n widths.push(\n column.fixed\n ? `${colWidth}px`\n : `${(colWidth / dynamicWidthsSum) * 100}%`,\n );\n }\n return widths;\n }, []);\n}\n\n/** Width of a column in \"fixed\" layout. */\nfunction columnWidth(column: Column, defaultColumnsMinWidth: number): number {\n return Array.isArray(column.width)\n ? column.width.reduce((sum, width) => sum + width, 0)\n : (column.width ?? defaultColumnsMinWidth * (column.colSpan ?? 1));\n}\n\n/** Left-most columns. */\nfunction leftMostColumns(columns: Column[]): Column[] {\n if (columns.length === 0) {\n return [];\n }\n const firstColumn = columns[0];\n return [firstColumn, ...leftMostColumns(firstColumn.children)];\n}\n\n/** Right-most columns. */\nfunction rightMostColumns(columns: Column[]): Column[] {\n if (columns.length === 0) {\n return [];\n }\n const lastColumn = columns[columns.length - 1];\n return [lastColumn, ...rightMostColumns(lastColumn.children)];\n}\n","import { type ScrollToOptions } from \"@tanstack/react-virtual\";\nimport * as React from \"react\";\n\n/** Options used when using the `goTo` function of the `DataTableApi`. */\nexport type DataTableScrollToOptions = ScrollToOptions;\n\n/** Imperative data table API. */\nexport interface DataTableApi<T = unknown> {\n /**\n * Function that provides a way of notifying that changes have been made to\n * the table rows when using the `getRows`/`count` API. Either this function\n * or `refresh` should be called after changing the table's `count`.\n *\n * @param startIndex Index of where to change started.\n * @param deleteCount Number of rows deleted from `startIndex`. Defaults to\n * `0`.\n * @param added Either the number of rows added, or an array with the added\n * rows themselves. Defaults to `0`.\n */\n splice: (startIndex: number, deleted?: number, added?: number | T[]) => void;\n /**\n * Refreshes the data table provided its new total count (if it changed).\n *\n * @param newTotalCount New total number of rows, in case it changed. Set to\n * `null` to specify that the new total count is unknown. Set to `undefined`\n * when the new total count shouldn't change.\n */\n refresh: (newTotalCount?: number | null) => void;\n /**\n * Navigates to the row with the provided index.\n *\n * @param index Index of row to navigate to.\n * @param scrollOptions Options used to configure to scrolling to the row\n * (only relevant in scrolled display mode).\n */\n goTo: (index: number, scrollOptions?: DataTableScrollToOptions) => void;\n}\n\n/** Hook used to access the data table API. */\nexport function useDataTableApiRef(): React.RefObject<DataTableApi | null> {\n return React.useRef<DataTableApi>(null);\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { TableCell } from \"../Table\";\nimport { DataTableCellContext } from \"./DataTableContext.ts\";\n\n/** Properties of a data table cell. */\nexport interface DataTableCellProps\n extends React.ComponentPropsWithoutRef<typeof TableCell> {\n columnLabel?: React.ReactNode;\n columnLabelId?: string;\n}\n\n/** Data table cell. */\nexport const DataTableCell = React.forwardRef<\n React.ComponentRef<typeof TableCell>,\n DataTableCellProps\n>(function DataTableCell(\n { columnLabel, columnLabelId, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n return (\n <DataTableCellContext.Provider value={{ columnLabel, columnLabelId }}>\n <TableCell\n className={cx(prefix(\"data-table__cell\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n </DataTableCellContext.Provider>\n );\n});\n","/** Result of matching a formatted value against a filter. */\nexport interface MatchAgainstFilter {\n /** Content before the matched content. */\n before: string;\n /** Matched content. */\n matched: string;\n /** Content after the matched content. */\n after: string;\n}\n\n/**\n * Matches a string value against a filter and returns the match or `null` when\n * the value doesn't match.\n */\nexport function matchAgainstFilter(\n value: string,\n filter: string,\n locale: string,\n): MatchAgainstFilter | null {\n if (value === \"\" || filter === \"\") {\n return null;\n }\n const normalizedField = value.toLocaleLowerCase(locale);\n const normalizedFilter = filter.toLocaleLowerCase(locale);\n const index = normalizedField.indexOf(normalizedFilter);\n return index === -1\n ? null\n : {\n before: value.slice(0, index),\n matched: value.slice(index, index + filter.length),\n after: value.slice(index + filter.length),\n };\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Possible mark colours. */\nexport type MarkColor = AccentColor;\n\n/** Properties of the mark component. */\nexport interface MarkProps extends React.ComponentPropsWithoutRef<\"mark\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Colour to use for marking the text.\n *\n * @default warning\n */\n color?: MarkColor;\n}\n\n/**\n * Component used to mark or highlight text for reference or notation purposes.\n * It is built on top of the browser's [`<mark>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/mark).\n *\n * Example usage:\n *\n * ```tsx\n * import { Mark } from \"@ostack.tech/ui\";\n *\n * function HighlightedPassage() {\n * return (\n * <>\n * “The study found that{\" \"}\n * <Mark>climate change significantly impacts biodiversity</Mark>,\n * leading to habitat loss and species extinction.”\n * </>\n * );\n * }\n * ```\n */\nexport const Mark = React.forwardRef<React.ComponentRef<\"mark\">, MarkProps>(\n function Mark(\n { asChild, color = \"warning\", className, ...otherProps },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"mark\";\n return (\n <As\n className={cx(prefix(\"mark\"), className)}\n role={asChild ? \"mark\" : undefined}\n data-accent={color}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n },\n);\n","import type * as React from \"react\";\n\nimport { type DataTableProps } from \"./DataTable.tsx\";\n\n/** Returns the key of a row. */\nexport function getRowKey<T = unknown>(\n row: T,\n rowKey: DataTableProps<T>[\"rowKey\"],\n): React.Key {\n return typeof rowKey === \"function\"\n ? rowKey(row)\n : (row[rowKey as keyof T] as React.Key);\n}\n","import * as React from \"react\";\n\nexport interface CheckboxGroupContextValue {\n name?: string;\n value: string[];\n onCheckedChange: (value: string, checked: boolean) => void;\n}\n\n/** Checkbox group context. */\nexport const CheckboxGroupContext =\n React.createContext<CheckboxGroupContextValue | null>(null);\n","import * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport {\n ControlContext,\n type ControlStatus,\n type ControlVariant,\n useControlContext,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot, Slottable } from \"../Slot\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\n/** Properties of the control's code component. */\nexport interface ControlCodeProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /** Variant of the control code. */\n variant?: ControlVariant;\n /**\n * Sets the status of the code (this should typically be the same as the\n * control's status).\n */\n status?: ControlStatus;\n /** Text prefixed to the code to be announced by assistive technologies. */\n visuallyHiddenPrefix?: React.ReactNode;\n}\n\n/** Component used to display the \"code\" of a form control. */\nexport const ControlCode = React.forwardRef<\n React.ComponentRef<\"div\">,\n ControlCodeProps\n>(function ControlCode(\n {\n asChild,\n variant = \"default\",\n status,\n visuallyHiddenPrefix,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n visuallyHiddenPrefix ??= locale.ControlCode.visuallyHiddenPrefix;\n const controlContext = useControlContext();\n\n const As = asChild ? Slot : \"div\";\n return (\n <ControlContext.Provider value={null}>\n <As\n className={cx(prefix(\"control-code\"), className)}\n data-variant={controlContext?.variant ?? variant}\n data-status={controlContext?.status ?? status}\n ref={forwardedRef}\n {...otherProps}\n >\n {visuallyHiddenPrefix && (\n <VisuallyHidden>{visuallyHiddenPrefix} </VisuallyHidden>\n )}\n <Slottable>{children}</Slottable>\n </As>\n </ControlContext.Provider>\n );\n});\n","import * as React from \"react\";\nimport { create } from \"zustand\";\n\nimport { computed } from \"./zustandUtils.ts\";\n\n/** Scrollbar measurements. */\ninterface ScrollbarMeasurements {\n height: number;\n width: number;\n}\n\n/** Hook returning the measurements of the browser's scrollbars. */\nexport function useScrollbarSize(): ScrollbarMeasurements {\n React.useEffect(\n () => useScrollbarSizeStore.getState().actions.subscribe(),\n [],\n );\n return useScrollbarSizeStore((state) => state.measurements);\n}\n\n/** State of the store keeping track of scrollbar sizes. */\ninterface ScrollbarSizeStoreState {\n measurements: ScrollbarMeasurements;\n element: () => HTMLDivElement;\n subscriptionCount: number;\n actions: {\n subscribe: () => () => void;\n unsubscribe: () => void;\n updateMeasurements: () => void;\n };\n}\n\n/** Hook providing access to the scrollbar size's store. */\nconst useScrollbarSizeStore = create<ScrollbarSizeStoreState>((set, get) => ({\n measurements: { height: 0, width: 0 },\n element: computed(\n () => [],\n () => {\n const element = document.createElement(\"div\");\n element.style.width = \"99px\";\n element.style.height = \"99px\";\n element.style.overflow = \"scroll\";\n element.style.position = \"absolute\";\n element.style.top = \"-9999px\";\n element.ariaHidden = \"true\";\n element.role = \"presentation\";\n return element;\n },\n ),\n subscriptionCount: 0,\n actions: {\n subscribe: () => {\n const { element, subscriptionCount, actions } = get();\n if (subscriptionCount === 0) {\n window.addEventListener(\"resize\", actions.updateMeasurements);\n document.body.appendChild(element());\n actions.updateMeasurements();\n }\n set((state) => ({ subscriptionCount: state.subscriptionCount + 1 }));\n return actions.unsubscribe;\n },\n unsubscribe: () => {\n const { element, subscriptionCount, actions } = get();\n set((state) => ({ subscriptionCount: state.subscriptionCount - 1 }));\n if (subscriptionCount === 0) {\n window.removeEventListener(\"resize\", actions.updateMeasurements);\n document.body.removeChild(element());\n }\n },\n updateMeasurements: () => {\n const { offsetHeight, clientHeight, offsetWidth, clientWidth } =\n get().element();\n const scrollbarHeight = offsetHeight - clientHeight;\n const scrollbarWidth = offsetWidth - clientWidth;\n\n set((state) => {\n const { height, width } = state.measurements;\n return height !== scrollbarHeight || width !== scrollbarWidth\n ? { measurements: { height: scrollbarHeight, width: scrollbarWidth } }\n : { measurements: state.measurements };\n });\n },\n },\n}));\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { TableCell, TableRow, useTableNumberOfColumns } from \"../Table\";\nimport { type DataTableContentProps } from \"./DataTableContent.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { DataTableRow } from \"./DataTableRow.tsx\";\n\n/** Properties of the data table empty/loading row. */\nexport interface DataTableEmptyOrLoadingRowProps\n extends Pick<DataTableContentProps, \"emptyMessage\" | \"emptyMessageProps\"> {}\n\n/**\n * Data table rows displayed when the data table is either loading or has no\n * rows.\n */\nexport function DataTableEmptyOrLoadingRows({\n emptyMessage,\n emptyMessageProps,\n}: DataTableEmptyOrLoadingRowProps) {\n const prefix = usePrefix();\n const { showSelectionColumn, renderRow, store, apiRef } =\n useDataTableContext();\n const loading = useStore(store, (state) => state.loading);\n const loadingCount = useStore(store, (state) => state.loadingCount);\n const numberOfColumns =\n (useTableNumberOfColumns() ?? 1) + (showSelectionColumn ? 1 : 0);\n\n // Set up the API\n React.useImperativeHandle(\n apiRef,\n () => ({\n splice: () => {},\n refresh: () => {},\n goTo: () => {},\n }),\n [],\n );\n\n return loading ? (\n Array.from({ length: loadingCount }, (_, i) => {\n const props = { row: undefined, index: i };\n const key = `loading-${i}`;\n return renderRow ? (\n <React.Fragment key={key}>{renderRow(props)}</React.Fragment>\n ) : (\n <DataTableRow key={key} {...props} />\n );\n })\n ) : (\n <TableRow>\n <TableCell paddingless={false} colSpan={numberOfColumns}>\n {!loading && (\n <div\n className={cx(\n prefix(\"data-table__empty-message\"),\n emptyMessageProps?.className,\n )}\n >\n {emptyMessage}\n </div>\n )}\n </TableCell>\n </TableRow>\n );\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\n\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { DataTableRow } from \"./DataTableRow.tsx\";\nimport { getRowKey } from \"./getRowKey.ts\";\n\n/** Body of the data table in \"paged\" display mode. */\nexport function PagedDataTableRows<T = unknown>() {\n const { rowKey, renderRow, apiRef, store } = useDataTableContext<T>();\n\n const splice = React.useCallback(\n (startIndex: number, deleted = 0, added: number | T[] = 0) => {\n const { pageOffset, limit, actions } = store.getState();\n actions.spliceWindow(pageOffset(), limit, startIndex, deleted, added);\n },\n [store],\n );\n\n const refresh = React.useCallback(\n (newTotalCount?: number | null) =>\n store.getState().actions.refresh(newTotalCount),\n [store],\n );\n\n const goTo = React.useCallback(\n (index: number) =>\n React.startTransition(() => store.getState().actions.setOffset(index)),\n [store],\n );\n\n // Set up the API\n React.useImperativeHandle(apiRef, () => ({ splice, refresh, goTo }), [\n goTo,\n refresh,\n splice,\n ]);\n\n // Update the window whenever `updateCounter` changes\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.updateCounter,\n () => {\n const { pageOffset, pageLimit, limit, actions } = store.getState();\n actions.updateWindow(pageOffset(), pageLimit() ?? limit);\n },\n { fireImmediately: true },\n ),\n [goTo, store],\n );\n\n const pageOffset = useStore(store, (state) => state.pageOffset());\n const rowsWindow = useStore(\n store,\n useShallow((state) =>\n state.rowsWindow(\n state.pageOffset(),\n state.pageLimit() ?? state.loadingCount,\n ),\n ),\n );\n\n return rowsWindow.map((row, i) => {\n const props = { row, index: pageOffset + i };\n const key = row ? `row-${getRowKey(row, rowKey)}` : `loading-${i}`;\n return renderRow ? (\n <React.Fragment key={key}>{renderRow(props)}</React.Fragment>\n ) : (\n <DataTableRow key={key} {...props} />\n );\n });\n}\n","import {\n observeElementRect,\n useVirtualizer,\n type VirtualItem,\n type Virtualizer,\n} from \"@tanstack/react-virtual\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\n\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { type DataTableScrollToOptions } from \"./DataTableApi.ts\";\nimport { type DataTableBodyProps } from \"./DataTableBody.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { DataTableRow } from \"./DataTableRow.tsx\";\nimport { getRowKey } from \"./getRowKey.ts\";\n\n/** Properties of the scrolled data table body component. */\ninterface ScrolledDataTableRowsProps\n extends Pick<DataTableBodyProps, \"containerRef\"> {}\n\n/** Body of the data table in \"scrolled\" display mode. */\nexport function ScrolledDataTableRows<T = unknown>({\n containerRef,\n}: ScrolledDataTableRowsProps) {\n const {\n rowKey,\n renderRow,\n dynamicRowHeight,\n estimatedRowHeight,\n overscan,\n apiRef,\n store,\n } = useDataTableContext<T>();\n const tableHeadHeight = useStore(store, (state) => state.tableHeadHeight);\n const bodyCount = useStore(store, (state) => state.bodyCount());\n\n // eslint-disable-next-line react-hooks/incompatible-library\n const virtualizer = useVirtualizer<HTMLDivElement, HTMLTableRowElement>({\n count: bodyCount,\n getScrollElement: React.useCallback(\n () => containerRef.current,\n [containerRef],\n ),\n estimateSize: React.useCallback(\n (index: number) =>\n typeof estimatedRowHeight === \"number\"\n ? estimatedRowHeight\n : estimatedRowHeight(index),\n [estimatedRowHeight],\n ),\n overscan,\n // The height of the scrolling container should ignore the sticky header,\n // since any elements behind it are hidden\n observeElementRect: React.useCallback(\n (\n virtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>,\n cb: (rect: { width: number; height: number }) => void,\n ) =>\n observeElementRect(virtualizer, ({ width, height }) =>\n cb({\n width,\n height:\n height -\n (tableHeadHeight ??\n (typeof estimatedRowHeight === \"number\"\n ? estimatedRowHeight\n : estimatedRowHeight(0))),\n }),\n ),\n [estimatedRowHeight, tableHeadHeight],\n ),\n onChange: (virtualizer, sync) => {\n if (!sync) {\n update(virtualizer.getVirtualItems());\n }\n },\n });\n\n const update = React.useCallback(\n (virtualItems: VirtualItem[]) => {\n const { offset, limit, totalCount, actions } = store.getState();\n\n // Initial update (when the total count isn't yet known)\n if (totalCount() == null) {\n const from = Math.max(0, offset() - overscan);\n const to = offset() + limit + overscan;\n actions.updateWindow(from, to - from + 1);\n } else {\n actions.updateWindow(virtualItems[0]?.index ?? 0, virtualItems.length);\n }\n },\n [overscan, store],\n );\n\n // Update the window whenever `updateCounter` changes\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.updateCounter,\n () => update(virtualizer.getVirtualItems()),\n ),\n [store, update, virtualizer],\n );\n\n const splice = React.useCallback(\n (startIndex: number, deleted = 0, added: number | T[] = 0) => {\n const { limit, actions } = store.getState();\n const windowOffset = virtualizer.getVirtualItems()[0]?.index ?? 0;\n const windowLimit = limit + Math.min(windowOffset, overscan) + overscan;\n actions.spliceWindow(\n windowOffset,\n windowLimit,\n startIndex,\n deleted,\n added,\n );\n },\n [overscan, store, virtualizer],\n );\n\n const refresh = React.useCallback(\n (newCount?: number | null) => {\n store.getState().actions.refresh(newCount);\n virtualizer.measure();\n },\n [store, virtualizer],\n );\n\n const goTo = React.useCallback(\n (index: number, options?: DataTableScrollToOptions) => {\n const state = store.getState();\n const totalCount = state.totalCount();\n if (totalCount != null && totalCount > state.limit) {\n if (index < totalCount - 1) {\n virtualizer.scrollToIndex(index, options);\n } else {\n // Make sure to scroll to the very bottom when going to the last row\n virtualizer.scrollToOffset(Infinity, { align: \"end\", ...options });\n }\n }\n },\n [store, virtualizer],\n );\n\n // Set up the API\n React.useImperativeHandle(apiRef, () => ({ splice, refresh, goTo }), [\n goTo,\n refresh,\n splice,\n ]);\n\n const virtualItems = virtualizer.getVirtualItems();\n const firstVirtualItem = virtualItems[0];\n const lastVirtualItem = virtualItems[virtualItems.length - 1];\n const rowsWindow = useStore(\n store,\n useShallow((state) =>\n state.rowsWindow(firstVirtualItem?.index ?? 0, virtualItems.length),\n ),\n );\n\n // Scroll to the offset when it changes while not scrolling\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.offset(),\n (offset) => !virtualizer.isScrolling && goTo(offset),\n ),\n [goTo, store, virtualizer],\n );\n\n // Update offset and range when it changes\n const { startIndex = 0, endIndex = 0 } = virtualizer.range ?? {};\n React.useEffect(() => {\n React.startTransition(() => {\n store.getState().actions.setOffset(startIndex);\n store.setState({\n scrolledRangeStart: startIndex,\n scrolledRangeEnd: endIndex,\n });\n });\n }, [endIndex, startIndex, store]);\n\n return (\n <>\n <tr aria-hidden=\"true\">\n <td\n style={{\n height: firstVirtualItem?.start ?? 0,\n padding: 0,\n border: 0,\n }}\n />\n </tr>\n {virtualItems.map((virtualRow, i) => {\n const props = {\n row: rowsWindow[i],\n index: virtualRow.index,\n \"data-index\": dynamicRowHeight ? virtualRow.index : undefined,\n // Inverted even/odd logic since row 1 has index 0, etc.\n \"data-even-row\": boolDataAttr(virtualRow.index % 2 !== 0),\n \"data-odd-row\": boolDataAttr(virtualRow.index % 2 === 0),\n \"data-last-row\": boolDataAttr(virtualRow.index === bodyCount - 1),\n ref: dynamicRowHeight ? virtualizer.measureElement : undefined,\n };\n const key = rowsWindow[i]\n ? `row-${getRowKey(rowsWindow[i], rowKey)}`\n : `loading-${i}`;\n return renderRow ? (\n <React.Fragment key={key}>{renderRow(props)}</React.Fragment>\n ) : (\n <DataTableRow key={key} {...props} />\n );\n })}\n <tr aria-hidden=\"true\">\n <td\n style={{\n height: virtualizer.getTotalSize() - (lastVirtualItem?.end ?? 0),\n padding: 0,\n border: 0,\n }}\n />\n </tr>\n </>\n );\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { TableBody } from \"../Table\";\nimport { type DataTableContentProps } from \"./DataTableContent.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { DataTableEmptyOrLoadingRows } from \"./DataTableEmptyOrLoadingRows.tsx\";\nimport { PagedDataTableRows } from \"./PagedDataTableRows.tsx\";\nimport { ScrolledDataTableRows } from \"./ScrolledDataTableRows.tsx\";\n\n/** Properties of the data table foot component. */\nexport interface DataTableBodyProps\n extends React.ComponentPropsWithoutRef<typeof TableBody>,\n Pick<DataTableContentProps, \"emptyMessage\" | \"emptyMessageProps\"> {\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n}\n\n/** Body of the data table. */\nexport const DataTableBody = React.forwardRef<\n React.ComponentRef<typeof TableBody>,\n DataTableBodyProps\n>(function DataTableBody(\n { emptyMessage, emptyMessageProps, containerRef, ...otherProps },\n forwardedRef,\n) {\n const { displayMode, store } = useDataTableContext();\n\n const isEmptyOrLoading = useStore(\n store,\n (state) => state.loading || state.totalCount() === 0,\n );\n\n return (\n <TableBody {...otherProps} ref={forwardedRef}>\n {isEmptyOrLoading && (\n <DataTableEmptyOrLoadingRows\n emptyMessage={emptyMessage}\n emptyMessageProps={emptyMessageProps}\n />\n )}\n {!isEmptyOrLoading &&\n (displayMode === \"paged\" ? (\n <PagedDataTableRows />\n ) : (\n <ScrolledDataTableRows containerRef={containerRef} />\n ))}\n </TableBody>\n );\n});\n","import * as React from \"react\";\n\n/** `useLayoutEffect` hook which performs a noop when run on the server. */\nexport const useLayoutEffect =\n typeof document !== \"undefined\" ? React.useLayoutEffect : () => {};\n","import { useLayoutEffect } from \"./useLayoutEffect.ts\";\n\n/**\n * Hook that tracks the dimensions of an HTML element using the Resize Observer\n * API.\n */\n// Adapted from https://github.com/streamich/react-use/blob/master/src/useMeasure.ts\nexport function useMeasure<T extends Element = Element>(\n element: T | null,\n setMeasurement: (measurement: DOMRectReadOnly | undefined) => void,\n) {\n useLayoutEffect(() => {\n if (!element) {\n setMeasurement(undefined);\n return;\n }\n\n setMeasurement(element.getBoundingClientRect());\n\n const observer = new ResizeObserver(\n ([entry]) => entry && setMeasurement(element.getBoundingClientRect()),\n );\n observer.observe(element);\n\n return () => {\n observer.disconnect();\n setMeasurement(undefined);\n };\n }, [element, setMeasurement]);\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useMeasure } from \"../../utils/useMeasure.ts\";\nimport { TableFoot } from \"../Table\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\n\n/** Properties of the data table foot component. */\nexport interface DataTableFootProps\n extends React.ComponentPropsWithoutRef<typeof TableFoot> {\n showWhenEmpty: boolean;\n}\n\n/** Foot of the data table. */\nexport const DataTableFoot = React.forwardRef<\n React.ComponentRef<typeof TableFoot>,\n DataTableFootProps\n>(function DataTableFoot({ showWhenEmpty, ...otherProps }, forwardedRef) {\n const { store } = useDataTableContext();\n const shouldShow = useStore(\n store,\n (state) =>\n showWhenEmpty || (!state.loading && (state.totalCount() ?? 0) > 0),\n );\n\n const [tableFootEl, setTableFootEl] =\n React.useState<HTMLTableSectionElement | null>(null);\n useMeasure(\n tableFootEl,\n React.useCallback(\n (measurement) => store.setState({ tableFootHeight: measurement?.height }),\n [store],\n ),\n );\n\n const combinedTableFootRef = useCombinedRef(setTableFootEl, forwardedRef);\n return shouldShow && <TableFoot {...otherProps} ref={combinedTableFootRef} />;\n});\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\n\nimport { type SortDirection } from \"../../utils/sorting.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useMeasure } from \"../../utils/useMeasure.ts\";\nimport { TableColumn, TableHead } from \"../Table\";\nimport { type DataTableColumns } from \"./DataTableColumn.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport {\n useDataTableSelectionColumn,\n useDataTableSelectionColumnId,\n} from \"./useDataTableSelectionColumn.tsx\";\n\n/** Properties of the data table head component. */\nexport interface DataTableHeadProps\n extends React.ComponentPropsWithoutRef<typeof TableHead> {}\n\n/** Head of the data table. */\nexport const DataTableHead = React.forwardRef<\n React.ComponentRef<typeof TableHead>,\n DataTableHeadProps\n>(function DataTableHead({ rowProps, ...otherProps }, forwardedRef) {\n const { generatedId, store } = useDataTableContext();\n const selectionColumn = useDataTableSelectionColumn();\n const dataTableSelectionColumnId = useDataTableSelectionColumnId();\n const columns = useStore(\n store,\n useShallow((state) =>\n selectionColumn\n ? {\n [dataTableSelectionColumnId]: selectionColumn,\n ...state.columns,\n }\n : state.columns,\n ),\n );\n const sortBy = useStore(store, (state) => state.sortBy);\n const sortDirection = useStore(store, (state) => state.sortDirection);\n const { setSort } = useStore(store, (state) => state.actions);\n\n const [tableHeadEl, setTableHeadEl] =\n React.useState<HTMLTableSectionElement | null>(null);\n useMeasure(\n tableHeadEl,\n React.useCallback(\n (measurement) => store.setState({ tableHeadHeight: measurement?.height }),\n [store],\n ),\n );\n\n const combinedTableHeadRef = useCombinedRef(setTableHeadEl, forwardedRef);\n return (\n <TableHead\n {...otherProps}\n rowProps={React.useCallback(\n (i: number) => ({\n ...(typeof rowProps === \"function\" ? rowProps(i) : rowProps),\n \"aria-rowindex\": i + 1,\n }),\n [rowProps],\n )}\n ref={combinedTableHeadRef}\n >\n {renderDataTableColumns(columns, generatedId, {\n sortBy,\n sortDirection,\n onSort: React.useCallback(\n (...args) => React.startTransition(() => setSort(...args)),\n [setSort],\n ),\n })}\n </TableHead>\n );\n});\n\n/** Function that renders all columns. */\nfunction renderDataTableColumns<T>(\n columns: DataTableColumns<T> | undefined,\n generatedId: string,\n sortingProps: {\n sortBy: string | null;\n sortDirection: SortDirection;\n onSort: (sortBy: string | null, sortDirection: SortDirection) => void;\n },\n) {\n return (\n columns &&\n Object.entries(columns).map(\n ([\n columnName,\n {\n sortable,\n subColumns,\n // `DataTableColumn` props not to be passed to `TableColumn`\n filterable: _filterable,\n paddingless: _paddingless,\n getValue: _getValue,\n format: _format,\n render: _render,\n compare: _compare,\n labelProps,\n ...column\n },\n ]) => (\n <TableColumn\n key={columnName}\n {...column}\n sortable={sortable}\n sorted={\n sortable && sortingProps.sortBy === columnName\n ? sortingProps.sortDirection\n : undefined\n }\n onSort={(sortDirection) =>\n sortDirection\n ? sortingProps.onSort(columnName, sortDirection)\n : sortingProps.onSort(null, \"asc\")\n }\n labelProps={{\n id:\n labelProps?.id ??\n `data-table-column-label-${columnName}-${generatedId}`,\n ...labelProps,\n }}\n >\n {renderDataTableColumns(subColumns, generatedId, sortingProps)}\n </TableColumn>\n ),\n )\n );\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useScrollbarSize } from \"../../utils/useScrollbarSize.ts\";\nimport {\n Table,\n type TableBody,\n type TableFoot,\n type TableHead,\n} from \"../Table\";\nimport { DataTableBody } from \"./DataTableBody.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { DataTableFoot } from \"./DataTableFoot.tsx\";\nimport { DataTableHead } from \"./DataTableHead.tsx\";\n\n/** Properties of the data table content component. */\nexport interface DataTableContentProps\n extends Omit<React.ComponentPropsWithoutRef<typeof Table>, \"layout\"> {\n /** Message to display when the data table contains no rows. */\n emptyMessage?: React.ReactNode;\n /** Content of the table foot component. */\n tableFootContent?: React.ReactNode;\n /**\n * Whether the table foot show be shown when the data table is empty.\n *\n * @default false\n */\n showTableFootWhenEmpty?: boolean;\n /** Properties to pass to the table head component. */\n tableHeadProps?: React.ComponentPropsWithRef<typeof TableHead>;\n /** Properties to pass to the table body component. */\n tableBodyProps?: React.ComponentPropsWithRef<typeof TableBody>;\n /** Properties to pass to the table foot component, when one exists. */\n tableFootProps?: React.ComponentPropsWithRef<typeof TableFoot>;\n /** Properties to pass to the component containing the empty message. */\n emptyMessageProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/**\n * Component containing the \"main content\" of the data table, i.e. the table\n * itself.\n */\nexport const DataTableContent = React.forwardRef<\n React.ComponentRef<typeof Table>,\n DataTableContentProps\n>(function DataTable(\n {\n emptyMessage,\n tableFootContent,\n showTableFootWhenEmpty = false,\n containerProps,\n tableHeadProps,\n tableBodyProps,\n emptyMessageProps,\n tableFootProps,\n className,\n ...otherProps\n }: DataTableContentProps,\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n emptyMessage ??= locale.DataTable.emptyMessage;\n\n const { displayMode, required, estimatedRowHeight, store } =\n useDataTableContext();\n const tableRef = React.useRef<HTMLTableElement | null>(null);\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n\n const { height: scrollbarHeight } = useScrollbarSize();\n const rowHeight =\n typeof estimatedRowHeight === \"number\"\n ? estimatedRowHeight\n : estimatedRowHeight(0);\n const maxHeight = useStore(store, (state) =>\n displayMode === \"scrolled\" &&\n !state.loading &&\n (state.totalCount() ?? 0) > state.limit\n ? (state.tableHeadHeight ?? rowHeight) +\n (state.tableFootHeight ?? 0) +\n rowHeight * state.limit +\n // TODO: Only add this if the container overflows horizontally\n scrollbarHeight\n : undefined,\n );\n const stickyHeadFoot = maxHeight !== undefined;\n\n // Update `aria-rowcount` of the table when head count/count change\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.headCount + state.bodyCount(),\n (totalCount) => {\n tableRef.current!.ariaRowCount = totalCount.toString();\n },\n { fireImmediately: true },\n ),\n [store],\n );\n\n const combinedContainerRef = useCombinedRef(\n containerRef,\n containerProps?.ref,\n );\n const combinedTableRef = useCombinedRef(tableRef, forwardedRef);\n return (\n <Table\n className={cx(prefix(\"data-table__content\"), className)}\n required={required}\n maxHeight={maxHeight}\n containerProps={{\n ...containerProps,\n className: cx(\n prefix(\"data-table__content-container\"),\n containerProps?.className,\n ),\n ref: combinedContainerRef,\n }}\n {...otherProps}\n layout=\"fixed\"\n ref={combinedTableRef}\n >\n <DataTableHead sticky={stickyHeadFoot} {...tableHeadProps} />\n\n <DataTableBody\n containerRef={containerRef}\n emptyMessage={emptyMessage}\n emptyMessageProps={emptyMessageProps}\n {...tableBodyProps}\n />\n\n {tableFootContent && (\n <DataTableFoot\n sticky={stickyHeadFoot}\n showWhenEmpty={showTableFootWhenEmpty}\n {...tableFootProps}\n >\n {tableFootContent}\n </DataTableFoot>\n )}\n </Table>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n type ControlVariant,\n useControlContext,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the control addon component. */\nexport interface ControlAddonProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /** Variant of the control addon. */\n variant?: ControlVariant;\n /**\n * Sets the status of the addon (this should typically be the same as the\n * input's status).\n */\n status?: ControlStatus;\n /**\n * Styles the addon as muted.\n *\n * Note that if rendering the addon as a button or a link via `asChild`, this\n * property will have no effect. For such cases set the `disabled`/\n * `data-disabled` properties directly on the button/link.\n */\n muted?: boolean;\n /** Styles the addon as read-only. */\n readOnly?: boolean;\n}\n\n/**\n * Component used as an \"add-on\" for controls.\n *\n * The control addon is typically used within the `startAdornment` and\n * `endAdornment` properties of a control, but can also be used standalone where\n * it makes sense.\n */\nexport const ControlAddon = React.forwardRef<\n React.ComponentRef<\"div\">,\n ControlAddonProps\n>(function ControlAddon(\n {\n asChild,\n variant = \"default\",\n status,\n muted,\n readOnly,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const controlContext = useControlContext();\n\n const As = asChild ? Slot : \"div\";\n return (\n <ControlContext.Provider value={null}>\n <As\n className={cx(prefix(\"control-addon\"), className)}\n data-variant={controlContext?.variant ?? variant}\n data-status={controlContext?.status ?? status}\n data-muted={boolDataAttr(controlContext?.disabled || muted)}\n data-readonly={boolDataAttr(controlContext?.readOnly || readOnly)}\n ref={forwardedRef}\n {...otherProps}\n />\n </ControlContext.Provider>\n );\n});\n","/**\n * Sets the native value of an HTML element in a way that isn't detected by\n * React; meaning that we can then dispatch an event that React will handle.\n *\n * See: https://github.com/facebook/react/issues/10135\n */\nexport function setNativeValue(element: HTMLElement, value: string) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { set: valueSetter } =\n Object.getOwnPropertyDescriptor(element, \"value\") ?? {};\n const prototype = Object.getPrototypeOf(element);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { set: prototypeValueSetter } =\n Object.getOwnPropertyDescriptor(prototype, \"value\") ?? {};\n\n if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {\n prototypeValueSetter.call(element, value);\n } else if (valueSetter) {\n valueSetter.call(element, value);\n } else {\n throw new Error(\"The given element does not have a value setter.\");\n }\n}\n","import { faClose } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { IconButton } from \"../IconButton\";\n\n/** Properties of the close button component. */\nexport interface CloseButtonProps\n extends Partial<React.ComponentPropsWithoutRef<typeof IconButton>> {}\n\n/** Component rendering a “close” button. */\nexport const CloseButton = React.forwardRef<\n React.ComponentRef<\"button\">,\n CloseButtonProps\n>(function CloseIconButton(\n { icon, label = null, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n\n return (\n <IconButton\n className={cx(prefix(\"close-button\"), className)}\n variant=\"ghost\"\n circle\n icon={icon ?? faClose}\n label={label}\n aria-label={locale.CloseButton[\"aria-label\"]}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr, setBoolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n controlStatusToAccent,\n type ControlVariant,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { setNativeValue } from \"../../utils/setNativeValue.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport {\n type Responsive,\n useResponsiveValues,\n} from \"../../utils/useResponsiveValues.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { CloseButton } from \"../CloseButton\";\nimport { type ControlAddon } from \"../ControlAddon\";\nimport { ControlCode } from \"../ControlCode\";\nimport { useDataTableColumnLabelId } from \"../DataTable\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useSetFieldControl,\n useSetFieldControlFocused,\n} from \"../Field\";\nimport { Slot } from \"../Slot\";\nimport { Spinner } from \"../Spinner\";\nimport { useIsInTableCell } from \"../Table\";\n\nconst REQUIRABLE_CONTROLS = [\"INPUT\", \"SELECT\", \"TEXTAREA\"];\n\n/** Accepted values for \"show clear button\". */\nexport type ShowClearButton = boolean | \"auto\";\n\nexport interface InputProps\n extends Omit<React.ComponentPropsWithoutRef<\"input\">, \"children\">,\n InputPropsBase {}\n\n/** Properties of the input component. */\nexport interface InputPropsBase {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n children?: React.ReactElement;\n /**\n * Input's style variant. Defaults to the default variant unless when\n * rendering inside a table cell (in which it defaults to `\"cell\"`).\n */\n variant?: ControlVariant;\n /** Sets the status of the input. */\n status?: ControlStatus;\n /** Input code. */\n code?: React.ReactNode;\n /**\n * Adds a spinner to the input to indicate activity. Note that it doesn't\n * automatically disable the input.\n *\n * @default false\n */\n loading?: boolean;\n /** Sets the input's text align. */\n align?: Responsive<React.CSSProperties[\"textAlign\"]>;\n /** Input's start adornment. */\n startAdornment?: React.ReactNode;\n /** Input's end adornment. */\n endAdornment?: React.ReactNode;\n /**\n * Whether to show a button to clear the input when it has content.\n *\n * @default false\n */\n showClearButton?: ShowClearButton;\n /** Label of the clear button announced to assistive technologies. */\n clearButtonLabel?: string;\n /**\n * Function called whenever the value changes.\n *\n * @param value New value.\n */\n onValueChange?: (value: string) => void;\n /**\n * Function called when the focus moves out of the control as a whole.\n *\n * This is useful when there is a need to know when the user stops interacting\n * with the control.\n */\n onBlurToOutside?: (event: React.FocusEvent) => void;\n /** Properties to pass to the root component. */\n rootProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the code component. */\n codeProps?: Omit<React.ComponentPropsWithRef<typeof ControlAddon>, \"status\">;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the clear button component. */\n clearButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n}\n\n/**\n * The input component is used to collect user input. It is built on top of the\n * browser's [`<input>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input).\n *\n * For accessibility purposes, inputs are usually included within a `Field`\n * together with a `Label` and optionally `HelperText` and/or `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { Input } from \"@ostack.tech/ui\";\n *\n * function Search() {\n * return <Input placeholder=\"Search…\" />;\n * }\n * ```\n */\nexport const Input = React.forwardRef<React.ComponentRef<\"input\">, InputProps>(\n function Input(\n {\n asChild,\n type,\n defaultValue,\n value,\n variant,\n status,\n code,\n loading,\n align,\n startAdornment,\n endAdornment,\n showClearButton,\n clearButtonLabel,\n onValueChange,\n onBlurToOutside,\n rootProps,\n codeProps,\n containerProps,\n clearButtonProps,\n spinnerProps,\n id,\n className,\n required,\n disabled,\n readOnly,\n style,\n onChange,\n onFocus,\n onBlur,\n onClick,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const locale = useLocale();\n clearButtonLabel ??= locale.Input.clearButtonLabel;\n const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();\n const dataTableColumnLabelId = useDataTableColumnLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const [inputEl, setInputEl] = React.useState<HTMLInputElement | null>(null);\n const { controlId, codeId } = useSetFieldControl(\n id,\n inputEl?.tagName,\n codeProps?.id,\n !!code,\n required,\n );\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const clearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n\n const isInTableCell = useIsInTableCell();\n variant ??= isInTableCell ? \"cell\" : \"default\";\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n onValueChange?.((event.target as HTMLInputElement).value);\n },\n [onValueChange],\n );\n\n // Manually keep track of focus in order to style the input's container\n // based on it; we track the input's focus instead of simply styling via\n // `focus-within` since the container may also contain other focusable\n // elements\n const setFieldControlFocused = useSetFieldControlFocused();\n const handleControlFocus = React.useCallback(\n (evt: React.FocusEvent) => {\n if (!disabled && evt.target === inputEl) {\n setBoolDataAttr(containerRef.current, \"focused\", true);\n setFieldControlFocused(true);\n }\n },\n [disabled, inputEl, setFieldControlFocused],\n );\n const handleControlBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n if (\n !evt.relatedTarget ||\n (inputEl !== evt.relatedTarget &&\n !clearButtonRef.current?.contains(evt.relatedTarget))\n ) {\n setBoolDataAttr(containerRef.current, \"focused\", false);\n setFieldControlFocused(false);\n onBlurToOutside?.(evt);\n }\n },\n [inputEl, onBlurToOutside, setFieldControlFocused],\n );\n\n // Prevent changing the value in read-only mode for certain input types\n const handleClick = React.useCallback(\n (evt: React.MouseEvent) => {\n if (readOnly && (type === \"file\" || type === \"color\")) {\n evt.preventDefault();\n }\n },\n [readOnly, type],\n );\n\n // Focus input when the container is pressed\n const handleContainerPointerDown = React.useCallback(\n (evt: React.MouseEvent) => {\n const target = evt.target as HTMLElement;\n if (\n inputEl &&\n !disabled &&\n !target.closest(\"input, select, textarea, button, a\")\n ) {\n const cursorIdx = target.closest(`.${prefix(\"input\")} ~ *`)\n ? inputEl.value.length\n : 0;\n requestAnimationFrame(() => {\n try {\n // Fails for certain element/input types\n inputEl.setSelectionRange(cursorIdx, cursorIdx);\n } finally {\n inputEl.focus();\n }\n });\n }\n },\n [disabled, inputEl, prefix],\n );\n\n // Keep track of whether the input should show a clear button when\n // `showClearButton` is set to `\"auto\"`\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(\n ((value ?? defaultValue)?.toString() ?? \"\").length > 0,\n );\n React.useEffect(() => {\n if (inputEl && showClearButton === \"auto\" && value === undefined) {\n const observer = new MutationObserver((mutations) => {\n setShouldShowClearButton(\n (mutations[0].target as HTMLInputElement).value.length > 0,\n );\n });\n observer.observe(inputEl, { attributeFilter: [\"value\"] });\n return () => observer.disconnect();\n }\n }, [inputEl, showClearButton, value]);\n\n const handleClearButtonClick = React.useCallback<\n React.MouseEventHandler<HTMLButtonElement>\n >(() => {\n if (inputEl) {\n setNativeValue(inputEl, \"\");\n const changeEvent = new Event(\"input\", { bubbles: true });\n inputEl.dispatchEvent(changeEvent);\n if (!changeEvent.defaultPrevented) {\n onValueChange?.(\"\");\n inputEl.focus();\n }\n }\n }, [inputEl, onValueChange]);\n\n const hasClearButton =\n !disabled &&\n !readOnly &&\n (showClearButton === true ||\n (showClearButton === \"auto\" &&\n (value !== undefined\n ? (value?.toString() ?? \"\")?.length > 0\n : shouldShowClearButton)));\n\n const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(\n \"control\",\n { align },\n );\n\n const requirable = inputEl && REQUIRABLE_CONTROLS.includes(inputEl.tagName);\n const As = asChild ? Slot : \"input\";\n const combinedContainerRef = useCombinedRef(\n containerRef,\n containerProps?.ref,\n );\n const combinedInputRef = useCombinedRef(setInputEl, forwardedRef);\n const combinedClearButtonRef = useCombinedRef(\n clearButtonRef,\n clearButtonProps?.ref,\n );\n return (\n <ClearContexts field={false}>\n <ControlContext.Provider\n value={{ variant, status, disabled, readOnly }}\n >\n <div\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...rootProps}\n className={cx(prefix(\"input__root\"), rootProps?.className)}\n >\n {code && (\n <ControlCode\n {...codeProps}\n id={codeId}\n className={cx(prefix(\"input__code\"), codeProps?.className)}\n >\n {code}\n </ControlCode>\n )}\n\n <div\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...containerProps}\n className={cx(\n prefix(\"input__container\"),\n containerProps?.className,\n )}\n onPointerDown={combineEventHandlers(\n containerProps?.onPointerDown,\n handleContainerPointerDown,\n { checkDefaultPrevented: true },\n )}\n ref={combinedContainerRef}\n >\n {startAdornment}\n\n <As\n type={type}\n defaultValue={defaultValue}\n value={value}\n id={controlId}\n className={cx(prefix(\"input\"), className)}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onInput={combineEventHandlers(onChange, handleChange, {\n checkDefaultPrevented: true,\n })}\n onFocus={combineEventHandlers(onFocus, handleControlFocus, {\n checkDefaultPrevented: true,\n })}\n onBlur={combineEventHandlers(onBlur, handleControlBlur, {\n checkDefaultPrevented: true,\n })}\n onClick={combineEventHandlers(onClick, handleClick, {\n checkDefaultPrevented: true,\n })}\n style={{ ...cssVars, ...style }}\n {...dataAttrs}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n aria-required={required && !requirable ? \"true\" : undefined}\n aria-invalid={status === \"invalid\" ? \"true\" : undefined}\n aria-labelledby={mergeAriaIds(\n dataTableColumnLabelId,\n ariaLabelledBy,\n )}\n aria-describedby={mergeAriaIds(\n code && codeId,\n errorMessageIds,\n descriptionIds,\n ariaDescribedBy,\n )}\n {...otherProps}\n ref={combinedInputRef}\n />\n\n {/* Clear button */}\n {hasClearButton && (\n <CloseButton\n size=\"sm\"\n aria-label={clearButtonLabel}\n tabIndex={-1}\n {...clearButtonProps}\n className={cx(\n prefix(\"input__clear-button\"),\n clearButtonProps?.className,\n )}\n onClick={combineEventHandlers(\n clearButtonProps?.onClick,\n handleClearButtonClick,\n { checkDefaultPrevented: true },\n )}\n onFocus={combineEventHandlers(\n clearButtonProps?.onFocus,\n handleControlFocus,\n )}\n onBlur={combineEventHandlers(\n clearButtonProps?.onBlur,\n handleControlBlur,\n )}\n ref={combinedClearButtonRef}\n />\n )}\n\n {/* Spinner */}\n {loading && (\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(disabled)}\n {...spinnerProps}\n className={cx(\n prefix(\"input__spinner\"),\n spinnerProps?.className,\n )}\n />\n )}\n\n {endAdornment}\n </div>\n </div>\n </ControlContext.Provider>\n </ClearContexts>\n );\n },\n);\n","import * as React from \"react\";\n\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { Input, type InputProps } from \"./Input.tsx\";\n\n/**\n * Utility input component whose `ref` is passed to the input's container. Use\n * `inputRef` to provide the input's ref instead.\n *\n * This component is useful when using an input component as a trigger for\n * popovers/menus, and we wish to align said popover/menu against the input's\n * container (since popovers/menus align themselves based on the element\n * referenced by their trigger).\n */\nexport const InputWithContainerRef = React.forwardRef<\n React.ComponentRef<\"div\">,\n InputProps & { inputRef?: React.Ref<React.ComponentRef<typeof Input>> }\n>(function InputWithContainerRef(\n { inputRef, containerProps, ...otherProps },\n forwardedRef,\n) {\n return (\n <Input\n containerProps={{\n ...containerProps,\n ref: useCombinedRef(forwardedRef, containerProps?.ref),\n }}\n ref={inputRef}\n {...otherProps}\n />\n );\n});\n","import { faFilter } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { ControlAddon } from \"../ControlAddon\";\nimport { Icon } from \"../Icon\";\nimport { Input } from \"../Input\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\n\n/** Properties of the data table filter component. */\nexport interface DataTableFilterProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n \"defaultValue\" | \"value\"\n > {}\n\n/** Input used to globally filter a data table. */\nexport const DataTableFilter = React.forwardRef<\n React.ComponentRef<typeof Input>,\n DataTableFilterProps\n>(function DataTableFilter(\n {\n endAdornment = (\n <ControlAddon>\n <Icon icon={faFilter} />\n </ControlAddon>\n ),\n placeholder,\n [\"aria-label\"]: ariaLabel,\n onValueChange,\n className,\n rootProps,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n ariaLabel ??= locale.DataTableFilter[\"aria-label\"];\n placeholder ??= locale.DataTableFilter.placeholder;\n const { store } = useDataTableContext();\n const filter = useStore(store, (state) => state.filter);\n\n const handleFilterChange = (value: string) => {\n React.startTransition(() => store.getState().actions.setFilter(value));\n };\n\n return (\n <ClearContexts>\n <Input\n placeholder={placeholder}\n showClearButton={\"auto\"}\n endAdornment={endAdornment}\n className={cx(prefix(\"data-table__filter\"), className)}\n value={filter}\n onValueChange={combineEventHandlers(onValueChange, handleFilterChange)}\n rootProps={{\n ...rootProps,\n className: cx(\n prefix(\"data-table__filter-root\"),\n rootProps?.className,\n ),\n }}\n aria-label={ariaLabel}\n {...otherProps}\n ref={forwardedRef}\n />\n </ClearContexts>\n );\n});\n","import * as React from \"react\";\n\nimport {\n type MenuListIconPlacement,\n type MenuListVariant,\n} from \"./MenuList.tsx\";\n\n/** Value of the menu list context. */\nexport interface MenuListContextValue {\n iconPlacement: MenuListIconPlacement;\n variant: MenuListVariant;\n}\n\n/** Context for menu lists. */\nexport const MenuListContext = React.createContext<MenuListContextValue>({\n iconPlacement: \"start\",\n variant: \"subtle\",\n});\n\n/** Hook providing access to the menu list context. */\nexport function useMenuListContext(): MenuListContextValue {\n return React.useContext(MenuListContext);\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\nimport { MenuListContext } from \"./MenuListContext.ts\";\n\n/** Menu list variants. */\nexport type MenuListVariant = \"solid\" | \"subtle\";\n\n/** Placement of icons within menu list items. */\nexport type MenuListIconPlacement = \"start\" | \"end\";\n\n/** Properties of the menu list component. */\nexport interface MenuListProps extends React.ComponentPropsWithoutRef<\"ul\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Style variant of the menu list.\n *\n * @default solid\n */\n variant?: MenuListVariant;\n /**\n * Default placement of icons within menu list items. This property can be\n * overridden on a per-item basis.\n *\n * @default start\n */\n iconPlacement?: MenuListIconPlacement;\n}\n\n/**\n * The menu list component is used to display a list as a menu of actionable\n * items.\n *\n * Example usage:\n *\n * ```tsx\n * import { MenuList, MenuListItem } from \"@ostack.tech/ui\";\n *\n * function ActionsList() {\n * return (\n * <MenuList>\n * <MenuListItem onSelect={loadDocument}>Load…</MenuListItem>\n * <MenuListItem onSelect={saveDocument}>Save…</MenuListItem>\n * <MenuListItem onSelect={printDocument}>Print…</MenuListItem>\n * </MenuList>\n * );\n * }\n * ```\n */\nexport const MenuList = React.forwardRef<\n React.ComponentRef<\"ul\">,\n MenuListProps\n>(function MenuList(\n {\n asChild,\n variant = \"solid\",\n iconPlacement = \"start\",\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"ul\";\n return (\n <MenuListContext.Provider value={{ iconPlacement, variant }}>\n <As\n className={cx(\n prefix(\"menu-list\"),\n prefix(`menu-list--${variant}`),\n className,\n )}\n {...otherProps}\n ref={forwardedRef}\n />\n </MenuListContext.Provider>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { Slot } from \"../Slot\";\nimport { Spinner } from \"../Spinner\";\nimport { type MenuListIconPlacement } from \"./MenuList.tsx\";\nimport { useMenuListContext } from \"./MenuListContext.ts\";\n\n/** Menu list item colours. */\nexport type MenuListItemColor = AccentColor;\n\n/** Properties of the menu list item component. */\nexport interface MenuListItemProps\n extends Omit<React.ComponentPropsWithoutRef<\"li\">, \"onSelect\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Type of the item.\n *\n * @default button\n */\n type?: \"button\" | \"link\" | \"text\";\n /**\n * Marks the item as being selected.\n *\n * @default false\n */\n selected?: boolean;\n /** Event handler for when the item has been selected. */\n onSelect?: (\n event: React.MouseEvent<\n HTMLButtonElement | HTMLAnchorElement | HTMLDivElement\n >,\n ) => void;\n /** Accent colour of the menu list item. */\n color?: MenuListItemColor;\n /**\n * Whether to display the item in \"loading\" state by presenting a spinner as\n * icon. The position of the spinner may be controlled via `iconPlacement`.\n *\n * Setting this property will automatically disable the item.\n *\n * @default false\n */\n loading?: boolean;\n /**\n * Whether the item should be enabled when `loading` is `true`.\n *\n * @default false\n */\n enabledWhenLoading?: boolean;\n /**\n * Content of the item when it is in \"loading\" state. If not provided, the\n * item content will remain unchanged.\n */\n loadingContent?: React.ReactNode;\n /**\n * Optional item icon.\n *\n * @default null\n */\n icon?: IconProp | React.ReactElement | null;\n /**\n * Placement of the icon.\n *\n * @default start\n */\n iconPlacement?: MenuListIconPlacement;\n /**\n * Whether the item should be disabled.\n *\n * @default false\n */\n disabled?: boolean;\n /** Href for the link, when `itemType` is set to `\"link\"`. */\n href?: React.ComponentProps<\"a\">[\"href\"];\n /** Target of the link, when `itemType` is set to `\"link\"`. */\n target?: React.ComponentProps<\"a\">[\"target\"];\n /** Rel of the link, when `itemType` is set to `\"link\"`. */\n rel?: React.ComponentProps<\"a\">[\"rel\"];\n /** Properties to pass to the action element of the item. */\n actionProps?: Omit<\n React.ComponentPropsWithRef<\"button\" | \"a\" | \"div\">,\n \"disabled\" | \"href\" | \"target\" | \"rel\"\n >;\n /** Properties to pass to the content element of the item. */\n contentProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the spinner component. */\n spinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;\n}\n\n/** Menu list item component. */\nexport const MenuListItem = React.forwardRef<\n React.ComponentRef<\"li\">,\n MenuListItemProps\n>(function ListItem(\n {\n asChild,\n type = \"button\",\n selected,\n onSelect,\n color,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n icon = null,\n iconPlacement,\n href,\n target,\n rel,\n actionProps,\n contentProps,\n iconProps,\n spinnerProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const menuListContext = useMenuListContext();\n const variant = menuListContext.variant;\n iconPlacement ??= menuListContext.iconPlacement;\n\n const handleSelect = React.useCallback(\n (\n event: React.MouseEvent<\n HTMLAnchorElement | HTMLButtonElement | HTMLDivElement\n >,\n ) => {\n if (!disabled) {\n onSelect?.(event);\n }\n },\n [disabled, onSelect],\n );\n\n const iconEl = React.useMemo(\n () =>\n icon && (\n <Slot\n className={cx(\n prefix(\"menu-list__item-icon\"),\n prefix(`menu-list__item-icon--${iconPlacement}`),\n iconProps?.className,\n )}\n >\n {React.isValidElement(icon) ? (\n icon\n ) : (\n <Icon icon={icon} {...iconProps} />\n )}\n </Slot>\n ),\n [icon, iconPlacement, iconProps, prefix],\n );\n const spinnerEl = React.useMemo(\n () => (\n <Spinner\n {...spinnerProps}\n className={cx(\n prefix(\"menu-list__item-spinner\"),\n prefix(`menu-list__item-spinner--${iconPlacement}`),\n spinnerProps?.className,\n )}\n />\n ),\n [iconPlacement, prefix, spinnerProps],\n );\n\n const shouldDisable = disabled || (loading && !enabledWhenLoading);\n const Action = type === \"button\" ? \"button\" : type === \"link\" ? \"a\" : \"div\";\n const actionEl = (\n <Action\n type={type === \"button\" ? \"button\" : undefined}\n disabled={type === \"button\" ? shouldDisable : undefined}\n data-disabled={boolDataAttr(type !== \"button\" && shouldDisable)}\n aria-disabled={type !== \"button\" && shouldDisable ? \"true\" : undefined}\n data-selected={boolDataAttr(selected)}\n data-accent={color}\n href={href}\n target={target}\n rel={rel}\n {...(actionProps as any)}\n onClick={combineEventHandlers(\n actionProps?.onClick as never,\n handleSelect,\n { checkDefaultPrevented: true },\n )}\n className={cx(\n prefix(\"menu-list__item-action\"),\n prefix(`menu-list__item-action--${variant}`),\n actionProps?.className,\n )}\n >\n {loading && iconPlacement === \"start\" && spinnerEl}\n {!loading && iconPlacement === \"start\" && iconEl}\n <span\n {...contentProps}\n className={cx(\n prefix(\"menu-list__item-content\"),\n contentProps?.className,\n )}\n >\n {loading && loadingContent\n ? loadingContent\n : asChild\n ? (children as React.ReactElement<any>).props.children\n : children}\n </span>\n {!loading && iconPlacement === \"end\" && iconEl}\n {loading && iconPlacement === \"end\" && spinnerEl}\n </Action>\n );\n\n const As = asChild ? Slot : \"li\";\n return (\n <As\n className={cx(prefix(\"menu-list__item\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {asChild\n ? React.cloneElement(\n children as React.ReactElement,\n undefined,\n actionEl,\n )\n : actionEl}\n </As>\n );\n});\n","import { faSearch } from \"@fortawesome/free-solid-svg-icons\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ControlAddon } from \"../ControlAddon\";\nimport { Icon } from \"../Icon\";\nimport { Input } from \"../Input\";\nimport {\n MenuList,\n type MenuListIconPlacement,\n type MenuListVariant,\n} from \"../MenuList\";\nimport { Spinner } from \"../Spinner\";\n\n/** Command menu variants. */\nexport type CommandMenuVariant = MenuListVariant;\n\n/** Placement of icons within command menu items. */\nexport type CommandMenuIconPlacement = MenuListIconPlacement;\n\n/** Properties of the command menu component. */\nexport interface CommandMenuProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {\n /**\n * Style variant of the command menu list.\n *\n * @default subtle\n */\n variant?: CommandMenuVariant;\n /**\n * Default placement of icons within command menu items. This property can be\n * overridden on a per-item basis.\n *\n * @default start\n */\n iconPlacement?: CommandMenuIconPlacement;\n /** Placeholder of the search input. */\n searchPlaceholder?: string;\n /** Optional controlled search value. */\n searchValue?: string;\n /** Event handler called when the search value changes. */\n onSearchValueChange?: (search: string) => void;\n /** Accessible label for the list of items. Not shown visibly. */\n listLabel?: string;\n /**\n * Whether the command list is loading.\n *\n * @default false\n */\n loading?: boolean;\n /** Accessible label for the loading of items. Not shown visibly. */\n loadingLabel?: string;\n /** Estimated progress of loading the list of items. */\n loadingProgress?: number;\n /** Message to display when no items were found. */\n emptyMessage?: React.ReactNode;\n /** Properties to pass to the search `Input` component. */\n searchProps?: Omit<\n React.ComponentPropsWithRef<typeof Input>,\n | \"asChild\"\n | \"variant\"\n | \"status\"\n | \"code\"\n | \"defaultValue\"\n | \"value\"\n | \"onValueChange\"\n | \"startAdornment\"\n | \"endAdornment\"\n | \"showClearButton\"\n >;\n /** Properties to pass to the search adornment `ControlAddon` component. */\n searchAdornmentProps?: React.ComponentPropsWithRef<typeof ControlAddon>;\n /** Properties to pass to the search `Icon` component. */\n searchIconProps?: React.ComponentPropsWithRef<typeof Icon>;\n /** Properties to pass to the list component. */\n listProps?: Omit<\n React.ComponentPropsWithRef<typeof MenuList>,\n \"asChild\" | \"variant\" | \"iconPlacement\"\n >;\n /** Properties to pass to the loading element. */\n loadingProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the spinner component. */\n spinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;\n /** Properties to pass to the component containing the empty message. */\n emptyMessageProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/**\n * The command menu renders a menu of selectable items which can be filtered and\n * sorted via a search query.\n *\n * Built on top of the [cmdk Command primitive](https://cmdk.paco.me) and the\n * `MenuList` component.\n *\n * It composes the following subcomponents:\n *\n * - `CommandMenuDialog`: Optional dialog to display the command menu.\n * - `CommandMenuGroup`: Groups items under an optional label.\n * - `CommandMenuItem`: An item of the command menu.\n *\n * Example usage:\n *\n * ```tsx\n * import { CommandMenu, CommandMenuItem } from \"@ostack.tech/ui\";\n *\n * function ActionsCommandMenu() {\n * return (\n * <CommandMenu>\n * <CommandMenuItem onSelect={loadDocument}>Load…</CommandMenuItem>\n * <CommandMenuItem onSelect={saveDocument}>Save…</CommandMenuItem>\n * <CommandMenuItem onSelect={printDocument}>Print…</CommandMenuItem>\n * </CommandMenu>\n * );\n * }\n * ```\n */\nexport const CommandMenu = React.forwardRef<\n React.ComponentRef<\"div\">,\n CommandMenuProps\n>(function CommandMenu(\n {\n variant,\n iconPlacement = \"start\",\n label,\n searchPlaceholder,\n searchValue,\n onSearchValueChange,\n listLabel,\n loading,\n loadingLabel,\n loadingProgress,\n emptyMessage,\n className,\n searchProps,\n searchAdornmentProps,\n searchIconProps,\n listProps,\n loadingProps,\n spinnerProps,\n emptyMessageProps,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n label ??= locale.CommandMenu.label;\n searchPlaceholder ??= locale.CommandMenu.searchPlaceholder;\n emptyMessage ??= locale.CommandMenu.emptyMessage;\n listLabel ??= locale.CommandMenu.listLabel;\n loadingLabel ??= locale.CommandMenu.loadingLabel;\n\n const searchAdornmentEl = (\n <ControlAddon\n {...searchAdornmentProps}\n className={cx(\n prefix(\"command-menu__search-adornment\"),\n searchAdornmentProps?.className,\n )}\n >\n <Icon\n icon={faSearch}\n {...searchIconProps}\n className={cx(\n prefix(\"command-menu__search-icon\"),\n searchIconProps?.className,\n )}\n />\n </ControlAddon>\n );\n\n return (\n <CommandPrimitive\n label={label}\n className={cx(prefix(\"command-menu\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n <CommandPrimitive.Input\n asChild\n value={searchValue}\n onValueChange={onSearchValueChange}\n >\n <Input\n variant=\"cell\"\n placeholder={searchPlaceholder}\n startAdornment={iconPlacement === \"start\" && searchAdornmentEl}\n endAdornment={iconPlacement === \"end\" && searchAdornmentEl}\n {...searchProps}\n className={cx(prefix(\"command-menu__search\"), searchProps?.className)}\n rootProps={{\n className: cx(\n prefix(\"command-menu__search-root\"),\n searchProps?.rootProps?.className,\n ),\n }}\n containerProps={{\n className: cx(\n prefix(\"command-menu__search-container\"),\n searchProps?.containerProps?.className,\n ),\n }}\n />\n </CommandPrimitive.Input>\n <MenuList\n {...listProps}\n className={cx(prefix(\"command-menu__list\"), listProps?.className)}\n variant={variant}\n iconPlacement={iconPlacement}\n asChild\n >\n <CommandPrimitive.List label={listLabel}>\n {loading && (\n <CommandPrimitive.Loading\n label={loadingLabel}\n progress={loadingProgress}\n className={cx(\n prefix(\"command-menu__loading\"),\n loadingProps?.className,\n )}\n >\n <Spinner\n {...spinnerProps}\n className={cx(\n prefix(\"command-menu__spinner\"),\n spinnerProps?.className,\n )}\n />\n </CommandPrimitive.Loading>\n )}\n\n {!loading && (\n <CommandPrimitive.Empty\n {...emptyMessageProps}\n className={cx(\n prefix(\"command-menu__empty-message\"),\n emptyMessageProps?.className,\n )}\n >\n {emptyMessage}\n </CommandPrimitive.Empty>\n )}\n\n {!loading && children}\n </CommandPrimitive.List>\n </MenuList>\n </CommandPrimitive>\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\n\n/**\n * The dialog component displays a “window” overlaid on either the main screen\n * or another dialog window, rendering the content underneath inert.\n *\n * Built on top of the [Radix Dialog\n * primitive](https://www.radix-ui.com/primitives/docs/components/dialog), and\n * the `Card` component.\n *\n * It composes the following subcomponents:\n *\n * - `DialogTrigger`: The button which, when pressed, opens the dialog.\n * - `DialogContent`: Content to display when the dialog is open.\n * - `DialogHeader`: Header section of the dialog.\n * - `DialogTitle`: An accessible title to be announced when the dialog is opened.\n * - `DialogBody`: Body section of the dialog.\n * - `DialogDescription`: An optional accessible description to be announced when\n * the dialog is opened.\n *\n * To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove\n * the description entirely, pass `aria-describedby={undefined}` to the\n * `DialogContent` and omit this component.\n * - `DialogFooter`: Footer section of the dialog.\n * - `DialogClose`: A button which closes the dialog.\n *\n * Example usage:\n *\n * ```tsx\n * import {\n * Button,\n * Dialog,\n * DialogBody,\n * DialogClose,\n * DialogContent,\n * DialogDescription,\n * DialogFooter,\n * DialogHeader,\n * DialogTitle,\n * DialogTrigger,\n * } from \"@ostack.tech/ui\";\n *\n * function UserSettings() {\n * return (\n * <Dialog>\n * <DialogTrigger>\n * <Button>User settings…</Button>\n * </DialogTrigger>\n *\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>User Settings</DialogTitle>\n * </DialogHeader>\n * <DialogBody>\n * <DialogDescription>Edit your user settings:</DialogDescription>\n * …\n * </DialogBody>\n * <DialogFooter>\n * <DialogClose>\n * <Button>Close</Button>\n * </DialogClose>\n * </DialogFooter>\n * </DialogContent>\n * </Dialog>\n * );\n * }\n * ```\n */\nexport const Dialog = DialogPrimitive.Root;\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Card variants. */\nexport type CardVariant = \"solid\" | \"subtle\" | \"outlined\" | \"ghost\";\n\n/** Possible card colours. */\nexport type CardColor = AccentColor;\n\n/** Properties of the card component. */\nexport interface CardProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Card variant.\n *\n * @default solid\n */\n variant?: CardVariant;\n /**\n * Whether sections should be merged together, as opposed to them being\n * clearly delimited. By default, each section is clearly delimited via a\n * border or solid background colour.\n *\n * @default false\n */\n mergeSections?: boolean;\n /**\n * Card color.\n *\n * @default neutral\n */\n color?: CardColor;\n}\n\n/**\n * The card component encapsulates content in a card format.\n *\n * It composes the following subcomponents:\n *\n * - `CardHeader`: Header section of the card.\n * - `CardTitle`: Title of the card.\n * - `CardBody`: Body section of the card.\n * - `CardFooter`: Footer section of the card.\n *\n * Example usage:\n *\n * ```tsx\n * import {\n * Card,\n * CardBody,\n * CardFooter,\n * CardHeader,\n * CardTitle,\n * } from \"@ostack.tech/ui\";\n *\n * function UserCard() {\n * return (\n * <Card>\n * <CardHeader>\n * <CardTitle>User</CardTitle>\n * </CardHeader>\n * <CardBody>…</CardBody>\n * <CardFooter>…</CardFooter>\n * </Card>\n * );\n * }\n * ```\n */\nexport const Card = React.forwardRef<React.ComponentRef<\"div\">, CardProps>(\n function Card(\n {\n asChild,\n variant = \"solid\",\n color = \"neutral\",\n mergeSections = false,\n className,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(\n prefix(\"card\"),\n prefix(`card--${variant}`),\n mergeSections && prefix(\"card--merged\"),\n className,\n )}\n data-accent={color}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n },\n);\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the card body component. */\nexport interface CardBodyProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Body section of the `Card` component. */\nexport const CardBody = React.forwardRef<\n React.ComponentRef<\"div\">,\n CardBodyProps\n>(function CardBody({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"card__body\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the card footer component. */\nexport interface CardFooterProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Footer section of the `Card` component. */\nexport const CardFooter = React.forwardRef<\n React.ComponentRef<\"div\">,\n CardFooterProps\n>(function CardFooter({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"card__footer\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the card header component. */\nexport interface CardHeaderProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Header section of the `Card` component. */\nexport const CardHeader = React.forwardRef<\n React.ComponentRef<\"div\">,\n CardHeaderProps\n>(function CardBody({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"card__header\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Heading levels. */\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Properties of the heading component. */\nexport interface HeadingProps\n extends React.ComponentPropsWithoutRef<`h${HeadingLevel}`> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Heading level. By default, if `asChild` is not provided, the level is used\n * to determine which HTML element to render, so a level of `2` causes an\n * `<h2>` element to be rendered.\n *\n * @default 2\n */\n level?: HeadingLevel;\n}\n\n/**\n * Component used to render semantic HTML heading elements.\n *\n * Example usage:\n *\n * ```tsx\n * import { Heading } from \"@ostack.tech/ui\";\n *\n * function FavoriteBooksTitle() {\n * return <Heading>Favourite Books</Heading>;\n * }\n * ```\n */\nexport const Heading = React.forwardRef<\n React.ComponentRef<`h${HeadingLevel}`>,\n HeadingProps\n>(function Heading(\n { asChild, level = 2, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : `h${level}`;\n return (\n <As\n className={cx(prefix(\"heading\"), prefix(`heading--${level}`), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { type HeadingLevel } from \"../Heading\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the card title component. */\nexport interface CardTitleProps extends React.ComponentPropsWithoutRef<\"h2\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Heading level.\n *\n * @default 2\n */\n level?: HeadingLevel;\n}\n\n/** Title of the `Card` component. */\nexport const CardTitle = React.forwardRef<\n React.ComponentRef<\"h2\">,\n CardTitleProps\n>(function CardTitle(\n { asChild, level = 2, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : `h${level}`;\n return (\n <As\n className={cx(prefix(\"card__title\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CardBody } from \"../Card\";\n\n/** Properties of the dialog body component. */\nexport interface DialogBodyProps\n extends React.ComponentPropsWithoutRef<typeof CardBody> {}\n\n/** Body section of the dialog. */\nexport const DialogBody = React.forwardRef<\n React.ComponentRef<typeof CardBody>,\n DialogBodyProps\n>(function DialogBody({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CardBody\n className={cx(prefix(\"dialog__body\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the dialog close component. */\nexport interface DialogCloseProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>,\n \"asChild\"\n > {}\n\n/** Button which closes the dialog. */\nexport const DialogClose = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Close>,\n DialogCloseProps\n>(function DialogClose(props, forwardedRef) {\n return <DialogPrimitive.Close {...props} asChild ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the label component. */\nexport interface OverlayProps extends React.ComponentPropsWithoutRef<\"div\"> {}\n\n/** Overlay component. */\nexport const Overlay = React.forwardRef<\n React.ComponentRef<\"div\">,\n OverlayProps\n>(function Overlay({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <div\n className={cx(prefix(\"overlay\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Card, type CardColor, type CardVariant } from \"../Card\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { Overlay } from \"../Overlay\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\n\n/** Dialog content variants. */\nexport type DialogContentVariant = CardVariant;\n\n/** Possible dialog content colors. */\nexport type DialogContentColor = CardColor;\n\n/** Possible dialog content sizes. */\nexport type DialogContentSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Properties of the dialog content component. */\nexport interface DialogContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /**\n * Dialog content variant.\n *\n * @default solid\n */\n variant?: DialogContentVariant;\n /**\n * Whether sections should be merged together, as opposed to them being\n * clearly delimited. By default, each section is clearly delimited via a\n * border or solid background colour.\n *\n * @default false\n */\n mergeSections?: boolean;\n /**\n * Dialog content color.\n *\n * @default neutral\n */\n color?: DialogContentColor;\n /**\n * Size of the dialog content.\n *\n * @default md\n */\n size?: DialogContentSize;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof DialogPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the `Overlay` component. */\n overlayProps?: React.ComponentPropsWithRef<typeof Overlay>;\n}\n\n/** Content to be rendered in the open dialog. */\nexport const DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(function DialogContent(\n {\n variant = \"solid\",\n mergeSections,\n color = \"neutral\",\n size = \"md\",\n forceMount,\n onPointerDownOutside,\n portalProps,\n overlayProps,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const portalContext = usePortalContext();\n\n // FIXME: Workaround for https://github.com/radix-ui/primitives/issues/1280\n // This can be removed once the above issue is fixed upstream.\n // The workaround doesn't work when the scrollbar doesn't have a width.\n const handlePointerDownOutside = React.useCallback((evt: CustomEvent) => {\n if (\n evt.detail.originalEvent.offsetX >\n (evt.currentTarget as HTMLElement).clientWidth\n ) {\n evt.preventDefault();\n }\n }, []);\n\n return (\n <ClearContexts>\n <DialogPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n <DialogPrimitive.Overlay forceMount={forceMount} asChild>\n <Overlay\n {...overlayProps}\n className={cx(prefix(\"dialog__overlay\"), overlayProps?.className)}\n >\n <Card\n variant={variant}\n color={color}\n mergeSections={mergeSections}\n asChild\n >\n <DialogPrimitive.Content\n onPointerDownOutside={combineEventHandlers(\n onPointerDownOutside,\n handlePointerDownOutside,\n { checkDefaultPrevented: true },\n )}\n className={cx(\n prefix(\"dialog\"),\n prefix(`dialog--${size}`),\n className,\n )}\n ref={forwardedRef}\n {...otherProps}\n />\n </Card>\n </Overlay>\n </DialogPrimitive.Overlay>\n </Root>\n </DialogPrimitive.Portal>\n </ClearContexts>\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the dialog description component. */\nexport interface DialogDescriptionProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description> {}\n\n/**\n * Optional accessible description to be announced when the dialog is opened.\n *\n * To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove\n * the description entirely, pass `aria-describedby={undefined}` to the\n * `DialogContent` and omit this component.\n */\nexport const DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n DialogDescriptionProps\n>(function DialogDescription({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <DialogPrimitive.Description\n className={cx(prefix(\"dialog__description\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CardFooter } from \"../Card\";\n\n/** Properties of the dialog footer component. */\nexport interface DialogFooterProps\n extends React.ComponentPropsWithoutRef<typeof CardFooter> {}\n\n/** Footer section of the dialog. */\nexport const DialogFooter = React.forwardRef<\n React.ComponentRef<typeof CardFooter>,\n DialogFooterProps\n>(function DialogFooter({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CardFooter\n className={cx(prefix(\"dialog__footer\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { CardHeader } from \"../Card\";\nimport { CloseButton } from \"../CloseButton\";\nimport { Slottable } from \"../Slot\";\n\n/** Properties of the dialog header component. */\nexport interface DialogHeaderProps\n extends React.ComponentPropsWithoutRef<typeof CardHeader> {\n /**\n * Whether to show a close button.\n *\n * @default true\n */\n showCloseButton?: boolean;\n /** Properties to pass to the close button component. */\n closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n}\n\n/** Header section of the dialog. */\nexport const DialogHeader = React.forwardRef<\n React.ComponentRef<typeof CardHeader>,\n DialogHeaderProps\n>(function DialogHeader(\n {\n showCloseButton = true,\n closeButtonProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n // The Radix dialog implementation autofocuses the first focusable element\n // within the dialog content. Because of this, when `showCloseButton` is\n // set, the most likely scenario is that the close button ends up getting\n // focused. To prevent this and have the dialog focus other elements\n // instead, we initially set the close button's tab index to `-1`, and set\n // it back to its original value after the initial focus occurs. If no\n // element is focused by that time (because the dialog has no other\n // focusable elements), then we manually focus the close button instead.\n const [closeButtonTabIndex, setCloseButtonTabIndex] = React.useState<\n number | undefined\n >(-1);\n const closeButtonRef = React.useRef<React.ComponentRef<\n typeof CloseButton\n > | null>(null);\n React.useEffect(() => {\n void Promise.resolve().then(() => {\n setCloseButtonTabIndex(undefined);\n const activeElTabIndex = (document.activeElement as HTMLElement | null)\n ?.tabIndex;\n if (activeElTabIndex == null || activeElTabIndex < 0) {\n void Promise.resolve().then(() => closeButtonRef.current?.focus());\n }\n });\n }, []);\n\n const combinedCloseButtonRef = useCombinedRef(\n closeButtonRef,\n closeButtonProps?.ref,\n );\n return (\n <CardHeader\n className={cx(prefix(\"dialog__header\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n <Slottable>{children}</Slottable>\n {showCloseButton && (\n <DialogPrimitive.DialogClose asChild>\n <CloseButton\n ref={combinedCloseButtonRef}\n {...closeButtonProps}\n tabIndex={closeButtonTabIndex ?? closeButtonProps?.tabIndex}\n className={cx(\n prefix(\"dialog__close-button\"),\n closeButtonProps?.className,\n )}\n />\n </DialogPrimitive.DialogClose>\n )}\n </CardHeader>\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CardTitle } from \"../Card\";\n\n/** Properties of the dialog title component. */\nexport interface DialogTitleProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title> {}\n\n/** Accessible title to be announced when the dialog is opened. */\nexport const DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n DialogTitleProps\n>(function DialogTitle({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CardTitle asChild>\n <DialogPrimitive.Title\n className={cx(prefix(\"dialog__title\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n </CardTitle>\n );\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the dialog trigger component. */\nexport interface DialogTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>,\n \"asChild\"\n > {}\n\n/** The button which, when pressed, opens the dialog. */\nexport const DialogTrigger = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Trigger>,\n DialogTriggerProps\n>(function DialogTrigger(props, forwardedRef) {\n return <DialogPrimitive.Trigger {...props} asChild ref={forwardedRef} />;\n});\n","import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { type DialogContentSize } from \"../Dialog\";\nimport { Overlay } from \"../Overlay\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\n/** Possible command menu dialog sizes. */\nexport type CommandMenuDialogSize = DialogContentSize;\n\n/** Properties of the command menu dialog. */\nexport interface CommandMenuDialogProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n \"asChild\" | \"title\"\n > {\n /** Accessible dialog title. Not shown visibly. */\n title?: React.ReactNode;\n /** Accessible dialog description. Not shown visibly. */\n description?: React.ReactNode;\n /**\n * Size of the command menu dialog.\n *\n * @default md\n */\n size?: CommandMenuDialogSize;\n /**\n * The open state of the command menu dialog when it is initially rendered.\n * Use when you do not need to control its open state.\n */\n defaultOpen?: boolean;\n /**\n * The controlled open state of the dialog. Should be used in conjunction with\n * `onOpenChange`.\n */\n open?: boolean;\n /** Event handler called when the open state of the dialog changes. */\n onOpenChange?: (open: boolean) => void;\n /**\n * The modality of the dialog. When set to `true`, interaction with outside\n * elements will be disabled and only dialog content will be visible to screen\n * readers.\n *\n * @default true\n */\n modal?: boolean;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof DialogPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the `Overlay` component. */\n overlayProps?: React.ComponentPropsWithRef<typeof Overlay>;\n}\n\n/** Component used to display the command menu within a dialog. */\nexport const CommandMenuDialog = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n CommandMenuDialogProps\n>(function CommandMenuDialog(\n {\n title,\n description,\n size = \"md\",\n open,\n defaultOpen,\n onOpenChange,\n modal,\n forceMount,\n portalProps,\n overlayProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n title ??= locale.CommandMenuDialog.title;\n description ??= locale.CommandMenuDialog.description;\n const portalContext = usePortalContext();\n\n return (\n <DialogPrimitive.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n modal={modal}\n >\n <ClearContexts>\n <DialogPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n <DialogPrimitive.Overlay forceMount={forceMount} asChild>\n <Overlay\n {...overlayProps}\n className={cx(\n prefix(\"command-menu__overlay\"),\n overlayProps?.className,\n )}\n >\n <DialogPrimitive.Content\n autoFocus\n className={cx(\n prefix(\"command-menu__dialog\"),\n prefix(`command-menu__dialog--${size}`),\n className,\n )}\n aria-describedby={undefined}\n ref={forwardedRef}\n {...otherProps}\n >\n <VisuallyHidden asChild>\n <DialogPrimitive.Title>{title}</DialogPrimitive.Title>\n </VisuallyHidden>\n <VisuallyHidden asChild>\n <DialogPrimitive.Description>\n {description}\n </DialogPrimitive.Description>\n </VisuallyHidden>\n\n {children}\n </DialogPrimitive.Content>\n </Overlay>\n </DialogPrimitive.Overlay>\n </Root>\n </DialogPrimitive.Portal>\n </ClearContexts>\n </DialogPrimitive.Root>\n );\n});\n","import { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the command menu group. */\nexport interface CommandMenuGroupProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>,\n \"asChild\" | \"heading\"\n > {\n /** Optional label of the command menu group. */\n label?: React.ReactNode;\n}\n\n/** Component used to group multiple command items. */\nexport const CommandMenuGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n CommandMenuGroupProps\n>(function CommandMenuGroup({ label, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CommandPrimitive.Group\n {...otherProps}\n heading={label}\n className={cx(prefix(\"command-menu__group\"), className)}\n ref={forwardedRef}\n />\n );\n});\n","import { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { MenuListItem, type MenuListItemProps } from \"../MenuList\";\n\nexport interface CommandMenuItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>,\n \"asChild\" | \"color\"\n >,\n Pick<\n MenuListItemProps,\n | \"selected\"\n | \"color\"\n | \"loading\"\n | \"enabledWhenLoading\"\n | \"loadingContent\"\n | \"icon\"\n | \"iconPlacement\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"actionProps\"\n | \"contentProps\"\n | \"iconProps\"\n | \"spinnerProps\"\n > {\n /**\n * Render the item as a link. When set, you can pass `href`, `target`, and\n * `rel` properties to the item.\n *\n * @default false\n */\n asLink?: boolean;\n}\n\nexport const CommandMenuItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n CommandMenuItemProps\n>(function CommandMenuItem(\n {\n onSelect,\n selected,\n asLink,\n color,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n icon,\n iconPlacement,\n href,\n target,\n rel,\n keywords,\n actionProps,\n contentProps,\n iconProps,\n spinnerProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const handleSelect = React.useCallback(() => {\n if (asLink) {\n window.open(href, target, rel?.split(\" \").join(\",\"));\n }\n }, [asLink, href, rel, target]);\n\n return (\n <MenuListItem\n selected={selected}\n type={asLink ? \"link\" : \"text\"}\n color={color}\n disabled={disabled}\n loading={loading}\n enabledWhenLoading={enabledWhenLoading}\n loadingContent={loadingContent}\n icon={icon}\n iconPlacement={iconPlacement}\n href={href}\n target={target}\n rel={rel}\n actionProps={{\n tabIndex: asLink ? -1 : undefined,\n ...actionProps,\n className: cx(\n prefix(\"command-menu__item-action\"),\n actionProps?.className,\n ),\n }}\n contentProps={contentProps}\n iconProps={iconProps}\n spinnerProps={spinnerProps}\n asChild\n >\n <CommandPrimitive.Item\n disabled={disabled || (loading && !enabledWhenLoading)}\n {...otherProps}\n keywords={\n typeof children === \"string\"\n ? [children, ...(keywords ?? [])]\n : keywords\n }\n onSelect={combineEventHandlers(onSelect, handleSelect)}\n className={cx(prefix(\"command-menu__item\"), className)}\n ref={forwardedRef}\n >\n {children}\n </CommandPrimitive.Item>\n </MenuListItem>\n );\n});\n","import * as React from \"react\";\n\nimport { type CollapsibleDirection } from \"./Collapsible.tsx\";\n\n/** Value of the collapsible context. */\nexport interface CollapsibleContextValue {\n open: boolean;\n direction: CollapsibleDirection;\n}\n\n/** Collapsible context. */\nexport const CollapsibleContext =\n React.createContext<CollapsibleContextValue | null>(null);\n\n/** Hook providing access to the collapsible context. */\nexport function useCollapsibleContext(): CollapsibleContextValue {\n const dataTableContext = React.useContext(CollapsibleContext);\n if (!dataTableContext) {\n throw new Error(\"Collapsible context not in scope.\");\n }\n return dataTableContext;\n}\n","import { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { CollapsibleContext } from \"./CollapsibleContext.ts\";\n\n/** Direction in which to collapse/expand content. */\nexport type CollapsibleDirection = \"horizontal\" | \"vertical\";\n\n/** Properties of the collapsible component. */\nexport interface CollapsibleProps\n extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root> {\n /**\n * Direction in which to collapse/expand content.\n *\n * @default vertical\n */\n direction?: CollapsibleDirection;\n}\n\n/**\n * The collapsible component is an interactive component that expands/collapses\n * content.\n *\n * It composes the following subcomponents:\n *\n * - `CollapsibleTrigger`: A trigger, such as an icon, that visually indicates and\n * controls the expanded/collapsed states.\n * - `CollapsibleContent`: The content that are shown or hidden based on trigger's\n * state.\n */\nexport const Collapsible = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.Root>,\n CollapsibleProps\n>(function Collapsible(\n {\n defaultOpen,\n open: controlledOpen,\n onOpenChange,\n direction = \"vertical\",\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const [open, setOpen] = useControllableState(\n defaultOpen ?? false,\n controlledOpen,\n );\n\n return (\n <CollapsibleContext.Provider value={{ open, direction }}>\n <CollapsiblePrimitive.Root\n open={open}\n onOpenChange={combineEventHandlers(onOpenChange, setOpen)}\n className={cx(prefix(\"collapsible\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n </CollapsibleContext.Provider>\n );\n});\n","import { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCollapsibleContext } from \"./CollapsibleContext.ts\";\n\n/** Properties of the collapsible content component. */\nexport interface CollapsibleContentProps\n extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content> {}\n\n/** Component containing the collapsible content. */\nexport const CollapsibleContent = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.Content>,\n CollapsibleContentProps\n>(function CollapsibleContent({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n const { direction } = useCollapsibleContext();\n\n return (\n <CollapsiblePrimitive.Content\n className={cx(prefix(\"collapsible__content\"), className)}\n {...otherProps}\n data-direction={direction}\n ref={forwardedRef}\n />\n );\n});\n","import { faChevronDown, faChevronUp } from \"@fortawesome/free-solid-svg-icons\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { IconButton } from \"../IconButton\";\nimport { useCollapsibleContext } from \"./CollapsibleContext.ts\";\n\n/** Properties of the collapsible trigger component. */\nexport interface CollapsibleTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>,\n \"asChild\" | \"children\"\n > {\n defaultTriggerCollapseLabel?: string;\n defaultTriggerExpandLabel?: string;\n children?: React.ReactNode | ((open: boolean) => React.ReactNode);\n}\n\n/** Trigger that toggles the expansion of the collapsible content. */\nexport const CollapsibleTrigger = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.Trigger>,\n CollapsibleTriggerProps\n>(function CollapsibleTrigger({ children, ...props }, forwardedRef) {\n const prefix = usePrefix();\n const { open } = useCollapsibleContext();\n children ??= (\n <IconButton\n variant=\"ghost\"\n className={prefix(\"collapsible__trigger\")}\n icon={open ? faChevronUp : faChevronDown}\n label={null}\n />\n );\n\n return (\n <CollapsiblePrimitive.Trigger {...props} asChild ref={forwardedRef}>\n {typeof children === \"function\" ? children(open) : children}\n </CollapsiblePrimitive.Trigger>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CloseButton } from \"../CloseButton\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../Collapsible\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { Slot, Slottable } from \"../Slot\";\n\n/** Tag variants. */\nexport type TagVariant = \"solid\" | \"subtle\" | \"outlined\";\n\n/** Tag colours. */\nexport type TagColor = AccentColor;\n\n/** Tag's icon placement. */\nexport type TagIconPlacement = \"start\" | \"end\";\n\n/** Properties of the tag component. */\nexport interface TagProps extends React.ComponentPropsWithoutRef<\"span\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Tag variant.\n *\n * @defualt filled\n */\n variant?: TagVariant;\n /**\n * Tag colour.\n *\n * @default neutral\n */\n color?: TagColor;\n /**\n * Whether the tag should be open by default.\n *\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Property controlling whether the tag should be open. Use together with\n * `onOpenChange` to control the tag's open state.\n */\n open?: boolean;\n /** Function called when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n /**\n * Font Awesome icon to show within the tag. The position of the icon may be\n * controlled via `iconPlacement`.\n *\n * @default null\n */\n icon?: IconProp | null;\n /**\n * Whether to display the icon at the start or end of the tag.\n *\n * @default start\n */\n iconPlacement?: TagIconPlacement;\n /**\n * Display the tag as a pill (with rounder corners).\n *\n * @default false\n */\n pill?: boolean;\n /**\n * Whether to show a close button.\n *\n * @default false\n */\n showCloseButton?: boolean;\n /** Properties to pass to the container element. */\n containerProps?: React.ComponentPropsWithRef<typeof CollapsibleContent>;\n /** Properties to pass to the content element. */\n contentProps?: React.ComponentPropsWithRef<\"span\">;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the close button component. */\n closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n}\n\n/**\n * Component displaying a stylised tag.\n *\n * Example usage:\n *\n * ```tsx\n * import { Tag } from \"@ostack.tech/ui\";\n *\n * function InProgressIndicator() {\n * return <Tag>In progress</Tag>;\n * }\n * ```\n */\nexport const Tag = React.forwardRef<React.ComponentRef<\"span\">, TagProps>(\n function Tag(\n {\n asChild,\n variant = \"solid\",\n color = \"neutral\",\n defaultOpen = true,\n open,\n onOpenChange,\n icon = null,\n iconPlacement = \"start\",\n pill,\n showCloseButton,\n className,\n containerProps,\n contentProps,\n iconProps,\n closeButtonProps,\n children,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const iconEl = React.useMemo(\n () =>\n icon && (\n <Icon\n icon={icon}\n {...iconProps}\n className={cx(\n prefix(\"tag__icon\"),\n prefix(`tag__icon--${iconPlacement}`),\n iconProps?.className,\n )}\n />\n ),\n [icon, iconPlacement, iconProps, prefix],\n );\n\n const As = asChild ? Slot : \"span\";\n return (\n <Collapsible\n defaultOpen={defaultOpen}\n open={open}\n onOpenChange={onOpenChange}\n direction=\"horizontal\"\n asChild\n >\n <CollapsibleContent\n {...containerProps}\n className={cx(prefix(\"tag__container\"), containerProps?.className)}\n >\n <As\n className={cx(\n prefix(\"tag\"),\n prefix(`tag--${variant}`),\n pill && prefix(\"tag--pill\"),\n className,\n )}\n data-accent={color}\n {...otherProps}\n ref={forwardedRef}\n >\n {iconPlacement === \"start\" && iconEl}\n <Slottable>\n <span\n {...contentProps}\n className={cx(prefix(\"tag__content\"), contentProps?.className)}\n >\n {children}\n </span>\n </Slottable>\n {iconPlacement === \"end\" && iconEl}\n\n {showCloseButton && (\n <CollapsibleTrigger>\n <CloseButton\n color={variant === \"solid\" ? \"neutral\" : color}\n {...closeButtonProps}\n className={cx(\n prefix(\"tag__close-button\"),\n closeButtonProps?.className,\n )}\n />\n </CollapsibleTrigger>\n )}\n </As>\n </CollapsibleContent>\n </Collapsible>\n );\n },\n);\n","import { Tag, type TagColor, type TagProps, type TagVariant } from \"./Tag.tsx\";\n\n// TODO: Remove these at some point\n/**\n * @deprecated `Badge` component was renamed to `Tag`, please use\n * {@link TagVariant} instead.\n */\nexport type BadgeVariant = TagVariant;\n/**\n * @deprecated `Badge` component was renamed to `Tag`, please use\n * {@link TagColor} instead.\n */\nexport type BadgeColor = TagColor;\n/**\n * @deprecated `Badge` component was renamed to `Tag`, please use\n * {@link TagProps} instead.\n */\nexport type BadgeProps = TagProps;\n/**\n * @deprecated `Badge` component was renamed to `Tag`, please use {@link Tag}\n * instead.\n */\nexport const Badge = Tag;\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { controlStatusToAccent } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Tag } from \"../Tag\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { useSelectContext } from \"./SelectContext.ts\";\n\nexport function SelectMultipleValue() {\n const prefix = usePrefix();\n const { value, setValue, status, disabled, readOnly, valueTagProps, store } =\n useSelectContext();\n useStore(store, (state) => state.actions.getOptionState(value as string));\n\n const handleCloseValueTag = React.useCallback(\n (tagValue: string, evt: React.MouseEvent) => {\n evt.preventDefault();\n setValue((value) => (value as string[]).filter((v) => v !== tagValue));\n },\n [setValue],\n );\n\n // Remove repeated values\n const valuesToRender = React.useMemo(\n () => Array.from(new Set<string>(value as string)),\n [value],\n );\n\n const valuesOptionStates = useStore(\n store,\n useShallow((state) =>\n valuesToRender.map((v) => state.actions.getOptionState(v)),\n ),\n );\n\n const valuesList = React.useMemo(\n () =>\n valuesOptionStates.map((optionState, i) => (\n <React.Fragment key={i}>\n {i === 0 ? \"\" : \", \"}\n {optionState?.content}\n </React.Fragment>\n )),\n [valuesOptionStates],\n );\n\n const valuesTags = React.useMemo(\n () =>\n valuesToRender.map((v, i) => {\n const optionState = valuesOptionStates[i];\n return (\n optionState && (\n <Tag\n variant=\"subtle\"\n {...valueTagProps}\n showCloseButton={!optionState.disabled}\n closeButtonProps={\n {\n asChild: true,\n children: <span />,\n type: undefined,\n tabIndex: -1,\n role: \"button\",\n disabled,\n \"data-disabled\": disabled ? \"\" : undefined,\n // Prevent element from gaining focus\n onMouseDown: (evt: React.MouseEvent<HTMLSpanElement>) =>\n evt.preventDefault(),\n onClick: (evt: React.MouseEvent<HTMLSpanElement>) =>\n handleCloseValueTag(v, evt),\n ...valueTagProps?.closeButtonProps,\n } as never\n }\n key={v}\n color={\n optionState.color ?? controlStatusToAccent(status, \"primary\")\n }\n className={cx(\n prefix(\"select__value-tag\"),\n valueTagProps?.className,\n )}\n containerProps={{\n className: cx(\n prefix(\"select__value-tag-container\"),\n valueTagProps?.containerProps?.className,\n ),\n ...valueTagProps?.containerProps,\n }}\n contentProps={{\n className: cx(\n prefix(\"select__value-tag-content\"),\n valueTagProps?.contentProps?.className,\n ),\n ...valueTagProps?.contentProps,\n }}\n aria-hidden=\"true\"\n >\n {optionState.content}\n </Tag>\n )\n );\n }),\n [\n disabled,\n handleCloseValueTag,\n prefix,\n status,\n valueTagProps,\n valuesOptionStates,\n valuesToRender,\n ],\n );\n\n return (\n <>\n {valuesToRender.length > 0 && readOnly && valuesList}\n {valuesToRender.length > 0 && !readOnly && (\n <>\n <VisuallyHidden>{valuesList}</VisuallyHidden>\n {valuesTags}\n </>\n )}\n </>\n );\n}\n","import { useStore } from \"zustand\";\n\nimport { useSelectContext } from \"./SelectContext.ts\";\n\nexport function SelectSingleValue() {\n const { value, store } = useSelectContext();\n\n return useStore(\n store,\n (state) => state.actions.getOptionState(value as string)?.content,\n );\n}\n","import { faChevronDown, faChevronUp } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { useCssVars } from \"../../utils/useCssVars.ts\";\nimport { CommandMenu } from \"../CommandMenu\";\nimport { useFieldLabelId } from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport { type IconButton } from \"../IconButton\";\nimport { type Input, InputWithContainerRef } from \"../Input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport { type Tag } from \"../Tag\";\nimport { SelectContext, useCreateSelectContext } from \"./SelectContext.ts\";\nimport { SelectMultipleValue } from \"./SelectMultipleValue.tsx\";\nimport { SelectSingleValue } from \"./SelectSingleValue.tsx\";\n\n/** Base properties of the select component. */\nexport interface SelectPropsBase<\n T extends string | number | readonly string[] =\n | string\n | number\n | readonly string[],\n> extends React.ComponentPropsWithoutRef<typeof PopoverTrigger>,\n Pick<\n React.ComponentPropsWithoutRef<typeof Input>,\n | \"name\"\n | \"required\"\n | \"variant\"\n | \"status\"\n | \"code\"\n | \"readOnly\"\n | \"loading\"\n | \"align\"\n | \"startAdornment\"\n | \"endAdornment\"\n | \"showClearButton\"\n | \"onBlurToOutside\"\n | \"rootProps\"\n | \"codeProps\"\n | \"containerProps\"\n | \"clearButtonProps\"\n | \"spinnerProps\"\n >,\n Pick<\n React.ComponentPropsWithoutRef<typeof CommandMenu>,\n \"searchPlaceholder\" | \"searchValue\" | \"onSearchValueChange\"\n > {\n /**\n * Whether multiple options can be selected. If not set, at most one option\n * can be selected at a time.\n *\n * @default false\n */\n multiple?: boolean;\n /** Default select value. */\n defaultValue?: T;\n /** Select value. */\n value?: T;\n /**\n * Function called whenever the value of the select changes.\n *\n * @param value Select value. An array of values when `multiple` is set.\n */\n onValueChange?: (value: Exclude<T, number>) => void;\n /**\n * Default (uncontrolled) open state of the popover.\n *\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Controlled open state of the popover. Should be used together with\n * `onOpenChange`.\n */\n open?: boolean;\n /** Function called whenever the menu's open state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Select's placeholder. */\n placeholder?: React.ReactNode;\n /** Accessible label for the list of options. Not shown visibly. */\n optionsLabel?: string;\n /**\n * Whether the options are loading.\n *\n * @default false\n */\n loadingOptions?: boolean;\n /** Accessible label for the loading of options. Not shown visibly. */\n loadingOptionsLabel?: string;\n /** Estimated progress of loading the list of options. */\n loadingOptionsProgress?: number;\n /** Message to display when no options were found. */\n emptyMessage?: React.ReactNode;\n /**\n * When `multiple` is set, this property controls the maximum width the\n * content of a value tag representing a selected option can reach. By\n * default, selected value tags have no width limit.\n */\n valueTagMaxWidth?: React.CSSProperties[\"maxWidth\"];\n /** Properties to pass to the element holding the whole value or placeholder. */\n valueProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to each `Tag` holding a value, when `multiple` is set. */\n valueTagProps?: Omit<\n React.ComponentPropsWithoutRef<typeof Tag>,\n \"defaultOpen\" | \"open\" | \"onOpenChange\" | \"color\" | \"showCloseButton\"\n >;\n /** Properties to pass to the arrow `Icon` component. */\n arrowProps?: Omit<\n React.ComponentPropsWithRef<typeof IconButton>,\n \"icon\" | \"label\"\n >;\n /** Properties to pass to the `Popover` component. */\n popoverProps?: React.ComponentPropsWithRef<typeof PopoverContent>;\n /** Options to pass to the `CommandMenu` component. */\n commandMenuProps?: Omit<\n React.ComponentPropsWithRef<typeof CommandMenu>,\n | \"defaultValue\"\n | \"value\"\n | \"onValueChange\"\n | \"iconPlacement\"\n | \"searchPlaceholder\"\n | \"searchValue\"\n | \"onSearchValueChange\"\n | \"listLabel\"\n | \"loading\"\n | \"loadingLabel\"\n | \"loadingProgress\"\n | \"emptyMessage\"\n >;\n}\n\n/** Properties of the select component with `multiple` not set. */\nexport interface SelectSingleProps extends SelectPropsBase<string | number> {\n multiple?: false;\n}\n\n/** Properties of the select component with `multiple` set. */\nexport interface SelectMultipleProps extends SelectPropsBase<string[]> {\n multiple: true;\n}\n\n/** Properties of the select component. */\nexport type SelectProps = SelectSingleProps | SelectMultipleProps;\n\n/**\n * Control which displays a menu of options for the user to pick from. Provides\n * an alternative to the browser's [`<select>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select)\n * via the “combobox” pattern, allowing users to search for options. It is built\n * on top of the `Input`, `Popover`, and `CommandMenu` components.\n *\n * It supports the selection of more than one option by setting the `multiple`\n * property.\n *\n * For accessibility purposes, select components are usually included within a\n * `Field` together with a `Label` and optionally `HelperText` and/or\n * `Feedback`.\n *\n * It composes the following subcomponents:\n *\n * - `OptionsGroup`: Groups options under an optional label.\n * - `Option`: An option that can be selected.\n *\n * Example usage:\n *\n * ```tsx\n * import { Option, Select } from \"@ostack.tech/ui\";\n *\n * function FavoriteFruit() {\n * return (\n * <Select placeholder=\"Select your favourite fruit…\">\n * <Option value=\"apple\">Apple</Option>\n * <Option value=\"banana\">Banana</Option>\n * <Option value=\"cherry\">Cherry</Option>\n * </Select>\n * );\n * }\n * ```\n */\nexport const Select = React.forwardRef<\n React.ComponentRef<typeof PopoverTrigger>,\n SelectProps\n>(function Select(\n {\n multiple = false,\n defaultValue,\n value: controlledValue,\n onValueChange,\n defaultOpen,\n open: controlledOpen,\n onOpenChange,\n searchPlaceholder,\n searchValue: controlledSearchValue,\n onSearchValueChange,\n name,\n placeholder,\n disabled,\n readOnly,\n required,\n loading,\n variant,\n status,\n code,\n startAdornment,\n endAdornment,\n showClearButton = \"auto\",\n optionsLabel,\n loadingOptions,\n loadingOptionsLabel,\n loadingOptionsProgress,\n emptyMessage,\n valueTagMaxWidth,\n onKeyDown,\n onBlurToOutside,\n className,\n rootProps,\n codeProps,\n containerProps,\n valueProps,\n valueTagProps,\n clearButtonProps,\n spinnerProps,\n arrowProps,\n popoverProps,\n commandMenuProps,\n style,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n searchPlaceholder ??= locale.Select.searchPlaceholder;\n emptyMessage ??= locale.Select.emptyMessage;\n optionsLabel ??= locale.Select.optionsLabel;\n loadingOptionsLabel ??= locale.Select.loadingOptionsLabel;\n const { cssVarStyle } = useCssVars();\n const labelId = useFieldLabelId();\n const [open, setOpen] = useControllableState(\n defaultOpen ?? false,\n controlledOpen,\n );\n const [value, setValue] = useControllableState(\n defaultValue ?? \"\",\n controlledValue,\n );\n const [searchValue, setSearchValue] = useControllableState(\n \"\",\n controlledSearchValue,\n );\n\n const actualValue = React.useMemo(\n () =>\n multiple\n ? Array.isArray(value)\n ? value\n : value === \"\"\n ? []\n : [value.toString()]\n : Array.isArray(value)\n ? (value.at(-1) ?? \"\")\n : value.toString(),\n [multiple, value],\n );\n const isEmpty = multiple ? actualValue.length === 0 : actualValue === \"\";\n\n const buttonRef = React.useRef<HTMLButtonElement | null>(null);\n const popoverRef =\n React.useRef<React.ComponentRef<typeof PopoverContent>>(null);\n\n // Toggle select open state when the container is pressed\n const handleContainerPointerDown = React.useCallback(\n (evt: React.MouseEvent) => {\n evt.preventDefault();\n const buttonEl = buttonRef.current;\n const target = evt.target as HTMLElement;\n if (\n buttonEl &&\n !disabled &&\n !target.closest(\"input, select, textarea, button, a\")\n ) {\n setOpen((open) => !open);\n }\n },\n [disabled, setOpen],\n );\n\n const handleOptionSelect = React.useCallback(\n (optionValue: string) => {\n if (multiple) {\n const newValue = actualValue.includes(optionValue)\n ? (actualValue as string[]).filter((v: string) => v !== optionValue)\n : [...actualValue, optionValue];\n setValue(newValue);\n onValueChange?.(newValue as never);\n } else {\n if (optionValue !== actualValue) {\n setValue(optionValue);\n onValueChange?.(optionValue as never);\n }\n setOpen(false);\n }\n setSearchValue(\"\");\n onSearchValueChange?.(\"\");\n },\n [\n actualValue,\n multiple,\n onSearchValueChange,\n onValueChange,\n setOpen,\n setSearchValue,\n setValue,\n ],\n );\n const handleClearButtonClick = React.useCallback(() => {\n if (!isEmpty) {\n const newValue = multiple ? [] : \"\";\n setValue(newValue);\n onValueChange?.(newValue as never);\n }\n }, [isEmpty, multiple, onValueChange, setValue]);\n\n // Manually focus the button after close since we're forwarding the trigger's\n // ref to the input's container\n const handleCloseAutoFocus = React.useCallback((evt: Event) => {\n if (\n document.activeElement === document.body ||\n document.activeElement === document.documentElement\n ) {\n evt.preventDefault();\n buttonRef.current?.focus();\n }\n }, []);\n\n // Clear value when pressing 'Delete' or 'Backspace'\n const clearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const handleKeyDown = React.useCallback(\n (evt: React.KeyboardEvent) => {\n if (evt.code === \"Delete\" || evt.code === \"Backspace\") {\n clearButtonRef.current?.click();\n } else if (evt.code === \"ArrowUp\" || evt.code === \"ArrowDown\") {\n setOpen(true);\n }\n },\n [setOpen],\n );\n\n // Notify when the focus moves out of the control\n const handleControlBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n if (\n onBlurToOutside &&\n (!evt.relatedTarget ||\n (!buttonRef.current?.contains(evt.relatedTarget) &&\n !popoverRef.current?.contains(evt.relatedTarget)))\n ) {\n onBlurToOutside(evt);\n }\n },\n [onBlurToOutside],\n );\n\n const selectContext = useCreateSelectContext({\n multiple,\n value: actualValue,\n setValue: setValue as never,\n onOptionSelect: handleOptionSelect,\n status,\n disabled,\n readOnly,\n valueTagProps,\n });\n const registeringOptionsSelectContext = React.useMemo(\n () => ({ registering: true, ...selectContext }),\n [selectContext],\n );\n\n const showOpen = open && !disabled && !readOnly;\n const combinedClearButtonRef = useCombinedRef(\n clearButtonRef,\n clearButtonProps?.ref,\n );\n const combinedButtonRef = useCombinedRef(buttonRef, forwardedRef);\n const combinedPopoverRef = useCombinedRef(popoverRef, popoverProps?.ref);\n return (\n <SelectContext.Provider value={selectContext}>\n {/* Render children with `registering` set to keep track of existing\n options. */}\n <SelectContext.Provider value={registeringOptionsSelectContext}>\n {children}\n </SelectContext.Provider>\n\n <Popover\n open={showOpen}\n onOpenChange={combineEventHandlers(onOpenChange, setOpen)}\n >\n <PopoverTrigger\n className={cx(prefix(\"select\"), className)}\n role=\"combobox\"\n aria-autocomplete=\"none\"\n data-multiple={boolDataAttr(multiple)}\n data-limit-value-tags-width={boolDataAttr(valueTagMaxWidth != null)}\n onKeyDown={combineEventHandlers(onKeyDown, handleKeyDown)}\n {...otherProps}\n style={{\n ...cssVarStyle(\n \"select-value-tag-max-width\",\n typeof valueTagMaxWidth === \"number\"\n ? `${valueTagMaxWidth}px`\n : valueTagMaxWidth,\n ),\n ...style,\n }}\n >\n <InputWithContainerRef\n asChild\n name={name}\n variant={variant}\n status={status}\n code={code}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n loading={loading || loadingOptions}\n startAdornment={startAdornment}\n endAdornment={\n <>\n {!readOnly && (\n <Icon\n icon={showOpen ? faChevronUp : faChevronDown}\n className={cx(\n prefix(\"select__arrow\"),\n arrowProps?.className,\n )}\n data-status={status}\n data-disabled={disabled}\n />\n )}\n {endAdornment}\n </>\n }\n showClearButton={\n showClearButton === \"auto\" ? !isEmpty : showClearButton\n }\n onBlurToOutside={handleControlBlur}\n rootProps={rootProps}\n codeProps={codeProps}\n containerProps={{\n // Propagate open state to container for styling purposes\n ...{ \"data-state\": showOpen ? \"open\" : \"closed\" },\n ...containerProps,\n className: cx(\n prefix(\"select__container\"),\n containerProps?.className,\n ),\n onPointerDown: combineEventHandlers(\n containerProps?.onPointerDown,\n handleContainerPointerDown,\n ),\n }}\n clearButtonProps={{\n ...clearButtonProps,\n className: cx(\n prefix(\"select__clear-button\"),\n clearButtonProps?.className,\n ),\n onClick: combineEventHandlers(\n clearButtonProps?.onClick,\n handleClearButtonClick,\n { checkDefaultPrevented: true },\n ),\n ref: combinedClearButtonRef,\n }}\n spinnerProps={{\n ...spinnerProps,\n className: cx(prefix(\"select__spinner\"), spinnerProps?.className),\n }}\n aria-readonly={readOnly ? \"true\" : undefined}\n data-placeholder={boolDataAttr(isEmpty)}\n >\n <button ref={combinedButtonRef}>\n <span\n {...valueProps}\n className={cx(prefix(\"select__value\"), valueProps?.className)}\n >\n {isEmpty && placeholder}\n {!isEmpty && !multiple && <SelectSingleValue />}\n {!isEmpty && multiple && <SelectMultipleValue />}\n </span>\n </button>\n </InputWithContainerRef>\n </PopoverTrigger>\n\n <PopoverContent\n asChild\n align=\"start\"\n showArrow={false}\n {...popoverProps}\n className={cx(prefix(\"select__popover\"), popoverProps?.className)}\n onCloseAutoFocus={combineEventHandlers(\n popoverProps?.onCloseAutoFocus,\n handleCloseAutoFocus,\n { checkDefaultPrevented: true },\n )}\n onBlur={combineEventHandlers(popoverProps?.onBlur, handleControlBlur)}\n ref={combinedPopoverRef}\n >\n <CommandMenu\n value={multiple ? \"\" : (actualValue as string)}\n {...commandMenuProps}\n searchPlaceholder={searchPlaceholder}\n emptyMessage={emptyMessage}\n listLabel={optionsLabel}\n loading={loadingOptions}\n loadingLabel={loadingOptionsLabel}\n loadingProgress={loadingOptionsProgress}\n iconPlacement=\"end\"\n searchValue={searchValue}\n onSearchValueChange={combineEventHandlers(\n onSearchValueChange,\n setSearchValue,\n )}\n searchProps={{ \"aria-labelledby\": labelId }}\n listProps={{\n \"aria-multiselectable\": multiple ? true : undefined,\n ...commandMenuProps?.listProps,\n }}\n >\n {children}\n </CommandMenu>\n </PopoverContent>\n </Popover>\n </SelectContext.Provider>\n );\n});\n","import * as React from \"react\";\nimport { createStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { type ControlStatus } from \"../../utils/control.ts\";\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { type SelectProps } from \"./Select.tsx\";\n\n/** Value of the select context. */\nexport interface SelectContextValue {\n registering?: boolean;\n multiple: boolean;\n value: string | string[];\n setValue: React.Dispatch<\n React.SetStateAction<string | number | readonly string[]>\n >;\n onOptionSelect: (value: string) => void;\n status?: ControlStatus;\n disabled?: boolean;\n readOnly?: boolean;\n valueTagProps?: SelectProps[\"valueTagProps\"];\n store: SelectStore;\n}\n\n/** State of an option. */\nexport interface OptionState {\n content: React.ReactNode;\n color?: AccentColor;\n disabled?: boolean;\n}\n\n/** State of the select. */\nexport interface SelectState {\n // State below is wrapped in an array in order to trigger state updates by\n // simply changing the identity of the wrapper without creating new object\n // instances\n optionsContent: [Map<string, OptionState>];\n actions: SelectActions;\n}\n\nexport interface SelectActions {\n getOptionState: (value: string) => OptionState | undefined;\n registerOption: (value: string, state: OptionState) => void;\n unregisterOption: (value: string) => void;\n}\n\n/** Select store. */\nexport type SelectStore = ReturnType<typeof useCreateSelectContext>[\"store\"];\n\n/** Select context. */\nexport const SelectContext = React.createContext<SelectContextValue | null>(\n null,\n);\n\n/** Options to pass to the `useCreateSelectContext` hook. */\nexport type UseCreateSelectContextOptions = Omit<SelectContextValue, \"store\">;\n\n/** Hook which creates the select context. */\nexport function useCreateSelectContext({\n multiple,\n value,\n setValue,\n onOptionSelect,\n status,\n disabled,\n readOnly,\n valueTagProps,\n}: UseCreateSelectContextOptions) {\n const store = useConstant(() =>\n createStore<SelectState>()(\n subscribeWithSelector((set, get) => ({\n optionsContent: [new Map<string, OptionState>()],\n actions: {\n getOptionState: (value) => get().optionsContent[0].get(value),\n registerOption: (value, content) => {\n const [optionsContent] = get().optionsContent;\n optionsContent.set(value, content);\n set({ optionsContent: [optionsContent] });\n },\n unregisterOption: (value) => {\n const [optionsContent] = get().optionsContent;\n optionsContent.delete(value);\n set({ optionsContent: [optionsContent] });\n },\n },\n })),\n ),\n );\n\n return React.useMemo(\n () => ({\n multiple,\n value,\n setValue,\n onOptionSelect,\n status,\n disabled,\n readOnly,\n valueTagProps,\n store,\n }),\n [\n disabled,\n multiple,\n onOptionSelect,\n readOnly,\n setValue,\n status,\n store,\n value,\n valueTagProps,\n ],\n );\n}\n\n/** Hooks returning the select context value. */\nexport function useSelectContext(): SelectContextValue {\n const selectContext = React.useContext(SelectContext);\n if (!selectContext) {\n throw new Error(\"Select context not in scope.\");\n }\n return selectContext;\n}\n","import { faCheck } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CommandMenuItem } from \"../CommandMenu\";\nimport { useSelectContext } from \"./SelectContext.ts\";\n\n/** Properties of the option component. */\nexport interface OptionProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CommandMenuItem>,\n \"value\" | \"asLink\" | \"onSelect\" | \"selected\" | \"icon\" | \"target\" | \"href\"\n > {\n /**\n * A unique value for this item. If no value is provided, it will be inferred\n * from `children` or the rendered `textContent`. If your `textContent`\n * changes between renders, you must provide a stable, unique `value`.\n */\n value?: string | number;\n}\n\n/** An option which can be selected in a `Select`. */\nexport const Option = React.memo(\n React.forwardRef<React.ComponentRef<typeof CommandMenuItem>, OptionProps>(\n function Option(\n {\n value,\n color,\n disabled,\n className,\n actionProps,\n iconProps,\n children,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const textValue = value?.toString() ?? \"\";\n const {\n registering,\n multiple,\n value: selectValue,\n onOptionSelect,\n store,\n } = useSelectContext();\n\n // Register option when `registering` is set\n const { registerOption, unregisterOption } = useStore(\n store,\n (state) => state.actions,\n );\n React.useEffect(() => {\n if (registering) {\n registerOption(textValue, { content: children, color, disabled });\n return () => unregisterOption(textValue);\n }\n }, [\n children,\n disabled,\n color,\n registering,\n registerOption,\n textValue,\n unregisterOption,\n ]);\n if (registering) {\n return null;\n }\n\n const selected = multiple\n ? selectValue.includes(textValue)\n : selectValue === textValue;\n return (\n <CommandMenuItem\n className={cx(prefix(\"select__option\"), className)}\n value={textValue}\n onSelect={onOptionSelect}\n selected={selected}\n aria-checked={selected}\n disabled={disabled}\n color={color}\n icon={selected ? faCheck : undefined}\n actionProps={{\n ...actionProps,\n className: cx(\n prefix(\"select__option-action\"),\n actionProps?.className,\n ),\n }}\n iconProps={{\n size: \"sm\",\n ...iconProps,\n className: cx(\n prefix(\"select__option-indicator\"),\n iconProps?.className,\n ),\n }}\n ref={forwardedRef}\n {...otherProps}\n >\n {children}\n </CommandMenuItem>\n );\n },\n ),\n);\n","import * as React from \"react\";\n\nimport { CommandMenuGroup } from \"../CommandMenu\";\nimport { useSelectContext } from \"./SelectContext.ts\";\n\n/** Properties of the options group component. */\nexport interface OptionsGroupProps\n extends React.ComponentPropsWithoutRef<typeof CommandMenuGroup> {}\n\n/** Component used to group options within a `Select`. */\nexport const OptionsGroup = React.forwardRef<\n React.ComponentRef<typeof CommandMenuGroup>,\n OptionsGroupProps\n>(function OptionsGroup({ children, ...otherProps }, forwardedRef) {\n const { registering } = useSelectContext();\n\n return registering ? (\n children\n ) : (\n <CommandMenuGroup {...otherProps} ref={forwardedRef}>\n {children}\n </CommandMenuGroup>\n );\n});\n","import { faArrowLeft, faArrowRight } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { IconButton } from \"../IconButton\";\nimport { Option, Select } from \"../Select\";\nimport { Spinner } from \"../Spinner\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { type DataTablePaginationProps } from \"./DataTablePagination.tsx\";\n\n/** Properties of the scrolled data table pagination. */\nexport interface PagedDataTablePaginationProps\n extends React.ComponentPropsWithoutRef<\"div\">,\n Pick<\n DataTablePaginationProps,\n \"rowsRange\" | \"previousPageButtonLabel\" | \"nextPageButtonLabel\"\n > {}\n\n/** Pagination component of the scrolled data table. */\nexport const PagedDataTablePagination = React.forwardRef<\n React.ComponentRef<\"div\">,\n PagedDataTablePaginationProps\n>(function PagedDataTablePagination(\n {\n rowsRange,\n previousPageButtonLabel,\n nextPageButtonLabel,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { store } = useDataTableContext();\n const totalCount = useStore(store, (state) => state.totalCount());\n const limit = useStore(store, (state) => state.limit);\n const { setOffset } = useStore(store, (state) => state.actions);\n\n const setOffsetWithTransition = (offset: number) =>\n React.startTransition(() => setOffset(offset));\n\n const currentPage = useStore(store, (state) => state.currentPage());\n const numberOfPages = Math.ceil((totalCount ?? 0) / limit);\n const lastPage = Math.max(0, numberOfPages - 1);\n\n return (\n <ClearContexts>\n <div\n className={cx(prefix(\"data-table__pagination\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n <label className={prefix(\"data-table__pagination-label\")}>\n {totalCount == null && (\n <Spinner className={prefix(\"data-table__pagination-spinner\")} />\n )}\n {totalCount != null &&\n rowsRange?.(\n <Select\n className={prefix(\"data-table__pagination-select\")}\n value={currentPage}\n onValueChange={(value) =>\n setOffsetWithTransition(+value * limit)\n }\n showClearButton={false}\n rootProps={{\n className: prefix(\"data-table__pagination-select-root\"),\n }}\n >\n {totalCount === 0 && <Option value={0}>0–0</Option>}\n {totalCount > 0 &&\n Array.from({ length: numberOfPages }, (_, i) => (\n <Option value={i} key={i}>\n {limit * i + 1}–{Math.min(limit * i + limit, totalCount)}\n </Option>\n ))}\n </Select>,\n totalCount,\n )}\n </label>\n\n {/* Left/right arrows */}\n <div className={prefix(\"data-table__pagination-arrows\")}>\n <IconButton\n icon={faArrowLeft}\n label={previousPageButtonLabel ?? \"\"}\n disabled={currentPage === 0}\n onClick={() => setOffsetWithTransition((currentPage - 1) * limit)}\n />\n <IconButton\n icon={faArrowRight}\n label={nextPageButtonLabel ?? \"\"}\n disabled={currentPage === lastPage}\n onClick={() => setOffsetWithTransition((currentPage + 1) * limit)}\n />\n </div>\n </div>\n </ClearContexts>\n );\n});\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Spinner } from \"../Spinner\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { type DataTablePaginationProps } from \"./DataTablePagination.tsx\";\n\n/** Properties of the scrolled data table pagination. */\nexport interface ScrolledDataTablePaginationProps\n extends React.ComponentPropsWithoutRef<\"div\">,\n Pick<DataTablePaginationProps, \"rowsRange\"> {}\n\n/** Pagination component of the scrolled data table. */\nexport const ScrolledDataTablePagination = React.forwardRef<\n React.ComponentRef<\"div\">,\n ScrolledDataTablePaginationProps\n>(function ScrolledDataTablePagination(\n { rowsRange, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { store } = useDataTableContext();\n const totalCount = useStore(store, (state) => state.totalCount());\n const scrolledRangeStart = useStore(\n store,\n (state) => state.scrolledRangeStart,\n );\n const scrolledRangeEnd = useStore(store, (state) => state.scrolledRangeEnd);\n\n return (\n <div\n className={cx(prefix(\"data-table__pagination\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {totalCount == null && (\n <Spinner className={prefix(\"data-table__pagination-spinner\")} />\n )}\n {totalCount != null &&\n rowsRange?.(\n `${Math.min(scrolledRangeStart + 1, totalCount)}–${Math.min(\n scrolledRangeEnd + 1,\n totalCount,\n )}`,\n totalCount,\n )}\n </div>\n );\n});\n","import * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { PagedDataTablePagination } from \"./PagedDataTablePagination.tsx\";\nimport { ScrolledDataTablePagination } from \"./ScrolledDataTablePagination.tsx\";\n\n/** Properties of the data table pagination component. */\nexport interface DataTablePaginationProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Function used to render the range of displayed rows.\n *\n * @param range Node representing the range of rows (note that, in paged mode,\n * this is a select).\n * @param total Total number of rows.\n */\n rowsRange?: (range: React.ReactNode, total: number) => React.ReactNode;\n /** Label of the previous page button (only relevant in paged mode). */\n previousPageButtonLabel?: string;\n /** Label of the next page button (only relevant in paged mode). */\n nextPageButtonLabel?: string;\n}\n\n/** Component used to provide pagination to the data table. */\nexport const DataTablePagination = React.forwardRef<\n React.ComponentRef<\"div\">,\n DataTablePaginationProps\n>(function DataTablePagination(\n { rowsRange, previousPageButtonLabel, nextPageButtonLabel, ...otherProps },\n forwardedRef,\n) {\n const locale = useLocale();\n rowsRange ??= locale.DataTablePagination.rowsRange;\n previousPageButtonLabel ??=\n locale.DataTablePagination.previousPageButtonLabel;\n nextPageButtonLabel ??= locale.DataTablePagination.nextPageButtonLabel;\n\n const { displayMode } = useDataTableContext();\n\n return displayMode === \"paged\" ? (\n <PagedDataTablePagination\n {...otherProps}\n rowsRange={rowsRange}\n previousPageButtonLabel={previousPageButtonLabel}\n nextPageButtonLabel={nextPageButtonLabel}\n ref={forwardedRef}\n />\n ) : (\n <ScrolledDataTablePagination\n {...otherProps}\n rowsRange={rowsRange}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { Option, Select } from \"../Select\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\n\n/** Default options shown on the \"rows per page\" component. */\nconst DEFAULT_ROWS_PER_PAGE_OPTIONS = [10, 15, 25, 50];\n\n/** Properties of the data table rows per page component. */\nexport interface DataTableRowsPerPageProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Options used to set the data table's `limit` (the maximum number of rows\n * shown per page).\n *\n * @default [10, 15, 25, 50]\n */\n limitOptions?: number[];\n /**\n * Function used to render the number of rows per page.\n *\n * @param rows Node representing the number of rows (a select).\n */\n label?: React.ReactNode;\n}\n\n/** Component displaying a select used to change the number of rows per page. */\nexport const DataTableRowsPerPage = React.forwardRef<\n React.ComponentRef<\"div\">,\n DataTableRowsPerPageProps\n>(function DataTableRowsPerPage(\n {\n limitOptions = DEFAULT_ROWS_PER_PAGE_OPTIONS,\n label,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n label ??= locale.DataTableRowsPerPage.label;\n const { store } = useDataTableContext();\n const limit = useStore(store, (state) => state.limit);\n const { setLimit } = useStore(store, (state) => state.actions);\n const optionsIncludingLimit = limitOptions.includes(limit)\n ? [...limitOptions]\n : [...limitOptions, limit];\n optionsIncludingLimit.sort((v1, v2) => v1 - v2);\n const selectId = prefix(`data-table-rows-per-page-${React.useId()}`);\n\n return (\n <ClearContexts>\n <div\n className={cx(prefix(\"data-table__rows-per-page\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n <label\n htmlFor={selectId}\n className={prefix(\"data-table__rows-per-page-label\")}\n >\n {label}:\n </label>\n <Select\n className={prefix(\"data-table__rows-per-page-select\")}\n id={selectId}\n value={limit}\n onValueChange={(value) => setLimit(+value)}\n showClearButton={false}\n rootProps={{\n className: prefix(\"data-table__rows-per-page-select-root\"),\n }}\n >\n {optionsIncludingLimit.map((option) => (\n <Option value={option} key={option}>\n {option}\n </Option>\n ))}\n </Select>\n </div>\n </ClearContexts>\n );\n});\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Button } from \"../Button\";\nimport { Slot } from \"../Slot\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\n\n/** Properties of the data table selection trigger component. */\nexport interface DataTableSelectionTriggerProps\n extends Omit<React.ComponentPropsWithoutRef<typeof Button>, \"onClick\"> {\n /**\n * Whether the button should be displayed when no rows are selected.\n *\n * @default false\n */\n showWhenNoneSelected?: boolean;\n /**\n * Action to run when triggering the action.\n *\n * @param selectedRows Rows currently selected.\n * @param event Original click event.\n */\n onClick: (selectedRows: React.Key[], event: React.MouseEvent) => void;\n children: React.ReactNode;\n}\n\n/** Trigger used to run an action over selected rows. */\nexport const DataTableSelectionTrigger = React.forwardRef<\n React.ComponentRef<typeof Button>,\n DataTableSelectionTriggerProps\n>(function DataTableSelectionTrigger(\n { showWhenNoneSelected, onClick, className, children, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { store } = useDataTableContext();\n const hasSelected = useStore(store, (state) => state.selectedRows.length > 0);\n\n const handleClick = React.useCallback(\n (event: React.MouseEvent) => {\n onClick(Array.from(store.getState().selectedRows[0]).sort(), event);\n },\n [onClick, store],\n );\n\n const As: any = Slot;\n return (\n (showWhenNoneSelected || hasSelected) && (\n <As\n className={cx(prefix(\"data-table__selection-trigger\"), className)}\n disabled={!hasSelected}\n onClick={handleClick}\n {...otherProps}\n ref={forwardedRef}\n >\n {children ?? <Button />}\n </As>\n )\n );\n});\n","/** Native form controls. */\nexport const NATIVE_CONTROLS = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"METER\",\n \"OUTPUT\",\n \"PROGRESS\",\n \"SELECT\",\n \"TEXTAREA\",\n]);\n","import {\n faAsterisk,\n faCircleQuestion,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { Label as LabelPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { NATIVE_CONTROLS } from \"../../utils/nativeControls.ts\";\nimport {\n useFieldControlId,\n useFieldControlRequired,\n useFieldControlTagName,\n useSetFieldLabel,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport { IconButton } from \"../IconButton\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport { Slottable } from \"../Slot\";\n\n/** Properties of the label component. */\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {\n /** Shows a \"required\" symbol next to the label. */\n required?: boolean;\n /** Optional helper text displayed as a popover triggered by an icon button. */\n helperText?: React.ReactNode;\n /** Label of the required icon announced to assistive technologies. */\n requiredIconLabel?: string;\n /** Label of the helper button announced to assistive technologies. */\n helperButtonLabel?: string;\n /** Properties to pass to the container element. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the required icon container element. */\n requiredIconContainerProps?: React.ComponentPropsWithRef<\"span\">;\n /** Properties to pass to the required icon component. */\n requiredIconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the helper button component. */\n helperButtonProps?: Omit<\n React.ComponentPropsWithRef<typeof IconButton>,\n \"icon\"\n >;\n /** Properties to pass to the helper popover component. */\n helperPopoverProps?: React.ComponentPropsWithRef<typeof Popover>;\n /** Properties to pass to the helper popover content component. */\n helperPopoverContentProps?: React.ComponentPropsWithRef<\n typeof PopoverContent\n >;\n}\n\n/**\n * The `Label` component renders an accessible label which can be associated\n * with form controls.\n *\n * It should typically be used within a `Field` component together with a\n * control (`Input`, `Checkbox`, `Select`, _etc._), in which case the label will\n * be automatically associated with its respective control.\n *\n * Example usage:\n *\n * ```tsx\n * import { Label } from \"@ostack.tech/ui\";\n *\n * function FullNameLabel() {\n * return <Label>Full name</Label>;\n * }\n * ```\n */\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n LabelProps\n>(function Label(\n {\n asChild,\n required,\n helperText,\n requiredIconLabel,\n helperButtonLabel,\n htmlFor,\n id,\n className,\n children,\n containerProps,\n requiredIconProps,\n requiredIconContainerProps,\n helperButtonProps,\n helperPopoverProps,\n helperPopoverContentProps,\n onClick,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n requiredIconLabel ??= locale.Label.requiredIconLabel;\n helperButtonLabel ??= locale.Label.helperButtonLabel;\n const labelId = useSetFieldLabel(children, id);\n const controlId = useFieldControlId();\n const controlTagName = useFieldControlTagName();\n const controlRequired = useFieldControlRequired();\n const labelRequired = required ?? controlRequired;\n\n // Focus non-native controls\n const handleClick = (evt: React.MouseEvent) => {\n const forId = htmlFor ?? controlId;\n if (evt.isTrusted && forId) {\n const forEl = document.getElementById(forId);\n if (\n forEl &&\n (asChild || !NATIVE_CONTROLS.has(forEl.tagName)) &&\n !forEl.contains(evt.target as Node)\n ) {\n // XXX: Trick browser into triggering `focus-visible`\n const contentEditable = forEl.contentEditable;\n forEl.contentEditable = \"true\";\n forEl.focus();\n forEl.contentEditable = contentEditable;\n }\n }\n };\n\n const actualHtmlFor =\n htmlFor ??\n (!asChild && controlTagName && NATIVE_CONTROLS.has(controlTagName)\n ? controlId\n : undefined);\n const renderSpan = asChild == null && actualHtmlFor == null;\n\n return (\n <div\n {...containerProps}\n className={cx(prefix(\"label__container\"), containerProps?.className)}\n >\n <LabelPrimitive.Root\n asChild={asChild ?? renderSpan}\n id={labelId}\n className={cx(prefix(\"label\"), className)}\n htmlFor={actualHtmlFor}\n onClick={combineEventHandlers(onClick, handleClick, {\n checkDefaultPrevented: true,\n })}\n ref={forwardedRef}\n {...otherProps}\n >\n <Slottable>{renderSpan ? <span>{children}</span> : children}</Slottable>\n {labelRequired && (\n <span\n className={cx(\n prefix(\"label__required-icon-container\"),\n requiredIconContainerProps?.className,\n )}\n >\n {/* Zero-width non-breaking space: prevent breaking between the text\n and the required icon, while controlling spacing via CSS. */}\n \n <Icon\n label={requiredIconLabel && ` (${requiredIconLabel})`}\n {...requiredIconProps}\n className={cx(\n prefix(\"label__required-icon\"),\n requiredIconProps?.className,\n )}\n icon={faAsterisk}\n />\n </span>\n )}\n </LabelPrimitive.Root>\n\n {helperText && (\n <Popover modal={false} {...helperPopoverProps}>\n <PopoverTrigger>\n <IconButton\n icon={faCircleQuestion}\n variant=\"ghost\"\n size=\"sm\"\n label={helperButtonLabel ?? \"\"}\n {...helperButtonProps}\n className={cx(\n prefix(\"label__helper-button\"),\n helperButtonProps?.className,\n )}\n />\n </PopoverTrigger>\n\n <PopoverContent\n side=\"top\"\n {...helperPopoverContentProps}\n className={cx(\n prefix(\"label__helper-popover\"),\n helperPopoverContentProps?.className,\n )}\n >\n {helperText}\n </PopoverContent>\n </Popover>\n )}\n </div>\n );\n});\n","import { faCheck, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n controlStatusToAccent,\n type ControlVariant,\n useControlContext,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { CheckboxGroupContext } from \"../CheckboxGroup/CheckboxGroupContext.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { ControlCode } from \"../ControlCode\";\nimport { useDataTableColumnLabelId } from \"../DataTable\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useFieldLabelId,\n useSetFieldControl,\n useSetFieldControlFocused,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport { Label } from \"../Label\";\nimport { Spinner } from \"../Spinner\";\nimport { useIsInTableCell } from \"../Table\";\n\n/** `checked` state of a checkbox. */\nexport type CheckboxChecked = CheckboxPrimitive.CheckedState;\n\n/** Properties of the checkbox component. */\nexport interface CheckboxProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n \"asChild\"\n > {\n /**\n * Checkbox style variant. Defaults to the default variant unless when\n * rendering inside a table cell (in which case it defaults to `\"cell\"`).\n */\n variant?: ControlVariant;\n /** Sets the status of the checkbox. */\n status?: ControlStatus;\n /** Checkbox code. */\n code?: React.ReactNode;\n /** Sets the checkbox as read-only. */\n readOnly?: boolean;\n /**\n * Adds a spinner to the checkbox to indicate activity. Note that it doesn't\n * automatically disable the checkbox.\n *\n * @default false\n */\n loading?: boolean;\n /**\n * Function called when the focus moves out of the control as a whole.\n *\n * This is useful when there is a need to know when the user stops interacting\n * with the control.\n */\n onBlurToOutside?: (event: React.FocusEvent) => void;\n /** Properties to pass to the root component. */\n rootProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the code component. */\n codeProps?: React.ComponentPropsWithRef<typeof ControlCode>;\n /** Properties to pass to the indicator component. */\n indicatorProps?: React.ComponentPropsWithRef<typeof Icon>;\n /** Properties to pass to the label component. */\n labelProps?: Omit<React.ComponentPropsWithRef<typeof Label>, \"required\">;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n}\n\n/**\n * The `Checkbox` component allows a user to toggle a “button” between checked\n * and not checked.\n *\n * It can be used standalone or as part of a checkbox group (see the\n * `CheckboxGroup` component).\n *\n * Example usage:\n *\n * ```tsx\n * import { Checkbox } from \"@ostack.tech/ui\";\n *\n * function AcceptTerms() {\n * return <Checkbox>Accept terms and conditions</Checkbox>;\n * }\n * ```\n */\nexport const Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(function Checkbox(\n {\n variant,\n status,\n code,\n loading,\n onBlurToOutside,\n children,\n rootProps,\n containerProps,\n codeProps,\n indicatorProps,\n labelProps,\n spinnerProps,\n value,\n defaultChecked,\n checked: controlledChecked,\n onCheckedChange,\n onFocus,\n onBlur,\n id,\n name,\n className,\n required,\n disabled,\n readOnly,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const controlContext = useControlContext();\n const checkboxGroupContext = React.useContext(CheckboxGroupContext);\n\n const fieldLabelId = useFieldLabelId();\n const dataTableColumnLabelId = useDataTableColumnLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const { controlId, codeId } = useSetFieldControl(\n id,\n \"BUTTON\",\n codeProps?.id,\n !!code,\n required,\n );\n const generatedId = React.useId();\n const labelId =\n children && (labelProps?.id ?? prefix(`checkbox-label-${generatedId}`));\n const checkboxRef = React.useRef<React.ComponentRef<\n typeof CheckboxPrimitive.Root\n > | null>(null);\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const labelRef = React.useRef<React.ComponentRef<typeof Label> | null>(null);\n\n const isInTableCell = useIsInTableCell();\n\n const checkboxVariant = variant ?? (isInTableCell ? \"cell\" : \"default\");\n status = controlContext?.status ?? status;\n disabled = controlContext?.disabled || disabled;\n readOnly = controlContext?.readOnly || readOnly;\n\n const [checked, setChecked] = useControllableState<CheckboxChecked>(\n defaultChecked ?? false,\n controlledChecked ?? checkboxGroupContext?.value.includes(String(value)),\n );\n\n const onContextCheckedChange = checkboxGroupContext?.onCheckedChange;\n const handleCheckedChange = React.useCallback(\n (state: CheckboxChecked) => {\n if (!readOnly) {\n onCheckedChange?.(state);\n setChecked(state);\n onContextCheckedChange?.(value?.toString() ?? \"\", state === true);\n }\n },\n [onCheckedChange, onContextCheckedChange, readOnly, setChecked, value],\n );\n\n // Notify field when checkbox is focused\n const setFieldControlFocused = useSetFieldControlFocused();\n const handleFocus = React.useCallback(() => {\n setFieldControlFocused(true);\n }, [setFieldControlFocused]);\n const handleBlur = React.useCallback(() => {\n setFieldControlFocused(false);\n }, [setFieldControlFocused]);\n\n // Notify when the focus moves out of the checkbox\n const handleContainerBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n if (\n onBlurToOutside &&\n (!evt.relatedTarget ||\n !containerRef.current?.contains(evt.relatedTarget))\n ) {\n onBlurToOutside(evt);\n }\n },\n [onBlurToOutside],\n );\n // XXX: Make it so that when pressing on the label temporarily focuses it so\n // that the `relatedTarget` in the code above points to the label rather than\n // being `null`\n const handleLabelMouseDown = React.useCallback(() => {\n const labelEl = labelRef.current;\n if (labelEl && labelEl.tabIndex < 0) {\n labelEl.tabIndex = 0;\n void Promise.resolve().then(() => (labelEl.tabIndex = -1));\n }\n }, []);\n\n const combinedContainerRef = useCombinedRef(\n containerProps?.ref,\n containerRef,\n );\n const combinedCheckboxRef = useCombinedRef(checkboxRef, forwardedRef);\n const combinedLabelRef = useCombinedRef(labelProps?.ref, labelRef);\n return (\n <ClearContexts>\n <ControlContext.Provider\n value={{\n variant:\n // Propagate the context variant for addon/code styles when inside a\n // checkbox group\n variant ??\n (isInTableCell ? \"cell\" : (controlContext?.variant ?? \"default\")),\n status,\n disabled,\n readOnly,\n }}\n >\n <div\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={checkboxVariant}\n {...rootProps}\n className={cx(prefix(\"checkbox__root\"), rootProps?.className)}\n >\n {code && (\n <ControlCode\n {...codeProps}\n id={codeId}\n className={cx(prefix(\"checkbox__code\"), codeProps?.className)}\n >\n {code}\n </ControlCode>\n )}\n\n <div\n data-status={status}\n data-variant={checkboxVariant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...containerProps}\n className={cx(\n prefix(\"checkbox__container\"),\n containerProps?.className,\n )}\n onBlur={combineEventHandlers(\n containerProps?.onBlur,\n handleContainerBlur,\n )}\n ref={combinedContainerRef}\n >\n <CheckboxPrimitive.Root\n id={controlId}\n className={cx(prefix(\"checkbox\"), className)}\n name={\n name ??\n (checkboxGroupContext?.name\n ? `${checkboxGroupContext.name}[]`\n : undefined)\n }\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n data-readonly={boolDataAttr(readOnly)}\n data-status={status}\n data-variant={checkboxVariant}\n onCheckedChange={handleCheckedChange}\n onFocus={combineEventHandlers(onFocus, handleFocus)}\n onBlur={combineEventHandlers(onBlur, handleBlur)}\n aria-readonly={readOnly ? \"true\" : undefined}\n aria-labelledby={\n dataTableColumnLabelId || fieldLabelId || ariaLabelledBy\n ? mergeAriaIds(\n dataTableColumnLabelId,\n fieldLabelId,\n labelId,\n ariaLabelledBy,\n )\n : undefined\n }\n aria-invalid={status === \"invalid\" ? \"true\" : undefined}\n aria-describedby={mergeAriaIds(\n codeId,\n errorMessageIds,\n descriptionIds,\n ariaDescribedBy,\n )}\n {...otherProps}\n ref={combinedCheckboxRef}\n >\n <CheckboxPrimitive.Indicator asChild>\n <Icon\n icon={checked === \"indeterminate\" ? faMinus : faCheck}\n {...indicatorProps}\n className={cx(\n prefix(\"checkbox__indicator\"),\n indicatorProps?.className,\n )}\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n\n {children && (\n <Label\n htmlFor={controlId}\n data-status={status}\n {...labelProps}\n id={labelId as string}\n className={cx(prefix(\"checkbox__label\"), labelProps?.className)}\n required={required}\n onMouseDown={combineEventHandlers(\n labelProps?.onMouseDown,\n handleLabelMouseDown,\n )}\n containerProps={{\n ...labelProps?.containerProps,\n className: cx(\n prefix(\"checkbox__label-container\"),\n labelProps?.containerProps?.className,\n ),\n }}\n ref={combinedLabelRef}\n >\n {children}\n </Label>\n )}\n\n {/* Spinner */}\n {loading && (\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(disabled)}\n {...spinnerProps}\n className={cx(\n prefix(\"checkbox__spinner\"),\n spinnerProps?.className,\n )}\n />\n )}\n </div>\n </div>\n </ControlContext.Provider>\n </ClearContexts>\n );\n});\n","import { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { Checkbox, type CheckboxChecked } from \"../Checkbox\";\nimport { Spinner } from \"../Spinner\";\nimport { type DataTableDisplayMode } from \"./DataTable.tsx\";\nimport { type DataTableColumn } from \"./DataTableColumn.tsx\";\nimport {\n type DataTableState,\n useDataTableContext,\n} from \"./DataTableContext.ts\";\nimport { getRowKey } from \"./getRowKey.ts\";\n\nexport const DATA_TABLE_SELECTION_COLUMN_WIDTH = 42;\n\nexport function useDataTableSelectionColumn<T = unknown, TValue = any>():\n | DataTableColumn<T, TValue>\n | undefined {\n const { displayMode, rowKey, showSelectionColumn, store } =\n useDataTableContext();\n const [selectedRows] = useStore(store, (state) => state.selectedRows);\n const { selectRows, unselectRows } = useStore(\n store,\n (state) => state.actions,\n );\n const allChecked: CheckboxChecked | \"loading\" = useStore(store, (state) => {\n if (state.loading || !showSelectionColumn) {\n return \"loading\";\n }\n const [selectedRows] = state.selectedRows;\n const window = selectionWindow(displayMode, state);\n let selectedCount = 0;\n for (const row of window) {\n if (row === undefined) {\n return \"loading\";\n }\n selectedCount += +selectedRows.has(getRowKey(row, rowKey));\n }\n return selectedCount === window.length\n ? true\n : selectedCount === 0\n ? false\n : \"indeterminate\";\n });\n\n if (showSelectionColumn) {\n return {\n label:\n allChecked === \"loading\" ? (\n <Spinner />\n ) : (\n <Checkbox\n checked={allChecked}\n onCheckedChange={(checked) => {\n const window = selectionWindow(displayMode, store.getState());\n const keys = window.map((row) => getRowKey(row, rowKey));\n if (checked) {\n selectRows(keys);\n } else {\n unselectRows(keys);\n }\n }}\n />\n ),\n header: true,\n sticky: \"left\",\n width: DATA_TABLE_SELECTION_COLUMN_WIDTH,\n fixed: true,\n align: \"center\",\n paddingless: true,\n render: ({ row }) => {\n const key = getRowKey(row, rowKey);\n return (\n <Checkbox\n checked={selectedRows.has(key)}\n onCheckedChange={(checked) => {\n if (checked) {\n selectRows([key]);\n } else {\n unselectRows([key]);\n }\n }}\n />\n );\n },\n };\n }\n}\n\nexport function useDataTableSelectionColumnId(): string {\n const prefix = usePrefix();\n return prefix(\"data-table-selection-column\");\n}\n\nfunction selectionWindow(\n displayMode: DataTableDisplayMode,\n state: DataTableState,\n) {\n if (displayMode === \"paged\") {\n return state.rowsWindow(\n state.pageOffset(),\n state.pageLimit() ?? state.limit,\n );\n } else {\n const totalCount = state.totalCount() ?? state.limit;\n const start = Math.min(state.scrolledRangeStart, totalCount - 1);\n const end = Math.min(state.scrolledRangeEnd, totalCount - 1);\n return state.rowsWindow(start, end - start + 1);\n }\n}\n","import * as React from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { matchAgainstFilter } from \"../../utils/filtering.ts\";\nimport { Mark } from \"../Mark\";\nimport { Spinner } from \"../Spinner\";\nimport { TableRow } from \"../Table\";\nimport { DataTableCell } from \"./DataTableCell.tsx\";\nimport { useDataTableContext } from \"./DataTableContext.ts\";\nimport { getRowKey } from \"./getRowKey.ts\";\nimport {\n useDataTableSelectionColumn,\n useDataTableSelectionColumnId,\n} from \"./useDataTableSelectionColumn.tsx\";\n\n/** Properties of a data table row. */\n\nexport interface DataTableRowProps<T = any>\n extends React.ComponentPropsWithoutRef<typeof TableRow> {\n /** Row data. When `undefined`, the row is rendered as \"loading\". */\n row: T | undefined;\n /** Row index. */\n index: number;\n}\n\n/** Data table row. */\nexport const DataTableRow = React.memo(\n React.forwardRef<React.ComponentRef<typeof TableRow>, DataTableRowProps>(\n function DataTableRow<T = unknown>(\n { row, index, className, ...otherProps }: DataTableRowProps<T>,\n forwardedRef: React.ForwardedRef<React.ComponentRef<typeof TableRow>>,\n ) {\n const prefix = usePrefix();\n const { rowKey, renderCell, generatedId, estimatedRowHeight, store } =\n useDataTableContext();\n const selectionColumn = useDataTableSelectionColumn();\n const dataTableSelectionColumnId = useDataTableSelectionColumnId();\n const leafColumns = useStore(\n store,\n useShallow((state) =>\n selectionColumn\n ? {\n [dataTableSelectionColumnId]: selectionColumn,\n ...state.leafColumns,\n }\n : state.leafColumns,\n ),\n );\n const headCount = useStore(store, (state) => state.headCount);\n const filter = useStore(store, (state) => state.filter);\n const selected = useStore(\n store,\n (state) => row && state.selectedRows[0].has(getRowKey(row, rowKey)),\n );\n const rowHeight =\n typeof estimatedRowHeight === \"number\"\n ? estimatedRowHeight\n : estimatedRowHeight(index);\n\n return (\n <TableRow\n className={cx(prefix(\"data-table__row\"), className)}\n selected={selected}\n aria-rowindex={headCount + index + 1}\n ref={forwardedRef}\n {...otherProps}\n >\n {Object.entries(leafColumns).map(\n ([\n columnName,\n {\n filterable,\n locale,\n subColumns: _subColumns,\n getValue,\n format,\n render,\n compare: _compare,\n label,\n labelText: _labelText,\n helperText: _helperText,\n helperButtonLabel: _helperButtonLabel,\n width: _width,\n fixed: _fixed,\n sortable: _sortable,\n defaultSortDirection: _defaultSortDirection,\n containerProps: _containerProps,\n labelProps,\n sortButtonProps: _sortButtonProps,\n sortIconContainerProps: _sortIconContainerProps,\n sortAscIconProps: _sortAscIconProps,\n sortDescIconProps: _sortDescIconProps,\n helperButtonProps: _helperButtonProps,\n helperPopoverProps: _helperPopoverProps,\n helperPopoverContentProps: _helperPopoverContentProps,\n ...otherProps\n },\n ]) => {\n const loadingRow = row === undefined;\n const value =\n !loadingRow &&\n (getValue\n ? getValue({ row, index })\n : (row?.[columnName as keyof T] ?? null));\n const formattedValue =\n !loadingRow &&\n (format\n ? format({ value, row, index })\n : (value?.toString() ?? \"\"));\n const match =\n !loadingRow && filterable\n ? matchAgainstFilter(\n formattedValue as string,\n filter,\n locale ?? \"pt-PT\",\n )\n : null;\n const markedValue =\n match == null ? (\n formattedValue\n ) : (\n <>\n {match.before}\n <Mark>{match.matched}</Mark>\n {match.after}\n </>\n );\n\n const props = {\n \"data-loading\": boolDataAttr(loadingRow),\n ...otherProps,\n style: {\n height: loadingRow ? rowHeight : undefined,\n ...otherProps?.style,\n },\n columnLabel: label,\n columnLabelId: label\n ? (labelProps?.id ??\n `data-table-column-label-${columnName}-${generatedId}`)\n : undefined,\n children: loadingRow ? (\n <Spinner className={cx(prefix(\"data-table__cell-spinner\"))} />\n ) : render ? (\n render({\n formattedValue: formattedValue as string,\n match,\n markedValue,\n value,\n row,\n index,\n })\n ) : (\n markedValue\n ),\n };\n return renderCell ? (\n <React.Fragment key={columnName}>\n {renderCell(props)}\n </React.Fragment>\n ) : (\n <DataTableCell key={columnName} {...props} />\n );\n },\n )}\n </TableRow>\n );\n },\n ),\n);\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { type SortDirection } from \"../../utils/sorting.ts\";\nimport { DEFAULT_TABLE_ROW_HEIGHT } from \"../Table\";\nimport { type DataTableApi } from \"./DataTableApi.ts\";\nimport { type DataTableCellProps } from \"./DataTableCell.tsx\";\nimport { type DataTableColumns } from \"./DataTableColumn.tsx\";\nimport {\n DataTableContext,\n useCreateDataTableContext,\n} from \"./DataTableContext.ts\";\nimport { type DataTableRowProps } from \"./DataTableRow.tsx\";\n\n/** Display mode of the data table. */\nexport type DataTableDisplayMode = \"paged\" | \"scrolled\";\n\n/**\n * Options passed to the `getRows` function to get the rows meant to be\n * rendered.\n */\nexport interface DataTableGetRowsOptions {\n /** Index from which to fetch rows. */\n offset: number;\n /** Limit of rows to fetch. */\n limit: number;\n /**\n * Filter to apply. An empty string will be passed when the results shouldn't\n * be filtered.\n */\n filter: string;\n /** Column to sort by. `null` is passed when the results shouldn't be sorted. */\n sortBy: string | null;\n /**\n * Direction of the sorting. `null` is passed when the results shouldn't be\n * sorted.\n */\n sortDirection: SortDirection | null;\n /**\n * Abort signal provided by the data table which is cancelled when the result\n * of this `getRows` call is no longer needed.\n */\n signal: AbortSignal;\n}\n\n/** Object which should be returned by `getRows`. */\nexport interface DataTableGetRowsResult<T = unknown> {\n /** Fetched rows for the given options. */\n rows: T[];\n /** Total number of rows of the data table. */\n totalCount: number;\n}\n\n/** Properties of the data table component. */\nexport interface DataTableProps<T = any>\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Display mode of the data table. Rows are displayed either in pages or\n * within an infinite scroll component.\n *\n * @default paged\n */\n displayMode?: DataTableDisplayMode;\n /** Data table columns. */\n columns: DataTableColumns<T>;\n /**\n * Rows of the data table.\n *\n * Either this property or `getRows` should be provided.\n */\n rows?: T[];\n /**\n * Function used to dynamically get the rows of the data table.\n *\n * Either this property or `rows` should be provided.\n */\n getRows?: (\n options: DataTableGetRowsOptions,\n ) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;\n /**\n * Property of the row that contains the row's key, or a function used to get\n * it, given the row.\n *\n * Keys should be of type `React.Key`, i.e. `string | number | bigint`.\n */\n rowKey: string | number | symbol | ((row: T) => React.Key);\n /**\n * Number of rows to show when `loading` is `true`, or using `getRows` and the\n * total count isn't yet known.\n *\n * @default 2\n */\n loadingCount?: number;\n /** Marks the data table as \"required\" when it is being used as a control. */\n required?: boolean;\n /** Marks the data table as currently loading data. */\n loading?: boolean;\n /**\n * Default offset from which to display rows. When in paged mode, the actually\n * used offset will always be a multiple of `limit`.\n *\n * @default 0\n */\n defaultOffset?: number;\n /**\n * Controlled offset from which to display rows. When in paged mode, the\n * actually used offset will always be a multiple of `limit`.\n *\n * Use together with `onOffsetChange` to control the offset.\n */\n offset?: number;\n /**\n * Function called whenever the offset changes.\n *\n * @param offset New offset.\n */\n onOffsetChange?: (offset: number) => void;\n /**\n * Default value used to limit the number of rows shown on screen.\n *\n * @default 10\n */\n defaultLimit?: number;\n /**\n * Controlled value used to limit the number of rows shown on screen.\n *\n * Use together with `onLimitChange` to control the limit.\n */\n limit?: number;\n /**\n * Function called whenever the limit changes.\n *\n * @param limit New limit.\n */\n onLimitChange?: (limit: number) => void;\n /** Default string to filter by. */\n defaultFilter?: string;\n /**\n * Controlled string to filter by. Use together with `onFilterChange` to\n * change the filter.\n */\n filter?: string;\n /**\n * Function called whenever the string to filter by changes.\n *\n * @param filter New filter.\n */\n onFilterChange?: (filter: string) => void;\n /**\n * Default column to sort by. When `null`, the table is sorted according to\n * the rows' natural order.\n *\n * @default null\n */\n defaultSortBy?: string | null;\n /**\n * Controlled column to sort by. When `null`, the table is sorted according to\n * the rows' natural order.\n *\n * Use together with `onSort` to change the sorting order.\n */\n sortBy?: string | null;\n /** Default sort direction. */\n defaultSortDirection?: SortDirection;\n /**\n * Controlled sort direction.\n *\n * Use together with `onSort` to change the sort direction.\n */\n sortDirection?: SortDirection;\n /**\n * Function called whenever the sorting of data changes.\n *\n * @param sortBy New column to sort by.\n * @param sortDirection New direction to sort by.\n */\n onSort?: (sortBy: string | null, sortDirection: SortDirection) => void;\n /**\n * Prepend a column containing checkboxes used to select rows of the data\n * table.\n *\n * @default false\n */\n showSelectionColumn?: boolean;\n /** Default keys of the selected rows. */\n defaultSelectedRows?: React.Key[];\n /**\n * Controlled keys of the selected rows.\n *\n * Use together with `onSelectedRowsChange` to change the selected rows.\n */\n selectedRows?: React.Key[];\n /**\n * Function called whenever the selected rows of the data table change.\n *\n * @param selectedRows Array containing the keys of the newly selected rows.\n */\n onSelectedRowsChange?: (selectedRows: React.Key[]) => void;\n /**\n * Function used to render each row. This function should typically return a\n * `DataTableRow` with the provided properties. This function is useful to\n * wrap each row in its own context.\n *\n * @default props => <DataTableRow {...props} />\n * @param props Properties to pass to the data table row to render.\n */\n renderRow?: (props: DataTableRowProps) => React.ReactNode;\n /**\n * Function used to render each cell. This function should typically return a\n * `DataTableCell` with the provided properties. This function is useful to\n * wrap each cell in its own context.\n *\n * @default props => <DataTableCell {...props} />\n * @param props Properties to pass to the data table cell to render.\n */\n renderCell?: (props: DataTableCellProps) => React.ReactNode;\n /**\n * Whether the height of each row should be computed dynamically (only\n * relevant for scrolled mode).\n *\n * @default false\n */\n dynamicRowHeight?: boolean;\n /**\n * Estimated height of each table row.\n *\n * A function may be provided to return the actual or estimated height of each\n * row.\n *\n * @default DEFAULT_TABLE_ROW_HEIGHT\n */\n estimatedRowHeight?: number | ((index: number) => number);\n /**\n * Number of items to render above and below the visible area (only relevant\n * for scrolled mode).\n *\n * @default 5\n */\n overscan?: number;\n /** Reference to interact with the data table's API. */\n apiRef?: React.Ref<DataTableApi<T> | undefined>;\n}\n\n/**\n * The `DataTable` component is the root component used for displaying a data\n * table. It supports features such as different display modes (paged or\n * scrolled), pagination, dynamic data loading, custom rows and cells, sorting,\n * and filtering, allowing flexible data table functionality via configuration.\n *\n * It composes the following subcomponents:\n *\n * - `DataTableContent`: Represents the core content area of the `DataTable`,\n * containing the table itself, including its head and body. It is responsible\n * for rendering the main parts of the `DataTable`.\n * - `DataTableFilter`: Implements filtering functionality, allowing users to\n * filter displayed data based on specific conditions.\n * - `DataTablePagination`: Component responsible for handling the pagination\n * functionality of the `DataTable`. Allows control over which page of the\n * table to display (when in \"paged\" mode), or insight into the rows being\n * currently rendered (in \"scrolled\" mode).\n * - `DataTableRowsPerPage`: Component which allows the user to control the\n * `limit` property of the `DataTable`, i.e. how many rows to display per page\n * in \"paged\" mode or how many rows to display at once in \"scrolled\" mode.\n * - `DataTableRow`: Represents an individual row of the `DataTable`. This\n * component is only relevant when providing a custom data table row via\n * `renderRow`.\n * - `DataTableCell`: Represents an individual cell of the `DataTable`. This\n * component is only relevant when providing a custom data table cell via\n * `renderCell`.\n */\nexport const DataTable = React.forwardRef<\n React.ComponentRef<\"div\">,\n DataTableProps\n>(function DataTableRoot<T>(\n {\n displayMode = \"paged\",\n columns,\n rows,\n getRows,\n rowKey,\n loadingCount = 2,\n required,\n loading = false,\n defaultOffset = 0,\n offset,\n onOffsetChange,\n defaultLimit = 10,\n limit,\n onLimitChange,\n defaultFilter = \"\",\n filter,\n onFilterChange,\n defaultSortBy = null,\n sortBy,\n defaultSortDirection,\n sortDirection,\n onSort,\n showSelectionColumn = false,\n defaultSelectedRows,\n selectedRows,\n onSelectedRowsChange,\n renderRow,\n renderCell,\n dynamicRowHeight = false,\n estimatedRowHeight = DEFAULT_TABLE_ROW_HEIGHT,\n overscan = 5,\n apiRef,\n className,\n ...otherProps\n }: DataTableProps<T>,\n forwardedRef: React.ForwardedRef<React.ComponentRef<\"div\">>,\n) {\n const prefix = usePrefix();\n const leaves = React.useMemo(() => leafColumns(columns), [columns]);\n const headCount = React.useMemo(() => numberOfRows(columns), [columns]);\n const dataTableContextValue = useCreateDataTableContext({\n displayMode,\n columns,\n rows,\n getRows,\n rowKey,\n loadingCount,\n required,\n loading,\n renderRow,\n renderCell,\n dynamicRowHeight,\n estimatedRowHeight,\n overscan,\n apiRef,\n leafColumns: leaves,\n headCount,\n defaultOffset,\n offset,\n onOffsetChange,\n defaultLimit,\n limit,\n onLimitChange,\n defaultFilter,\n filter,\n onFilterChange,\n defaultSortBy,\n sortBy,\n defaultSortDirection,\n sortDirection,\n onSort,\n showSelectionColumn,\n defaultSelectedRows,\n selectedRows,\n onSelectedRowsChange,\n });\n\n return (\n <DataTableContext.Provider value={dataTableContextValue}>\n <div\n className={cx(prefix(\"data-table\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n </DataTableContext.Provider>\n );\n});\n\n/** List of \"leaf\" columns (columns with no sub columns, i.e. the \"bottom\" ones). */\nfunction leafColumns<T>(columns: DataTableColumns<T>): DataTableColumns<T> {\n return Object.entries(columns).reduce(\n (leaves: DataTableColumns<T>, [columnName, column]) => {\n if (column.subColumns) {\n Object.assign(leaves, leafColumns(column.subColumns));\n } else {\n leaves[columnName] = column;\n }\n return leaves;\n },\n {},\n );\n}\n\n/** Total number of table rows of the head. */\nfunction numberOfRows<T>(columns: DataTableColumns<T>): number {\n return Object.values(columns).reduce(\n (n, column) => Math.max(n, numberOfRows(column.subColumns ?? {}) + 1),\n 0,\n );\n}\n","/** Result of applying the table splice to the visible window. */\nexport interface SpliceWindowResult<T = unknown> {\n /** New total number of rows. */\n totalCount: number;\n /**\n * New visible window. If the window didn't change, then this window will be\n * the same object as the one provided, otherwise it will be a new object.\n */\n window: (T | undefined)[];\n}\n\n/**\n * Applies the splice performed on the table to the window containing the\n * visible rows.\n *\n * @param totalCount Total number of rows.\n * @param offset Window offset.\n * @param limit Window limit.\n * @param window Window of visible rows.\n * @param startIndex Start index of the splice.\n * @param deleted Number of deleted items by the splice.\n * @param added Rows added via splice.\n * @returns The new table count as well as the new visible window.\n */\nexport function spliceWindow<T = unknown>(\n totalCount: number,\n offset: number,\n limit: number,\n window: (T | undefined)[],\n startIndex: number,\n deleted = 0,\n added: number | T[] = 0,\n): SpliceWindowResult<T> {\n const deletedCount = Math.min(deleted, totalCount - startIndex);\n const addedCount = typeof added === \"number\" ? added : added.length;\n\n // If making changes after the window, or changes before the window without\n // changing the number of rows\n const countDiff = addedCount - deletedCount;\n const newTotalCount = totalCount + countDiff;\n if (\n startIndex >= offset + limit ||\n (startIndex + deletedCount <= offset && countDiff === 0)\n ) {\n return { totalCount: newTotalCount, window };\n }\n\n // Case where we delete so many rows that the current window is gone\n const newLimit = Math.min(newTotalCount - offset, limit);\n if (newLimit < 0) {\n return { totalCount: newTotalCount, window: [] };\n }\n\n // When making changes before the window and removing more than we are adding,\n // then we just need to shift the window rows by the count difference\n let newWindow: (T | undefined)[];\n if (startIndex + deletedCount <= offset && countDiff < 0) {\n newWindow = window.slice(-countDiff);\n }\n // Apply the splice to the window\n else {\n const relativeStartIndex = startIndex - offset;\n const spliceStartIndex = Math.max(0, relativeStartIndex);\n const spliceDeleteCount = Math.max(\n 0,\n relativeStartIndex + deletedCount - spliceStartIndex,\n );\n const ignoreAddedCount = Math.max(\n 0,\n Math.min(offset - startIndex, addedCount),\n );\n const padRightCount = Math.max(\n 0,\n countDiff - addedCount + ignoreAddedCount,\n );\n const spliceToAdd: (T | undefined)[] =\n typeof added === \"number\"\n ? Array.from({ length: added - ignoreAddedCount + padRightCount })\n : added\n .slice(ignoreAddedCount)\n .concat(Array.from({ length: padRightCount }));\n newWindow = window.slice();\n newWindow.splice(spliceStartIndex, spliceDeleteCount, ...spliceToAdd);\n }\n\n // Set size of the new window to the new page limit and, if needed, fill the\n // right side with `undefined`s\n const newWindowLength = newWindow.length;\n newWindow.length = newLimit;\n if (newWindowLength < newLimit) {\n newWindow.fill(undefined, newWindowLength);\n }\n\n return { totalCount: newTotalCount, window: newWindow };\n}\n","import { matchAgainstFilter } from \"../../utils/filtering.ts\";\nimport {\n compare,\n type SortDirection,\n stableSort,\n} from \"../../utils/sorting.ts\";\nimport { type DataTableColumns } from \"./DataTableColumn.tsx\";\n\n/** Filters the provided rows. */\nexport function filterRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[],\n filter: string,\n): T[];\nexport function filterRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: undefined,\n filter: string,\n): undefined;\nexport function filterRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[] | undefined,\n filter: string,\n): T[] | undefined;\nexport function filterRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[] | undefined,\n filter: string,\n): T[] | undefined {\n if (!rows || filter === \"\") {\n return rows;\n }\n\n return rows.filter((row, index) =>\n Object.entries(leafColumns).some(([columnId, column]) => {\n if (!column.filterable) {\n return false;\n }\n const value = column.getValue\n ? column.getValue({ row, index })\n : row[columnId as keyof T];\n const formattedValue = column.format\n ? column.format({ value, row, index })\n : (value?.toString() ?? \"\");\n return (\n matchAgainstFilter(formattedValue, filter, column.locale ?? \"pt-PT\") !=\n null\n );\n }),\n );\n}\n\n/** Sorts the provided rows. */\nexport function sortRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[],\n sortBy: string | null,\n sortDirection: SortDirection | null,\n): T[];\nexport function sortRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: undefined,\n sortBy: string | null,\n sortDirection: SortDirection | null,\n): undefined;\nexport function sortRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[] | undefined,\n sortBy: string | null,\n sortDirection: SortDirection | null,\n): T[] | undefined;\nexport function sortRows<T>(\n leafColumns: DataTableColumns<T>,\n rows: T[] | undefined,\n sortBy: string | null,\n sortDirection: SortDirection | null,\n): T[] | undefined {\n if (!rows) {\n return rows;\n }\n // When no column is specified, sort according to the rows' natural order\n if (sortBy === null) {\n return sortDirection === \"asc\" ? rows : rows.slice().reverse();\n }\n const column = leafColumns[sortBy];\n const getValue =\n column.getValue ?? (({ row }) => row[sortBy as unknown as keyof T]);\n const compareFn = column.compare ?? compare;\n return stableSort(\n rows,\n (r1, r2, i1, i2) =>\n compareFn(\n getValue({ row: r1, index: i1 }),\n getValue({ row: r2, index: i2 }),\n ),\n sortDirection ?? column.defaultSortDirection ?? \"asc\",\n );\n}\n","import * as React from \"react\";\nimport { createStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { isPromiseLike } from \"../../utils/promiseUtils.ts\";\nimport { type SortDirection } from \"../../utils/sorting.ts\";\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { useLatestValues } from \"../../utils/useLatestValues.ts\";\nimport { computed } from \"../../utils/zustandUtils.ts\";\nimport {\n type DataTableDisplayMode,\n type DataTableGetRowsOptions,\n type DataTableGetRowsResult,\n} from \"./DataTable.tsx\";\nimport { type DataTableApi } from \"./DataTableApi.ts\";\nimport { type DataTableCellProps } from \"./DataTableCell.tsx\";\nimport { type DataTableColumns } from \"./DataTableColumn.tsx\";\nimport { type DataTableRowProps } from \"./DataTableRow.tsx\";\nimport { spliceWindow } from \"./spliceWindow.ts\";\nimport { filterRows, sortRows } from \"./transformRows.ts\";\n\n/** Value of the data table context. */\n\nexport interface DataTableContextValue<T = any> {\n displayMode: DataTableDisplayMode;\n rowKey: string | number | symbol | ((row: T) => React.Key);\n required?: boolean;\n showSelectionColumn: boolean;\n renderRow?: (props: DataTableRowProps) => React.ReactNode;\n renderCell?: (props: DataTableCellProps) => React.ReactNode;\n dynamicRowHeight: boolean;\n estimatedRowHeight: number | ((index: number) => number);\n overscan: number;\n generatedId: string;\n apiRef?: React.Ref<DataTableApi<T> | undefined>;\n store: DataTableStore<T>;\n}\n\n/** State of the data table. */\n\nexport interface DataTableState<T = any> {\n columns: DataTableColumns<T>;\n leafColumns: DataTableColumns<T>;\n headCount: number;\n // Provided rows\n _rows?: T[];\n _filteredRows: () => T[] | undefined;\n transformedRows: () => T[] | undefined;\n getRows?: (\n options: DataTableGetRowsOptions,\n ) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;\n loading: boolean;\n loadingCount: number;\n updateCounter: number;\n ongoingGetRows?: { from: number; to: number };\n abortController?: AbortController;\n cachedRows?: Record<number, T | undefined>;\n rowsWindow: (offset: number, limit: number) => (T | undefined)[];\n _totalCount?: number;\n totalCount: () => number | undefined;\n bodyCount: () => number;\n _offset: number;\n offset: () => number;\n currentPage: () => number;\n pageOffset: () => number;\n limit: number;\n pageLimit: () => number | undefined;\n filter: string;\n sortBy: string | null;\n sortDirection: SortDirection;\n // State below is wrapped in an array in order to trigger state updates by\n // simply changing the identity of the wrapper without creating new object\n // instances\n selectedRows: [Set<React.Key>];\n scrolledRangeStart: number;\n scrolledRangeEnd: number;\n tableHeadHeight?: number;\n tableFootHeight?: number;\n actions: DataTableActions<T>;\n}\n\n/** Actions of the data table. */\nexport interface DataTableActions<T> {\n setGetRows: (getRows: DataTableState[\"getRows\"]) => void;\n setOffset: (offset: number) => void;\n setLimit: (limit: number) => void;\n setFilter: (filter: string) => void;\n setSort: (sortBy: string | null, sortDirection: SortDirection) => void;\n selectRows: (keys: React.Key[]) => void;\n unselectRows: (keys: React.Key[]) => void;\n updateWindow: (offset: number, limit: number) => void;\n spliceWindow: (\n offset: number,\n limit: number,\n startIndex: number,\n deleted?: number,\n added?: number | T[],\n ) => void;\n refresh: (newTotalCount?: number | null) => void;\n}\n\n/** Data table store. */\nexport type DataTableStore<T> = ReturnType<\n typeof useCreateDataTableContext<T>\n>[\"store\"];\n\n/** Data table context. */\nexport const DataTableContext =\n React.createContext<DataTableContextValue | null>(null);\n\n/** Options used to create the data table context value. */\nexport interface UseCreateDataTableContextOptions<T>\n extends Omit<DataTableContextValue, \"generatedId\" | \"store\"> {\n columns: DataTableColumns<T>;\n leafColumns: DataTableColumns<T>;\n headCount: number;\n rows?: T[];\n getRows?: (\n options: DataTableGetRowsOptions,\n ) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;\n loading: boolean;\n loadingCount: number;\n defaultOffset: number;\n offset?: number;\n onOffsetChange?: (offset: number) => void;\n defaultLimit: number;\n limit?: number;\n onLimitChange?: (limit: number) => void;\n defaultFilter: string;\n filter?: string;\n onFilterChange?: (filter: string) => void;\n defaultSortBy: string | null;\n sortBy?: string | null;\n defaultSortDirection: SortDirection | undefined;\n sortDirection?: SortDirection;\n onSort?: (sortBy: string | null, sortDirection: SortDirection) => void;\n showSelectionColumn: boolean;\n defaultSelectedRows?: React.Key[];\n selectedRows?: React.Key[];\n onSelectedRowsChange?: (selectedRows: React.Key[]) => void;\n}\n\n/** Hook which creates the data table context value. */\nexport function useCreateDataTableContext<T>({\n displayMode,\n columns,\n rows,\n getRows,\n rowKey,\n loadingCount,\n required,\n loading,\n renderRow,\n renderCell,\n dynamicRowHeight,\n estimatedRowHeight,\n overscan,\n apiRef,\n leafColumns,\n headCount,\n defaultOffset,\n offset,\n onOffsetChange,\n defaultLimit,\n limit,\n onLimitChange,\n defaultFilter,\n filter,\n onFilterChange,\n defaultSortBy,\n sortBy,\n defaultSortDirection,\n sortDirection,\n onSort,\n showSelectionColumn,\n defaultSelectedRows,\n selectedRows,\n onSelectedRowsChange,\n}: UseCreateDataTableContextOptions<T>) {\n const listeners = useLatestValues({\n onOffsetChange,\n onLimitChange,\n onSort,\n onFilterChange,\n onSelectedRowsChange,\n });\n\n const store = useConstant(() => {\n const initialSortBy = sortBy ?? defaultSortBy;\n return createStore<DataTableState<T>>()(\n subscribeWithSelector((set, get) => ({\n columns,\n leafColumns,\n headCount,\n _offset: offset ?? defaultOffset,\n offset: computed(\n () => [get()._offset, get().totalCount()],\n (offset, totalCount = offset) =>\n Math.min(Math.max(offset, 0), Math.max(totalCount - 1, 0)),\n ),\n currentPage: computed(\n () => [get().offset(), get().limit],\n (offset, limit) => Math.floor(offset / limit),\n ),\n pageOffset: computed(\n () => [get().currentPage(), get().limit],\n (currentPage, limit) => currentPage * limit,\n ),\n limit: limit ?? defaultLimit,\n pageLimit: computed(\n () => [get().pageOffset(), get().limit, get().totalCount()],\n (pageOffset, limit, totalCount) =>\n totalCount == null\n ? undefined\n : Math.min(totalCount - pageOffset, limit),\n ),\n filter: filter ?? defaultFilter,\n sortBy: initialSortBy,\n sortDirection:\n sortDirection ??\n defaultSortDirection ??\n ((initialSortBy !== null &&\n columns[initialSortBy].defaultSortDirection) ||\n \"asc\"),\n selectedRows: [\n new Set(selectedRows ?? defaultSelectedRows ?? undefined),\n ],\n _rows: rows,\n _filteredRows: computed(\n () => [get().leafColumns, get()._rows, get().filter],\n (leafColumns, rows, filter) => filterRows(leafColumns, rows, filter),\n ),\n transformedRows: computed(\n () => [\n get().leafColumns,\n get()._filteredRows(),\n get().sortBy,\n get().sortDirection,\n ],\n (leafColumns, filteredRows, sortBy, sortDirection) =>\n sortRows(leafColumns, filteredRows, sortBy, sortDirection),\n ),\n getRows,\n loading,\n loadingCount,\n updateCounter: 0,\n ongoingGetRows: undefined,\n abortController: undefined,\n cachedRows: undefined,\n rowsWindow: (offset: number, limit: number) => {\n return get()._rows\n ? get()\n .transformedRows()!\n .slice(offset, offset + limit)\n : Array.from(\n { length: limit },\n (_, i) => get().cachedRows?.[offset + i],\n );\n },\n _totalCount: undefined,\n totalCount: computed(\n () => [get().transformedRows(), get()._totalCount],\n (rows, totalCount) => rows?.length ?? totalCount,\n ),\n bodyCount: computed(\n () => [get().totalCount(), get().loading, get().loadingCount],\n (totalCount, loading, loadingCount) =>\n loading ? loadingCount : (totalCount ?? loadingCount),\n ),\n scrolledRangeStart: 1,\n scrolledRangeEnd: 1,\n tableHeadHeight: undefined,\n tableFootHeight: undefined,\n actions: {\n setGetRows: (getRows: DataTableState[\"getRows\"]) => {\n if (get().offset() > 0) {\n get().actions.setOffset(0);\n }\n set({ getRows });\n get().actions.refresh(null);\n },\n setOffset: (offset: number) => {\n set({ updateCounter: get().updateCounter + 1, _offset: offset });\n listeners.onOffsetChange?.(offset);\n },\n setLimit: (limit: number) => {\n set({ updateCounter: get().updateCounter + 1, limit });\n listeners.onLimitChange?.(limit);\n },\n setFilter: (filter: string) => {\n if (get().offset() > 0) {\n get().actions.setOffset(0);\n }\n set({ filter });\n get().actions.refresh(null);\n listeners.onFilterChange?.(filter);\n },\n setSort: (sortBy: string | null, sortDirection: SortDirection) => {\n if (get().offset() > 0) {\n get().actions.setOffset(0);\n }\n set({ sortBy, sortDirection });\n get().actions.refresh();\n listeners.onSort?.(sortBy, sortDirection);\n },\n selectRows: (keys: React.Key[]) => {\n const [selectedRows] = get().selectedRows;\n let selected = false;\n for (const key of keys) {\n if (!selectedRows.has(key)) {\n selectedRows.add(key);\n selected = true;\n }\n }\n if (selected) {\n set({ selectedRows: [selectedRows] });\n listeners.onSelectedRowsChange?.(Array.from(selectedRows).sort());\n }\n },\n unselectRows: (keys: React.Key[]) => {\n const [selectedRows] = get().selectedRows;\n let unselected = false;\n for (const key of keys) {\n if (selectedRows.delete(key)) {\n unselected = true;\n }\n }\n if (unselected) {\n set({ selectedRows: [selectedRows] });\n listeners.onSelectedRowsChange?.(Array.from(selectedRows).sort());\n }\n },\n updateWindow: (offset: number, limit: number) => {\n if (get()._rows || !get().getRows) {\n return;\n }\n\n let getFrom = -1;\n for (let i = 0; i < limit; ++i) {\n if (get().cachedRows?.[offset + i] === undefined) {\n getFrom = offset + i;\n break;\n }\n }\n\n if (getFrom !== -1) {\n let getTo: number;\n for (let i = limit - 1; ; --i) {\n if (get().cachedRows?.[offset + i] === undefined) {\n getTo = offset + i;\n break;\n }\n }\n const getLimit = getTo - getFrom + 1;\n\n // If already getting rows within the range, no need to do\n // anything\n const ongoingGetRows = get().ongoingGetRows;\n if (\n ongoingGetRows &&\n ongoingGetRows.from <= getFrom &&\n ongoingGetRows.to >= getTo\n ) {\n return;\n }\n\n get().abortController?.abort(); // Abort previous `getRows`\n const abortController = new AbortController();\n set({\n abortController,\n ongoingGetRows: { from: getFrom, to: getTo },\n });\n const result = get().getRows!({\n offset: getFrom,\n limit: getLimit,\n filter: get().filter,\n sortBy: get().sortBy,\n sortDirection: get().sortDirection,\n signal: abortController.signal,\n });\n\n const cacheRows = ({\n rows,\n totalCount,\n }: DataTableGetRowsResult<T>) => {\n const newCachedRows: Record<number, T | undefined> = {};\n const resultOffset = getFrom - offset;\n for (let i = 0; i < limit; ++i) {\n newCachedRows[offset + i] =\n rows[i - resultOffset] ?? get().cachedRows?.[offset + i];\n }\n set({\n updateCounter: get().updateCounter + 1,\n cachedRows: newCachedRows,\n _totalCount: totalCount,\n abortController: undefined,\n ongoingGetRows: undefined,\n });\n };\n\n if (isPromiseLike(result)) {\n void result.then(\n (result) => {\n if (!abortController.signal.aborted) {\n cacheRows(result);\n }\n },\n (err) => {\n if (\n !(err instanceof DOMException) ||\n err.name !== \"AbortError\"\n ) {\n throw err;\n }\n },\n );\n } else {\n cacheRows(result);\n }\n } else if (\n get().cachedRows &&\n Object.keys(get().cachedRows!).length > limit\n ) {\n const newCachedRows: Record<number, T | undefined> = {};\n for (let i = 0; i < limit; ++i) {\n newCachedRows[offset + i] = get().cachedRows?.[offset + i];\n }\n set({ cachedRows: newCachedRows });\n }\n },\n spliceWindow: (\n offset: number,\n limit: number,\n startIndex: number,\n deleted = 0,\n added: number | T[] = 0,\n ) => {\n if (get()._rows || !get().getRows) {\n return;\n }\n\n const curWindow = [];\n for (let i = 0; i < limit; ++i) {\n curWindow.push(get().cachedRows?.[offset + i]);\n }\n const { totalCount: newTotalCount, window: newWindow } =\n spliceWindow(\n get().totalCount() ?? offset + limit,\n offset,\n limit,\n curWindow,\n startIndex,\n deleted,\n added,\n );\n\n if (curWindow !== newWindow) {\n const newCachedRows: Record<number, T | undefined> = {};\n for (let i = 0; i < newWindow.length; ++i) {\n newCachedRows[offset + i] = newWindow[i];\n }\n set({\n updateCounter: get().updateCounter + 1,\n _totalCount: newTotalCount,\n cachedRows: newCachedRows,\n });\n }\n },\n refresh: (newTotalCount?: number | null) => {\n if (get()._rows || !get().getRows) {\n return;\n }\n\n get().abortController?.abort();\n set({\n updateCounter: get().updateCounter + 1,\n cachedRows: undefined,\n ...(newTotalCount === undefined\n ? {}\n : { _totalCount: newTotalCount ?? undefined }),\n abortController: undefined,\n ongoingGetRows: undefined,\n });\n },\n },\n })),\n );\n });\n\n // Update store when `getRows` changes\n React.useEffect(() => {\n if (store.getState().getRows !== getRows) {\n store.getState().actions.setGetRows(getRows);\n }\n }, [getRows, store]);\n // Update store when offset changes\n React.useEffect(() => {\n if (offset !== undefined && offset !== store.getState()._offset) {\n store.getState().actions.setOffset(offset);\n }\n }, [offset, store]);\n // Update store when limit changes\n React.useEffect(() => {\n if (limit !== undefined && limit !== store.getState().limit) {\n store.getState().actions.setLimit(limit);\n }\n }, [limit, store]);\n // Update store when filter changes\n React.useEffect(() => {\n if (filter !== undefined && filter !== store.getState().filter) {\n store.getState().actions.setFilter(filter);\n }\n }, [filter, store]);\n // Update store when sort changes\n React.useEffect(() => {\n if (\n (sortBy !== undefined || sortDirection !== undefined) &&\n (sortBy !== store.getState().sortBy ||\n sortDirection !== store.getState().sortDirection)\n ) {\n store\n .getState()\n .actions.setSort(\n sortBy === undefined ? store.getState().sortBy : sortBy,\n sortDirection ?? store.getState().sortDirection,\n );\n }\n }, [sortBy, sortDirection, store]);\n // Update store when other params change\n React.useEffect(() => {\n store.setState({\n columns,\n leafColumns,\n _rows: rows,\n loading,\n loadingCount,\n headCount,\n ...(selectedRows === undefined\n ? {}\n : { selectedRows: [new Set(selectedRows)] }),\n });\n }, [\n columns,\n headCount,\n loading,\n loadingCount,\n leafColumns,\n limit,\n offset,\n rows,\n selectedRows,\n store,\n ]);\n\n const generatedId = React.useId();\n return React.useMemo(\n () => ({\n displayMode,\n rowKey,\n required,\n showSelectionColumn,\n renderRow,\n renderCell,\n dynamicRowHeight,\n estimatedRowHeight,\n overscan,\n generatedId,\n apiRef,\n store,\n }),\n [\n displayMode,\n rowKey,\n required,\n showSelectionColumn,\n renderRow,\n renderCell,\n dynamicRowHeight,\n estimatedRowHeight,\n overscan,\n generatedId,\n apiRef,\n store,\n ],\n );\n}\n\n/** Hook providing access to the data table context. */\nexport function useDataTableContext<T = unknown>(): DataTableContextValue<T> {\n const dataTableContext = React.useContext(DataTableContext);\n if (!dataTableContext) {\n throw new Error(\"Data table context not in scope.\");\n }\n return dataTableContext as DataTableContextValue<T>;\n}\n\n/** Context value of a data table cell. */\nexport interface DataTableCellContextValue {\n columnLabel?: React.ReactNode;\n columnLabelId?: string;\n}\n\n/** Data table cell context. */\nexport const DataTableCellContext =\n React.createContext<DataTableCellContextValue | null>(null);\n\n/** Column label accessible within a data table cell. */\nexport function useDataTableColumnLabel(): React.ReactNode {\n return React.useContext(DataTableCellContext)?.columnLabel ?? null;\n}\n\n/** Column label id accessible within a data table cell. */\nexport function useDataTableColumnLabelId(): string | null {\n return React.useContext(DataTableCellContext)?.columnLabelId ?? null;\n}\n","import { faArrowUpRightFromSquare } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { Slot, Slottable } from \"../Slot\";\nimport { useLinkContext } from \"./LinkContext.ts\";\n\n/** Link variants. */\nexport type LinkVariant = \"default\" | \"alert\";\n\n/** Link colours. */\nexport type LinkColor = AccentColor;\n\n/** Properties of the link component. */\nexport interface LinkProps extends React.ComponentPropsWithoutRef<\"a\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Colour of the link.\n *\n * @default primary\n */\n color?: LinkColor;\n /**\n * Link variant. Defaults to `\"default\"`, unless when rendered within an\n * `Alert`, in which case the `\"alert\"` variant is used.\n *\n * @default default\n */\n variant?: LinkVariant;\n /**\n * Marks this link as external, making it open in a new tab (it sets both\n * `target=\"_blank\"` and `rel=\"noopener noreferrer\"`).\n *\n * If a `Referer` header should be included when navigating, then the `rel`\n * attribute should be overriden to simply `rel=\"noopener\"`.\n */\n external?: boolean;\n /** Link icon. By default, only `external` links have an icon. */\n icon?: IconProp | null;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n}\n\n/**\n * The link component, with its `href` property, is used to create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or anything\n * else a URL can address. It is built on top of the browser's [`<a>` (anchor)\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a).\n *\n * Example usage:\n *\n * ```tsx\n * import { Link } from \"@ostack.tech/ui\";\n *\n * function GoBackLink() {\n * return <Link href=\"../\">Go back</Link>;\n * }\n * ```\n */\nexport const Link = React.forwardRef<React.ComponentRef<\"a\">, LinkProps>(\n function Link(\n {\n asChild,\n color,\n variant,\n external,\n icon = external ? faArrowUpRightFromSquare : null,\n iconProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const { defaultColor, defaultVariant } = useLinkContext();\n color ??= defaultColor;\n variant ??= defaultVariant;\n\n const As = asChild ? Slot : \"a\";\n return (\n <As\n className={cx(\n prefix(\"link\"),\n variant !== \"default\" && prefix(`link--${variant}`),\n className,\n )}\n data-accent={color}\n target={external ? \"_blank\" : undefined}\n rel={external ? \"noopener noreferrer\" : undefined}\n {...otherProps}\n ref={forwardedRef}\n >\n <Slottable>{children}</Slottable>\n {icon && (\n <Icon\n {...iconProps}\n className={cx(prefix(\"link__icon\"), iconProps?.className)}\n icon={icon}\n />\n )}\n </As>\n );\n },\n);\n","import * as React from \"react\";\n\nimport { type LinkColor, type LinkVariant } from \"./Link.tsx\";\n\n/** Value of the link context. */\nexport interface LinkContextValue {\n /** Default colour that the link should use. */\n defaultColor: LinkColor;\n /** Default variant that the link should use. */\n defaultVariant: LinkVariant;\n}\n\n/** Default value of the link context. */\nexport const LINK_CONTEXT_DEFAULT_VALUE: LinkContextValue = {\n defaultColor: \"primary\",\n defaultVariant: \"default\",\n};\n\n/** Context for links. */\nexport const LinkContext = React.createContext(LINK_CONTEXT_DEFAULT_VALUE);\n\n/** Hook providing access to the link context. */\nexport function useLinkContext(): LinkContextValue {\n return React.useContext(LinkContext);\n}\n","import * as React from \"react\";\n\nimport { DataTableCellContext } from \"../DataTable/DataTableContext.ts\";\nimport { FieldContext } from \"../Field/FieldContext.ts\";\nimport {\n LINK_CONTEXT_DEFAULT_VALUE,\n LinkContext,\n} from \"../Link/LinkContext.ts\";\nimport { TableCellContext } from \"../Table/TableContext.ts\";\n\n/** Properties of the clear context component. */\nexport interface ClearContextsProps {\n /**\n * Clear the data table cell context.\n *\n * @default true\n */\n dataTableCell?: boolean;\n /**\n * Clear the field context.\n *\n * @default true\n */\n field?: boolean;\n /**\n * Clear the link context.\n *\n * @default true\n */\n link?: boolean;\n /**\n * Clear the table cell context.\n *\n * @default true\n */\n tableCell?: boolean;\n children?: React.ReactNode;\n}\n\n/** Component used to clear component contexts. */\nexport function ClearContexts({\n dataTableCell = true,\n field = true,\n link = true,\n tableCell = true,\n children,\n}: ClearContextsProps) {\n let result = children;\n if (dataTableCell) {\n result = (\n <DataTableCellContext.Provider value={null}>\n {result}\n </DataTableCellContext.Provider>\n );\n }\n if (field) {\n result = (\n <FieldContext.Provider value={null}>{result}</FieldContext.Provider>\n );\n }\n if (link) {\n result = (\n <LinkContext.Provider value={LINK_CONTEXT_DEFAULT_VALUE}>\n {result}\n </LinkContext.Provider>\n );\n }\n if (tableCell) {\n result = (\n <TableCellContext.Provider value={false}>\n {result}\n </TableCellContext.Provider>\n );\n }\n return result;\n}\n","import { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\n\n/** Properties of the tooltip component. */\nexport interface TooltipProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,\n \"asChild\" | \"content\" | \"forceMount\"\n > {\n /** Tooltip's content. */\n content: React.ReactNode;\n /**\n * Whether to show an arrow pointing to the anchor.\n *\n * @default true\n */\n showArrow?: boolean;\n /** Tooltip's trigger element. */\n children: React.ReactElement;\n /** The open state of the tooltip when it is initially rendered. */\n defaultOpen?: boolean;\n /**\n * The controlled open state of the tooltip. Should be used in conjunction\n * with `onOpenChange`.\n */\n open?: boolean;\n /** Event handler called when the open state of the tooltip changes. */\n onOpenChange?: (open: boolean) => void;\n /**\n * Override the duration given to the `TooltipProvider` to customise the open\n * delay for a specific tooltip.\n */\n delayDuration?: number;\n /**\n * Prevents the content from remaining open when hovering. Disabling this has\n * accessibility consequences. Inherits from `TooltipProvider`.\n */\n disableHoverableContent?: boolean;\n /** Used to force mounting when more control is needed. */\n forceMount?: true;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof TooltipPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the arrow component. */\n arrowProps?: React.ComponentPropsWithRef<typeof TooltipPrimitive.Arrow>;\n}\n\n/**\n * The `Tooltip` component renders a popup that displays information related to\n * an element (trigger) when the element receives keyboard focus or the mouse\n * hovers over it.\n *\n * In ostack/UI applications, `TooltipProvider` is already integrated into the\n * root container to ensure consistent tooltip behavior throughout the\n * application. Developers typically don't need to configure it manually, as the\n * default setup handles delay times and interactions seamlessly.\n *\n * For detailed information on these props, which do not have descriptions,\n * please refer to the\n * [docs](https://www.radix-ui.com/primitives/docs/components/tooltip).\n */\nexport const Tooltip = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipProps\n>(function Tooltip(\n {\n content,\n showArrow = true,\n children,\n defaultOpen,\n open,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n forceMount,\n portalProps,\n arrowProps,\n sideOffset = 4,\n collisionPadding = 3,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const portalContext = usePortalContext();\n\n return (\n <TooltipPrimitive.Root\n defaultOpen={defaultOpen}\n open={open}\n onOpenChange={onOpenChange}\n delayDuration={delayDuration}\n disableHoverableContent={disableHoverableContent}\n >\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <ClearContexts>\n <TooltipPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n <TooltipPrimitive.Content\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cx(prefix(\"tooltip\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {content}\n {showArrow && (\n <TooltipPrimitive.Arrow\n width={8}\n height={4}\n {...arrowProps}\n className={cx(\n prefix(\"tooltip__arrow\"),\n arrowProps?.className,\n )}\n />\n )}\n </TooltipPrimitive.Content>\n </Root>\n </TooltipPrimitive.Portal>\n </ClearContexts>\n </TooltipPrimitive.Root>\n );\n});\n","import { Tooltip as TooltipPrimitive } from \"radix-ui\";\n\n/** Wrapper providing global options for tooltips. */\nexport const TooltipProvider = TooltipPrimitive.Provider;\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport {\n type ButtonColor,\n type ButtonSize,\n type ButtonVariant,\n} from \"../Button\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { Slot } from \"../Slot\";\nimport { Spinner } from \"../Spinner\";\nimport { Tooltip } from \"../Tooltip\";\n\n/** Icon button variants. */\nexport type IconButtonVariant = ButtonVariant;\n\n/** Icon button colours. */\nexport type IconButtonColor = ButtonColor;\n\n/** Icon button sizes. */\nexport type IconButtonSize = ButtonSize;\n\n/** Properties of the icon button component. */\nexport interface IconButtonProps\n extends Omit<React.ComponentPropsWithoutRef<\"button\">, \"children\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n children?: React.ReactElement;\n /**\n * Icon button's variant.\n *\n * @default solid\n */\n variant?: IconButtonVariant;\n /**\n * Icon button's colour.\n *\n * @default neutral\n */\n color?: IconButtonColor;\n /**\n * Size of the icon button.\n *\n * @default md\n */\n size?: IconButtonSize;\n /** Whether to display the icon button as a circle. */\n circle?: boolean;\n /** Font Awesome icon to show within the button. */\n icon: IconProp | React.ReactElement;\n /** Button label provided to the icon button as a tooltip. */\n label: React.ReactNode;\n /**\n * Whether to display the button in \"active\" state.\n *\n * @default false\n */\n active?: boolean;\n /**\n * Whether to disable the button.\n *\n * @default false\n */\n disabled?: boolean;\n /**\n * Whether to display the button in \"loading\" state.\n *\n * @default false\n */\n loading?: boolean;\n /**\n * Whether the icon button should be enabled when `loading` is `true`.\n *\n * @default false\n */\n enabledWhenLoading?: boolean;\n /** Properties to pass to the `Icon` component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\" | \"label\">;\n /** Properties to pass to the `Spinner` component. */\n spinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;\n /** Properties to pass to the `Tooltip` component. */\n tooltipProps?: Omit<\n React.ComponentPropsWithRef<typeof Tooltip>,\n \"content\" | \"children\"\n >;\n}\n\n/**\n * The icon button component renders a button containing a single icon. Use it\n * as appropriate, as an alternative to the `Button` component, to trigger\n * actions or events, such as opening a dialog or submitting a form\n *\n * A `label` property, displayed as a tooltip, is required for screen-readers to\n * give meaning to the button.\n *\n * Example usage:\n *\n * ```tsx\n * import { faRocket } from \"@fortawesome/free-solid-svg-icons\";\n * import { IconButton } from \"@ostack.tech/ui\";\n *\n * function Launch() {\n * return (\n * <IconButton\n * icon={faRocket}\n * label=\"Launch rocket\"\n * onClick={launchRocket}\n * />\n * );\n * }\n * ```\n */\nexport const IconButton = React.forwardRef<\n React.ComponentRef<\"button\">,\n IconButtonProps\n>(function IconButton(\n {\n asChild,\n variant = \"solid\",\n color = \"neutral\",\n size = \"md\",\n circle,\n icon,\n label,\n active,\n disabled,\n loading,\n enabledWhenLoading,\n iconProps,\n spinnerProps,\n tooltipProps,\n type,\n onClick,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const iconEl = React.useMemo(\n () =>\n icon && (\n <Slot className={cx(prefix(\"icon-button__icon\"), iconProps?.className)}>\n {React.isValidElement(icon) ? (\n icon\n ) : (\n <Icon icon={icon} fixedWidth {...iconProps} />\n )}\n </Slot>\n ),\n [icon, iconProps, prefix],\n );\n const spinnerEl = React.useMemo(\n () => (\n <Spinner\n {...spinnerProps}\n className={cx(prefix(\"icon-button__spinner\"), spinnerProps?.className)}\n />\n ),\n [prefix, spinnerProps],\n );\n\n let content = loading ? spinnerEl : iconEl;\n if (asChild && children) {\n content = React.cloneElement(children, undefined, content);\n }\n\n const handleClick = React.useCallback(\n (evt: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) {\n return evt.preventDefault();\n }\n return onClick?.(evt);\n },\n [disabled, onClick],\n );\n\n const shouldDisable = disabled || (loading && !enabledWhenLoading);\n const As = asChild ? Slot : \"button\";\n const button = (\n <As\n type={!asChild && !type ? \"button\" : type}\n className={cx(\n prefix(\"icon-button\"),\n prefix(`icon-button--${variant}`),\n prefix(`icon-button--${size}`),\n circle && prefix(\"icon-button--circle\"),\n className,\n )}\n onClick={handleClick}\n data-accent={color}\n disabled={shouldDisable}\n // Elements such as links don't support `disabled`\n data-disabled={boolDataAttr(asChild && shouldDisable)}\n aria-disabled={asChild && shouldDisable ? \"true\" : undefined}\n data-active={boolDataAttr(active)}\n // Prevent focus when disabled\n tabIndex={asChild && shouldDisable ? -1 : undefined}\n ref={forwardedRef}\n {...otherProps}\n >\n {content}\n </As>\n );\n\n return label ? (\n <Tooltip {...tooltipProps} content={label}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n});\n","import * as React from \"react\";\n\nimport { type CalendarProps } from \"./Calendar.tsx\";\n\n/** Value of the calendar context. */\nexport interface CalendarContextValue {\n minAllowedDate: Date | undefined;\n maxAllowedDate: Date | undefined;\n previousMonthLabel: CalendarProps[\"previousMonthLabel\"];\n nextMonthLabel: CalendarProps[\"nextMonthLabel\"];\n captionProps: CalendarProps[\"captionProps\"];\n previousButtonProps: CalendarProps[\"previousButtonProps\"];\n nextButtonProps: CalendarProps[\"nextButtonProps\"];\n monthSelectProps: CalendarProps[\"monthSelectProps\"];\n yearSelectProps: CalendarProps[\"yearSelectProps\"];\n}\n\n/** Calendar context. */\nexport const CalendarContext = React.createContext<CalendarContextValue | null>(\n null,\n);\n\n/** Hook providing access to the calendar context. */\nexport function useCalendarContext(): CalendarContextValue {\n const tableContext = React.useContext(CalendarContext);\n if (!tableContext) {\n throw new Error(\"Calendar context not in scope.\");\n }\n return tableContext;\n}\n","import * as React from \"react\";\nimport { type DayProps, useDayPicker } from \"react-day-picker\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\n\n/**\n * Reimplementation of the React Day Picker's day component to provide a\n * consistent inner element (even when the day isn't interactive), as well as a\n * wrapper over the day text which lets us style it without styling the whole\n * button.\n */\nexport const CalendarDay = React.memo(function CalendarDay({\n day: _day,\n modifiers,\n children,\n ...otherProps\n}: DayProps) {\n const prefix = usePrefix();\n const {\n classNames,\n dayPickerProps: { onDayClick },\n } = useDayPicker();\n const isInteractive = onDayClick !== undefined;\n\n const dayText = isInteractive\n ? (children as React.ReactElement<any>).props.children\n : children;\n const dayContent = (\n <span className={prefix(\"calendar__day-content\")}>{dayText}</span>\n );\n return (\n <td {...otherProps}>\n {!modifiers.hidden &&\n (isInteractive ? (\n React.cloneElement(children as React.ReactElement<any>, {\n children: dayContent,\n })\n ) : (\n <span className={classNames.day_button}>{dayContent}</span>\n ))}\n </td>\n );\n});\n","import {\n faChevronLeft,\n faChevronRight,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport {\n addMonths,\n format,\n getMonth,\n getYear,\n isAfter,\n isBefore,\n isSameYear,\n type Locale,\n setMonth,\n setYear,\n startOfMonth,\n startOfYear,\n} from \"date-fns\";\nimport * as React from \"react\";\nimport { type MonthCaptionProps, useDayPicker } from \"react-day-picker\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { IconButton } from \"../IconButton\";\nimport { Option, Select } from \"../Select\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { useCalendarContext } from \"./CalendarContext.ts\";\n\n// Formats\nconst CAPTION_FORMAT = \"LLLL y\";\nconst MONTH_FORMAT = \"LLLL\";\nconst YEAR_FORMAT = \"yyyy\";\n\n/**\n * Reimplementation of the React Day Picker's caption component to provide both\n * navigation arrows and dropdown selections.\n */\nexport const CalendarMonthCaption = React.memo(function CalendarMonthCaption({\n calendarMonth,\n displayIndex,\n ...otherProps\n}: MonthCaptionProps) {\n const prefix = usePrefix();\n const {\n minAllowedDate,\n maxAllowedDate,\n previousMonthLabel,\n nextMonthLabel,\n captionProps,\n previousButtonProps,\n nextButtonProps,\n monthSelectProps,\n yearSelectProps,\n } = useCalendarContext();\n const {\n months,\n goToMonth,\n dayPickerProps: {\n onPrevClick,\n onNextClick,\n disableNavigation,\n pagedNavigation,\n locale,\n },\n } = useDayPicker();\n\n const displayDate = calendarMonth.date;\n const isFirst = displayIndex === 0;\n const isLast = displayIndex === months.length - 1;\n const prevMonth = addMonths(\n months[0].date,\n pagedNavigation ? -months.length : -1,\n );\n const allowsPrevMonth =\n minAllowedDate == null || isAfter(prevMonth, minAllowedDate);\n const nextMonth = addMonths(\n months[0].date,\n pagedNavigation ? months.length : 1,\n );\n const allowsNextMonth =\n maxAllowedDate == null || isBefore(nextMonth, maxAllowedDate);\n\n const handlePrevClick: React.MouseEventHandler = React.useCallback(() => {\n if (allowsPrevMonth) {\n goToMonth(prevMonth);\n onPrevClick?.(prevMonth);\n }\n }, [allowsPrevMonth, goToMonth, onPrevClick, prevMonth]);\n const handleNextClick: React.MouseEventHandler = React.useCallback(() => {\n if (allowsNextMonth) {\n goToMonth(nextMonth);\n onNextClick?.(nextMonth);\n }\n }, [allowsNextMonth, goToMonth, nextMonth, onNextClick]);\n\n const monthDates: Date[] = React.useMemo(() => {\n const months = [];\n const date = startOfMonth(new Date());\n for (let month = 0; month <= 11; month++) {\n months.push(setMonth(date, month));\n }\n return months;\n }, []);\n\n const yearDates = React.useMemo(() => {\n const displayYear = getYear(displayDate);\n const curYear = getYear(new Date());\n const nearestCentury = curYear + 50 - ((curYear + 50) % 100);\n const minYear = minAllowedDate\n ? getYear(minAllowedDate)\n : Math.min(displayYear, nearestCentury - 100);\n const maxYear = maxAllowedDate\n ? getYear(maxAllowedDate)\n : Math.max(displayYear, nearestCentury + 99);\n\n const years: Date[] = [];\n for (let year = minYear; year <= maxYear; year++) {\n years.push(setYear(startOfYear(new Date()), year));\n }\n return years;\n }, [displayDate, minAllowedDate, maxAllowedDate]);\n\n const handleMonthChange = React.useCallback(\n (value: string) =>\n goToMonth(\n addMonths(\n setMonth(startOfMonth(displayDate), Number(value)),\n -displayIndex,\n ),\n ),\n [displayIndex, displayDate, goToMonth],\n );\n const handleYearChange = React.useCallback(\n (value: string) =>\n goToMonth(\n addMonths(\n setYear(startOfMonth(displayDate), Number(value)),\n -displayIndex,\n ),\n ),\n [displayIndex, displayDate, goToMonth],\n );\n\n const captionLabel = (\n <span\n className={prefix(\"calendar__caption-label\")}\n role=\"status\"\n aria-live=\"polite\"\n >\n {format(displayDate, CAPTION_FORMAT, { locale: locale as Locale })}\n </span>\n );\n const prevButton = (\n <IconButton\n variant=\"ghost\"\n icon={faChevronLeft}\n disabled={!allowsPrevMonth}\n circle\n {...previousButtonProps}\n className={cx(\n prefix(\"calendar__navigation-button\"),\n previousButtonProps?.className,\n )}\n label={previousMonthLabel ?? \"\"}\n onClick={combineEventHandlers(\n previousButtonProps?.onClick,\n handlePrevClick,\n { checkDefaultPrevented: true },\n )}\n />\n );\n const nextButton = (\n <IconButton\n variant=\"ghost\"\n icon={faChevronRight}\n disabled={!allowsNextMonth}\n circle\n {...nextButtonProps}\n className={cx(\n prefix(\"calendar__navigation-button\"),\n nextButtonProps?.className,\n )}\n label={nextMonthLabel ?? \"\"}\n onClick={combineEventHandlers(nextButtonProps?.onClick, handleNextClick, {\n checkDefaultPrevented: true,\n })}\n />\n );\n const monthOptions = React.useMemo(\n () =>\n monthDates.map((monthDate) => (\n <Option\n key={getMonth(monthDate)}\n value={getMonth(monthDate)}\n disabled={\n minAllowedDate &&\n maxAllowedDate &&\n isSameYear(minAllowedDate, maxAllowedDate) &&\n (getMonth(monthDate) < getMonth(minAllowedDate) ||\n getMonth(monthDate) > getMonth(maxAllowedDate))\n }\n >\n {format(monthDate, MONTH_FORMAT, { locale: locale as Locale })}\n </Option>\n )),\n [locale, maxAllowedDate, minAllowedDate, monthDates],\n );\n const yearOptions = React.useMemo(\n () =>\n yearDates.map((yearDate) => (\n <Option key={getYear(yearDate)} value={getYear(yearDate)}>\n {format(yearDate, YEAR_FORMAT, { locale: locale as Locale })}\n </Option>\n )),\n [locale, yearDates],\n );\n\n return (\n <div\n {...otherProps}\n {...captionProps}\n className={cx(prefix(\"calendar__caption\"), captionProps?.className)}\n >\n {disableNavigation ? (\n captionLabel\n ) : (\n <VisuallyHidden>{captionLabel}</VisuallyHidden>\n )}\n\n {!disableNavigation && (\n <>\n {months.length > 1 && (\n <div className={cx(prefix(\"calendar__navigation\"))}>\n {isFirst && prevButton}\n </div>\n )}\n\n <div className={prefix(\"calendar__selects\")}>\n <ClearContexts>\n <Select\n disabled={!allowsPrevMonth && !allowsNextMonth}\n showClearButton={false}\n {...monthSelectProps}\n className={cx(\n prefix(\"calendar__select\"),\n monthSelectProps?.className,\n )}\n onValueChange={combineEventHandlers(\n monthSelectProps?.onValueChange as never,\n handleMonthChange,\n )}\n value={getMonth(displayDate)}\n >\n {monthOptions}\n </Select>\n <Select\n disabled={yearDates.length < 2}\n showClearButton={false}\n {...yearSelectProps}\n className={cx(\n prefix(\"calendar__select\"),\n yearSelectProps?.className,\n )}\n onValueChange={combineEventHandlers(\n yearSelectProps?.onValueChange as never,\n handleYearChange,\n )}\n value={getYear(displayDate)}\n >\n {yearOptions}\n </Select>\n </ClearContexts>\n </div>\n\n <div className={cx(prefix(\"calendar__navigation\"))}>\n {months.length === 1 && prevButton}\n {isLast && nextButton}\n </div>\n </>\n )}\n </div>\n );\n});\n","import {\n addMonths,\n isAfter,\n isBefore,\n isValid,\n lastDayOfMonth,\n type Locale,\n max,\n min,\n parseISO,\n startOfMonth,\n} from \"date-fns\";\nimport * as React from \"react\";\nimport {\n type DayEventHandler,\n DayPicker,\n type DayPickerProps,\n} from \"react-day-picker\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { type IconButton } from \"../IconButton\";\nimport { type Select } from \"../Select\";\nimport { CalendarContext } from \"./CalendarContext.ts\";\nimport { CalendarDay } from \"./CalendarDay.tsx\";\nimport { CalendarMonthCaption } from \"./CalendarMonthCaption.tsx\";\n\n/** Properties of the calendar component. */\nexport interface CalendarProps\n extends Omit<\n DayPickerProps,\n // Properties that we don't want to support or whose name we change\n | \"mode\"\n | \"selected\"\n | \"onSelect\"\n | \"classNames\"\n | \"modifiersClassNames\"\n | \"styles\"\n | \"modifiersStyles\"\n | \"fromDate\"\n | \"toDate\"\n | \"fromMonth\"\n | \"toMonth\"\n | \"fromYear\"\n | \"toYear\"\n | \"startMonth\"\n | \"endMonth\"\n | \"reverseMonths\"\n | \"captionLayout\"\n | \"navLayout\"\n | \"components\"\n | \"locale\"\n | \"labels\"\n | \"formatters\"\n | \"dir\"\n | \"dateLib\"\n > {\n /** Minimum date allowed. */\n minDate?: string | Date | null;\n /** Maximum date allowed. */\n maxDate?: string | Date | null;\n /** Minimum month allowed. */\n minMonth?: string | Date | null;\n /** Maximum month allowed. */\n maxMonth?: string | Date | null;\n /** Minimum year allowed. */\n minYear?: number;\n /** Maximum year allowed. */\n maxYear?: number;\n /** `date-fns` locale to format dates and to be used by the date picker. */\n locale?: Locale;\n /** Label of the \"previous month\" button. */\n previousMonthLabel?: string;\n /** Label of the \"next month\" button. */\n nextMonthLabel?: string;\n /** Properties to pass to the caption element. */\n captionProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the previous button component. */\n previousButtonProps?: React.ComponentPropsWithRef<typeof IconButton>;\n /** Properties to pass to the next button component. */\n nextButtonProps?: React.ComponentPropsWithRef<typeof IconButton>;\n /** Properties to pass to the month select component. */\n monthSelectProps?: Omit<\n React.ComponentPropsWithRef<typeof Select>,\n \"multiple\" | \"defaultValue\" | \"value\"\n >;\n /** Properties to pass to the year select component. */\n yearSelectProps?: Omit<\n React.ComponentPropsWithRef<typeof Select>,\n \"multiple\" | \"defaultValue\" | \"value\"\n >;\n}\n\n/**\n * Calendar component built on top of [React\n * DayPicker](https://react-day-picker.js.org).\n */\nexport function Calendar({\n required,\n minDate,\n maxDate,\n minMonth,\n maxMonth,\n minYear,\n maxYear,\n previousMonthLabel,\n nextMonthLabel,\n defaultMonth,\n month: controlledMonth,\n onMonthChange,\n onDayClick,\n numberOfMonths = 1,\n // Show outside days and fix the number of weeks by default\n showOutsideDays = true,\n fixedWeeks = true,\n disableNavigation,\n locale: dateFnsLocale,\n disabled,\n modifiers,\n captionProps,\n previousButtonProps,\n nextButtonProps,\n monthSelectProps,\n yearSelectProps,\n pagedNavigation,\n ...otherProps\n}: CalendarProps) {\n const prefix = usePrefix();\n const locale = useLocale();\n dateFnsLocale ??= locale.dateFnsLocale;\n previousMonthLabel ??= locale.Calendar.previousMonthLabel;\n nextMonthLabel ??= locale.Calendar.nextMonthLabel;\n\n // Minimum allowed date\n const minAllowedDate = React.useMemo(() => {\n const minDates = [\n toValidDate(minDate),\n toValidDate(minMonth),\n minYear != null && new Date(minYear, 0, 1),\n ].filter((d) => d);\n return minDates.length > 0 ? max(minDates as Date[]) : undefined;\n }, [minDate, minMonth, minYear]);\n\n // Maximum allowed Date\n const maxAllowedDate = React.useMemo(() => {\n const maxDates = [\n toValidDate(maxDate),\n toValidDate(maxMonth),\n maxYear != null && new Date(maxYear, 11, 31),\n ].filter((d) => d);\n return maxDates.length > 0 ? min(maxDates as Date[]) : undefined;\n }, [maxDate, maxMonth, maxYear]);\n\n // Manually track the month so that we navigate between months when clicking\n // on \"outside\" days\n const [month, setMonth] = useControllableState(\n defaultMonth ?? minAllowedDate ?? new Date(),\n controlledMonth,\n );\n\n // Month change handler\n const handleMonthChange = React.useCallback(\n (date: Date) => {\n onMonthChange?.(date);\n setMonth(date);\n },\n [onMonthChange, setMonth],\n );\n\n // When clicking on outside days, navigate to their corresponding month\n const handleDayClick: DayEventHandler<React.MouseEvent> = React.useCallback(\n (date: Date, modifiers, evt) => {\n onDayClick?.(date, modifiers, evt);\n if (!disableNavigation && modifiers.outside) {\n const firstDay = startOfMonth(month);\n const lastDay = lastDayOfMonth(addMonths(firstDay, numberOfMonths - 1));\n if (isBefore(date, firstDay)) {\n handleMonthChange(\n addMonths(firstDay, pagedNavigation ? -numberOfMonths : -1),\n );\n } else if (isAfter(date, lastDay)) {\n handleMonthChange(\n addMonths(firstDay, pagedNavigation ? numberOfMonths : 1),\n );\n }\n }\n },\n [\n disableNavigation,\n handleMonthChange,\n month,\n numberOfMonths,\n onDayClick,\n pagedNavigation,\n ],\n );\n\n const dynamicModifierClasses = modifiers\n ? Object.keys(modifiers).reduce(\n (classNames: Record<string, string>, modifier) => {\n classNames[modifier] = prefix(\n `calendar__day--${modifier.replaceAll(\"_\", \"-\")}`,\n );\n return classNames;\n },\n {},\n )\n : null;\n\n const composedDisabled = React.useMemo(() => {\n const composedDisabled = [];\n if (minAllowedDate) {\n composedDisabled.push({ before: minAllowedDate });\n }\n if (maxAllowedDate) {\n composedDisabled.push({ after: maxAllowedDate });\n }\n if (disabled) {\n if (Array.isArray(disabled)) {\n composedDisabled.push(...disabled);\n } else {\n composedDisabled.push(disabled);\n }\n }\n return composedDisabled;\n }, [disabled, maxAllowedDate, minAllowedDate]);\n\n return (\n <CalendarContext.Provider\n value={{\n minAllowedDate,\n maxAllowedDate,\n previousMonthLabel,\n nextMonthLabel,\n captionProps,\n previousButtonProps,\n nextButtonProps,\n monthSelectProps,\n yearSelectProps,\n }}\n >\n <DayPicker\n locale={dateFnsLocale}\n required={required as never}\n disabled={composedDisabled}\n components={{\n MonthCaption: CalendarMonthCaption as never,\n Day: CalendarDay as never,\n Nav: () => null!,\n }}\n classNames={{\n root: prefix(\"calendar\"),\n months: prefix(\"calendar__months\"),\n month: prefix(\"calendar__month\"),\n month_caption: prefix(\"calendar__caption\"),\n caption_label: prefix(\"calendar__caption-label\"),\n button_previous: prefix(\"calendar__previous\"),\n button_next: prefix(\"calendar__next\"),\n month_grid: prefix(\"calendar__grid\"),\n weekdays: prefix(\"calendar__weekdays\"),\n weekday: prefix(\"calendar__weekday\"),\n weeks: prefix(\"calendar__weeks\"),\n week: prefix(\"calendar__week\"),\n week_number: prefix(\"calendar__week-number\"),\n day: prefix(\"calendar__day\"),\n day_button: prefix(\"calendar__day-inner\"),\n footer: prefix(\"calendar__footer\"),\n }}\n modifiers={modifiers}\n modifiersClassNames={{\n // Dynamic modifiers\n ...dynamicModifierClasses,\n // Built-in modifiers\n selected: prefix(\"calendar__day--selected\"),\n focused: prefix(\"calendar__day--focused\"),\n disabled: prefix(\"calendar__day--disabled\"),\n hidden: prefix(\"calendar__day--hidden\"),\n today: prefix(\"calendar__day--today\"),\n outside: prefix(\"calendar__day--outside\"),\n }}\n onDayClick={onDayClick && handleDayClick}\n month={month}\n onMonthChange={handleMonthChange}\n numberOfMonths={numberOfMonths}\n showOutsideDays={showOutsideDays}\n fixedWeeks={fixedWeeks}\n disableNavigation={disableNavigation}\n pagedNavigation={pagedNavigation}\n {...otherProps}\n />\n </CalendarContext.Provider>\n );\n}\n\n/** Converts a value to a valid date or `undefined`. */\nfunction toValidDate(\n value: string | Date | null | undefined,\n): Date | undefined {\n const date =\n typeof value === \"string\" ? parseISO(value) : (value ?? undefined);\n return date === undefined || !isValid(date) ? undefined : date;\n}\n","import { format, type FormatOptions, parse, type ParseOptions } from \"date-fns\";\n\n// Reference date for date parsing\nconst REF_DATE = new Date(0);\n\n/**\n * Strictly parses a string date into a date.\n *\n * Workaround for: https://github.com/date-fns/date-fns/issues/942\n */\nexport function parseDateStrict(\n dateString: string,\n dateFormat: string,\n options?: ParseOptions & FormatOptions,\n): Date | null {\n const date = parse(dateString, dateFormat, REF_DATE, options);\n if (isNaN(+date)) {\n return null;\n }\n return format(date, dateFormat, options) === dateString ? date : null;\n}\n","import { format, type Locale } from \"date-fns\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../providers/LocalizationProvider\";\nimport { parseDateStrict } from \"./parseDateStrict.ts\";\n\n/** Default short date format. */\nexport const DEFAULT_SHORT_DATE_FORMAT = \"yyyy-MM-dd\";\n\n/** Default full date format. */\nexport const DEFAULT_FULL_DATE_FORMAT = \"EEEE, d MMMM yyyy\";\n\n/** Options of the `useDateTransformer` hook. */\nexport interface DateTransformerOptions {\n /** `date-fns` locale to format dates. */\n locale?: Locale;\n /**\n * Short format of the date, as supported by\n * [`date-fns`](https://date-fns.org/docs/format).\n */\n shortFormat?: string;\n /**\n * Full format of the date, as supported by\n * [`date-fns`](https://date-fns.org/docs/format).\n */\n fullFormat?: string;\n}\n\n/** Available formatting widths. */\nexport type DateFormatWidth = \"short\" | \"full\";\n\n/** Optons of the date formatter. */\nexport interface DateFormatterOptions {\n /**\n * Formatted date width.\n *\n * @default short\n */\n width?: DateFormatWidth;\n}\n\n/** Optons of the date parser. */\nexport interface DateParserOptions {\n /**\n * Formatted date width.\n *\n * @default short\n */\n width?: DateFormatWidth;\n}\n\n/** Date transformer. */\nexport interface DateTransformer {\n /** Function used to strictly parse a string as a date. */\n parse: (formattedDate: string, options?: DateParserOptions) => Date | null;\n /** Function used to format the date as a string. */\n format: (\n date: string | number | Date | null,\n options?: DateFormatterOptions,\n ) => string;\n}\n\n/**\n * Hook returning functions that can be used to transform a date according to\n * the current locale. By default, the returned functions transform a date in\n * the same way a `DateInput` would.\n */\nexport function useDateTransformer({\n locale: dateFnsLocale,\n shortFormat,\n fullFormat,\n}: DateTransformerOptions = {}): DateTransformer {\n const locale = useLocale();\n dateFnsLocale ??= locale.dateFnsLocale;\n shortFormat ??=\n locale.DateInput.shortFormat ??\n dateFnsLocale.formatLong?.date({ width: \"short\" }) ??\n DEFAULT_SHORT_DATE_FORMAT;\n fullFormat ??=\n locale.DateInput.fullFormat ??\n dateFnsLocale.formatLong?.date({ width: \"full\" }) ??\n DEFAULT_FULL_DATE_FORMAT;\n\n return React.useMemo(\n () => ({\n parse: (\n formattedDate: string,\n { width = \"short\" }: DateParserOptions = {},\n ) =>\n parseDateStrict(\n formattedDate,\n width === \"short\" ? shortFormat : fullFormat,\n { locale: dateFnsLocale },\n ),\n format: (\n date: string | number | Date | null,\n { width = \"short\" }: DateFormatterOptions = {},\n ) =>\n date != null\n ? format(date, width === \"short\" ? shortFormat : fullFormat, {\n locale: dateFnsLocale,\n })\n : \"\",\n }),\n [dateFnsLocale, fullFormat, shortFormat],\n );\n}\n","import * as React from \"react\";\nimport { type DayEventHandler } from \"react-day-picker\";\n\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { Calendar } from \"../Calendar\";\n\n/** Properties of the date picker component. */\nexport interface DatePickerProps\n extends React.ComponentPropsWithoutRef<typeof Calendar> {\n /** Default date value. */\n defaultValue?: Date | null;\n /** Controlled selected date value. */\n value?: Date | null;\n /** Action called whenever the date picker's value changes. */\n onChange?: (value: Date | null) => void;\n}\n\n/**\n * Date picker component built on top of [React\n * DayPicker](https://react-day-picker.js.org) and\n * [Calendar](/docs/ostack-ui-forms-calendar--docs) component, providing an\n * intuitive and easy-to-use interface for selecting a date. It acts as a\n * higher-level abstraction that manages date selection while offering both\n * controlled and uncontrolled usage scenarios.\n *\n * The DatePicker allows users to easily select a date by responding to click\n * events on the calendar days. When a date is clicked, the component updates\n * the selected date and triggers a callback, making it simple to integrate into\n * forms or other applications that need to track a chosen date.\n *\n * For detailed customization options, refer to the Calendar component story.\n */\nexport function DatePicker({\n defaultValue,\n value: controlledValue,\n defaultMonth,\n onChange,\n onDayClick,\n ...otherProps\n}: DatePickerProps) {\n const [value, setValue] = useControllableState(\n defaultValue ?? undefined,\n controlledValue,\n );\n\n // Set the value when clicking on the day\n const handleDayClick: DayEventHandler<React.MouseEvent> = React.useCallback(\n (date: Date, modifiers, evt) => {\n onDayClick?.(date, modifiers, evt);\n setValue(date);\n onChange?.(date);\n },\n [onChange, onDayClick, setValue],\n );\n\n return (\n <Calendar\n modifiers={{ selected: value ?? undefined }}\n onDayClick={handleDayClick}\n defaultMonth={defaultMonth ?? value ?? undefined}\n {...otherProps}\n />\n );\n}\n","import { faCalendar } from \"@fortawesome/free-regular-svg-icons\";\nimport {\n addMonths,\n isDate,\n isWithinInterval,\n lastDayOfMonth,\n type Locale,\n startOfMonth,\n} from \"date-fns\";\nimport * as React from \"react\";\nimport { type MonthChangeEventHandler } from \"react-day-picker\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { useDateTransformer } from \"../../utils/useDateTransformer.tsx\";\nimport { ControlAddon } from \"../ControlAddon\";\nimport { DatePicker } from \"../DatePicker\";\nimport { Icon } from \"../Icon\";\nimport { type Input, InputWithContainerRef } from \"../Input\";\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from \"../Popover\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\n/** Properties of the date input component. */\nexport interface DateInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n \"defaultValue\" | \"value\" | \"onValueChange\"\n > {\n /** Date input's default value. */\n defaultValue?: string | Date | null;\n /** Date input's controlled value. */\n value?: string | Date | null;\n /**\n * Function called whenever the value of the date input changes.\n *\n * @param valueRepresentations Different representations of the date value.\n */\n onValueChange?: (valueRepresentations: DateValueRepresentations) => void;\n /** Minimum date allowed. */\n minDate?: string | Date | null;\n /** Maximum date allowed. */\n maxDate?: string | Date | null;\n /** Minimum month allowed. */\n minMonth?: string | Date | null;\n /** Maximum month allowed. */\n maxMonth?: string | Date | null;\n /** Minimum year allowed. */\n minYear?: number;\n /** Maximum year allowed. */\n maxYear?: number;\n /** `date-fns` locale to format dates and to be used by the date picker. */\n locale?: Locale;\n /**\n * Short format of the date, as supported by\n * [`date-fns`](https://date-fns.org/docs/format), used for the written input\n * text.\n */\n shortFormat?: string;\n /**\n * Full format of the date, as supported by\n * [`date-fns`](https://date-fns.org/docs/format), used to announce the date\n * to assistive technologies.\n */\n fullFormat?: string;\n /** Description of the short format provided to assistive technologies. */\n formatDescription?: string;\n /**\n * Function that should return the label to provide to the button that opens\n * the input's calendar.\n *\n * @param selectedDate Currently selected date.\n * @param editable Whether the calendar is editable.\n */\n calendarButtonLabel?: (\n selectedDate: string | null,\n editable: boolean,\n ) => string;\n /** Function called whenever the popover's open state changes. */\n onPopoverOpenChange?: (open: boolean) => void;\n /** Properties to pass to the date picker component. */\n datePickerProps?: Omit<\n React.ComponentPropsWithRef<typeof DatePicker>,\n | \"value\"\n | \"defaultValue\"\n | \"minDate\"\n | \"maxDate\"\n | \"minMonth\"\n | \"maxMonth\"\n | \"minYear\"\n | \"maxYear\"\n | \"locale\"\n >;\n /** Properties to pass to the popover content component. */\n popoverContentProps?: React.ComponentPropsWithRef<typeof PopoverContent>;\n}\n\n/** Representations of the date value. */\nexport interface DateValueRepresentations {\n /** Date value as a formatted string. */\n formattedValue: string;\n /** Date value as a date. */\n dateValue: Date | null;\n}\n\n/**\n * The date input component is used to allow a user to enter a date with the aid\n * of a popover calendar. It is built on top of the `Input`, `Popover`, and\n * `DatePicker` components (and, by extension, the browser's [`<input>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)).\n *\n * For accessibility purposes, date inputs are usually included within a `Field`\n * together with a `Label` and optionally `HelperText` and/or `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { DateInput } from \"@ostack.tech/ui\";\n *\n * function DateOfBirth() {\n * return <DateInput placeholder=\"Enter your date of birth…\" />;\n * }\n * ```\n */\nexport const DateInput = React.forwardRef<\n React.ComponentRef<typeof Input>,\n DateInputProps\n>(function DateInput(\n {\n value: controlledValue,\n defaultValue,\n onValueChange,\n onChange,\n onFocus,\n disabled,\n readOnly,\n showClearButton = \"auto\",\n endAdornment,\n minDate,\n maxDate,\n minMonth,\n maxMonth,\n minYear,\n maxYear,\n locale: dateFnsLocale,\n shortFormat,\n fullFormat,\n formatDescription,\n calendarButtonLabel,\n onPopoverOpenChange,\n onBlurToOutside,\n containerProps,\n clearButtonProps,\n datePickerProps,\n popoverContentProps,\n className,\n placeholder,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n dateFnsLocale ??= locale.dateFnsLocale;\n placeholder ??= locale.DateInput.placeholder;\n formatDescription ??= locale.DateInput.formatDescription;\n calendarButtonLabel ??= locale.DateInput.calendarButtonLabel;\n\n // Transform dates from/to strings\n const { format: formatDate, parse: parseDate } = useDateTransformer({\n locale: dateFnsLocale,\n shortFormat,\n fullFormat,\n });\n\n // Identifier used to reference the format description\n const generatedId = React.useId();\n const formatDescriptionId =\n formatDescription && prefix(`control-format-${generatedId}`);\n\n const [formattedValue, setFormattedValue] = useControllableState<string>(\n defaultValue === null || isDate(defaultValue)\n ? formatDate(defaultValue)\n : (defaultValue?.toString() ?? \"\"),\n controlledValue === null || isDate(controlledValue)\n ? formatDate(controlledValue)\n : controlledValue?.toString(),\n );\n const dateValue = React.useMemo(\n () => parseDate(formattedValue),\n [parseDate, formattedValue],\n );\n const deferredFormattedValue = React.useDeferredValue(formattedValue);\n const deferredDateValue = React.useMemo(\n () => parseDate(deferredFormattedValue),\n [deferredFormattedValue, parseDate],\n );\n const [popoverState, setPopoverState] = React.useState({\n open: false,\n modal: false,\n });\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const clearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const addonButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const popoverRef = React.useRef<React.ComponentRef<\n typeof PopoverContent\n > | null>(null);\n const monthSelectMenuRef = React.useRef<HTMLDivElement | null>(null);\n const yearSelectMenuRef = React.useRef<HTMLDivElement | null>(null);\n\n // Change popover state while emitting an `onPopoverOpenChange` event as\n // appropriate\n const changePopoverState = React.useCallback(\n (state: { open: boolean; modal: boolean }) => {\n setPopoverState(state);\n if (popoverState.open !== state.open) {\n onPopoverOpenChange?.(state.open);\n }\n },\n [onPopoverOpenChange, popoverState.open],\n );\n\n // Month to display when opening the popover\n const monthToDisplay = React.useCallback(\n () =>\n startOfMonth(datePickerProps?.defaultMonth ?? dateValue ?? new Date()),\n [datePickerProps?.defaultMonth, dateValue],\n );\n\n // Control the date picker's month in order to automatically set the\n // displayed month while manually entering a date on the input or when\n // focusing the input\n const [month, setMonth] = useControllableState(\n () => monthToDisplay(),\n datePickerProps?.month,\n );\n\n // Whether a given date is visible within the date picker\n const dateIsVisible = React.useCallback(\n (date: Date) =>\n isWithinInterval(date, {\n start: month,\n end: lastDayOfMonth(\n addMonths(month, (datePickerProps?.numberOfMonths ?? 1) - 1),\n ),\n }),\n [datePickerProps?.numberOfMonths, month],\n );\n\n const handleMonthChange: MonthChangeEventHandler = combineEventHandlers(\n datePickerProps?.onMonthChange,\n setMonth,\n );\n\n // Handle changes coming from the input\n const handleInputChange: React.ChangeEventHandler<HTMLInputElement> =\n React.useCallback(\n (evt) => {\n const formattedValue = evt.currentTarget.value;\n const dateValue = parseDate(formattedValue);\n onValueChange?.({ formattedValue, dateValue });\n setFormattedValue(formattedValue);\n\n // Focus the month of the date that was inputted when it isn't visible\n if (!evt.defaultPrevented && dateValue && !dateIsVisible(dateValue)) {\n handleMonthChange(startOfMonth(dateValue));\n }\n },\n [\n dateIsVisible,\n handleMonthChange,\n onValueChange,\n parseDate,\n setFormattedValue,\n ],\n );\n\n // Open the popover in non-modal mode when the input is focused\n const handleInputFocus: React.FocusEventHandler<HTMLInputElement> =\n React.useCallback(() => {\n if (!popoverState.open) {\n handleMonthChange(monthToDisplay());\n }\n changePopoverState({ open: true, modal: false });\n }, [\n popoverState.open,\n changePopoverState,\n handleMonthChange,\n monthToDisplay,\n ]);\n\n // Open the popover in modal mode when clicking the addon button\n const handleAddonButtonClick = React.useCallback(() => {\n handleMonthChange(monthToDisplay());\n changePopoverState({ open: true, modal: true });\n }, [changePopoverState, handleMonthChange, monthToDisplay]);\n\n // Handle changes coming from the date picker\n const handleDatePickerChange = React.useCallback(\n (date: Date | null) => {\n const formattedValue = formatDate(date);\n onValueChange?.({ formattedValue, dateValue: date });\n setFormattedValue(formattedValue);\n\n // Close popup and focus addon button\n changePopoverState({ open: false, modal: false });\n addonButtonRef.current?.focus();\n },\n [changePopoverState, formatDate, onValueChange, setFormattedValue],\n );\n\n // Prevent focusing the popup when not in modal mode (since the input should\n // have focus instead)\n const handlePopoverOpenAutoFocus = React.useCallback(\n (evt: Event) => {\n if (!popoverState.modal) {\n evt.preventDefault();\n }\n },\n [popoverState.modal],\n );\n\n // Close popup in modal mode when interacting outside the popup or input\n const handlePopoverInteractOutside = React.useCallback(\n (evt: CustomEvent) => {\n if (!popoverState.modal && inputRef.current !== evt.target) {\n changePopoverState({ open: false, modal: false });\n }\n },\n [changePopoverState, popoverState.modal],\n );\n\n // Close the popup on `Escape` in modal mode\n const handlePopoverEscapeKeyDown = React.useCallback(() => {\n if (popoverState.modal) {\n changePopoverState({ open: false, modal: false });\n }\n }, [changePopoverState, popoverState.modal]);\n\n // Close the popup when clicking outside in modal mode (doing this during the\n // \"interact outside\" event instead breaks the focus trap)\n const handlePopoverPointerDownOutside = React.useCallback(() => {\n if (popoverState.modal) {\n changePopoverState({ open: false, modal: false });\n }\n }, [changePopoverState, popoverState.modal]);\n\n // Notify when the focus moves out of the control\n const handleControlBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n if (\n !evt.relatedTarget ||\n (!inputRef.current?.contains(evt.relatedTarget) &&\n !clearButtonRef.current?.contains(evt.relatedTarget) &&\n !addonButtonRef.current?.contains(evt.relatedTarget) &&\n !popoverRef.current?.contains(evt.relatedTarget) &&\n !monthSelectMenuRef.current?.contains(evt.relatedTarget) &&\n !yearSelectMenuRef.current?.contains(evt.relatedTarget))\n ) {\n // Normalise formatted value when blurring to outside\n const formattedDateValue = formatDate(dateValue);\n if (formattedDateValue !== formattedValue) {\n onValueChange?.({ formattedValue: formattedDateValue, dateValue });\n setFormattedValue(formattedDateValue);\n }\n\n onBlurToOutside?.(evt);\n }\n },\n [\n dateValue,\n formatDate,\n formattedValue,\n onBlurToOutside,\n onValueChange,\n setFormattedValue,\n ],\n );\n\n // Localised date value to be announced by assistive technologies on the\n // button label\n const fullFormattedValue = React.useMemo(\n () => formatDate(dateValue, { width: \"full\" }),\n [dateValue, formatDate],\n );\n\n const combinedClearButtonRef = useCombinedRef(\n clearButtonProps?.ref,\n clearButtonRef,\n );\n const combinedInputRef = useCombinedRef(inputRef, forwardedRef);\n const combinedPopoverRef = useCombinedRef(\n popoverContentProps?.ref,\n popoverRef,\n );\n return (\n <>\n <Popover open={popoverState.open} modal={popoverState.modal}>\n <PopoverAnchor asChild>\n <InputWithContainerRef\n className={cx(prefix(\"date-input\"), className)}\n value={formattedValue}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n onChange={combineEventHandlers(onChange, handleInputChange)}\n onFocus={combineEventHandlers(onFocus, handleInputFocus)}\n onBlurToOutside={handleControlBlur}\n showClearButton={showClearButton}\n endAdornment={\n <>\n {endAdornment}\n\n <ControlAddon asChild>\n <PopoverTrigger>\n <button\n aria-label={calendarButtonLabel?.(\n fullFormattedValue,\n !disabled && !readOnly,\n )}\n onClick={handleAddonButtonClick}\n onBlur={handleControlBlur}\n data-state={undefined}\n ref={addonButtonRef}\n >\n <Icon icon={faCalendar} />\n </button>\n </PopoverTrigger>\n </ControlAddon>\n </>\n }\n aria-describedby={mergeAriaIds(\n formatDescriptionId,\n ariaDescribedBy,\n )}\n // Style the input as \"focused\" while the date picker is open\n containerProps={{\n // Propagate open state to container for styling purposes\n ...{ \"data-state\": popoverState.open ? \"open\" : \"closed\" },\n ...containerProps,\n }}\n clearButtonProps={{\n ...clearButtonProps,\n ref: combinedClearButtonRef,\n }}\n inputRef={combinedInputRef}\n {...otherProps}\n />\n </PopoverAnchor>\n\n <PopoverContent\n {...popoverContentProps}\n className={cx(\n prefix(\"date-input__popover\"),\n popoverContentProps?.className,\n )}\n side={popoverContentProps?.side ?? \"bottom\"}\n sideOffset={popoverContentProps?.sideOffset ?? 5}\n showArrow={popoverContentProps?.showArrow ?? false}\n onOpenAutoFocus={combineEventHandlers(\n popoverContentProps?.onOpenAutoFocus,\n handlePopoverOpenAutoFocus,\n )}\n onEscapeKeyDown={combineEventHandlers(\n popoverContentProps?.onEscapeKeyDown,\n handlePopoverEscapeKeyDown,\n )}\n onPointerDownOutside={combineEventHandlers(\n popoverContentProps?.onPointerDownOutside,\n handlePopoverPointerDownOutside,\n )}\n onInteractOutside={combineEventHandlers(\n popoverContentProps?.onInteractOutside,\n handlePopoverInteractOutside,\n )}\n onBlur={combineEventHandlers(\n popoverContentProps?.onBlur,\n handleControlBlur,\n )}\n ref={combinedPopoverRef}\n >\n <DatePicker\n className={cx(\n prefix(\"date-input__picker\"),\n datePickerProps?.className,\n )}\n {...datePickerProps}\n value={deferredDateValue}\n onChange={combineEventHandlers(\n datePickerProps?.onChange,\n handleDatePickerChange,\n )}\n month={month}\n onMonthChange={handleMonthChange}\n disabled={disabled || readOnly || datePickerProps?.disabled}\n minDate={minDate}\n maxDate={maxDate}\n minMonth={minMonth}\n maxMonth={maxMonth}\n minYear={minYear}\n maxYear={maxYear}\n locale={dateFnsLocale}\n monthSelectProps={{\n ...datePickerProps?.monthSelectProps,\n popoverProps: {\n ...datePickerProps?.monthSelectProps?.popoverProps,\n ref: monthSelectMenuRef,\n },\n }}\n yearSelectProps={{\n ...datePickerProps?.yearSelectProps,\n popoverProps: {\n ...datePickerProps?.yearSelectProps?.popoverProps,\n ref: yearSelectMenuRef,\n },\n }}\n />\n </PopoverContent>\n </Popover>\n\n {/* Description of the date format for assistive technologies */}\n {formatDescription && (\n <VisuallyHidden id={formatDescriptionId}>\n {formatDescription}\n </VisuallyHidden>\n )}\n </>\n );\n});\n","import { isAfter, isBefore, isEqual } from \"date-fns\";\nimport * as React from \"react\";\nimport { type DayEventHandler, type Modifiers } from \"react-day-picker\";\n\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { Calendar } from \"../Calendar\";\n\n/** A range of dates from a start date to an end date. */\nexport interface DateRange {\n start: Date | null;\n end: Date | null;\n}\n\n/** Mode specifying which end of the range the user is controlling. */\nexport type DateRangePickerSelectionMode = \"start\" | \"end\" | \"both\";\n\n/** Properties of the date-range picker component. */\nexport interface DateRangePickerProps\n extends React.ComponentPropsWithoutRef<typeof Calendar> {\n /** Default date-range value. */\n defaultValue?: DateRange;\n /** Controlled selected date-range value. */\n value?: DateRange;\n /** Action called whenever the date-range picker's value changes. */\n onChange?: (value: DateRange) => void;\n /**\n * Specifies which end of the range the user is currently attempting to\n * change.\n *\n * @default \"both\"\n */\n selectionMode?: DateRangePickerSelectionMode;\n}\n\n/**\n * Date-range picker component built on top of [React\n * DayPicker](https://react-day-picker.js.org) and\n * [Calendar](/docs/ostack-ui-forms-calendar--docs). Unlike the `Calendar`,\n * `DateRangePicker` provides its own default event handlers for date selection.\n * It supports controlled and uncontrolled states, logical constraints to ensure\n * valid ranges, and flexible selection modes for the start, end, or both dates.\n * Interactive hover feedback helps users visualize their selections in\n * real-time.\n *\n * This component doesn’t have dedicated stories as its functionality is covered\n * by [DatePicker](/docs/ostack-ui-forms-date-picker--docs) and `Calendar`\n * stories, avoiding redundancy. Ideal for booking systems, dashboards, and\n * forms, it simplifies workflows requiring precise date range inputs.\n */\nexport function DateRangePicker({\n defaultValue,\n value: controlledValue,\n onChange,\n selectionMode = \"both\",\n defaultMonth,\n modifiers,\n onDayClick,\n onDayFocus,\n onDayMouseEnter,\n numberOfMonths = 2,\n ...otherProps\n}: DateRangePickerProps) {\n const [unnormalizedValue, setValue] = useControllableState<DateRange>(\n defaultValue ?? { start: null, end: null },\n controlledValue,\n );\n const value = React.useMemo(\n () =>\n unnormalizedValue.start &&\n unnormalizedValue.end &&\n isAfter(unnormalizedValue.start, unnormalizedValue.end)\n ? { start: null, end: null }\n : unnormalizedValue,\n [unnormalizedValue],\n );\n // Provide feedback as we hover/focus a range\n const [focusedDates, setFocusedDates] = React.useState<DateRange>({\n start: null,\n end: null,\n });\n\n // Set the range value when clicking on days\n const handleDayClick: DayEventHandler<React.MouseEvent> = React.useCallback(\n (date, modifiers, evt) => {\n onDayClick?.(date, modifiers, evt);\n setFocusedDates({ start: null, end: null });\n let newValue: DateRange;\n if (selectionMode === \"start\") {\n newValue =\n !value.end || !isAfter(date, value.end)\n ? { start: date, end: value.end }\n : { start: date, end: null };\n } else if (selectionMode === \"end\") {\n newValue =\n !value.start || !isBefore(date, value.start)\n ? { start: value.start, end: date }\n : { start: date, end: null };\n } else if ((!value.start && !value.end) || (value.start && value.end)) {\n newValue = { start: date, end: null };\n } else {\n const filledDate = (value.start ?? value.end)!;\n newValue = isAfter(date, filledDate)\n ? { start: filledDate, end: date }\n : { start: date, end: filledDate };\n }\n setValue(newValue);\n onChange?.(newValue);\n },\n [onChange, onDayClick, selectionMode, setValue, value.end, value.start],\n );\n\n const handleDayFocus = React.useCallback(\n <T extends React.FocusEvent | React.KeyboardEvent | React.MouseEvent>(\n date: Date,\n modifiers: Modifiers,\n evt: T,\n handler?: (date: Date, activeModifiers: Modifiers, evt: T) => void,\n ) => {\n handler?.(date, modifiers, evt);\n let newFocused: DateRange;\n if (selectionMode === \"start\" && value.end && isBefore(date, value.end)) {\n newFocused = { start: date, end: value.end };\n } else if (\n selectionMode === \"end\" &&\n value.start &&\n isAfter(date, value.start)\n ) {\n newFocused = { start: value.start, end: date };\n } else if (\n selectionMode === \"both\" &&\n ((value.start && !value.end) || (!value.start && value.end))\n ) {\n const filledDate = (value.start ?? value.end)!;\n newFocused = isAfter(date, filledDate)\n ? { start: filledDate, end: date }\n : { start: date, end: filledDate };\n } else {\n newFocused = { start: null, end: null };\n }\n setFocusedDates(newFocused);\n },\n [selectionMode, value.end, value.start],\n );\n\n return (\n <Calendar\n modifiers={{\n ...modifiers,\n selected: {\n from: value.start ?? value.end ?? undefined,\n to: value.end ?? value.start ?? undefined,\n },\n range_start: value.start ?? value.end ?? false,\n range_end: value.end ?? value.start ?? false,\n range_middle:\n value.start && value.end && !isEqual(value.start, value.end)\n ? { after: value.start, before: value.end }\n : false,\n focused_range_start: focusedDates.start ?? false,\n focused_range_end: focusedDates.end ?? false,\n focused_range_middle:\n focusedDates.start &&\n focusedDates.end &&\n !isEqual(focusedDates.start, focusedDates.end)\n ? { after: focusedDates.start, before: focusedDates.end }\n : false,\n }}\n numberOfMonths={numberOfMonths}\n defaultMonth={defaultMonth ?? value.start ?? value.end ?? undefined}\n onDayClick={handleDayClick}\n onDayFocus={(date, activeModifiers, evt) =>\n handleDayFocus(date, activeModifiers, evt, onDayFocus)\n }\n onDayMouseEnter={(date, activeModifiers, evt) =>\n handleDayFocus(date, activeModifiers, evt, onDayMouseEnter)\n }\n {...otherProps}\n />\n );\n}\n","import { faCalendar } from \"@fortawesome/free-regular-svg-icons\";\nimport { faArrowRight } from \"@fortawesome/free-solid-svg-icons\";\nimport {\n addMonths,\n isDate,\n isWithinInterval,\n lastDayOfMonth,\n type Locale,\n startOfMonth,\n} from \"date-fns\";\nimport * as React from \"react\";\nimport { type MonthChangeEventHandler } from \"react-day-picker\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n controlStatusToAccent,\n type ControlVariant,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { setNativeValue } from \"../../utils/setNativeValue.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { useDateTransformer } from \"../../utils/useDateTransformer.tsx\";\nimport {\n type Responsive,\n useResponsiveValues,\n} from \"../../utils/useResponsiveValues.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { CloseButton } from \"../CloseButton\";\nimport { ControlAddon } from \"../ControlAddon\";\nimport { ControlCode } from \"../ControlCode\";\nimport { useDataTableColumnLabelId } from \"../DataTable\";\nimport { type DateRange, DateRangePicker } from \"../DateRangePicker\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useFieldLabelId,\n useSetFieldControl,\n useSetFieldControlFocused,\n} from \"../Field\";\nimport { Icon } from \"../Icon\";\nimport { type ShowClearButton } from \"../Input\";\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from \"../Popover\";\nimport { Spinner } from \"../Spinner\";\nimport { useIsInTableCell } from \"../Table\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\n/** Date-range using strings as dates. */\nexport interface StringRange {\n start: string;\n end: string;\n}\n\n/** Properties of the date-range input component. */\nexport interface DateRangeInputProps\n extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"defaultValue\"> {\n /**\n * Date-range input's style variant. Defaults to the default variant unless\n * when rendering inside a table cell (in which it defaults to `\"cell\"`).\n */\n variant?: ControlVariant;\n /** Sets the status of the date-range input. */\n status?: ControlStatus;\n /** Date-range input code. */\n code?: React.ReactNode;\n /** Default date-range value. */\n defaultValue?: DateRange | StringRange;\n /** Date-range value. */\n value?: DateRange | StringRange;\n /**\n * Function called whenever the value of the date-range input changes.\n *\n * @param valueRepresentations Different representations of the date-range\n * value.\n */\n onValueChange?: (valueRepresentations: DateRangeValueRepresentations) => void;\n /** Sets the control as required. */\n required?: boolean;\n /** Disables the control. */\n disabled?: boolean;\n /** Sets the control as read-only. */\n readOnly?: boolean;\n /** Minimum date allowed. */\n minDate?: string | Date | null;\n /** Maximum date allowed. */\n maxDate?: string | Date | null;\n /** Minimum month allowed. */\n minMonth?: string | Date | null;\n /** Maximum month allowed. */\n maxMonth?: string | Date | null;\n /** Minimum year allowed. */\n minYear?: number;\n /** Maximum year allowed. */\n maxYear?: number;\n /**\n * Adds a spinner to the start/end inputs to indicate activity. Note that it\n * doesn't automatically disable the input.\n *\n * @default false\n */\n loading?: boolean;\n /**\n * Adds a spinner to the start input to indicate activity. Note that it\n * doesn't automatically disable the input.\n *\n * @default loading\n */\n startLoading?: boolean;\n /**\n * Adds a spinner to the end input to indicate activity. Note that it doesn't\n * automatically disable the input.\n *\n * @default loading\n */\n endLoading?: boolean;\n /** Sets the inputs' text align. */\n align?: Responsive<React.CSSProperties[\"textAlign\"]>;\n /** Date-range input's start adornment. */\n startAdornment?: React.ReactNode;\n /** Date-range input's end adornment. */\n endAdornment?: React.ReactNode;\n /**\n * Whether to show buttons to clear the start/end inputs when they have\n * content.\n *\n * @default true\n */\n showClearButtons?: ShowClearButton;\n /** Label of the clear buttons announced to assistive technologies. */\n clearButtonsLabel?: string;\n /** `date-fns` locale to format dates and to be used by the date-range picker. */\n locale?: Locale;\n /**\n * Short format of the dates, as supported by\n * [`date-fns`](https://date-fns.org/docs/format), used for the written input\n * text.\n */\n shortFormat?: string;\n /**\n * Full format of the dates, as supported by\n * [`date-fns`](https://date-fns.org/docs/format), used to announce the dates\n * to assistive technologies.\n */\n fullFormat?: string;\n /** Description of the short format provided to assistive technologies. */\n formatDescription?: string;\n /**\n * Label announced to assistive technologies for the start input (so that the\n * user knows that they are interacting with the start input).\n */\n startInputLabel?: string;\n /**\n * Label announced to assistive technologies for the end input (so that the\n * user knows that they are interacting with the end input).\n */\n endInputLabel?: string;\n /**\n * Function that should return the label to provide to the button that opens\n * the input's calendar.\n *\n * @param selectedDateRange Currently selected date-range.\n * @param editable Whether the calendar is editable.\n */\n calendarButtonLabel?: (\n selectedDateRange: string | null,\n editable: boolean,\n ) => string;\n /** Placeholder for both start and end inputs. */\n placeholder?: string;\n /** Placeholder for the start input (defaults to `placeholder`). */\n startPlaceholder?: string;\n /** Placeholder for the end input (defaults to `placeholder`). */\n endPlaceholder?: string;\n /** Function called whenever the popover's open state changes. */\n onPopoverOpenChange?: (open: boolean, focusedInput: \"start\" | \"end\") => void;\n /**\n * Function called when the focus moves out of the control as a whole.\n *\n * This is useful when there is a need to know when the user stops interacting\n * with the control.\n */\n onBlurToOutside?: (event: React.FocusEvent) => void;\n /** Properties to pass to the code component. */\n codeProps?: React.ComponentPropsWithRef<typeof ControlCode>;\n /** Properties to pass to the popover anchor component. */\n popoverAnchorProps?: React.ComponentPropsWithRef<typeof PopoverAnchor>;\n /** Properties to pass to the start container element. */\n startContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the end container element. */\n endContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the input component representing the start date. */\n startInputProps?: React.ComponentPropsWithRef<\"input\">;\n /** Properties to pass to the input component representing the end date. */\n endInputProps?: React.ComponentPropsWithRef<\"input\">;\n /** Properties to pass to the button component that clears the start date. */\n startClearButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n /** Properties to pass to the button component that clears the end date. */\n endClearButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n /** Properties to pass to the date-range picker component. */\n dateRangePickerProps?: Omit<\n React.ComponentPropsWithRef<typeof DateRangePicker>,\n | \"value\"\n | \"defaultValue\"\n | \"minDate\"\n | \"maxDate\"\n | \"minMonth\"\n | \"maxMonth\"\n | \"minYear\"\n | \"maxYear\"\n | \"locale\"\n >;\n /** Properties to pass to the popover content component. */\n popoverContentProps?: React.ComponentPropsWithRef<typeof PopoverContent>;\n}\n\n/** Representations of the date-range value. */\nexport interface DateRangeValueRepresentations {\n /** Date-range value as formatted strings. */\n formattedValue: StringRange;\n /** Date-range value as dates. */\n dateValue: DateRange;\n}\n\n/**\n * The date-range input component displays two inputs used to allow a user to\n * specify a date interval with the aid of popover calendars. It is built on top\n * of the `Input`, `Popover`, and `DateRangePicker` components (and, by\n * extension, the browser's [`<input>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)).\n *\n * For accessibility purposes, date-range inputs are usually included within a\n * `Field` together with a `Label` and optionally `HelperText` and/or\n * `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { DateRangeInput } from \"@ostack.tech/ui\";\n *\n * function HolidayDates() {\n * return (\n * <DateRangeInput\n * startPlaceholder=\"Holiday start…\"\n * endPlaceholder=\"Holiday end…\"\n * />\n * );\n * }\n * ```\n */\nexport const DateRangeInput = React.forwardRef<\n React.ComponentRef<\"div\">,\n DateRangeInputProps\n>(function DateRangeInput(\n {\n variant,\n status,\n code,\n value: controlledValue,\n defaultValue,\n onValueChange,\n required,\n disabled = false,\n readOnly = false,\n minDate,\n maxDate,\n minMonth,\n maxMonth,\n minYear,\n maxYear,\n loading,\n startLoading = loading,\n endLoading = loading,\n align,\n startAdornment,\n endAdornment,\n showClearButtons = \"auto\",\n clearButtonsLabel,\n locale: dateFnsLocale,\n shortFormat,\n fullFormat,\n formatDescription,\n startInputLabel,\n endInputLabel,\n calendarButtonLabel,\n placeholder,\n startPlaceholder,\n endPlaceholder,\n className,\n onPopoverOpenChange,\n onBlurToOutside,\n codeProps,\n popoverAnchorProps,\n startContainerProps,\n endContainerProps,\n startInputProps,\n endInputProps,\n startClearButtonProps,\n endClearButtonProps,\n spinnerProps,\n dateRangePickerProps,\n popoverContentProps,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n clearButtonsLabel ??= locale.Input.clearButtonLabel;\n dateFnsLocale ??= locale.dateFnsLocale;\n placeholder ??= locale.DateInput.placeholder;\n formatDescription ??= locale.DateInput.formatDescription;\n startInputLabel ??= locale.DateRangeInput.startInputLabel;\n endInputLabel ??= locale.DateRangeInput.endInputLabel;\n calendarButtonLabel ??= locale.DateRangeInput.calendarButtonLabel;\n\n // Transform dates from/to strings\n const { format: formatDate, parse: parseDate } = useDateTransformer({\n locale: dateFnsLocale,\n shortFormat,\n fullFormat,\n });\n\n const dataTableColumnLabelId = useDataTableColumnLabelId();\n const labelId = useFieldLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const { controlId, codeId } = useSetFieldControl(\n startInputProps?.id,\n \"INPUT\",\n codeProps?.id,\n !!code,\n required,\n );\n const setFieldControlFocused = useSetFieldControlFocused();\n\n // Ids used for assistive technology announcements\n const generatedId = React.useId();\n const startInputLabelId =\n startInputLabel && prefix(`control-start-label-${generatedId}`);\n const endInputLabelId =\n endInputLabel && prefix(`control-end-label-${generatedId}`);\n const formatDescriptionId =\n formatDescription && prefix(`control-format-${generatedId}`);\n\n const isInTableCell = useIsInTableCell();\n variant ??= isInTableCell ? \"cell\" : \"default\";\n\n const [formattedValue, setFormattedValue] = useControllableState<StringRange>(\n defaultValue && (defaultValue.start === null || isDate(defaultValue.start))\n ? {\n start: formatDate(defaultValue.start),\n end: formatDate(defaultValue.end as Date | null),\n }\n : ((defaultValue as StringRange | undefined) ?? {\n start: \"\",\n end: \"\",\n }),\n controlledValue &&\n (controlledValue.start === null || isDate(controlledValue.start))\n ? {\n start: formatDate(controlledValue.start),\n end: formatDate(controlledValue.end as Date | null),\n }\n : (controlledValue as StringRange | undefined),\n );\n const dateValue = React.useMemo(\n () => ({\n start: parseDate(formattedValue.start),\n end: parseDate(formattedValue.end),\n }),\n [parseDate, formattedValue],\n );\n const deferredFormattedValue = React.useDeferredValue(formattedValue);\n const deferredDateValue = React.useMemo(\n () => ({\n start: parseDate(deferredFormattedValue.start),\n end: parseDate(deferredFormattedValue.end),\n }),\n [deferredFormattedValue.end, deferredFormattedValue.start, parseDate],\n );\n\n const [selectionMode, setSelectionMode] = React.useState<\"start\" | \"end\">(\n \"start\",\n );\n const [popoverState, setPopoverState] = React.useState({\n open: false,\n modal: false,\n });\n const startContainerRef = React.useRef<HTMLDivElement | null>(null);\n const endContainerRef = React.useRef<HTMLDivElement | null>(null);\n const startInputRef = React.useRef<HTMLInputElement | null>(null);\n const endInputRef = React.useRef<HTMLInputElement | null>(null);\n const startClearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const endClearButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const addonButtonRef = React.useRef<HTMLButtonElement | null>(null);\n const popoverRef = React.useRef<React.ComponentRef<\n typeof PopoverContent\n > | null>(null);\n const monthSelectMenuRef = React.useRef<HTMLDivElement | null>(null);\n const yearSelectMenuRef = React.useRef<HTMLDivElement | null>(null);\n\n // Change popover state while emitting an `onPopoverOpenChange` event as\n // appropriate\n const changePopoverState = React.useCallback(\n (state: { open: boolean; modal: boolean }) => {\n setPopoverState(state);\n if (popoverState.open !== state.open) {\n onPopoverOpenChange?.(state.open, selectionMode);\n }\n },\n [onPopoverOpenChange, popoverState.open, selectionMode],\n );\n\n // Month to display when opening the popover\n const monthToDisplay = React.useCallback(\n (input: \"start\" | \"end\") => {\n let toDisplay: Date;\n if (dateRangePickerProps?.defaultMonth) {\n toDisplay = dateRangePickerProps.defaultMonth;\n } else if (input === \"start\" && dateValue.start) {\n toDisplay = dateValue.start;\n } else {\n const relevantForEnd =\n dateValue.end &&\n addMonths(\n dateValue.end,\n -(dateRangePickerProps?.numberOfMonths ?? 2) + 1,\n );\n toDisplay = relevantForEnd ?? dateValue.start ?? new Date();\n }\n return startOfMonth(toDisplay);\n },\n [\n dateValue.end,\n dateValue.start,\n dateRangePickerProps?.defaultMonth,\n dateRangePickerProps?.numberOfMonths,\n ],\n );\n\n // Control the date picker's month in order to automatically set the\n // displayed month while manually entering a date on the input or when\n // focusing the inputs\n const [month, setMonth] = useControllableState(\n () => monthToDisplay(\"start\"),\n dateRangePickerProps?.month,\n );\n\n const dateIsVisible = React.useCallback(\n (date: Date) =>\n isWithinInterval(date, {\n start: month,\n end: lastDayOfMonth(\n addMonths(month, (dateRangePickerProps?.numberOfMonths ?? 2) - 1),\n ),\n }),\n [dateRangePickerProps?.numberOfMonths, month],\n );\n\n const handleMonthChange: MonthChangeEventHandler = combineEventHandlers(\n dateRangePickerProps?.onMonthChange,\n setMonth,\n );\n\n // Handle changes coming from an input\n const handleStartInputChange: React.ChangeEventHandler<HTMLInputElement> =\n React.useCallback(\n (evt) => {\n const formattedStart = evt.currentTarget.value;\n const dateStart = parseDate(formattedStart);\n const newFormattedValue = {\n start: formattedStart,\n end: formattedValue.end,\n };\n const newDateValue = { start: dateStart, end: dateValue.end };\n\n onValueChange?.({\n formattedValue: newFormattedValue,\n dateValue: newDateValue,\n });\n setFormattedValue(newFormattedValue);\n\n // Focus the month of the date that was inputted when it isn't visible\n if (!evt.defaultPrevented && dateStart && !dateIsVisible(dateStart)) {\n handleMonthChange(startOfMonth(dateStart));\n }\n },\n [\n dateIsVisible,\n dateValue.end,\n handleMonthChange,\n onValueChange,\n parseDate,\n setFormattedValue,\n formattedValue.end,\n ],\n );\n\n const handleEndInputChange: React.ChangeEventHandler<HTMLInputElement> =\n React.useCallback(\n (evt) => {\n const formattedEnd = evt.currentTarget.value;\n const dateEnd = parseDate(formattedEnd);\n const newFormattedValue = {\n start: formattedValue.start,\n end: formattedEnd,\n };\n const newDateValue = { start: dateValue.start, end: dateEnd };\n\n onValueChange?.({\n formattedValue: newFormattedValue,\n dateValue: newDateValue,\n });\n setFormattedValue(newFormattedValue);\n\n // Focus the month of the date that was inputted when it isn't visible\n if (!evt.defaultPrevented && dateEnd && !dateIsVisible(dateEnd)) {\n handleMonthChange(\n addMonths(\n startOfMonth(dateEnd),\n -(dateRangePickerProps?.numberOfMonths ?? 2) + 1,\n ),\n );\n }\n },\n [\n dateIsVisible,\n dateValue.start,\n dateRangePickerProps?.numberOfMonths,\n handleMonthChange,\n onValueChange,\n parseDate,\n setFormattedValue,\n formattedValue.start,\n ],\n );\n\n // Open the popover in non-modal mode when the input is focused\n const handleInputFocus: (\n input: \"start\" | \"end\",\n ) => React.FocusEventHandler<HTMLInputElement> = React.useCallback(\n (input) => (evt) => {\n setFieldControlFocused(true);\n setSelectionMode(input);\n if (!evt.defaultPrevented) {\n if (!popoverState.open) {\n handleMonthChange(monthToDisplay(input));\n }\n changePopoverState({ open: true, modal: false });\n }\n },\n [\n setFieldControlFocused,\n popoverState.open,\n changePopoverState,\n handleMonthChange,\n monthToDisplay,\n ],\n );\n\n // Handle clicks on clear input buttons\n const handleClearButtonClick = React.useCallback<\n (\n ref: React.MutableRefObject<HTMLInputElement | null>,\n ) => React.MouseEventHandler<HTMLButtonElement>\n >(\n (ref) => () => {\n if (ref.current) {\n setNativeValue(ref.current, \"\");\n ref.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n ref.current.focus();\n }\n },\n [],\n );\n\n // Focus input when the container is pressed\n const handleContainerPointerDown = React.useCallback(\n (input: \"start\" | \"end\") => (evt: React.MouseEvent) => {\n const target = evt.target as HTMLElement;\n const inputEl =\n input === \"start\" ? startInputRef.current : endInputRef.current;\n if (\n inputEl &&\n !disabled &&\n !target.closest(\"input, select, textarea, button, a\")\n ) {\n const cursorIdx = target.closest(`.${prefix(\"date-range-input\")} ~ *`)\n ? inputEl.value.length\n : 0;\n requestAnimationFrame(() => {\n try {\n // Fails for certain element/input types\n inputEl.setSelectionRange(cursorIdx, cursorIdx);\n } finally {\n inputEl.focus();\n }\n });\n }\n },\n [disabled, prefix],\n );\n\n // Open the popover in modal mode when clicking the addon button\n const handleAddonButtonClick = React.useCallback(() => {\n setSelectionMode(\"start\");\n handleMonthChange(monthToDisplay(\"start\"));\n changePopoverState({ open: true, modal: true });\n }, [handleMonthChange, monthToDisplay, changePopoverState]);\n\n // Handle changes coming from the date picker\n const handleDatePickerChange = React.useCallback(\n (range: DateRange) => {\n const newFormattedValue = {\n start: formatDate(range.start),\n end: formatDate(range.end),\n };\n onValueChange?.({ formattedValue: newFormattedValue, dateValue: range });\n setFormattedValue(newFormattedValue);\n\n if (selectionMode === \"start\") {\n setSelectionMode(\"end\");\n if (!popoverState.modal) {\n endInputRef.current?.focus();\n }\n } else {\n if (!range.start) {\n setSelectionMode(\"start\");\n if (!popoverState.modal) {\n startInputRef.current?.focus();\n }\n } else if (range.end) {\n // Close popup and focus addon button\n changePopoverState({ open: false, modal: false });\n addonButtonRef.current?.focus();\n }\n }\n },\n [\n changePopoverState,\n formatDate,\n onValueChange,\n popoverState.modal,\n selectionMode,\n setFormattedValue,\n ],\n );\n\n // Prevent focusing the popup when not in modal mode (since an input should\n // have focus instead)\n const handlePopoverOpenAutoFocus = React.useCallback(\n (evt: Event) => {\n if (!popoverState.modal) {\n evt.preventDefault();\n }\n },\n [popoverState.modal],\n );\n\n // Close popup in modal mode when interacting outside the popup or input\n const handlePopoverInteractOutside = React.useCallback(\n (evt: CustomEvent) => {\n if (\n !popoverState.modal &&\n startInputRef.current !== evt.target &&\n endInputRef.current !== evt.target\n ) {\n changePopoverState({ open: false, modal: false });\n }\n },\n [popoverState.modal, changePopoverState],\n );\n\n // Close the popup on `Escape` in modal mode\n const handlePopoverEscapeKeyDown = React.useCallback(() => {\n if (popoverState.modal) {\n changePopoverState({ open: false, modal: false });\n }\n }, [popoverState.modal, changePopoverState]);\n\n // Close the popup when clicking outside in modal mode (doing this during the\n // \"interact outside\" event instead breaks the focus trap)\n const handlePopoverPointerDownOutside = React.useCallback(() => {\n if (popoverState.modal) {\n changePopoverState({ open: false, modal: false });\n }\n }, [popoverState.modal, changePopoverState]);\n\n // Notify when the focus moves out of the control\n const handleControlBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n setFieldControlFocused(false);\n if (\n !evt.relatedTarget ||\n (!startInputRef.current?.contains(evt.relatedTarget) &&\n !endInputRef.current?.contains(evt.relatedTarget) &&\n !startClearButtonRef.current?.contains(evt.relatedTarget) &&\n !endClearButtonRef.current?.contains(evt.relatedTarget) &&\n !addonButtonRef.current?.contains(evt.relatedTarget) &&\n !popoverRef.current?.contains(evt.relatedTarget) &&\n !monthSelectMenuRef.current?.contains(evt.relatedTarget) &&\n !yearSelectMenuRef.current?.contains(evt.relatedTarget))\n ) {\n // Normalise formatted values when blurring to outside\n const formattedStartDateValue = formatDate(dateValue.start);\n const formattedEndDateValue = formatDate(dateValue.end);\n if (\n formattedStartDateValue !== formattedValue.start ||\n formattedEndDateValue !== formattedValue.end\n ) {\n const newFormattedValue = {\n start: formattedStartDateValue,\n end: formattedEndDateValue,\n };\n onValueChange?.({ formattedValue: newFormattedValue, dateValue });\n setFormattedValue(newFormattedValue);\n }\n\n onBlurToOutside?.(evt);\n }\n },\n [\n dateValue,\n formatDate,\n formattedValue.end,\n formattedValue.start,\n onBlurToOutside,\n onValueChange,\n setFieldControlFocused,\n setFormattedValue,\n ],\n );\n\n const hasStartClearButton =\n !disabled &&\n !startInputProps?.disabled &&\n !readOnly &&\n !startInputProps?.readOnly &&\n (showClearButtons === true ||\n (showClearButtons === \"auto\" && formattedValue.start !== \"\"));\n const hasEndClearButton =\n !disabled &&\n !endInputProps?.disabled &&\n !readOnly &&\n !endInputProps?.readOnly &&\n (showClearButtons === true ||\n (showClearButtons === \"auto\" && formattedValue.end !== \"\"));\n\n const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();\n const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(\n \"control\",\n { align },\n );\n\n // Localised date values to be announced by assistive technologies on the\n // button label\n const fullFormattedStart =\n dateValue.start && formatDate(dateValue.start, { width: \"full\" });\n const fullFormattedEnd =\n dateValue.end && formatDate(dateValue.end, { width: \"full\" });\n // TODO: Translate range?\n const fullFormattedValue =\n fullFormattedStart && fullFormattedEnd\n ? `${fullFormattedStart}–${fullFormattedEnd}`\n : fullFormattedStart || fullFormattedEnd;\n\n const combinedStartContainerRef = useCombinedRef(\n startContainerRef,\n startContainerProps?.ref,\n );\n const combinedStartInputRef = useCombinedRef(\n startInputRef,\n startInputProps?.ref,\n );\n const combinedStartClearButtonRef = useCombinedRef(\n startClearButtonRef,\n startClearButtonProps?.ref,\n );\n const combinedEndContainerRef = useCombinedRef(\n endContainerRef,\n endContainerProps?.ref,\n );\n const combinedEndInputRef = useCombinedRef(endInputRef, endInputProps?.ref);\n const combinedEndClearButtonRef = useCombinedRef(\n endClearButtonRef,\n endClearButtonProps?.ref,\n );\n const combinedPopoverRef = useCombinedRef(\n popoverRef,\n popoverContentProps?.ref,\n );\n return (\n <ClearContexts field={false}>\n <ControlContext.Provider value={{ variant, status, disabled, readOnly }}>\n <div\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n className={cx(prefix(\"date-range-input__root\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {startInputLabel && (\n <VisuallyHidden id={startInputLabelId}>\n {startInputLabel}\n </VisuallyHidden>\n )}\n {endInputLabel && (\n <VisuallyHidden id={endInputLabelId}>\n {endInputLabel}\n </VisuallyHidden>\n )}\n {/* Description of the date format for assistive technologies */}\n {formatDescription && (\n <VisuallyHidden id={formatDescriptionId}>\n {formatDescription}\n </VisuallyHidden>\n )}\n {code && (\n <ControlCode\n {...codeProps}\n id={codeId}\n className={cx(\n prefix(\"date-range-input__code\"),\n codeProps?.className,\n )}\n >\n {code}\n </ControlCode>\n )}\n <Popover open={popoverState.open} modal={popoverState.modal}>\n <PopoverAnchor\n {...popoverAnchorProps}\n className={cx(\n prefix(\"date-range-input__container\"),\n prefix(\"date-range-input__popover-anchor\"),\n popoverAnchorProps?.className,\n )}\n >\n {startAdornment}\n\n {/* Start container */}\n <div\n data-focused={boolDataAttr(\n !disabled &&\n !startInputProps?.disabled &&\n popoverState.open &&\n selectionMode === \"start\",\n )}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n data-disabled={boolDataAttr(\n disabled ||\n (startInputProps?.disabled && endInputProps?.disabled),\n )}\n data-readonly={boolDataAttr(\n readOnly ||\n (startInputProps?.readOnly && endInputProps?.readOnly),\n )}\n {...startContainerProps}\n className={cx(\n prefix(\"date-range-input__container\"),\n prefix(\"date-range-input__container--start\"),\n startContainerProps?.className,\n )}\n onPointerDown={combineEventHandlers(\n startContainerProps?.onPointerDown,\n handleContainerPointerDown(\"start\"),\n )}\n ref={combinedStartContainerRef}\n >\n {/* Start input */}\n <input\n {...startInputProps}\n id={controlId}\n data-status={status}\n data-variant={variant}\n className={cx(\n prefix(\"date-range-input\"),\n prefix(\"date-range-input--start\"),\n startInputProps?.className,\n )}\n value={formattedValue.start}\n placeholder={\n startInputProps?.placeholder ??\n startPlaceholder ??\n placeholder\n }\n required={required || startInputProps?.required}\n disabled={disabled || startInputProps?.disabled}\n readOnly={readOnly || startInputProps?.readOnly}\n onChange={combineEventHandlers(\n startInputProps?.onChange,\n handleStartInputChange,\n )}\n onFocus={combineEventHandlers(\n startInputProps?.onFocus,\n handleInputFocus(\"start\"),\n )}\n onBlur={combineEventHandlers(\n startInputProps?.onBlur,\n handleControlBlur,\n )}\n style={{ ...cssVars, ...startInputProps?.style }}\n {...dataAttrs}\n aria-invalid={status === \"invalid\" ? \"true\" : undefined}\n aria-labelledby={mergeAriaIds(\n dataTableColumnLabelId,\n labelId,\n startInputLabelId,\n startInputProps?.[\"aria-labelledby\"],\n )}\n aria-describedby={mergeAriaIds(\n codeId,\n errorMessageIds,\n descriptionIds,\n formatDescriptionId,\n startInputProps?.[\"aria-describedby\"],\n )}\n ref={combinedStartInputRef}\n />\n\n {/* Start clear button */}\n {hasStartClearButton && (\n <CloseButton\n size=\"sm\"\n aria-label={clearButtonsLabel}\n tabIndex={-1}\n {...startClearButtonProps}\n className={cx(\n prefix(\"date-range-input__clear-button\"),\n prefix(\"date-range-input__clear-button--start\"),\n startClearButtonProps?.className,\n )}\n onClick={combineEventHandlers(\n startClearButtonProps?.onClick,\n handleClearButtonClick(startInputRef),\n { checkDefaultPrevented: true },\n )}\n ref={combinedStartClearButtonRef}\n />\n )}\n\n {/* Start spinner */}\n {startLoading && (\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(\n disabled || startInputProps?.disabled,\n )}\n {...spinnerProps}\n className={cx(\n prefix(\"date-range-input__spinner\"),\n prefix(\"date-range-input__spinner--start\"),\n spinnerProps?.className,\n )}\n />\n )}\n </div>\n\n {/* Right arrow */}\n <ControlAddon className={cx(prefix(\"date-range-input__arrow\"))}>\n <Icon icon={faArrowRight} />\n </ControlAddon>\n\n {/* End container */}\n <div\n data-focused={boolDataAttr(\n !disabled &&\n !endInputProps?.disabled &&\n popoverState.open &&\n selectionMode === \"end\",\n )}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n data-disabled={boolDataAttr(\n disabled ||\n (startInputProps?.disabled && endInputProps?.disabled),\n )}\n data-readonly={boolDataAttr(\n readOnly ||\n (startInputProps?.readOnly && endInputProps?.readOnly),\n )}\n {...endContainerProps}\n className={cx(\n prefix(\"date-range-input__container\"),\n prefix(\"date-range-input__container--end\"),\n endContainerProps?.className,\n )}\n onPointerDown={combineEventHandlers(\n endContainerProps?.onPointerDown,\n handleContainerPointerDown(\"end\"),\n )}\n ref={combinedEndContainerRef}\n >\n {/* End input */}\n <input\n {...endInputProps}\n data-status={status}\n data-variant={variant}\n className={cx(\n prefix(\"date-range-input\"),\n prefix(\"date-range-input--end\"),\n endInputProps?.className,\n )}\n value={formattedValue.end}\n placeholder={\n endInputProps?.placeholder ?? endPlaceholder ?? placeholder\n }\n required={required || endInputProps?.required}\n disabled={disabled || endInputProps?.disabled}\n readOnly={readOnly || endInputProps?.readOnly}\n onChange={combineEventHandlers(\n endInputProps?.onChange,\n handleEndInputChange,\n )}\n onFocus={combineEventHandlers(\n endInputProps?.onFocus,\n handleInputFocus(\"end\"),\n )}\n onBlur={combineEventHandlers(\n endInputProps?.onBlur,\n handleControlBlur,\n )}\n style={{ ...cssVars, ...endInputProps?.style }}\n {...dataAttrs}\n aria-invalid={status === \"invalid\" ? \"true\" : undefined}\n aria-labelledby={mergeAriaIds(\n dataTableColumnLabelId,\n labelId,\n endInputLabelId,\n endInputProps?.[\"aria-labelledby\"],\n )}\n aria-describedby={mergeAriaIds(\n codeId,\n errorMessageIds,\n descriptionIds,\n formatDescriptionId,\n endInputProps?.[\"aria-describedby\"],\n )}\n ref={combinedEndInputRef}\n />\n\n {/* End clear button */}\n {hasEndClearButton && (\n <CloseButton\n size=\"sm\"\n aria-label={clearButtonsLabel}\n tabIndex={-1}\n {...endClearButtonProps}\n className={cx(\n prefix(\"date-range-input__clear-button\"),\n prefix(\"date-range-input__clear-button--end\"),\n endClearButtonProps?.className,\n )}\n onClick={combineEventHandlers(\n endClearButtonProps?.onClick,\n handleClearButtonClick(endInputRef),\n { checkDefaultPrevented: true },\n )}\n ref={combinedEndClearButtonRef}\n />\n )}\n\n {/* End spinner */}\n {endLoading && (\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(\n disabled || endInputProps?.disabled,\n )}\n {...spinnerProps}\n className={cx(\n prefix(\"date-range-input__spinner\"),\n prefix(\"date-range-input__spinner--end\"),\n spinnerProps?.className,\n )}\n />\n )}\n </div>\n\n {endAdornment}\n\n {/* Addon button */}\n <ControlAddon asChild>\n <PopoverTrigger>\n <button\n aria-label={calendarButtonLabel?.(\n fullFormattedValue,\n !disabled && !readOnly,\n )}\n onClick={handleAddonButtonClick}\n onBlur={handleControlBlur}\n data-state={undefined}\n className={cx(prefix(\"date-range-input__calendar-button\"))}\n ref={addonButtonRef}\n >\n <Icon icon={faCalendar} />\n </button>\n </PopoverTrigger>\n </ControlAddon>\n </PopoverAnchor>\n\n <PopoverContent\n {...popoverContentProps}\n className={cx(\n prefix(\"date-range-input__popover\"),\n popoverContentProps?.className,\n )}\n side={popoverContentProps?.side ?? \"bottom\"}\n sideOffset={popoverContentProps?.sideOffset ?? 5}\n showArrow={popoverContentProps?.showArrow ?? false}\n onOpenAutoFocus={combineEventHandlers(\n popoverContentProps?.onOpenAutoFocus,\n handlePopoverOpenAutoFocus,\n )}\n onEscapeKeyDown={combineEventHandlers(\n popoverContentProps?.onEscapeKeyDown,\n handlePopoverEscapeKeyDown,\n )}\n onPointerDownOutside={combineEventHandlers(\n popoverContentProps?.onPointerDownOutside,\n handlePopoverPointerDownOutside,\n )}\n onInteractOutside={combineEventHandlers(\n popoverContentProps?.onInteractOutside,\n handlePopoverInteractOutside,\n )}\n onBlur={combineEventHandlers(\n popoverContentProps?.onBlur,\n handleControlBlur,\n )}\n ref={combinedPopoverRef}\n >\n <DateRangePicker\n className={cx(\n prefix(\"date-range-input__picker\"),\n dateRangePickerProps?.className,\n )}\n {...dateRangePickerProps}\n value={deferredDateValue}\n onChange={combineEventHandlers(\n dateRangePickerProps?.onChange,\n handleDatePickerChange,\n )}\n selectionMode={selectionMode}\n month={month}\n onMonthChange={handleMonthChange}\n disabled={\n disabled ||\n readOnly ||\n ((startInputProps?.disabled || startInputProps?.readOnly) &&\n (endInputProps?.disabled || endInputProps?.readOnly)) ||\n dateRangePickerProps?.disabled\n }\n minDate={minDate}\n maxDate={maxDate}\n minMonth={minMonth}\n maxMonth={maxMonth}\n minYear={minYear}\n maxYear={maxYear}\n locale={dateFnsLocale}\n monthSelectProps={{\n ...dateRangePickerProps?.monthSelectProps,\n popoverProps: {\n ...dateRangePickerProps?.monthSelectProps?.popoverProps,\n ref: monthSelectMenuRef,\n },\n }}\n yearSelectProps={{\n ...dateRangePickerProps?.yearSelectProps,\n popoverProps: {\n ...dateRangePickerProps?.yearSelectProps?.popoverProps,\n ref: yearSelectMenuRef,\n },\n }}\n />\n </PopoverContent>\n </Popover>\n </div>\n </ControlContext.Provider>\n </ClearContexts>\n );\n});\n","/**\n * Non-cryptographically secure string hashing function.\n *\n * @param str String to hash.\n * @returns Hash of the string.\n */\nexport function stringHash(str: string): number {\n let hash = 2166136261;\n for (let i = 0, l = str.length; i < l; ++i) {\n hash ^= str.charCodeAt(i);\n hash = Math.imul(hash, 16777619);\n }\n return hash >>> 0;\n}\n","import type * as React from \"react\";\n\nimport { stringHash } from \"../../utils/stringHash.ts\";\n\n/** Error report. */\nexport interface ErrorReport {\n /** Hash of the error information, providing a unique identifier for the error. */\n digest: string;\n /** Error message. */\n message: string;\n /** Error stack, when available. */\n stack: string | null;\n /**\n * Component error stack (React component tree of where the error occurred),\n * when available.\n */\n componentStack: string | null;\n /** Timestamp of when the error occurred. */\n timestamp: Date;\n /**\n * Browser's user agent.\n *\n * **NOTE**: This could also be obtained from the `User-Agent` header of the\n * HTTP request. However, it is included here since it is possible for the\n * reporting to go through a proxy, which is free to alter the HTTP header.\n */\n userAgent: string;\n /** URL where the error occurred. */\n url: string;\n}\n\n/**\n * Builds the error report.\n *\n * @param error Error that occurred.\n * @param info Optional React error information.\n * @returns Error report.\n */\nexport function buildErrorReport(\n error: unknown,\n info?: React.ErrorInfo,\n): ErrorReport {\n const message =\n error instanceof Error ? `${error.name}: ${error.message}` : String(error);\n const stack = error instanceof Error ? (error.stack ?? null) : null;\n const componentStack = info?.componentStack ?? null;\n const digest = stringHash(\n message + (stack ?? \"\") + (componentStack ?? \"\"),\n ).toString(16);\n const timestamp = new Date();\n const userAgent = navigator.userAgent;\n const url = location.href;\n\n return { digest, message, stack, componentStack, timestamp, userAgent, url };\n}\n","import * as React from \"react\";\n\n/** Value of the error reporting context. */\nexport interface ErrorReportingContextValue {\n onError: (error: Error, info?: React.ErrorInfo) => void;\n}\n\n/** Error reporting context. */\nexport const ErrorReportingContext =\n React.createContext<ErrorReportingContextValue | null>(null);\n","import * as React from \"react\";\n\nimport { useLatestValues } from \"../../utils/useLatestValues.ts\";\nimport { buildErrorReport, type ErrorReport } from \"./ErrorReport.ts\";\nimport { ErrorReportingContext } from \"./ErrorReportingContext.ts\";\n\n/** Properties of the error reporting provider. */\nexport interface ErrorReportingProviderProps {\n /**\n * Whether error reporting is enabled. By default, error reporting is only\n * enabled in production.\n */\n enabled?: boolean;\n /**\n * Function used to report an error. This function completely overrides the\n * default error reporting and, as such, properties related to error reporting\n * such as the `errorReportingUrl` are ignored.\n *\n * The default `reportError` function uses `fetch` with the remaining\n * properties such as `errorReportingUrl` to perform the reporting.\n *\n * @param report Error report that should be reported.\n */\n reportError?: (report: ErrorReport) => void | Promise<void>;\n /**\n * URL to report the error to when using the default `reportError` function.\n *\n * This property is ignored when a custom `reportError` is provided.\n */\n errorReportingUrl?: string | URL;\n /**\n * Method to use when reporting the error.\n *\n * This property is ignored when a custom `reportError` is provided.\n *\n * @default POST\n */\n errorReportingMethod?: string;\n /**\n * Function used to encode the error report.\n *\n * By default, the report is encoded into JSON via `JSON.stringify`.\n *\n * This property is ignored when a custom `reportError` is provided.\n *\n * @param report Report to encode.\n */\n encodeErrorReport?: (report: ErrorReport) => BodyInit;\n /**\n * MIME type of the error report encoding.\n *\n * This property is ignored when a custom `reportError` is provided.\n *\n * @default application/json\n */\n encodedErrorReportMimeType?: string;\n /**\n * Options to provide to the `fetch` call when reporting an error, such as\n * headers or others. By default, the request is a `POST` with JSON\n * content-type.\n *\n * This property is ignored when a custom `reportError` is provided.\n */\n errorReportingOptions?: Omit<RequestInit, \"method\" | \"body\">;\n children?: React.ReactNode;\n}\n\n/**\n * Provider used to report errors caught in error boundaries throughout the\n * application.\n *\n * Note that this provider does **not** automatically set an error boundary, so\n * at least one should be manually set.\n */\nexport function ErrorReportingProvider({\n enabled = process.env.NODE_ENV === \"production\",\n reportError,\n errorReportingUrl,\n errorReportingMethod = \"POST\",\n encodeErrorReport = defaultEncodeErrorReport,\n encodedErrorReportMimeType = \"application/json\",\n errorReportingOptions,\n children,\n}: ErrorReportingProviderProps) {\n reportError ??=\n errorReportingUrl == null\n ? undefined\n : async (info: ErrorReport) => {\n await fetch(errorReportingUrl, {\n ...errorReportingOptions,\n method: errorReportingMethod,\n body: encodeErrorReport(info),\n headers: {\n \"Content-Type\": encodedErrorReportMimeType,\n ...errorReportingOptions?.headers,\n },\n });\n };\n\n const latest = useLatestValues({ enabled, reportError: reportError });\n const handledErrors = React.useRef<Set<string>>(null);\n const handleError = React.useCallback(\n async (error: unknown, info?: React.ErrorInfo) => {\n if (!latest.reportError || !latest.enabled) {\n return;\n }\n\n const errorInfo = buildErrorReport(error, info);\n if (!handledErrors.current?.has(errorInfo.digest)) {\n (handledErrors.current ??= new Set()).add(errorInfo.digest);\n try {\n await latest.reportError(errorInfo);\n } catch {\n handledErrors.current.delete(errorInfo.digest);\n }\n }\n },\n [latest],\n );\n\n return (\n <ErrorReportingContext.Provider value={{ onError: handleError }}>\n {children}\n </ErrorReportingContext.Provider>\n );\n}\n\n/** Default function used to encode the error report. */\nfunction defaultEncodeErrorReport(errorReport: ErrorReport): string {\n return JSON.stringify(\n errorReport,\n null,\n process.env.NODE_ENV === \"production\" ? 0 : 2,\n );\n}\n","import * as React from \"react\";\n\nimport { ErrorReportingContext } from \"./ErrorReportingContext.ts\";\n\n/** Hook used to report an error. */\nexport function useErrorReporter() {\n const context = React.useContext(ErrorReportingContext);\n if (context == null) {\n throw new Error(\"Error reporting context not in scope.\");\n }\n return context.onError;\n}\n","import {\n faCircleCheck,\n faCircleExclamation,\n faCircleInfo,\n faTriangleExclamation,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CloseButton } from \"../CloseButton\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../Collapsible\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { LinkContext } from \"../Link/LinkContext.ts\";\n\n/** Alert variants. */\nexport type AlertVariant = \"solid\" | \"subtle\" | \"outlined\";\n\n/** Alert severities. */\nexport type AlertSeverity =\n | \"neutral\"\n | \"info\"\n | \"success\"\n | \"danger\"\n | \"warning\";\n\n/** Properties of the alert component. */\nexport interface AlertProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Alert variant.\n *\n * @default subtle\n */\n variant?: AlertVariant;\n /**\n * Sets the alert's severity.\n *\n * @default info\n */\n severity?: AlertSeverity;\n /** Alert action. */\n action?: React.ReactNode;\n /**\n * Whether the alert should be open by default.\n *\n * @default true\n */\n defaultOpen?: boolean;\n /**\n * Property controlling whether the alert should be open. Use together with\n * `onOpenChange` to control the alert's open state.\n */\n open?: boolean;\n /** Function called when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n /**\n * Icon to show. The default icon is `faCircleInfo`. Each severity except\n * `\"neutral\"` has its own default icon.\n */\n icon?: IconProp | null;\n /**\n * Whether to show a close button.\n *\n * @default false\n */\n showCloseButton?: boolean;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<typeof CollapsibleContent>;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the content component. */\n contentProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the component containing the action/close button. */\n actionContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the close button component. */\n closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n}\n\n/** Default icon associated with each severity. */\nconst SEVERITY_ICON: Record<AlertSeverity, IconProp | null> = {\n neutral: null,\n info: faCircleInfo,\n success: faCircleCheck,\n danger: faCircleExclamation,\n warning: faTriangleExclamation,\n};\n\n/**\n * The alert component can be used to attract the user's attentions.\n *\n * It has the following subcomponent:\n *\n * - `AlertTitle`: Title of the alert.\n *\n * Example usage:\n *\n * ```tsx\n * import { Alert, AlertTitle } from \"@ostack.tech/ui\";\n *\n * function TermAndConditionsNotice {\n * return (\n * <Alert>\n * <AlertTitle>Notice</AlertTitle>\n * Terms and conditions may apply.\n * </Alert>\n * );\n * }\n * ```\n */\nexport const Alert = React.forwardRef<React.ComponentRef<\"div\">, AlertProps>(\n function Alert(\n {\n variant = \"subtle\",\n severity = \"info\",\n defaultOpen = true,\n open,\n onOpenChange,\n icon = SEVERITY_ICON[severity], // TODO[NG] maybe improve docs here\n showCloseButton,\n action,\n containerProps,\n iconProps,\n contentProps,\n actionContainerProps,\n closeButtonProps,\n children,\n className,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const accent = severity === \"info\" ? \"primary\" : severity;\n return (\n <Collapsible\n defaultOpen={defaultOpen}\n open={open}\n onOpenChange={onOpenChange}\n asChild\n >\n <CollapsibleContent\n {...containerProps}\n className={cx(prefix(\"alert__container\"), containerProps?.className)}\n >\n <LinkContext.Provider\n value={{ defaultColor: accent, defaultVariant: \"alert\" }}\n >\n <div\n className={cx(\n prefix(\"alert\"),\n prefix(`alert--${variant}`),\n className,\n )}\n data-accent={accent}\n role=\"alert\"\n {...otherProps}\n ref={forwardedRef}\n >\n {icon && (\n <Icon\n size=\"lg\"\n {...iconProps}\n className={cx(prefix(\"alert__icon\"), iconProps?.className)}\n icon={icon}\n />\n )}\n <div\n {...contentProps}\n className={cx(\n prefix(\"alert__content\"),\n contentProps?.className,\n )}\n >\n {children}\n </div>\n {(action || showCloseButton) && (\n <div\n {...actionContainerProps}\n className={cx(\n prefix(\"alert__action-container\"),\n actionContainerProps?.className,\n )}\n >\n {action}\n {showCloseButton && (\n <CollapsibleTrigger>\n <CloseButton\n color={variant === \"solid\" ? \"neutral\" : accent}\n {...closeButtonProps}\n className={cx(\n prefix(\"alert__close-button\"),\n closeButtonProps?.className,\n )}\n />\n </CollapsibleTrigger>\n )}\n </div>\n )}\n </div>\n </LinkContext.Provider>\n </CollapsibleContent>\n </Collapsible>\n );\n },\n);\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the alert title component. */\nexport interface AlertTitleProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Title of the alert. */\nexport const AlertTitle = React.forwardRef<\n React.ComponentRef<\"div\">,\n AlertTitleProps\n>(function AlertTitle({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"alert__title\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type AccentColor } from \"../../utils/accent.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Code colours. */\nexport type CodeColor = AccentColor;\n\n/** Properties of the code component. */\nexport interface CodeProps extends React.ComponentPropsWithoutRef<\"code\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Code colour.\n *\n * @default neutral\n */\n color?: CodeColor;\n}\n\n/**\n * Component used to display inline snippets of code. It is built on top of the\n * browser's [`<code>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/code).\n *\n * Example usage:\n *\n * ```tsx\n * import { Code } from \"@ostack.tech/ui\";\n *\n * function RoundingCodeSnippet() {\n * return <Code>Math.round(1.23)</Code>;\n * }\n * ```\n */\nexport const Code = React.forwardRef<React.ComponentRef<\"code\">, CodeProps>(\n function Code(\n { asChild, color = \"neutral\", className, ...otherProps },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"code\";\n return (\n <As\n className={cx(prefix(\"code\"), className)}\n role={asChild ? \"code\" : undefined}\n data-accent={color}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n },\n);\n","import { faRedo } from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\nimport { ErrorBoundary as ReactErrorBoundary } from \"react-error-boundary\";\n\nimport { useErrorReporter } from \"../../providers/ErrorReportingProvider\";\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { Alert, AlertTitle } from \"../Alert\";\nimport { Code } from \"../Code\";\nimport { IconButton } from \"../IconButton\";\n\n/** Properties provided to the fallback element. */\nexport interface FallbackProps {\n /** Error that occurred. */\n error: any;\n /**\n * Function which, when called, rerenders the boundary `children`.\n *\n * @param args Arguments passed to the `onReset` callback.\n */\n resetErrorBoundary: (...args: unknown[]) => void;\n}\n\n/** Properties of the error boundary component. */\nexport interface ErrorBoundaryProps\n extends Pick<\n React.ComponentPropsWithoutRef<typeof ReactErrorBoundary>,\n \"resetKeys\" | \"onError\" | \"onReset\"\n > {\n /**\n * Fallback component to render in the event of an error while rendering\n * `children`.\n *\n * This component completely replaces the default fallback and, as such, when\n * provided, other properties related to the default `Alert` fallback such as\n * `showError`, `fallbackTitle`, and `fallbackMessage` are ignored.\n *\n * By default, a “danger” `Alert` is displayed with a message (specified via\n * `fallbackMessage`) or the error that occurred when `showError` is set.\n */\n fallback?:\n | React.ReactNode\n | React.ComponentType<FallbackProps>\n | ((props: FallbackProps) => React.ReactNode);\n /**\n * Whether to show the error that occurred in the default fallback `Alert`.\n *\n * By default, the error is shown only when not in production mode.\n */\n showError?: boolean;\n /**\n * Whether to show a button to reset the error boundary in the default\n * fallback `Alert`.\n *\n * @default true\n */\n showResetButton?: boolean;\n /**\n * Title to display in the default fallback `Alert` component in the event of\n * an error occurring while rendering `children`. This property is ignored if\n * `fallback` is provided or if `showError` is set.\n *\n * By default, the locale's message is used.\n */\n fallbackTitle?: React.ReactNode | ((error?: unknown) => React.ReactNode);\n /**\n * Message to display in the default fallback `Alert` component in the event\n * of an error occurring while rendering `children`. This property is ignored\n * if `fallback` is provided or if `showError` is set.\n *\n * By default, the locale's message is used.\n */\n fallbackMessage?: React.ReactNode | ((error?: unknown) => React.ReactNode);\n /**\n * Label of the button used to reset the error boundary.\n *\n * By default, the locale's label is used.\n */\n resetButtonLabel?: React.ReactNode;\n /** Properties to pass to the default fallback `Alert` component. */\n fallbackProps?: React.ComponentPropsWithRef<typeof Alert>;\n /**\n * Properties to pass to the `IconButton` component used to reset the error\n * boundary.\n */\n resetButtonProps?: React.ComponentPropsWithRef<typeof IconButton>;\n children?: React.ReactNode;\n}\n\n/**\n * Generic error boundary which, by default, when an error occurs while\n * rendering `children`, displays an `Alert` with a generic message, together\n * with the error itself when in development mode.\n *\n * You can provide an alternative fallback component via the `fallback` property\n * or simply an alternative fallback message via the `fallbackMessage`\n * property.\n *\n * Example usage:\n *\n * ```tsx\n * import { ErrorBoundary } from \"@ostack.tech/ui\";\n *\n * function ProtectedApp() {\n * return (\n * <ErrorBoundary>\n * <App />\n * </ErrorBoundary>\n * );\n * }\n * ```\n */\nexport const ErrorBoundary = React.forwardRef<\n React.ComponentRef<typeof ReactErrorBoundary>,\n ErrorBoundaryProps\n>(function ErrorBoundary(\n {\n fallback,\n showError = process.env.NODE_ENV !== \"production\",\n showResetButton = true,\n fallbackTitle,\n fallbackMessage,\n onError,\n resetButtonLabel,\n fallbackProps,\n resetButtonProps,\n ...otherProps\n },\n forwardedRef,\n) {\n const locale = useLocale();\n const reportError = useErrorReporter();\n\n fallbackTitle ??= locale.ErrorBoundary.fallbackTitle;\n fallbackMessage ??= locale.ErrorBoundary.fallbackMessage;\n resetButtonLabel ??= locale.ErrorBoundary.resetButtonLabel;\n fallback ??= ({ error, resetErrorBoundary }: FallbackProps) => (\n <Alert\n severity=\"danger\"\n {...fallbackProps}\n action={\n showResetButton && (\n <IconButton\n variant=\"ghost\"\n color=\"danger\"\n icon={faRedo}\n {...resetButtonProps}\n label={resetButtonLabel}\n onClick={combineEventHandlers(\n resetButtonProps?.onClick,\n resetErrorBoundary,\n { checkDefaultPrevented: true },\n )}\n />\n )\n }\n >\n {(!showError || !(error instanceof Error)) && (\n <>\n {fallbackTitle && (\n <AlertTitle>\n {typeof fallbackTitle === \"function\"\n ? fallbackTitle(error)\n : fallbackTitle}\n </AlertTitle>\n )}\n {typeof fallbackMessage === \"function\"\n ? fallbackMessage(error)\n : fallbackMessage}\n </>\n )}\n\n {showError && error instanceof Error && (\n <>\n <AlertTitle>{error.name}</AlertTitle>\n {error.message}\n <pre>\n <Code color=\"danger\">{error.stack}</Code>\n </pre>\n </>\n )}\n </Alert>\n );\n\n const fallbackProp = React.isValidElement(fallback)\n ? { FallbackComponent: fallback }\n : typeof fallback === \"function\"\n ? { fallbackRender: fallback }\n : { fallback };\n\n return (\n <ReactErrorBoundary\n {...(fallbackProp as any)}\n {...otherProps}\n onError={combineEventHandlers(reportError, onError)}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\n/** Context present within a feedback list. */\nexport const FeedbackListContext = React.createContext(false);\n\n/** Hook exposing whether a component is being rendered within a feedback list. */\nexport function useIsInFeedbackList(): boolean {\n return React.useContext(FeedbackListContext);\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { FeedbackListContext } from \"./FeedbackListContext.ts\";\n\n/** Properties of the feedback list component. */\nexport interface FeedbackListProps\n extends React.ComponentPropsWithoutRef<\"ul\"> {}\n\n/** Component used to provide a list of feedbacks to a form control. */\nexport const FeedbackList = React.forwardRef<\n React.ComponentRef<\"ul\">,\n FeedbackListProps\n>(function FeedbackList({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <FeedbackListContext.Provider value={true}>\n <ul\n className={cx(prefix(\"feedback-list\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n </FeedbackListContext.Provider>\n );\n});\n","import * as React from \"react\";\n\nimport { type FeedbackType } from \"../Feedback\";\n\n/** Value of the feedback popover context. */\nexport interface FeedbackPopoverContextValue {\n onAddFeedback: (type: FeedbackType) => void;\n onRemoveFeedback: (type: FeedbackType) => void;\n}\n\n/** Feedback popover context. */\nexport const FeedbackPopoverContext =\n React.createContext<FeedbackPopoverContextValue | null>(null);\n\n/** Hook providing access to the feedback popover context. */\nexport function useFeedbackPopoverContext(): FeedbackPopoverContextValue | null {\n return React.useContext(FeedbackPopoverContext);\n}\n","import { type IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n faCircleCheck,\n faCircleExclamation,\n faTriangleExclamation,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { type ControlVariant } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { type FeedbackType } from \"../Feedback\";\nimport { useFieldControlFocused } from \"../Field\";\nimport { IconButton, type IconButtonSize } from \"../IconButton\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport { useIsInTableCell } from \"../Table\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { FeedbackPopoverContext } from \"./FeedbackPopoverContext.ts\";\n\n/** Properties of the feedback popover component. */\nexport interface FeedbackPopoverProps\n extends React.ComponentPropsWithoutRef<typeof PopoverContent> {\n /** Default open state of the feedback popover. */\n defaultOpen?: boolean;\n /** Controlled open state of the feedback popover. */\n open?: boolean;\n /**\n * Function called whenever the open state of the feedback popover changes.\n *\n * @param open New open state.\n */\n onOpenChange?: (open: boolean) => void;\n /** Whether to display the popover in modal mode. */\n modal?: boolean;\n /** Size of the icon button. */\n size?: IconButtonSize;\n /** Icon to show. Each feedback type has its own default icon. */\n icon?: IconProp;\n /** Label of the feedback popover button. */\n label?: React.ReactNode;\n /** Properties to pass to the element containing the button. */\n buttonContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the `IconButton` component. */\n iconButtonProps?: Omit<\n React.ComponentPropsWithRef<typeof IconButton>,\n \"size\" | \"icon\" | \"label\"\n >;\n}\n\n/** Default icon associated with each type of feedback. */\nconst FEEDBACK_ICON: Record<FeedbackType, IconProp> = {\n success: faCircleCheck,\n error: faCircleExclamation,\n warning: faTriangleExclamation,\n};\n\n/**\n * Component used to provide feedback to a form control, where the feedback is\n * displayed within a popover.\n */\nexport const FeedbackPopover = React.forwardRef<\n React.ComponentRef<typeof PopoverContent>,\n FeedbackPopoverProps\n>(function FeedbackPopover(\n {\n defaultOpen,\n open,\n onOpenChange,\n modal,\n icon,\n size,\n onOpenAutoFocus,\n label,\n buttonContainerProps,\n iconButtonProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n label ??= locale.FeedbackPopover.label;\n\n const variant: ControlVariant = useIsInTableCell() ? \"cell\" : \"default\";\n\n const [feedbacksCount, setFeedbacksCount] = React.useState({\n success: 0,\n error: 0,\n warning: 0,\n });\n const hasFeedback =\n feedbacksCount.success > 0 ||\n feedbacksCount.error > 0 ||\n feedbacksCount.warning > 0;\n const dominantFeedbackType =\n feedbacksCount.error > 0\n ? \"error\"\n : feedbacksCount.warning > 0\n ? \"warning\"\n : \"success\";\n icon ??= FEEDBACK_ICON[dominantFeedbackType];\n\n const handleAddFeedback = React.useCallback((type: FeedbackType) => {\n setFeedbacksCount(\n ({ [type]: count, ...otherCounts }) =>\n ({\n [type]: count + 1,\n ...otherCounts,\n }) as Record<FeedbackType, number>,\n );\n }, []);\n const handleRemoveFeedback = React.useCallback((type: FeedbackType) => {\n setFeedbacksCount(\n ({ [type]: count, ...otherCounts }) =>\n ({\n [type]: count - 1,\n ...otherCounts,\n }) as Record<FeedbackType, number>,\n );\n }, []);\n\n const controlFocused = useFieldControlFocused();\n const handleOpenAutoFocus = React.useCallback(\n (evt: Event) => {\n if (controlFocused) {\n evt.preventDefault();\n }\n },\n [controlFocused],\n );\n const inField = controlFocused !== undefined;\n const accent =\n dominantFeedbackType === \"error\" ? \"danger\" : dominantFeedbackType;\n\n return (\n <>\n {/* Keep track of feedback to display by making children visually\n hidden. These children are the ones referenced by the control's\n accessibility attributes. */}\n <FeedbackPopoverContext.Provider\n value={{\n onAddFeedback: handleAddFeedback,\n onRemoveFeedback: handleRemoveFeedback,\n }}\n >\n <VisuallyHidden>{children}</VisuallyHidden>\n </FeedbackPopoverContext.Provider>\n\n <Popover\n defaultOpen={defaultOpen}\n open={hasFeedback && (controlFocused || open || false)}\n onOpenChange={onOpenChange}\n modal={inField ? modal : false}\n >\n {hasFeedback && (\n <div\n data-variant={variant}\n data-accent={accent}\n {...buttonContainerProps}\n className={cx(\n prefix(\"feedback-popover__button-container\"),\n buttonContainerProps?.className,\n )}\n >\n <PopoverTrigger>\n <IconButton\n size={size}\n variant=\"ghost\"\n color={accent}\n circle\n tabIndex={inField ? -1 : 0}\n label={label}\n icon={icon}\n {...iconButtonProps}\n className={cx(\n prefix(\"feedback-popover__button\"),\n iconButtonProps?.className,\n )}\n tooltipProps={{\n side: \"bottom\",\n ...iconButtonProps?.tooltipProps,\n }}\n />\n </PopoverTrigger>\n </div>\n )}\n\n {/* Prevent feedback within the popover from being referenced by the\n control's accessibility attributes. */}\n <ClearContexts>\n {hasFeedback && (\n <PopoverContent\n className={cx(prefix(\"feedback-popover\"), className)}\n onOpenAutoFocus={combineEventHandlers(\n onOpenAutoFocus,\n handleOpenAutoFocus,\n { checkDefaultPrevented: true },\n )}\n side=\"top\"\n {...otherProps}\n data-accent={accent}\n ref={forwardedRef}\n >\n {children}\n </PopoverContent>\n )}\n </ClearContexts>\n </Popover>\n </>\n );\n});\n","import * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useLayoutEffect } from \"../../utils/useLayoutEffect.ts\";\nimport { useIsInFeedbackList } from \"../FeedbackList\";\nimport { useFeedbackPopoverContext } from \"../FeedbackPopover\";\nimport { useSetFieldFeedback } from \"../Field\";\nimport { Slot, Slottable } from \"../Slot\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\n\n/** Possible types of feedback. */\nexport type FeedbackType = \"success\" | \"error\" | \"warning\";\n\n/** Properties of the feedback component. */\nexport type FeedbackProps = React.ComponentPropsWithoutRef<\"div\" | \"li\"> & {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Type of feedback.\n *\n * @default error\n */\n type?: FeedbackType;\n /** Text prefixed to the feedback to be announced by assistive technologies. */\n visuallyHiddenPrefix?:\n | React.ReactNode\n | ((type: FeedbackType) => React.ReactNode);\n};\n\n/** Component used to provide some feedback to a form control. */\nexport const Feedback = React.forwardRef<\n React.ComponentRef<\"div\" | \"li\">,\n FeedbackProps\n>(function Feedback(\n {\n asChild,\n type = \"error\",\n visuallyHiddenPrefix,\n id,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const { onAddFeedback, onRemoveFeedback } = useFeedbackPopoverContext() ?? {};\n useLayoutEffect(() => {\n onAddFeedback?.(type);\n return () => onRemoveFeedback?.(type);\n }, [onAddFeedback, onRemoveFeedback, type]);\n\n const isInFeedbackList = useIsInFeedbackList();\n const locale = useLocale();\n visuallyHiddenPrefix ??= locale.Feedback.visuallyHiddenPrefix;\n const visuallyHiddenPrefixText =\n typeof visuallyHiddenPrefix === \"function\"\n ? visuallyHiddenPrefix(type)\n : visuallyHiddenPrefix;\n\n const feedbackId = useSetFieldFeedback(id, type === \"error\");\n\n const As: any = asChild ? Slot : isInFeedbackList ? \"li\" : \"div\";\n return (\n <As\n id={feedbackId}\n className={cx(prefix(\"feedback\"), className)}\n data-accent={type === \"error\" ? \"danger\" : type}\n {...otherProps}\n data-type={type}\n ref={forwardedRef as never}\n >\n {visuallyHiddenPrefixText && (\n <VisuallyHidden>{visuallyHiddenPrefixText} </VisuallyHidden>\n )}\n <Slottable>{children}</Slottable>\n </As>\n );\n});\n","import * as React from \"react\";\n\n/** Value of the field group context. */\nexport interface FieldGroupContextValue {\n setCodeId: React.Dispatch<React.SetStateAction<string | undefined>>;\n setTitleId: React.Dispatch<React.SetStateAction<string | undefined>>;\n}\n\n/** Field group context. */\nexport const FieldGroupContext =\n React.createContext<FieldGroupContextValue | null>(null);\n\n/** Hook providing access to the field group context. */\nexport function useFieldGroupContext(): FieldGroupContextValue {\n const fieldGroupContext = React.useContext(FieldGroupContext);\n if (!fieldGroupContext) {\n throw new Error(\"Field group context not in scope.\");\n }\n return fieldGroupContext;\n}\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { Slot } from \"../Slot\";\nimport { FieldGroupContext } from \"./FieldGroupContext.ts\";\n\n/** Properties of the field group component. */\nexport interface FieldGroupProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/**\n * Component used to group a set of fields of a form, improving the organization\n * and usability of forms. By combining a header and body layout, it makes forms\n * more readable and accessible, especially for complex interfaces. The header\n * gives the group a clear title, while the body contains all related input\n * controls.\n *\n * This component is especially useful for creating forms where logical grouping\n * of fields is essential for user comprehension. It ensures consistency in\n * design and simplifies the process of building accessible and maintainable\n * forms.\n *\n * It composes the following subcomponents:\n *\n * - `FieldGroupHeader`: Acts as the headers for the group, typically containing\n * the `FieldGroupTitle` of the section.\n * - `FieldGroupTitle`: Displays the title within the header.\n * - `FieldGroupBody`: The container for all fields and controls within the group.\n */\nexport const FieldGroup = React.forwardRef<\n React.ComponentRef<\"div\">,\n FieldGroupProps\n>(function FieldGroup(\n {\n asChild,\n className,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const [codeId, setCodeId] = React.useState<string>();\n const [titleId, setTitleId] = React.useState<string>();\n\n const As = asChild ? Slot : \"div\";\n return (\n <FieldGroupContext.Provider value={{ setCodeId, setTitleId }}>\n <As\n className={cx(prefix(\"field-group\"), className)}\n role=\"group\"\n {...otherProps}\n aria-labelledby={mergeAriaIds(titleId, ariaLabelledBy)}\n aria-describedby={mergeAriaIds(codeId, ariaDescribedBy)}\n ref={forwardedRef}\n />\n </FieldGroupContext.Provider>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the field group body component. */\nexport interface FieldGroupBodyProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Component used to display the body of a field group. */\nexport const FieldGroupBody = React.forwardRef<\n React.ComponentRef<\"div\">,\n FieldGroupBodyProps\n>(function FieldGroupBody({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"field-group__body\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot, Slottable } from \"../Slot\";\nimport { VisuallyHidden } from \"../VisuallyHidden\";\nimport { useFieldGroupContext } from \"./FieldGroupContext.ts\";\n\n/** Properties of the field group header component. */\nexport interface FieldGroupHeaderProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /** Code associated with the field group. */\n code?: React.ReactNode;\n /** Text prefixed to the code to be announced by assistive technologies. */\n visuallyHiddenCodePrefix?: React.ReactNode;\n /** Properties to pass to the code element. */\n codeProps?: React.ComponentPropsWithoutRef<\"span\">;\n}\n\n/** Component used to display the header of a field group. */\nexport const FieldGroupHeader = React.forwardRef<\n React.ComponentRef<\"div\">,\n FieldGroupHeaderProps\n>(function FieldGroupHeader(\n {\n asChild,\n code,\n visuallyHiddenCodePrefix,\n codeProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n visuallyHiddenCodePrefix ??= locale.FieldGroupHeader.visuallyHiddenCodePrefix;\n\n const generatedId = React.useId();\n const codeId = code\n ? (codeProps?.id ?? prefix(`field-group-code-${generatedId}`))\n : undefined;\n\n const { setCodeId } = useFieldGroupContext();\n React.useEffect(() => {\n setCodeId(codeId);\n }, [codeId, setCodeId]);\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"field-group__header\"), className)}\n data-has-code={boolDataAttr(!!code)}\n {...otherProps}\n ref={forwardedRef}\n >\n {code && (\n <span\n {...codeProps}\n id={codeId}\n className={cx(prefix(\"field-group__code\"), codeProps?.className)}\n >\n {visuallyHiddenCodePrefix && (\n <VisuallyHidden>{visuallyHiddenCodePrefix} </VisuallyHidden>\n )}\n {code}\n </span>\n )}\n <Slottable>{children}</Slottable>\n </As>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { type HeadingLevel } from \"../Heading\";\nimport { Slot } from \"../Slot\";\nimport { useFieldGroupContext } from \"./FieldGroupContext.ts\";\n\n/** Properties of the field group title component. */\nexport interface FieldGroupTitleProps\n extends React.ComponentPropsWithoutRef<\"h2\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Heading level.\n *\n * @default 2\n */\n level?: HeadingLevel;\n}\n\n/** Component used to display the caption of a field group. */\nexport const FieldGroupTitle = React.forwardRef<\n React.ComponentRef<\"h2\">,\n FieldGroupTitleProps\n>(function FieldGroupTitle(\n { asChild, level = 2, id, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const generatedId = React.useId();\n const titleId = id ?? prefix(`field-group-title-${generatedId}`);\n\n const { setTitleId } = useFieldGroupContext();\n React.useEffect(() => {\n setTitleId(titleId);\n }, [setTitleId, titleId]);\n\n const As = asChild ? Slot : `h${level}`;\n return (\n <As\n id={titleId}\n className={cx(prefix(\"field-group__title\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import fromExponential from \"from-exponential\";\n\n/**\n * Converts a numberic value to a string, removing exponential notation. Nullish\n * or `NaN` values become the empty string.\n */\nexport function numericToString(v: string | number | null | undefined): string {\n return typeof v === \"string\"\n ? v\n : v == null || isNaN(v)\n ? \"\"\n : fromExponential(v);\n}\n\n/** Whether a numeric string represents a negative number. */\nexport function isNumericStringNegative(v: string): boolean {\n return v.startsWith(\"-\");\n}\n\n/** Whether a numeric string represents the `null` value. */\nexport function numericStringRepresentsNull(v: string): boolean {\n return v === \"\" || v === \"-\" || v === \".\" || v === \"-.\";\n}\n\n/** Removes leading and trailing zeros from a numeric string. */\nexport function normalizeNumericString(v: string): string {\n if (numericStringRepresentsNull(v)) {\n return \"\";\n }\n const isNegative = isNumericStringNegative(v);\n if (isNegative) {\n v = v.slice(1);\n }\n let [decimal, fraction] = v.split(\".\");\n decimal = decimal.replace(/^0*/, \"\");\n fraction = fraction?.replace(/0*$/, \"\");\n const trimmedV =\n !decimal && !fraction\n ? \"0\"\n : decimal && !fraction\n ? decimal\n : !decimal && fraction\n ? `0.${fraction}`\n : `${decimal}.${fraction}`;\n return isNegative ? `-${trimmedV}` : trimmedV;\n}\n\n/**\n * Compares two numeric strings and returns a positive number if the first one\n * is greater than the second one, a negative number if the opposite is true, or\n * zero when they're equal.\n */\nexport function compareNumericStrings(v1: string, v2: string): number {\n const v1IsNegative = isNumericStringNegative(v1);\n const v2IsNegative = isNumericStringNegative(v2);\n const positiveNormalizedV1 =\n normalizeNumericString(v1).slice(v1IsNegative ? 1 : 0) || \"0\";\n const positiveNormalizedV2 =\n normalizeNumericString(v2).slice(v2IsNegative ? 1 : 0) || \"0\";\n\n if (v1IsNegative !== v2IsNegative) {\n return positiveNormalizedV1 === \"0\" && positiveNormalizedV2 === \"0\"\n ? 0\n : v2IsNegative\n ? 1\n : -1;\n }\n\n const negativeMultiplier = v1IsNegative ? -1 : 1;\n const [decimal1, fraction1 = \"\"] = positiveNormalizedV1.split(\".\");\n const [decimal2, fraction2 = \"\"] = positiveNormalizedV2.split(\".\");\n\n if (decimal1.length !== decimal2.length) {\n return (decimal1.length > decimal2.length ? 1 : -1) * negativeMultiplier;\n }\n\n for (let i = 0; i < decimal1.length; ++i) {\n const c1 = decimal1[i];\n const c2 = decimal2[i];\n if (c1 !== c2) {\n return (c1 > c2 ? 1 : -1) * negativeMultiplier;\n }\n }\n\n for (let i = 0; i < Math.max(fraction1.length, fraction2.length); ++i) {\n const c1 = fraction1[i] ?? \"0\";\n const c2 = fraction2[i] ?? \"0\";\n if (c1 !== c2) {\n return (c1 > c2 ? 1 : -1) * negativeMultiplier;\n }\n }\n\n return 0;\n}\n\n/**\n * Transforms an integer numeric string into a float numeric string, given the\n * scale.\n */\nexport function numericStringIntToFloat(v: string, scale: number): string {\n if (numericStringRepresentsNull(v) || scale === 0) {\n return v;\n }\n const isNegative = isNumericStringNegative(v);\n const positiveValue = isNegative ? v.slice(1) : v;\n const paddedPositiveValue = positiveValue.padStart(scale + 1, \"0\");\n return `${isNegative ? \"-\" : \"\"}${paddedPositiveValue.slice(\n 0,\n -scale,\n )}.${paddedPositiveValue.slice(-scale)}`;\n}\n\n/**\n * Transforms a float numeric string into an integer numeric string, given the\n * scale.\n */\nexport function numericStringFloatToInt(v: string, scale: number): string {\n if (numericStringRepresentsNull(v)) {\n return v;\n }\n const [decimal, fraction = \"\"] = v.split(\".\");\n if (scale === 0) {\n return decimal;\n }\n const sizedFraction =\n fraction.length > scale\n ? fraction.slice(0, scale)\n : fraction.padEnd(scale, \"0\");\n return `${decimal}${sizedFraction}`;\n}\n","import * as React from \"react\";\nimport {\n type NumericFormatProps,\n numericFormatter,\n removeNumericFormat,\n} from \"react-number-format\";\n\nimport { useLocale } from \"../providers/LocalizationProvider\";\nimport {\n isNumericStringNegative,\n normalizeNumericString,\n numericStringFloatToInt,\n numericStringIntToFloat,\n numericToString,\n} from \"./numericStringUtils.ts\";\n\n/** Styles of digit grouping. */\nexport type GroupingStyle = \"thousand\" | \"lakh\" | \"wan\";\n\n/** Options of the `useNumericTransformer` hook. */\nexport interface NumericTransformerOptions {\n /**\n * Whether the value should always represent an integer, even when it contains\n * a scale. Note that in this case, the scale must be known (i.e. `scale` must\n * not be `undefined`).\n */\n valueIsInteger?: boolean;\n /**\n * Specifies the number of digits allowed after the decimal separator. When\n * not specified, the scale has no limits.\n *\n * @default null\n */\n scale?: number;\n /**\n * Whether to always add trailing zeros to match the given `scale`. Defaults\n * to `false` when `scale` is `null` and `true` otherwise.\n */\n fixedScale?: boolean;\n /**\n * Character to use as a decimal separator. Defaults to the locale's\n * separator.\n */\n decimalSeparator?: string;\n /**\n * Whether to group the integer part of the number.\n *\n * @default false\n */\n groupDigits?: boolean;\n /** Style of grouping. Defaults to the locale's default style. */\n groupingStyle?: GroupingStyle;\n /**\n * Character to use to separate the groups of digits. Defaults to the locale's\n * separator.\n */\n groupSeparator?: string;\n /** Prefix to add to the input's text. */\n prefix?: string;\n /** Suffix to add to the input's text. */\n suffix?: string;\n}\n\n/** Numeric transformer. */\nexport interface NumericTransformer {\n /** Function used to parse a formatted numeric value into a numeric string. */\n parse: (\n formattedValue: string,\n options?: NumericTransformerOptions,\n ) => string;\n /** Function used to format a numeric value. */\n format: (\n value: string | number | null | undefined,\n options?: NumericTransformerOptions,\n ) => string;\n}\n\n/** Hook returning functions that can be used to transform a numeric value. */\nexport function useNumericTransformer({\n valueIsInteger,\n scale,\n fixedScale = scale != null,\n decimalSeparator,\n groupDigits = false,\n groupingStyle,\n groupSeparator,\n prefix,\n suffix,\n}: NumericTransformerOptions = {}): NumericTransformer {\n const locale = useLocale();\n decimalSeparator ??= locale.NumericInput.decimalSeparator ?? \".\";\n groupingStyle ??= locale.NumericInput.groupingStyle ?? \"thousand\";\n groupSeparator ??= locale.NumericInput.groupSeparator ?? \",\";\n\n const options = React.useMemo(\n () => ({\n valueIsInteger,\n scale,\n fixedScale,\n decimalSeparator,\n groupDigits,\n groupingStyle,\n groupSeparator,\n prefix,\n suffix,\n }),\n [\n decimalSeparator,\n fixedScale,\n groupDigits,\n groupSeparator,\n groupingStyle,\n prefix,\n scale,\n suffix,\n valueIsInteger,\n ],\n );\n\n return React.useMemo(\n () => ({\n parse: (\n formattedValue: string,\n optionsOverride: NumericTransformerOptions = {},\n ) =>\n parseNumericValue(formattedValue, { ...options, ...optionsOverride }),\n format: (\n value: string | number | null | undefined,\n optionsOverride: NumericTransformerOptions = {},\n ) => formatNumericValue(value, { ...options, ...optionsOverride }),\n }),\n [options],\n );\n}\n\n/** Validates numeric transformer options. */\nexport function validateNumericTransformerOptions({\n valueIsInteger = false,\n scale = undefined,\n decimalSeparator,\n groupSeparator,\n}: NumericTransformerOptions = {}) {\n if (valueIsInteger && scale === null) {\n throw new Error(\n \"The scale cannot be set to `null` when `valueIsInteger` is set.\",\n );\n }\n if (scale != null && (scale < 0 || Math.floor(scale) !== scale)) {\n throw new RangeError(\"The scale must be a non-negative integer.\");\n }\n if (decimalSeparator && decimalSeparator.length !== 1) {\n throw new Error(\"Decimal separator must be a string of length 1.\");\n }\n if (groupSeparator && groupSeparator.length > 1) {\n throw new Error(\"Group separator must be a string of length <= 1.\");\n }\n if (decimalSeparator === groupSeparator) {\n throw new Error(\"Decimal and group separators must be different.\");\n }\n}\n\n// Mock change meta used by the `removeNumericFormat` function\nconst MOCK_CHANGE_META = {\n from: { start: 0, end: 0 },\n to: { start: 0, end: 0 },\n lastValue: \"\",\n};\n\n/** Transforms a formatted numeric value into its numeric string representation. */\nexport function parseNumericValue(\n formattedValue: string,\n options: NumericTransformerOptions = {},\n): string {\n validateNumericTransformerOptions(options);\n const { valueIsInteger, scale } = options;\n\n const isNegative = isNumericStringNegative(formattedValue);\n const stringValue = `${isNegative ? \"-\" : \"\"}${removeNumericFormat(\n formattedValue,\n MOCK_CHANGE_META,\n transformOptions(options),\n )}`;\n return normalizeNumericString(\n valueIsInteger ? numericStringFloatToInt(stringValue, scale!) : stringValue,\n );\n}\n\n/** Formats a numeric value. */\nexport function formatNumericValue(\n value: string | number | null | undefined,\n options: NumericTransformerOptions = {},\n): string {\n validateNumericTransformerOptions(options);\n const { valueIsInteger, scale } = options;\n\n const stringValue = numericToString(value);\n return numericFormatter(\n normalizeNumericString(\n valueIsInteger\n ? numericStringIntToFloat(stringValue, scale!)\n : stringValue,\n ),\n transformOptions(options),\n );\n}\n\n/** Transforms our options into `react-number-format` options. */\nfunction transformOptions({\n scale,\n fixedScale,\n groupDigits,\n groupingStyle,\n groupSeparator,\n ...otherOptions\n}: NumericTransformerOptions = {}): NumericFormatProps {\n return {\n decimalScale: scale ?? undefined,\n fixedDecimalScale: fixedScale,\n thousandsGroupStyle: groupDigits ? groupingStyle : \"none\",\n thousandSeparator: groupDigits ? groupSeparator : \"\",\n ...otherOptions,\n };\n}\n","import * as React from \"react\";\nimport { type NumberFormatValues, NumericFormat } from \"react-number-format\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport {\n compareNumericStrings,\n isNumericStringNegative,\n normalizeNumericString,\n numericStringFloatToInt,\n numericStringIntToFloat,\n numericToString,\n} from \"../../utils/numericStringUtils.ts\";\nimport {\n type NumericTransformerOptions,\n validateNumericTransformerOptions,\n} from \"../../utils/useNumericTransformer.tsx\";\nimport { Input } from \"../Input\";\n\n/** Properties of the numeric input component. */\nexport interface NumericInputProps\n extends NumericTransformerOptions,\n Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n \"defaultValue\" | \"value\" | \"onValueChange\" | \"type\" | \"min\" | \"max\"\n > {\n type?: \"text\" | \"tel\" | \"password\";\n /** Numeric input's default value. */\n defaultValue?: string | number | null;\n /** Numeric input's controlled value. */\n value?: string | number | null;\n /**\n * Function called whenever the value of the numeric input changes.\n *\n * @param valueRepresentations Different representations of the numeric value.\n */\n onValueChange?: (valueRepresentations: NumericValueRepresentations) => void;\n /**\n * Set this property when passing in an unformatted string as `defaultValue`\n * or `value`.\n *\n * @default false\n */\n valueIsUnformattedString?: boolean;\n /**\n * Specifies the precision of a number, set to `null` to have no limit on\n * precision.\n *\n * @default null\n */\n precision?: number | null;\n /**\n * Minimum number allowed. If a string is provided, it should **not** be the\n * formatted representation, e.g. `\"999999.99\" should be provided instead of\n * `\"999 999,99 €\"`, i.e. `valueIsUnformattedString` has no effect on this\n * property.\n */\n min?: string | number | null;\n /**\n * Maximum number allowed. If a string is provided, it should **not** be the\n * formatted representation, e.g. `\"999999.99\" should be provided instead of\n * `\"999 999,99 €\"`, i.e. `valueIsUnformattedString` has no effect on this\n * property.\n */\n max?: string | number | null;\n /**\n * Value that the number should be greater than. If a string is provided, it\n * should **not** be the formatted representation, e.g. `\"999999.99\" should be\n * provided instead of `\"999 999,99 €\"`, i.e. `valueIsUnformattedString` has\n * no effect on this property.\n */\n exclusiveMin?: string | number | null;\n /**\n * Value that the number should be less than. If a string is provided, it\n * should **not** be the formatted representation, e.g. `\"999999.99\" should be\n * provided instead of `\"999 999,99 €\"`, i.e. `valueIsUnformattedString` has\n * no effect on this property.\n */\n exclusiveMax?: string | number | null;\n /**\n * Whether the numeric value should be allowed.\n *\n * @param valueRepresentations Different representations of the numeric value.\n */\n allowValue?: (valueRepresentations: NumericValueRepresentations) => boolean;\n}\n\n/** Representations of the numeric value. */\nexport interface NumericValueRepresentations {\n /** Numeric value as a formatted string. */\n formattedValue: string;\n /** Numeric value as an unformatted string. */\n stringValue: string;\n /** Numeric value as a number. */\n numberValue: number | null;\n}\n\n/**\n * The `NumericInput` component is designed for numeric data entry, offering\n * features like digit grouping, adornments, and precision control to enhance\n * the user experience when dealing with numbers.\n *\n * Similar to the [Input](/docs/ostack-ui-forms-input--docs)\n * component,`NumericInput` works seamlessly with the `Field` component to\n * create structured, accessible form groups. By combining it with `Field`, you\n * can ensure proper associations between `Label`, `NumericInput`, and\n * `HelperText`, improving clarity and accessibility for users.\n */\nexport const NumericInput = React.forwardRef<\n React.ComponentRef<typeof Input>,\n NumericInputProps\n>(function DateInput(\n {\n defaultValue,\n value,\n valueIsUnformattedString = false,\n valueIsInteger = false,\n onValueChange,\n precision,\n scale,\n fixedScale = scale != null,\n decimalSeparator,\n groupDigits = false,\n groupingStyle,\n groupSeparator,\n min,\n max,\n exclusiveMin,\n exclusiveMax,\n allowValue,\n ...otherProps\n },\n forwardedRef,\n) {\n const minString = numericToString(min);\n const maxString = numericToString(max);\n const exclusiveMinString = numericToString(exclusiveMin);\n const exclusiveMaxString = numericToString(exclusiveMax);\n\n const locale = useLocale();\n decimalSeparator ??= locale.NumericInput.decimalSeparator ?? \".\";\n groupingStyle ??= locale.NumericInput.groupingStyle ?? \"thousand\";\n groupSeparator ??= locale.NumericInput.groupSeparator ?? \",\";\n\n if (process.env.NODE_ENV !== \"production\") {\n validateNumericProps({\n valueIsInteger,\n precision,\n scale,\n decimalSeparator,\n groupSeparator,\n minString,\n maxString,\n exclusiveMinString,\n exclusiveMaxString,\n });\n }\n\n const handleValueChange = React.useCallback(\n (values: NumberFormatValues) => {\n onValueChange?.(\n transformNumberFormatValues(values, valueIsInteger, scale),\n );\n },\n [onValueChange, scale, valueIsInteger],\n );\n\n const isAllowed = React.useCallback(\n (values: NumberFormatValues) => {\n const valueRepresentations = transformNumberFormatValues(\n values,\n valueIsInteger,\n scale,\n );\n const { stringValue } = valueRepresentations;\n if (stringValue) {\n // Deny values that don't match the `precision` + `scale`\n if (precision != null) {\n const isNegative = isNumericStringNegative(stringValue);\n if (valueIsInteger) {\n if (stringValue.length - (isNegative ? 1 : 0) > precision) {\n return false;\n }\n } else {\n const decimalSeparatorIndex = stringValue.indexOf(\".\");\n const decimal =\n decimalSeparatorIndex === -1\n ? stringValue\n : stringValue.slice(0, decimalSeparatorIndex);\n if (decimal.length - (isNegative ? 1 : 0) > precision - scale!) {\n return false;\n }\n }\n }\n // Deny values less than `min` when `min` < 0 or values less than 0\n // when `min` >= 0\n if (\n minString &&\n ((compareNumericStrings(minString, \"0\") < 0 &&\n compareNumericStrings(stringValue, minString) < 0) ||\n (compareNumericStrings(minString, \"0\") >= 0 &&\n compareNumericStrings(stringValue, \"0\") < 0))\n ) {\n return false;\n }\n // Deny values greater than `max` when `max` > 0 or values greater than\n // 0 when `max` <= 0\n if (\n maxString &&\n ((compareNumericStrings(maxString, \"0\") > 0 &&\n compareNumericStrings(stringValue, maxString) > 0) ||\n (compareNumericStrings(maxString, \"0\") <= 0 &&\n compareNumericStrings(stringValue, \"0\") > 0))\n ) {\n return false;\n }\n // Deny values less than or equal to `exclusiveMin` when\n // `exclusiveMin` < 0 or values less than 0 when `exclusiveMin` >= 0\n if (\n exclusiveMinString &&\n ((compareNumericStrings(exclusiveMinString, \"0\") < 0 &&\n compareNumericStrings(stringValue, exclusiveMinString) <= 0) ||\n (compareNumericStrings(exclusiveMinString, \"0\") >= 0 &&\n compareNumericStrings(stringValue, \"0\") < 0))\n ) {\n return false;\n }\n // Deny values greater than or equal to `exclusiveMax` when\n // `exclusiveMax` > 0 or values greater than 0 when `exclusiveMax` <= 0\n if (\n exclusiveMaxString &&\n ((compareNumericStrings(exclusiveMaxString, \"0\") > 0 &&\n compareNumericStrings(stringValue, exclusiveMaxString) >= 0) ||\n (compareNumericStrings(exclusiveMaxString, \"0\") <= 0 &&\n compareNumericStrings(stringValue, \"0\") > 0))\n ) {\n return false;\n }\n }\n return allowValue?.(valueRepresentations) ?? true;\n },\n [\n valueIsInteger,\n scale,\n allowValue,\n precision,\n minString,\n maxString,\n exclusiveMinString,\n exclusiveMaxString,\n ],\n );\n\n const allowNegative =\n (!minString || compareNumericStrings(minString, \"0\") < 0) &&\n (!exclusiveMinString || compareNumericStrings(exclusiveMinString, \"0\") < 0);\n\n // Transform the passed value when necessary\n const relevantValueProp = value === undefined ? \"defaultValue\" : \"value\";\n const relevantValue = value === undefined ? defaultValue : value;\n const relevantValueNeedsTransformation = valueNeedsTransformation(\n relevantValue,\n valueIsUnformattedString,\n valueIsInteger,\n scale,\n );\n const relevantValuePropObject = {\n [relevantValueProp]: relevantValueNeedsTransformation\n ? transformIntegerValueWithScale(relevantValue!, scale)\n : (relevantValue ?? \"\"),\n };\n\n return (\n <NumericFormat\n {...relevantValuePropObject}\n valueIsNumericString={\n relevantValueNeedsTransformation || valueIsUnformattedString\n }\n onValueChange={handleValueChange}\n decimalScale={scale ?? undefined}\n fixedDecimalScale={fixedScale}\n decimalSeparator={decimalSeparator}\n thousandsGroupStyle={groupDigits ? groupingStyle : \"none\"}\n thousandSeparator={groupDigits ? groupSeparator : \"\"}\n isAllowed={isAllowed}\n allowNegative={allowNegative}\n customInput={Input}\n getInputRef={forwardedRef}\n {...otherProps}\n />\n );\n});\n\n/** Validates numeric props. */\nfunction validateNumericProps({\n valueIsInteger,\n precision,\n scale,\n decimalSeparator,\n groupSeparator,\n minString,\n maxString,\n exclusiveMinString,\n exclusiveMaxString,\n}: Pick<\n NumericInputProps,\n | \"valueIsInteger\"\n | \"precision\"\n | \"scale\"\n | \"decimalSeparator\"\n | \"groupSeparator\"\n> & {\n minString?: string;\n maxString?: string;\n exclusiveMinString?: string;\n exclusiveMaxString?: string;\n}) {\n validateNumericTransformerOptions({\n valueIsInteger,\n scale,\n decimalSeparator,\n groupSeparator,\n });\n if (precision != null && scale == null) {\n throw new Error(\n \"The scale cannot be set to `null` when a precision is provided.\",\n );\n }\n if (\n precision != null &&\n (precision <= 0 || Math.floor(precision) !== precision)\n ) {\n throw new RangeError(\"The precision must be a positive integer.\");\n }\n if (precision != null && scale! >= precision) {\n throw new RangeError(\"The scale must be less than the precision.\");\n }\n\n const lowerLimit =\n minString && exclusiveMinString\n ? compareNumericStrings(minString, exclusiveMinString) <= 0\n ? exclusiveMinString\n : minString\n : minString || exclusiveMinString;\n const upperLimit =\n maxString && exclusiveMaxString\n ? compareNumericStrings(maxString, exclusiveMaxString) >= 0\n ? exclusiveMaxString\n : maxString\n : maxString || exclusiveMaxString;\n if (\n lowerLimit &&\n upperLimit &&\n compareNumericStrings(lowerLimit, upperLimit) > 0\n ) {\n throw new RangeError(\n \"`min`/`exclusiveMin` should not be greater than `max`/`exclusiveMax`.\",\n );\n }\n}\n\n/**\n * Whether the passed value needs to be transformed before being passed to\n * `react-number-format`. In particular, it does when it is an integer value\n * with a scale.\n */\nfunction valueNeedsTransformation(\n value: string | number | null | undefined,\n valueIsUnformattedString: boolean,\n valueIsInteger: boolean,\n scale: number | undefined,\n): boolean {\n return (\n value != null &&\n valueIsInteger &&\n !!scale &&\n (typeof value !== \"string\" || valueIsUnformattedString)\n );\n}\n\n/**\n * Transforms an integer value with scale into an unformatted string value\n * understood by `react-number-format`.\n */\nfunction transformIntegerValueWithScale(\n value: string | number,\n scale: number | undefined,\n): string {\n const stringValue = numericToString(value);\n return numericStringIntToFloat(stringValue, scale!);\n}\n\n/**\n * Converts the `react-number-format` values representation into our own\n * representation, while handling the case of integer values with a scale.\n */\nfunction transformNumberFormatValues(\n { formattedValue, value, floatValue }: NumberFormatValues,\n valueIsInteger: boolean,\n scale: number | undefined,\n): NumericValueRepresentations {\n if (\n !valueIsInteger ||\n !scale ||\n Number.isNaN(floatValue) ||\n floatValue == null\n ) {\n return {\n formattedValue,\n stringValue: normalizeNumericString(value),\n numberValue:\n Number.isNaN(floatValue) || floatValue == null ? null : floatValue,\n };\n }\n const stringValue = normalizeNumericString(\n numericStringFloatToInt(value, scale),\n );\n return { formattedValue, stringValue, numberValue: +stringValue };\n}\n","import {\n faCircleCheck,\n faCircleExclamation,\n faCircleInfo,\n faTriangleExclamation,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport { Toast as ToastPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { CloseButton } from \"../CloseButton\";\nimport { Icon, type IconProp } from \"../Icon\";\nimport { LinkContext } from \"../Link/LinkContext.ts\";\n\n/** Toast variants. */\nexport type ToastVariant = \"solid\" | \"subtle\" | \"outlined\";\n\n/** Toast severities. */\nexport type ToastSeverity =\n | \"neutral\"\n | \"info\"\n | \"success\"\n | \"danger\"\n | \"warning\";\n\n/** Properties of the toast component. */\nexport type ToastProps = ToastPropsWithAction | ToastPropsWithoutAction;\n\n/** Properties of the toast component when it has an action. */\nexport interface ToastPropsWithAction extends ToastPropsBase {\n action: React.ReactNode;\n actionAltText: string;\n}\n\n/** Properties of the toast component when it does not have an action. */\nexport interface ToastPropsWithoutAction extends ToastPropsBase {\n action?: undefined;\n actionAltText?: undefined;\n}\n\n/** Base properties of the toast component. */\nexport interface ToastPropsBase\n extends Pick<\n React.ComponentPropsWithoutRef<typeof ToastPrimitive.Root>,\n | \"type\"\n | \"duration\"\n | \"defaultOpen\"\n | \"open\"\n | \"onOpenChange\"\n | \"onEscapeKeyDown\"\n | \"onPause\"\n | \"onResume\"\n | \"onSwipeStart\"\n | \"onSwipeEnd\"\n | \"forceMount\"\n >,\n Omit<React.ComponentPropsWithoutRef<\"div\">, \"onPause\"> {\n /**\n * Toast variant.\n *\n * @default solid\n */\n variant?: ToastVariant;\n /**\n * Sets the toast's severity.\n *\n * @default info\n */\n severity?: ToastSeverity;\n /** Alert action. */\n action?: React.ReactNode;\n /**\n * Describes an alternative way to achieve the action for assistive technology\n * users who cannot access the toast easily.\n *\n * This should always be provided whenever the toast has an `action`.\n */\n actionAltText?: string;\n /** Icon to show. Each severity except `\"neutral\"` has its own default icon. */\n icon?: IconProp | null;\n /**\n * Whether to show a close button. By default, a close button is shown when an\n * `action` is not specified.\n */\n showCloseButton?: boolean;\n /** Properties to pass to the root component. */\n rootProps?: Omit<React.ComponentPropsWithRef<\"li\">, \"onPause\">;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the icon component. */\n iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n /** Properties to pass to the content component. */\n contentProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the component containing the action/close button. */\n actionContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the close button component. */\n closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n}\n\n/** Default icon associated with each severity. */\nconst SEVERITY_ICON: Record<ToastSeverity, IconProp | null> = {\n neutral: null,\n info: faCircleInfo,\n success: faCircleCheck,\n danger: faCircleExclamation,\n warning: faTriangleExclamation,\n};\n\n/**\n * The `Toast` component is a simple and powerful element that provides\n * non-intrusive, temporary feedback to users. These messages can notify users\n * about system statuses, errors, successes, or informational alerts in a\n * visually appealing and unobtrusive manner.\n *\n * It composes the following subcomponents:\n *\n * - `ToastDescription`: Refers to the content displayed within the `Toast`\n * component. It typically includes the message or notification that the\n * `Toast` is meant to convey to the user.\n * - `ToastTitle`: Refers to the title displayed within the `Toast` component. It\n * is typically used to highlight the main subject or category of the toast\n * notification.\n */\nexport const Toast = React.forwardRef<React.ComponentRef<\"div\">, ToastProps>(\n function Toast(\n {\n type,\n duration,\n defaultOpen,\n open: controlledOpen,\n onOpenChange,\n onEscapeKeyDown,\n onPause,\n onResume,\n onSwipeStart,\n onSwipeEnd,\n forceMount,\n variant = \"solid\",\n severity = \"info\",\n icon = SEVERITY_ICON[severity],\n action,\n actionAltText,\n showCloseButton = action === undefined,\n rootProps,\n containerProps,\n iconProps,\n contentProps,\n actionContainerProps,\n closeButtonProps,\n children,\n className,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const [open, setOpen] = useControllableState(defaultOpen, controlledOpen);\n\n // Delay the collapsing to make sure that the animation occurs (Radix\n // doesn't animate the `Collapsible`'s initial render)\n const [collapsibleOpen, setCollapsibleOpen] = React.useState(open);\n React.useEffect(() => setCollapsibleOpen(open), [open]);\n\n const accent = severity === \"info\" ? \"primary\" : severity;\n return (\n <ToastPrimitive.Root\n type={type}\n duration={duration}\n open={open}\n onOpenChange={combineEventHandlers(onOpenChange, setOpen)}\n onEscapeKeyDown={onEscapeKeyDown}\n onPause={onPause}\n onResume={onResume}\n onSwipeStart={onSwipeStart}\n onSwipeEnd={onSwipeEnd}\n forceMount={forceMount}\n {...rootProps}\n className={cx(prefix(\"toast__root\"), rootProps?.className)}\n >\n <CollapsiblePrimitive.Root open={collapsibleOpen} asChild>\n <CollapsiblePrimitive.Content\n forceMount={forceMount}\n {...containerProps}\n className={cx(\n prefix(\"toast__container\"),\n containerProps?.className,\n )}\n >\n <LinkContext.Provider\n value={{ defaultColor: accent, defaultVariant: \"alert\" }}\n >\n <div\n className={cx(\n prefix(\"toast\"),\n prefix(`toast--${variant}`),\n className,\n )}\n data-accent={accent}\n ref={forwardedRef}\n {...otherProps}\n >\n {icon && (\n <Icon\n size=\"lg\"\n {...iconProps}\n className={cx(prefix(\"toast__icon\"), iconProps?.className)}\n icon={icon}\n />\n )}\n <div\n {...contentProps}\n className={cx(\n prefix(\"toast__content\"),\n contentProps?.className,\n )}\n >\n {children}\n </div>\n {(action || showCloseButton) && (\n <div\n {...actionContainerProps}\n className={cx(\n prefix(\"toast__action-container\"),\n actionContainerProps?.className,\n )}\n >\n {action && (\n <ToastPrimitive.Action altText={actionAltText} asChild>\n {action}\n </ToastPrimitive.Action>\n )}\n {showCloseButton && (\n <ToastPrimitive.Close asChild>\n <CloseButton\n color={variant === \"solid\" ? \"neutral\" : accent}\n {...closeButtonProps}\n className={cx(\n prefix(\"toast__close-button\"),\n closeButtonProps?.className,\n )}\n />\n </ToastPrimitive.Close>\n )}\n </div>\n )}\n </div>\n </LinkContext.Provider>\n </CollapsiblePrimitive.Content>\n </CollapsiblePrimitive.Root>\n </ToastPrimitive.Root>\n );\n },\n);\n","import { Toast as ToastPrimitive } from \"radix-ui\";\n\n/** The toast message. */\nexport const ToastDescription = ToastPrimitive.Description;\n","import { Toast as ToastPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\n\n/** Direction of pointer swipe that should close the toast */\nexport type ToastSwipeDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\n/** Properties of the toast provider. */\nexport interface ToastProviderProps\n extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Provider> {}\n\n/**\n * The provider that wraps the toasts and their viewport. It usually wraps the\n * application.\n */\nexport function ToastProvider({ label, ...otherProps }: ToastProviderProps) {\n const locale = useLocale();\n label ??= locale.ToastProvider.label;\n\n return <ToastPrimitive.Provider label={label} {...otherProps} />;\n}\n","import { Toast as ToastPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the toast title. */\nexport interface ToastTitleProps\n extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Title> {}\n\n/** An optional title for the toast. */\nexport const ToastTitle = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitive.Title>,\n ToastTitleProps\n>(function ToastTitle({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <ToastPrimitive.Title\n className={cx(prefix(\"toast__title\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { Toast as ToastPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the toast viewport component. */\nexport interface ToastViewportProps\n extends React.ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport> {}\n\n/**\n * The fixed area where toasts appear. Users can jump to the viewport by\n * pressing a hotkey.\n */\nexport const ToastViewport = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitive.Viewport>,\n ToastViewportProps\n>(function ToastViewport({ label, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n const locale = useLocale();\n label ??= locale.ToastViewport.label;\n\n return (\n <ToastPrimitive.Viewport\n label={label}\n className={cx(prefix(\"toast__viewport\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\n\n/**\n * The alert dialog component displays an important overlaid “window” to the\n * user and expects a response.\n *\n * Built on top of the [Radix Alert Dialog\n * primitive](https://www.radix-ui.com/primitives/docs/components/alert-dialog),\n * and the `Card` component.\n *\n * It composes the following subcomponents:\n *\n * - `AlertDialogTrigger`: The button which, when pressed, opens the alert dialog.\n * - `AlertDialogContent`: Content to display when the alert dialog is open.\n * - `AlertDialogHeader`: Header section of the alert dialog.\n * - `AlertDialogTitle`: An accessible title to be announced when the alert dialog\n * is opened.\n * - `AlertDialogBody`: Body section of the alert dialog.\n * - `AlertDialogDescription`: An optional accessible description to be announced\n * when the alert dialog is opened.\n *\n * To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove\n * the description entirely, pass `aria-describedby={undefined}` to the\n * `AlertDialogContent` and omit this component.\n * - `AlertDialogFooter`: Footer section of the alert dialog.\n * - `AlertDialogCancel`: A button which closes the alert dialog by cancelling the\n * action. These buttons should be distinguished visually from\n * `AlertDialogAction` buttons.\n * - `AlertDialogAction`: A button which closes the alert dialog by accepting the\n * action. These buttons should be distinguished visually from\n * `AlertDialogCancel` buttons.\n *\n * Example usage:\n *\n * ```tsx\n * import {\n * Button,\n * AlertDialog,\n * AlertDialogAction,\n * AlertDialogBody,\n * AlertDialogCancel,\n * AlertDialogClose,\n * AlertDialogContent,\n * AlertDialogDescription,\n * AlertDialogFooter,\n * AlertDialogHeader,\n * AlertDialogTitle,\n * AlertDialogTrigger,\n * } from \"@ostack.tech/ui\";\n *\n * function UserAgreement() {\n * return (\n * <AlertDialog>\n * <AlertDialogTrigger>\n * <Button>Accept user agreement…</Button>\n * </AlertDialogTrigger>\n *\n * <AlertDialogContent>\n * <AlertDialogHeader>\n * <AlertDialogTitle>User Agreement</AlertDialogTitle>\n * </AlertDialogHeader>\n * <AlertDialogBody>\n * <AlertDialogDescription>\n * Please read and accept the following user agreement:\n * </AlertDialogDescription>\n * …\n * </AlertDialogBody>\n * <AlertDialogFooter>\n * <AlertDialogCancel>\n * <Button variant=\"subtle\">Cancel</Button>\n * </AlertDialogCancel>\n * <AlertDialogAction>\n * <Button>Accept</Button>\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * </AlertDialogContent>\n * </AlertDialog>\n * );\n * }\n * ```\n */\nexport const AlertDialog = AlertDialogPrimitive.Root;\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the alert dialog action component. */\nexport interface AlertDialogActionProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>,\n \"asChild\"\n > {}\n\n/**\n * Button which closes the alert dialog by accepting the action. These buttons\n * should be distinguished visually from `AlertDialogCancel` buttons.\n */\nexport const AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n AlertDialogActionProps\n>(function AlertDialogAction(props, forwardedRef) {\n return <AlertDialogPrimitive.Action {...props} asChild ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\nimport { DialogBody } from \"../Dialog\";\n\n/** Properties to the alert dialog body component. */\nexport interface AlertDialogBodyProps\n extends React.ComponentPropsWithoutRef<typeof DialogBody> {}\n\n/** Body section of the alert dialog. */\nexport const AlertDialogBody = React.forwardRef<\n React.ComponentRef<typeof DialogBody>,\n AlertDialogBodyProps\n>(function AlertDialogBody(props, forwardedRef) {\n return <DialogBody {...props} ref={forwardedRef} />;\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the alert dialog cancel component. */\nexport interface AlertDialogCancelProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>,\n \"asChild\"\n > {}\n\n/**\n * Button which closes the alert dialog by cancelling the action. These buttons\n * should be distinguished visually from `AlertDialogAction` buttons.\n */\nexport const AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n AlertDialogCancelProps\n>(function AlertDialogCancel(props, forwardedRef) {\n return <AlertDialogPrimitive.Cancel {...props} asChild ref={forwardedRef} />;\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Card } from \"../Card\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport {\n type DialogContentColor,\n type DialogContentSize,\n type DialogContentVariant,\n} from \"../Dialog\";\nimport { Overlay } from \"../Overlay\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\n\n/** Alert dialog content variants. */\nexport type AlertDialogContentVariant = DialogContentVariant;\n\n/** Possible alert dialog content colors. */\nexport type AlertDialogContentColor = DialogContentColor;\n\n/** Possible alert dialog content sizes. */\nexport type AlertDialogContentSize = DialogContentSize;\n\n/** Properties of the alert dialog content component. */\nexport interface AlertDialogContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {\n /**\n * Dialog content variant.\n *\n * @default solid\n */\n variant?: AlertDialogContentVariant;\n /**\n * Whether sections should be merged together, as opposed to them being\n * clearly delimited. By default, each section is clearly delimited via a\n * border or solid background colour.\n *\n * @default false\n */\n mergeSections?: boolean;\n /**\n * Dialog content color.\n *\n * @default neutral\n */\n color?: AlertDialogContentColor;\n /**\n * Size of the dialog content.\n *\n * @default md\n */\n size?: AlertDialogContentSize;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof AlertDialogPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the dialog's overlay component. */\n overlayProps?: React.ComponentPropsWithRef<typeof Overlay>;\n}\n\n/** Content to be rendered in the open alert dialog. */\nexport const AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n AlertDialogContentProps\n>(function AlertDialogContent(\n {\n variant = \"solid\",\n mergeSections,\n color = \"neutral\",\n size = \"md\",\n forceMount,\n portalProps,\n overlayProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const portalContext = usePortalContext();\n\n return (\n <ClearContexts>\n <AlertDialogPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n <AlertDialogPrimitive.Overlay asChild>\n <Overlay\n {...overlayProps}\n className={cx(prefix(\"dialog__overlay\"), overlayProps?.className)}\n >\n <Card\n variant={variant}\n color={color}\n mergeSections={mergeSections}\n asChild\n >\n <AlertDialogPrimitive.Content\n className={cx(\n prefix(\"dialog\"),\n prefix(`dialog--${size}`),\n className,\n )}\n ref={forwardedRef}\n {...otherProps}\n >\n {children}\n </AlertDialogPrimitive.Content>\n </Card>\n </Overlay>\n </AlertDialogPrimitive.Overlay>\n </Root>\n </AlertDialogPrimitive.Portal>\n </ClearContexts>\n );\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the alert dialog description component. */\nexport interface AlertDialogDescriptionProps\n extends React.ComponentPropsWithoutRef<\n typeof AlertDialogPrimitive.Description\n > {}\n\n/**\n * Optional accessible description to be announced when the alert dialog is\n * opened.\n *\n * To hide the description, wrap it within `<VisuallyHidden asChild>`. To remove\n * the description entirely, pass `aria-describedby={undefined}` to the\n * `AlertDialogContent` and omit this component.\n */\nexport const AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n AlertDialogDescriptionProps\n>(function AlertDialogDescription({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <AlertDialogPrimitive.Description\n className={cx(prefix(\"dialog__description\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { DialogFooter } from \"../Dialog\";\n\n/** Properties to the alert dialog footer component. */\nexport interface AlertDialogFooterProps\n extends React.ComponentPropsWithoutRef<typeof DialogFooter> {}\n\n/** Footer section of the alert dialog. */\nexport const AlertDialogFooter = React.forwardRef<\n React.ComponentRef<typeof DialogFooter>,\n AlertDialogFooterProps\n>(function AlertDialogFooter(props, forwardedRef) {\n return <DialogFooter {...props} ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CardHeader } from \"../Card\";\n\n/** Properties of the alert dialog header component. */\nexport interface AlertDialogHeaderProps\n extends React.ComponentPropsWithoutRef<typeof CardHeader> {}\n\n/** Header section of the alert dialog. */\nexport const AlertDialogHeader = React.forwardRef<\n React.ComponentRef<typeof CardHeader>,\n AlertDialogHeaderProps\n>(function AlertDialogHeader({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CardHeader\n className={cx(prefix(\"dialog__header\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { CardTitle } from \"../Card\";\n\n/** Properties of the alert dialog title component. */\nexport interface AlertDialogTitleProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title> {}\n\n/** Accessible title to be announced when the alert dialog is opened. */\nexport const AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n AlertDialogTitleProps\n>(function AlertDialogTitle({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <CardTitle asChild>\n <AlertDialogPrimitive.Title\n className={cx(prefix(\"dialog__title\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n </CardTitle>\n );\n});\n","import { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the alert dialog trigger component. */\nexport interface AlertDialogTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>,\n \"asChild\"\n > {}\n\n/** The button which, when pressed, opens the alert dialog */\nexport const AlertDialogTrigger = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Trigger>,\n AlertDialogTriggerProps\n>(function AlertDialogTrigger(props, forwardedRef) {\n return <AlertDialogPrimitive.Trigger {...props} asChild ref={forwardedRef} />;\n});\n","import * as React from \"react\";\n\nimport {\n type AlertDialogBody,\n type AlertDialogContent,\n type AlertDialogContentColor,\n type AlertDialogContentSize,\n type AlertDialogContentVariant,\n type AlertDialogDescription,\n type AlertDialogFooter,\n type AlertDialogHeader,\n type AlertDialogTitle,\n} from \"../../components/AlertDialog\";\nimport { type Button } from \"../../components/Button\";\n\n/** Options that can be provided to both `alert` and `confirm` alert dialogs. */\nexport interface AlertDialogOptions {\n /** Alert dialog's title. */\n title?: React.ReactNode;\n /**\n * Alert dialog content variant.\n *\n * @default solid\n */\n variant?: AlertDialogContentVariant;\n /**\n * Whether sections should be merged together, as opposed to them being\n * clearly delimited. By default, each section is clearly delimited via a\n * border or solid background colour.\n *\n * @default false\n */\n mergeSections?: boolean;\n /**\n * Alert dialog content color.\n *\n * @default neutral\n */\n color?: AlertDialogContentColor;\n /** Alert dialog content size. */\n size?: AlertDialogContentSize;\n /** Alert dialog's extra body content, displayed after the description. */\n extraBodyContent?: React.ReactNode;\n /** Alert dialog's action text. */\n okText?: React.ReactNode;\n /**\n * Element that caused the alert dialog to be triggered. This element will be\n * automatically focused when the dialog closes.\n */\n triggerElement?: HTMLElement | null;\n /** Properties to pass to the alert dialog's content component. */\n contentProps?: Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogContent>,\n \"solid\" | \"color\" | \"size\"\n >;\n /** Properties to pass to the alert dialog's header component. */\n headerProps?: React.ComponentPropsWithRef<typeof AlertDialogHeader>;\n /** Properties to pass to the alert dialog's title component. */\n titleProps?: React.ComponentPropsWithRef<typeof AlertDialogTitle>;\n /** Properties to pass to the alert dialog's body component. */\n bodyProps?: React.ComponentPropsWithRef<typeof AlertDialogBody>;\n /** Properties to pass to the alert dialog's description component. */\n descriptionProps?: React.ComponentPropsWithRef<typeof AlertDialogDescription>;\n /** Properties to pass to the alert dialog's footer component. */\n footerProps?: React.ComponentPropsWithRef<typeof AlertDialogFooter>;\n /** Properties to pass to the alert dialog's OK button component. */\n okButtonProps?: Omit<React.ComponentPropsWithRef<typeof Button>, \"onClick\">;\n}\n\n/** Options that can be provided to a `confirm` alert dialog. */\nexport interface ConfirmDialogOptions extends AlertDialogOptions {\n /** Alert dialog's cancel text. */\n cancelText?: React.ReactNode;\n /** Properties to pass to the alert dialog's cancel button component. */\n cancelButtonProps?: Omit<\n React.ComponentPropsWithRef<typeof Button>,\n \"onClick\"\n >;\n}\n\n/** Value of the alert dialog context. */\nexport interface AlertDialogProviderContextValue {\n /**\n * Displays an alert to prompt the user with custom content rendered by the\n * provided `renderContent` function.\n *\n * The displayed content should eventually call the provided `resolve`\n * function with the user-provided value.\n *\n * @param renderContent Function used to render the alert's content. Receives\n * a `resolve` function that should be called with the user-provided value.\n * @returns A promise that resolves with the value called in `resolve`, or\n * `undefined` if the dialog was closed for another reason.\n */\n prompt: <T>(\n renderContent: (\n resolve: (value?: T | PromiseLike<T>) => void,\n ) => React.ReactNode,\n ) => Promise<T | undefined>;\n\n /**\n * Displays an alert (similar to the browser's `alert`, but non-blocking) via\n * an alert dialog.\n *\n * @param description Alert description.\n * @param dialogOptions Dialog options.\n * @returns A promise that resolves once the dialog has been dismissed.\n */\n alert: (\n description: React.ReactNode,\n dialogOptions?: AlertDialogOptions,\n ) => Promise<void>;\n\n /**\n * Displays a confirmation dialog (similar to the browser's `confirm` but\n * non-blocking) via an alert dialog.\n *\n * @param description Confirmation description.\n * @param dialogOptions Dialog options.\n * @returns A promise that resolves with a boolean representing whether the\n * dialog has been confirmed or cancelled.\n */\n confirm: (\n description: React.ReactNode,\n dialogOptions?: ConfirmDialogOptions,\n ) => Promise<boolean>;\n}\n\n/** Alert dialog context. */\nexport const AlertDialogProviderContext = React.createContext<\n AlertDialogProviderContextValue | undefined\n>(undefined);\n","import * as React from \"react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogBody,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../../components/AlertDialog\";\nimport { Button } from \"../../components/Button\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { useLocale } from \"../LocalizationProvider\";\nimport {\n type AlertDialogOptions,\n AlertDialogProviderContext,\n type ConfirmDialogOptions,\n} from \"./AlertDialogProviderContext.ts\";\n\n/** Properties of the alert dialog provider. */\nexport interface AlertDialogProviderProps {\n children: React.ReactNode;\n}\n\n/** Alert dialog provider. */\nexport function AlertDialogProvider({ children }: AlertDialogProviderProps) {\n const locale = useLocale();\n const [open, setOpen] = React.useState(false);\n const [content, setContent] = React.useState<React.ReactNode>(null);\n const resolveRef = React.useRef<(value?: never) => void>(null);\n\n const prompt = React.useCallback(\n // eslint-disable-next-line\n <T extends any>(\n renderContent: (\n resolve: (value?: T | PromiseLike<T>) => void,\n ) => React.ReactNode,\n ) =>\n new Promise<T | undefined>((res) => {\n const resolve = (resolveRef.current = (value?: T | PromiseLike<T>) => {\n res(value);\n setOpen(false);\n });\n setContent(\n // XXX: This is a slight hack, but it makes sure that component\n // state is not kept between new dialogs\n <React.Fragment key={Math.random()}>\n {renderContent(resolve)}\n </React.Fragment>,\n );\n setOpen(true);\n }),\n [],\n );\n\n const alert = React.useCallback(\n (\n description: React.ReactNode,\n {\n variant,\n mergeSections,\n color = \"neutral\",\n size,\n title,\n extraBodyContent,\n okText = locale.AlertDialog.okText,\n triggerElement,\n contentProps,\n headerProps,\n titleProps,\n bodyProps,\n descriptionProps,\n footerProps,\n okButtonProps,\n }: AlertDialogOptions = {},\n ) =>\n prompt<void>((resolve) => (\n <AlertDialogContent\n {...contentProps}\n variant={variant}\n mergeSections={mergeSections}\n color={color}\n size={size}\n onCloseAutoFocus={combineEventHandlers(\n contentProps?.onCloseAutoFocus,\n () => triggerElement?.focus(),\n { checkDefaultPrevented: true },\n )}\n >\n {title && (\n <AlertDialogHeader {...headerProps}>\n <AlertDialogTitle {...titleProps}>{title}</AlertDialogTitle>\n </AlertDialogHeader>\n )}\n <AlertDialogBody {...bodyProps}>\n {description && (\n <AlertDialogDescription {...descriptionProps}>\n {description}\n </AlertDialogDescription>\n )}\n {extraBodyContent}\n </AlertDialogBody>\n <AlertDialogFooter {...footerProps}>\n <AlertDialogAction>\n <Button\n {...okButtonProps}\n color={\n okButtonProps?.color ??\n (color === \"neutral\" ? \"primary\" : color)\n }\n onClick={() => resolve()}\n >\n {okText}\n </Button>\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n )),\n [locale.AlertDialog.okText, prompt],\n );\n\n const confirm = React.useCallback(\n (\n description: React.ReactNode,\n {\n variant,\n mergeSections,\n color = \"neutral\",\n size,\n title,\n extraBodyContent,\n okText = locale.ConfirmDialog.okText ?? locale.AlertDialog.okText,\n cancelText = locale.ConfirmDialog.cancelText,\n triggerElement,\n contentProps,\n headerProps,\n titleProps,\n bodyProps,\n descriptionProps,\n footerProps,\n okButtonProps,\n cancelButtonProps,\n }: ConfirmDialogOptions = {},\n ) =>\n prompt<boolean>((resolve) => (\n <AlertDialogContent\n {...contentProps}\n variant={variant}\n mergeSections={mergeSections}\n color={color}\n size={size}\n onEscapeKeyDown={combineEventHandlers(\n contentProps?.onEscapeKeyDown,\n () => resolve(false),\n { checkDefaultPrevented: true },\n )}\n onCloseAutoFocus={combineEventHandlers(\n contentProps?.onCloseAutoFocus,\n () => triggerElement?.focus(),\n { checkDefaultPrevented: true },\n )}\n >\n {title && (\n <AlertDialogHeader {...headerProps}>\n <AlertDialogTitle {...titleProps}>{title}</AlertDialogTitle>\n </AlertDialogHeader>\n )}\n <AlertDialogBody {...bodyProps}>\n {description && (\n <AlertDialogDescription {...descriptionProps}>\n {description}\n </AlertDialogDescription>\n )}\n {extraBodyContent}\n </AlertDialogBody>\n <AlertDialogFooter {...footerProps}>\n <AlertDialogCancel>\n <Button\n variant=\"subtle\"\n {...cancelButtonProps}\n onClick={() => resolve(false)}\n >\n {cancelText}\n </Button>\n </AlertDialogCancel>\n <AlertDialogAction>\n <Button\n {...okButtonProps}\n color={\n okButtonProps?.color ??\n (color === \"neutral\" ? \"primary\" : color)\n }\n onClick={() => resolve(true)}\n >\n {okText}\n </Button>\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n )),\n [\n locale.AlertDialog.okText,\n locale.ConfirmDialog.cancelText,\n locale.ConfirmDialog.okText,\n prompt,\n ],\n );\n\n const handleOpenChange = React.useCallback((open: boolean) => {\n if (!open) {\n resolveRef.current?.();\n setOpen(false);\n }\n }, []);\n\n return (\n <AlertDialogProviderContext.Provider\n value={{ prompt, alert, confirm: confirm as never }}\n >\n {children}\n <AlertDialog open={open} onOpenChange={handleOpenChange}>\n {content}\n </AlertDialog>\n </AlertDialogProviderContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport {\n AlertDialogProviderContext,\n type AlertDialogProviderContextValue,\n} from \"./AlertDialogProviderContext.ts\";\n\n/**\n * Hook used to access an alert dialog in an imperative manner, providing\n * `alert` and `confirm` functions somewhat mimicking the browser's.\n *\n * It also exposes a lower level `prompt` function which allows custom dialog\n * content to be provided, and any value to be resolved.\n *\n * @example\n *\n * ```typescript\n * const { alert, confirm } = useAlertDialog();\n *\n * async function handleRemoveItemClick(event) {\n * if (\n * (await confirm(`Are you sure you wish to remove item #${itemId}?`),\n * {\n * title: \"Remove item\",\n * color: \"danger\",\n * okText: \"Remove\",\n * triggerElement: event.target,\n * })\n * ) {\n * api.removeItem(itemId);\n * await alert(\"Item removed successfully!\", {\n * color: \"success\",\n * triggerElement: event.target,\n * });\n * }\n * }\n * ```\n *\n * @example\n *\n * ```typescript\n * const { prompt } = useAlertDialog();\n *\n * async function handleClick(event) {\n * const result = await prompt((resolve) => (\n * <AlertDialogContent>\n * <AlertDialogHeader>\n * <AlertDialogTitle>Custom alert dialog title</AlertDialogTitle>\n * </AlertDialogHeader>\n * <AlertDialogBody>\n * <AlertDialogDescription>\n * Custom alert dialog description\n * </AlertDialogDescription>\n * </AlertDialogBody>\n * <AlertDialogFooter>\n * <AlertDialogCancel>\n * <Button variant=\"subtle\" onClick={() => resolve()}>\n * Cancel\n * </Button>\n * </AlertDialogCancel>\n * <AlertDialogAction>\n * <Button color=\"primary\" onClick={() => resolve(\"custom\")}>\n * Confirm\n * </Button>\n * </AlertDialogAction>\n * </AlertDialogFooter>\n * </AlertDialogContent>\n * ));\n *\n * console.assert(result === \"custom\" || result === undefined);\n * }\n * ```\n */\nexport function useAlertDialog(): AlertDialogProviderContextValue {\n const context = React.useContext(AlertDialogProviderContext);\n if (context == null) {\n throw new Error(\"Alert dialog provider context not in scope.\");\n }\n return context;\n}\n","import { type LocalizationObject } from \"./LocalizationObject.ts\";\n\n/** `en` locale (partial). */\nexport const en: Omit<LocalizationObject, \"languageTag\" | \"dateFnsLocale\"> = {\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n previousMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n },\n CloseButton: {\n \"aria-label\": \"Close\",\n },\n CommandMenu: {\n searchPlaceholder: \"Search…\",\n listLabel: \"Suggestions\",\n loadingLabel: \"Loading…\",\n emptyMessage: \"No results found.\",\n },\n CommandMenuDialog: {\n title: \"Command palette\",\n description: \"Search for a command…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancel\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Field\",\n },\n DataTable: {\n emptyMessage: \"Nothing to show.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Table filter\",\n placeholder: \"Filter\",\n },\n DataTablePagination: {\n rowsRange: (range, total) => (\n <>\n Rows {range} of {total}\n </>\n ),\n previousPageButtonLabel: \"Previous page\",\n nextPageButtonLabel: \"Next page\",\n },\n DataTableRowsPerPage: {\n label: \"Rows per page\",\n },\n DateInput: {\n calendarButtonLabel: (selectedDate, editable) =>\n editable\n ? selectedDate\n ? `Open calendar to change selected date: ${selectedDate}`\n : \"Open calendar to select date\"\n : selectedDate\n ? `Open calendar with selected date: ${selectedDate}`\n : \"Open calendar with no selected date\",\n },\n DateRangeInput: {\n startInputLabel: \"Start date\",\n endInputLabel: \"End date\",\n calendarButtonLabel: (selectedDateRange, editable) =>\n editable\n ? selectedDateRange\n ? `Open calendar to change selected date-range: ${selectedDateRange}`\n : \"Open calendar to select date-range\"\n : selectedDateRange\n ? `Open calendar with selected date-range: ${selectedDateRange}`\n : \"Open calendar with no selected date-range\",\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Something went wrong.\n <br />\n Press the button on the right to try again. If the problem persists,\n please try again later.\n </>\n ),\n resetButtonLabel: \"Retry\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\" ? \"Error:\" : type === \"warning\" ? \"Warning:\" : null,\n },\n FeedbackPopover: {\n label: \"Show feedback\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Group\",\n },\n Input: {\n clearButtonLabel: \"Clear\",\n },\n Label: {\n requiredIconLabel: \"Required\",\n helperButtonLabel: \"Show help\",\n },\n NumericInput: {\n decimalSeparator: \".\",\n groupingStyle: \"thousand\",\n groupSeparator: \",\",\n },\n Select: {\n optionsLabel: \"Options\",\n },\n TableColumn: {\n helperButtonLabel: \"Show help\",\n },\n TableHead: {\n sortByColumnDescription: (columnName, sortDirection) =>\n sortDirection === null\n ? `Stop sorting table by column “${columnName}”`\n : `Sort table by column “${columnName}” in ${\n sortDirection === \"asc\" ? \"ascending\" : \"descending\"\n } order`,\n },\n ToastProvider: {\n label: \"Notification\",\n },\n ToastViewport: {\n label: \"Notifications ({hotkey})\",\n },\n};\n","import { enGB as dateFnsEnGB } from \"date-fns/locale\";\n\nimport { en } from \"./en.tsx\";\nimport { type LocalizationObject } from \"./LocalizationObject.ts\";\n\n/** `en-GB` locale. */\nexport const enGB: LocalizationObject = {\n ...en,\n languageTag: \"en-GB\",\n dateFnsLocale: dateFnsEnGB,\n DateInput: {\n ...en.DateInput,\n placeholder: \"day/month/year\",\n formatDescription: \"Enter date in DD/MM/YYYY format\",\n },\n};\n","import { enUS as dateFnsEnUS } from \"date-fns/locale\";\n\nimport { en } from \"./en.tsx\";\nimport { type LocalizationObject } from \"./LocalizationObject.ts\";\n\n/** `en-US` locale. */\nexport const enUS: LocalizationObject = {\n ...en,\n languageTag: \"en-US\",\n dateFnsLocale: dateFnsEnUS,\n DateInput: {\n ...en.DateInput,\n placeholder: \"month/day/year\",\n formatDescription: \"Enter date in MM/DD/YYYY format\",\n },\n};\n","import { fr as dateFnsFr } from \"date-fns/locale\";\n\nimport { type LocalizationObject } from \"./LocalizationObject.ts\";\n\n/** `fr-FR` locale. */\nexport const frFR: LocalizationObject = {\n languageTag: \"fr-FR\",\n dateFnsLocale: dateFnsFr,\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n previousMonthLabel: \"Mois précédent\",\n nextMonthLabel: \"Mois suivant\",\n },\n CloseButton: {\n \"aria-label\": \"Fermer\",\n },\n CommandMenu: {\n searchPlaceholder: \"Rechercher…\",\n listLabel: \"Suggestions\",\n loadingLabel: \"Chargement…\",\n emptyMessage: \"Aucun résultat trouvé.\",\n },\n CommandMenuDialog: {\n title: \"Palette de commandes\",\n description: \"Rechercher une commande…\",\n },\n ConfirmDialog: {\n cancelText: \"Annuler\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Champ\",\n },\n DataTable: {\n emptyMessage: \"Rien à afficher.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Tableau filtre\",\n placeholder: \"Filtre\",\n },\n DataTablePagination: {\n rowsRange: (range, total) => (\n <>\n Lignes {range} sur {total}\n </>\n ),\n previousPageButtonLabel: \"Page précédente\",\n nextPageButtonLabel: \"Page suivante\",\n },\n DataTableRowsPerPage: {\n label: \"Lignes par page\",\n },\n DateInput: {\n placeholder: \"jour/mois/année\",\n formatDescription: \"Saisir la date au format JJ/MM/AAAA\",\n calendarButtonLabel: (selectedDate, editable) =>\n editable\n ? selectedDate\n ? `Ouvrir le calendrier pour modifier la date sélectionnée\\u202F: ${selectedDate}`\n : \"Ouvrir le calendrier pour sélectionner la date\"\n : selectedDate\n ? `Ouvrir le calendrier avec la date sélectionnée\\u202F: ${selectedDate}`\n : \"Ouvrir le calendrier sans la date sélectionnée\",\n },\n DateRangeInput: {\n startInputLabel: \"Date de début\",\n endInputLabel: \"Date de fin\",\n calendarButtonLabel: (selectedDateRange, editable) =>\n editable\n ? selectedDateRange\n ? `Ouvrir le calendrier pour modifier la plage de dates sélectionnée\\u202F: ${selectedDateRange}`\n : \"Ouvrir le calendrier pour sélectionner la plage de dates\"\n : selectedDateRange\n ? `Ouvrir le calendrier avec la plage de dates sélectionnée\\u202F: ${selectedDateRange}`\n : \"Ouvrir le calendrier sans plage de dates sélectionnée\",\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Une erreur s'est produite.\n <br />\n Appuyez sur le bouton à droite pour réessayer. Si le problème persiste,\n réessayez plus tard.\n </>\n ),\n resetButtonLabel: \"Réessayer\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\"\n ? \"Erreur\\u202F:\"\n : type === \"warning\"\n ? \"Alerte\\u202F:\"\n : null,\n },\n FeedbackPopover: {\n label: \"Afficher les observations\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Groupe\",\n },\n Input: {\n clearButtonLabel: \"Effacer\",\n },\n Label: {\n requiredIconLabel: \"Obligatoire\",\n helperButtonLabel: \"Afficher l’aide\",\n },\n NumericInput: {\n decimalSeparator: \",\",\n groupingStyle: \"thousand\",\n groupSeparator: \"\\u00A0\",\n },\n Select: {\n optionsLabel: \"Options\",\n },\n TableColumn: {\n helperButtonLabel: \"Afficher l’aide\",\n },\n TableHead: {\n sortByColumnDescription: (columnName, sortDirection) =>\n sortDirection === null\n ? `Arrêter le tri du tableau par colonne «\\u202F${columnName}\\u202F»`\n : `Trier le tableau par colonne «\\u202F${columnName}\\u202F» par ordre ${\n sortDirection === \"asc\" ? \"croissant\" : \"décroissant\"\n }`,\n },\n ToastProvider: {\n label: \"Notification\",\n },\n ToastViewport: {\n label: \"Notifications ({hotkey})\",\n },\n};\n","import * as React from \"react\";\nimport { createStore, useStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { EMPTY_STORE } from \"../../utils/zustandUtils.ts\";\n\n/** Value of the document title provider context. */\nexport interface DocumentTitleProviderContextValue {\n baseDocumentTitle: string | null;\n baseSeparator: string;\n breadcrumbsSeparator: string;\n}\n\n/** Document title provider context. */\nexport const DocumentTitleProviderContext =\n React.createContext<DocumentTitleProviderContextValue | null>(null);\n\n/** State of the document title component. */\nexport interface DocumentTitleState {\n breadcrumbs: string[];\n childrenDocumentTitles: number;\n actions: DocumentTitleActions;\n}\n\n/** Document title actions. */\nexport interface DocumentTitleActions {\n addChildDocumentTitle: () => void;\n removeChildDocumentTitle: () => void;\n}\n\n/** Document title store. */\nexport type DocumentTitleStore = ReturnType<typeof useCreateDocumentTitleStore>;\n\n/** Document title context. */\nexport const DocumentTitleContext =\n React.createContext<DocumentTitleStore | null>(null);\n\n/** Hook used to create the context of a document title component. */\nexport function useCreateDocumentTitleStore(breadcrumbs?: string[]) {\n const store = useConstant(() =>\n createStore<DocumentTitleState>()(\n subscribeWithSelector((set) => ({\n breadcrumbs: breadcrumbs ?? [],\n childrenDocumentTitles: 0,\n actions: {\n addChildDocumentTitle: () =>\n set(({ childrenDocumentTitles }) => ({\n childrenDocumentTitles: childrenDocumentTitles + 1,\n })),\n removeChildDocumentTitle: () =>\n set(({ childrenDocumentTitles }) => ({\n childrenDocumentTitles: childrenDocumentTitles - 1,\n })),\n },\n })),\n ),\n );\n\n React.useEffect(() => {\n store.setState({ breadcrumbs });\n }, [breadcrumbs, store]);\n\n return store;\n}\n\n/** Hook that returns access to the document title's store. */\nexport function useDocumentTitleStore<T>(\n selector: (state: Partial<DocumentTitleState>) => T,\n): T {\n return useStore(\n React.useContext(DocumentTitleContext) ?? EMPTY_STORE,\n selector,\n );\n}\n","import * as React from \"react\";\nimport { useShallow } from \"zustand/react/shallow\";\nimport { shallow } from \"zustand/shallow\";\n\nimport {\n DocumentTitleContext,\n DocumentTitleProviderContext,\n useCreateDocumentTitleStore,\n useDocumentTitleStore,\n} from \"./DocumentTitleProviderContext.ts\";\n\n/** Properties of the document title component. */\nexport interface DocumentTitleProps {\n /** Title to set as a breadcrumb of the document title. */\n title?: string;\n children: React.ReactNode;\n}\n\n/**\n * Component used to set the provided title as a breadcrumb of the document\n * title.\n */\nexport function DocumentTitle({ title, children }: DocumentTitleProps) {\n const context = React.useContext(DocumentTitleProviderContext);\n if (context == null) {\n throw new Error(\"Document title provider context not in scope.\");\n }\n\n const actions = useDocumentTitleStore((state) => state.actions);\n const breadcrumbs = useDocumentTitleStore(\n useShallow((state) =>\n title ? [title, ...(state.breadcrumbs ?? [])] : (state.breadcrumbs ?? []),\n ),\n );\n\n const store = useCreateDocumentTitleStore(breadcrumbs);\n React.useEffect(() => {\n if (title) {\n actions?.addChildDocumentTitle();\n const unsubscribe = store.subscribe(\n ({ breadcrumbs, childrenDocumentTitles }) => ({\n breadcrumbs,\n childrenDocumentTitles,\n }),\n ({ breadcrumbs, childrenDocumentTitles }) => {\n if (childrenDocumentTitles === 0) {\n document.title = [\n breadcrumbs.join(` ${context.breadcrumbsSeparator} `),\n context.baseDocumentTitle,\n ].join(` ${context.baseSeparator} `);\n }\n },\n { fireImmediately: true, equalityFn: shallow },\n );\n return () => {\n unsubscribe();\n actions?.removeChildDocumentTitle();\n };\n }\n }, [\n context.baseDocumentTitle,\n context.baseSeparator,\n context.breadcrumbsSeparator,\n actions,\n store,\n title,\n ]);\n\n return (\n <DocumentTitleContext.Provider value={store}>\n {children}\n </DocumentTitleContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport {\n DocumentTitleContext,\n DocumentTitleProviderContext,\n useCreateDocumentTitleStore,\n} from \"./DocumentTitleProviderContext.ts\";\n\n/** Properties of the document title provider. */\nexport interface DocumentTitleProviderProps {\n /** Base document title. Defaults to the existing document title at load time. */\n baseDocumentTitle?: string | null;\n /**\n * String which separates the breadcrumbs from the base document title.\n *\n * @default \" | \"\n */\n baseSeparator?: string;\n /**\n * String which separates the breadcrumbs.\n *\n * @default \" ‹ \"\n */\n breadcrumbsSeparator?: string;\n children: React.ReactNode;\n}\n\n/** Default base document title. */\nconst DEFAULT_BASE_DOCUMENT_TITLE = document.title;\n\n/** Default base separator. */\nexport const DEFAULT_DOCUMENT_TITLE_BASE_SEPARATOR = \" | \";\n\n/** Default breadcrumbs separator. */\nexport const DEFAULT_DOCUMENT_TITLE_BREADCRUMBS_SEPARATOR = \" ‹ \";\n\n/** Localisation provider. */\nexport function DocumentTitleProvider({\n baseDocumentTitle = DEFAULT_BASE_DOCUMENT_TITLE,\n baseSeparator = DEFAULT_DOCUMENT_TITLE_BASE_SEPARATOR,\n breadcrumbsSeparator = DEFAULT_DOCUMENT_TITLE_BREADCRUMBS_SEPARATOR,\n children,\n}: DocumentTitleProviderProps) {\n const store = useCreateDocumentTitleStore();\n React.useEffect(\n () =>\n store.subscribe(\n ({ childrenDocumentTitles }) => childrenDocumentTitles,\n (childrenDocumentTitles) => {\n if (childrenDocumentTitles === 0) {\n document.title = baseDocumentTitle ?? \"\";\n }\n },\n { fireImmediately: true },\n ),\n [baseDocumentTitle, store],\n );\n\n return (\n <DocumentTitleProviderContext.Provider\n value={{ baseDocumentTitle, baseSeparator, breadcrumbsSeparator }}\n >\n <DocumentTitleContext.Provider value={store}>\n {children}\n </DocumentTitleContext.Provider>\n </DocumentTitleProviderContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport {\n type Toast,\n type ToastDescription,\n type ToastTitle,\n} from \"../../components/Toast\";\nimport { type DistributedOmit } from \"../../utils/typeUtils.ts\";\n\n/** Toast options. */\nexport type ToastOptions = DistributedOmit<\n React.ComponentPropsWithRef<typeof Toast>,\n \"defaultOpen\" | \"open\" | \"title\"\n> & {\n /** Toast's title. */\n title?: React.ReactNode;\n /** HTML `title` prop. */\n htmlTitle?: string;\n /** Properties to pass to the title component. */\n titleProps?: React.ComponentPropsWithRef<typeof ToastTitle>;\n /** Properties to pass to the description component. */\n descriptionProps?: React.ComponentPropsWithRef<typeof ToastDescription>;\n};\n\n/** Toast identifier. */\nexport type ToastId = number;\n\n/** Value of the toast manager context. */\nexport interface ToastManagerContextValue {\n /**\n * Adds a new toast.\n *\n * @param description Toast's description.\n * @param toastOptions Toast's options.\n * @returns Toast's unique identifier.\n */\n addToast: (\n description: React.ReactNode,\n toastOptions?: ToastOptions,\n ) => ToastId;\n /**\n * Removes an existing toast with the given identifier.\n *\n * @param toastId Toast identifier.\n */\n removeToast: (toastId: ToastId) => void;\n}\n\n/** Toast manager context. */\nexport const ToastManagerContext = React.createContext<\n ToastManagerContextValue | undefined\n>(undefined);\n","import * as React from \"react\";\n\nimport { Toast, ToastDescription, ToastTitle } from \"../../components/Toast\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n type ToastId,\n ToastManagerContext,\n type ToastOptions,\n} from \"./ToastManagerContext.ts\";\n\n/** Properties of the toast manager provider. */\nexport interface ToastManagerProviderProps {\n children: React.ReactNode;\n}\n\ntype ExtendedToastOptions = ToastOptions & {\n open: boolean;\n description: React.ReactNode;\n};\n\n/**\n * Toast manager provider.\n *\n * Note that this provider should be within a `ToastProvider`.\n */\nexport function ToastManagerProvider({ children }: ToastManagerProviderProps) {\n const toastId = React.useRef(0);\n const [toasts, setToasts] = React.useState<\n Record<ToastId, ExtendedToastOptions>\n >({});\n\n const addToast = React.useCallback(\n (description: React.ReactNode, toastOptions: ToastOptions = {}) => {\n const id = toastId.current++;\n setToasts((toasts) => ({\n ...toasts,\n [id]: { open: true, description, ...toastOptions },\n }));\n return id;\n },\n [],\n );\n\n const removeToast = React.useCallback((toastId: ToastId) => {\n setToasts((toasts) =>\n Object.entries(toasts).reduce(\n (res, [id, toast]) => {\n const numId = +id;\n res[numId] = numId === toastId ? { ...toast, open: false } : toast;\n return res;\n },\n {} as Record<ToastId, ExtendedToastOptions>,\n ),\n );\n // FIXME: Remove after https://github.com/radix-ui/primitives/issues/1020 is\n // fixed\n setTimeout(() => setToasts(({ [toastId]: _, ...toasts }) => toasts), 250);\n }, []);\n\n const handleAnimationEnd = React.useCallback(\n (toastId: ToastId) => {\n if (!toasts[toastId].open) {\n setToasts(({ [toastId]: _, ...toasts }) => toasts);\n }\n },\n [toasts],\n );\n\n return (\n <ToastManagerContext.Provider value={{ addToast, removeToast }}>\n {children}\n {Object.entries(toasts).map(\n ([\n toastId,\n {\n title,\n description,\n htmlTitle,\n rootProps,\n titleProps,\n descriptionProps,\n ...otherProps\n },\n ]) => (\n <Toast\n key={toastId}\n title={htmlTitle}\n onOpenChange={(open) => !open && removeToast(+toastId)}\n rootProps={{\n onAnimationEnd: combineEventHandlers(\n rootProps?.onAnimationEnd,\n () => handleAnimationEnd(+toastId),\n ),\n ...rootProps,\n }}\n {...otherProps}\n >\n {title && <ToastTitle {...titleProps}>{title}</ToastTitle>}\n <ToastDescription {...descriptionProps}>\n {description}\n </ToastDescription>\n </Toast>\n ),\n )}\n </ToastManagerContext.Provider>\n );\n}\n","import * as React from \"react\";\n\nimport {\n ToastManagerContext,\n type ToastManagerContextValue,\n} from \"./ToastManagerContext.ts\";\n\n/**\n * Hook used to programmatically manage toasts within an application.\n *\n * @example\n *\n * ```typescript\n * const { addToast } = useToastManager();\n *\n * async function handleNewItemClick() {\n * try {\n * await api.createNewItem();\n * addToast(\"New item created successfully!\", { severity: \"success\" });\n * } catch (err) {\n * addToast(err.message, {\n * title: \"Error creating new item. :-(\",\n * severity: \"danger\",\n * });\n * }\n * }\n * ```\n */\nexport function useToastManager(): ToastManagerContextValue {\n const context = React.useContext(ToastManagerContext);\n if (context == null) {\n throw new Error(\"Toast manager context not in scope.\");\n }\n return context;\n}\n","let loggedWarnings: Set<string> | undefined;\n\n/**\n * Emit a warning once.\n *\n * @param message Warning message.\n */\nexport function warnOnce(message: string): void {\n loggedWarnings ??= new Set();\n if (!loggedWarnings.has(message)) {\n console.warn(message);\n loggedWarnings.add(message);\n }\n}\n","import * as React from \"react\";\n\n/** Root context. */\nexport const RootContext = React.createContext<boolean>(false);\n\n/**\n * Hook exposing whether a component is being rendered within the `Root`\n * component.\n */\nexport function useIsInRoot(): boolean {\n return React.useContext(RootContext);\n}\n","import * as React from \"react\";\n\nimport { type LocalizationObject } from \"../../locale\";\nimport { AlertDialogProvider } from \"../../providers/AlertDialogProvider\";\nimport { DocumentTitleProvider } from \"../../providers/DocumentTitleProvider\";\nimport { ErrorReportingProvider } from \"../../providers/ErrorReportingProvider\";\nimport {\n LocalizationProvider,\n useLocale,\n} from \"../../providers/LocalizationProvider\";\nimport { PrefixProvider, usePrefix } from \"../../providers/PrefixProvider\";\nimport { ToastManagerProvider } from \"../../providers/ToastManagerProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { warnOnce } from \"../../utils/warnOnce.ts\";\nimport { ErrorBoundary } from \"../ErrorBoundary\";\nimport { Portal } from \"../Portal\";\nimport { PortalContext } from \"../Portal/PortalContext.ts\";\nimport { Slot } from \"../Slot\";\nimport {\n ToastProvider,\n type ToastSwipeDirection,\n ToastViewport,\n} from \"../Toast\";\nimport { TooltipProvider } from \"../Tooltip\";\nimport { RootContext, useIsInRoot } from \"./RootContext.ts\";\n\n/** Properties of the ostack/UI root component. */\nexport interface RootProps\n extends React.ComponentPropsWithoutRef<\"div\">,\n Pick<\n React.ComponentPropsWithoutRef<typeof ErrorReportingProvider>,\n | \"reportError\"\n | \"errorReportingUrl\"\n | \"errorReportingMethod\"\n | \"encodeErrorReport\"\n | \"encodedErrorReportMimeType\"\n | \"errorReportingOptions\"\n >,\n Pick<\n React.ComponentPropsWithoutRef<typeof DocumentTitleProvider>,\n \"baseDocumentTitle\"\n > {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Custom prefix used to prefix all component classes, styles, _etc._\n *\n * This prefix should match the `$prefix` SCSS variable.\n */\n prefix?: string;\n /**\n * Whether error reporting should be enabled. By default, error reporting is\n * enabled in production.\n */\n enableErrorReporting?: boolean;\n /**\n * Locale to use for the components.\n *\n * @default defaultLocale\n */\n locale?: LocalizationObject;\n /**\n * String which separates the breadcrumbs from the base document title.\n *\n * @default \" | \"\n */\n documentTitleBaseSeparator?: string;\n /**\n * String which separates the breadcrumbs of the document title.\n *\n * @default \" ‹ \"\n */\n documentTitleBreadcrumbsSeparator?: string;\n /**\n * Default container used by ostack/UI portals.\n *\n * @default document.body\n */\n portalsContainer?: Element | DocumentFragment | null;\n /**\n * The duration from when the pointer enters the trigger until the tooltip\n * gets opened.\n *\n * @defaultValue 700\n */\n tooltipsDelayDuration?: number;\n /**\n * How much time a user has to enter another trigger without incurring a delay\n * again.\n *\n * @defaultValue 300\n */\n tooltipsSkipDelayDuration?: number;\n /**\n * When set, trying to hover the content will result in the tooltip closing as\n * the pointer leaves the trigger.\n *\n * @defaultValue false\n */\n disableTooltipsHoverableContent?: boolean;\n /**\n * A label for each toast. Used to help screen-reader users associate the\n * interruption with a toast. By default, a translated version of the word\n * “Notification” is used.\n */\n toastsLabel?: string;\n /**\n * Time in milliseconds that each toast should remain visible for.\n *\n * @defaultValue 5000\n */\n toastsDuration?: number;\n /**\n * Direction of pointer swipe that should close the toast.\n *\n * @defaultValue \"right\"\n */\n toastsSwipeDirection?: ToastSwipeDirection;\n /**\n * Distance in pixels that the swipe must pass before a close is triggered.\n *\n * @defaultValue 50\n */\n toastsSwipeThreshold?: number;\n /**\n * The keys to use as the keyboard shortcut that will move focus to the toast\n * viewport.\n *\n * @defaultValue [\"F8\"]\n */\n toastViewportHotkey?: string[];\n /**\n * A label for the toast viewport to provide context for screen reader users\n * when navigating page landmarks. The available `{hotkey}` placeholder will\n * be automatically replaced. By default, a translated version of\n * “Notifications ({hotkey})” is used.\n */\n toastViewportLabel?: string;\n /** Properties to pass to the `ToastViewport` component. */\n toastViewportProps?: React.ComponentPropsWithRef<\"ol\">;\n /** Properties to pass to the `ErrorBoundary` component. */\n errorBoundaryProps?: React.ComponentPropsWithRef<typeof ErrorBoundary>;\n}\n\n/**\n * Root component that should wrap an ostack/UI application, exposing all\n * ostack/UI providers and base styles.\n *\n * It further wraps the whole application in an error boundary with support for\n * error reporting.\n */\nexport const Root = React.forwardRef<React.ComponentRef<\"div\">, RootProps>(\n function Root(\n {\n asChild,\n prefix: newPrefix,\n enableErrorReporting,\n reportError,\n errorReportingUrl,\n errorReportingMethod,\n encodeErrorReport,\n encodedErrorReportMimeType,\n errorReportingOptions,\n locale: newLocale,\n baseDocumentTitle,\n documentTitleBaseSeparator,\n documentTitleBreadcrumbsSeparator,\n portalsContainer,\n tooltipsDelayDuration,\n tooltipsSkipDelayDuration,\n disableTooltipsHoverableContent,\n toastsLabel,\n toastsDuration,\n toastsSwipeDirection,\n toastsSwipeThreshold,\n toastViewportHotkey,\n toastViewportLabel,\n toastViewportProps,\n errorBoundaryProps,\n className,\n children,\n ...otherProps\n },\n forwardedRef,\n ) {\n const isInRoot = useIsInRoot();\n\n // Properties that can only be declared on the top-most `Root` component\n const topMostProps = {\n enableErrorReporting,\n reportError,\n errorReportingUrl,\n errorReportingMethod,\n encodeErrorReport,\n encodedErrorReportMimeType,\n errorReportingOptions,\n baseDocumentTitle,\n documentTitleBaseSeparator,\n documentTitleBreadcrumbsSeparator,\n portalsContainer,\n tooltipsDelayDuration,\n tooltipsSkipDelayDuration,\n disableTooltipsHoverableContent,\n toastsLabel,\n toastsDuration,\n toastsSwipeDirection,\n toastsSwipeThreshold,\n toastViewportHotkey,\n toastViewportLabel,\n toastViewportProps,\n errorBoundaryProps,\n };\n if (\n isInRoot &&\n Object.values(topMostProps).some((prop) => prop !== undefined)\n ) {\n warnOnce(\n `Root: Properties ${Object.keys(topMostProps)\n .map((prop) => `\\`${prop}\\``)\n .join(\", \")} have no effect in nested \\`Root\\` components. ` +\n \"Please set any of these properties on the top-most `Root` \" +\n \"component instead.\",\n );\n }\n\n const contextPrefix = usePrefix();\n const prefix =\n newPrefix === undefined\n ? contextPrefix\n : (toPrefix: string) => `${newPrefix}${toPrefix}`;\n\n const contextLocale = useLocale();\n const locale = newLocale ?? contextLocale;\n\n const errorBoundChildren = (children: React.ReactNode) => (\n <ErrorBoundary {...errorBoundaryProps}>{children}</ErrorBoundary>\n );\n const content = isInRoot\n ? children\n : asChild\n ? React.cloneElement(\n children as React.ReactElement,\n undefined,\n errorBoundChildren(\n (children as React.ReactElement<any>).props.children,\n ),\n )\n : errorBoundChildren(children);\n\n const As = asChild ? Slot : \"div\";\n const root = (\n <As\n lang={locale.languageTag}\n className={cx(prefix(\"root\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {content}\n </As>\n );\n\n return isInRoot ? (\n <PrefixProvider prefix={newPrefix}>\n <LocalizationProvider locale={newLocale}>{root}</LocalizationProvider>\n </PrefixProvider>\n ) : (\n <RootContext.Provider value={true}>\n <PrefixProvider prefix={newPrefix}>\n <ErrorReportingProvider\n enabled={enableErrorReporting}\n reportError={reportError}\n errorReportingUrl={errorReportingUrl}\n errorReportingMethod={errorReportingMethod}\n encodeErrorReport={encodeErrorReport}\n encodedErrorReportMimeType={encodedErrorReportMimeType}\n errorReportingOptions={errorReportingOptions}\n >\n <LocalizationProvider locale={newLocale}>\n <DocumentTitleProvider\n baseDocumentTitle={baseDocumentTitle}\n baseSeparator={documentTitleBaseSeparator}\n breadcrumbsSeparator={documentTitleBreadcrumbsSeparator}\n >\n <PortalContext.Provider value={{ container: portalsContainer }}>\n <TooltipProvider\n delayDuration={tooltipsDelayDuration}\n skipDelayDuration={tooltipsSkipDelayDuration}\n disableHoverableContent={disableTooltipsHoverableContent}\n >\n <AlertDialogProvider>\n <ToastProvider\n label={toastsLabel}\n duration={toastsDuration}\n swipeDirection={toastsSwipeDirection}\n swipeThreshold={toastsSwipeThreshold}\n >\n <ToastManagerProvider>\n {root}\n\n <Portal container={portalsContainer} asChild>\n <ToastViewport\n hotkey={toastViewportHotkey}\n label={toastViewportLabel}\n {...toastViewportProps}\n />\n </Portal>\n </ToastManagerProvider>\n </ToastProvider>\n </AlertDialogProvider>\n </TooltipProvider>\n </PortalContext.Provider>\n </DocumentTitleProvider>\n </LocalizationProvider>\n </ErrorReportingProvider>\n </PrefixProvider>\n </RootContext.Provider>\n );\n },\n);\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the button group component. */\nexport interface ButtonGroupProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/**\n * The button group component can be used to group buttons together.\n *\n * It supports both `Button` and `IconButton` components as children.\n *\n * Example usage:\n *\n * ```tsx\n * import { Button, ButtonGroup } from \"@ostack.tech/ui\";\n *\n * function Actions() {\n * return (\n * <ButtonGroup>\n * <Button>Delete</Button>\n * <Button>Correct</Button>\n * <Button>Submit</Button>\n * </ButtonGroup>\n * );\n * }\n * ```\n */\nexport const ButtonGroup = React.forwardRef<\n React.ComponentRef<\"div\">,\n ButtonGroupProps\n>(function ButtonGroup({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(prefix(\"button-group\"), className)}\n ref={forwardedRef}\n role=\"group\"\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n controlStatusToAccent,\n type ControlVariant,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { ControlCode } from \"../ControlCode\";\nimport { useDataTableColumnLabelId } from \"../DataTable\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useFieldLabelId,\n useSetFieldControl,\n useSetFieldControlFocused,\n} from \"../Field\";\nimport { Spinner } from \"../Spinner\";\nimport { useIsInTableCell } from \"../Table\";\nimport { CheckboxGroupContext } from \"./CheckboxGroupContext.ts\";\n\n/** Properties of the checkbox group component. */\nexport interface CheckboxGroupProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Whether to display the checkbox group inline. Defaults to `false` unless\n * when rending inside a table cell.\n */\n inline?: boolean;\n /**\n * Checkbox group style variant. Defaults to the default variant unless when\n * rendering inside a table cell (in which it defaults to `\"cell\"`).\n */\n variant?: ControlVariant;\n /** Sets the status of the checkbox group. */\n status?: ControlStatus;\n /** Checkbox group code. */\n code?: React.ReactNode;\n /** Checkbox group name. */\n name?: string;\n /**\n * Adds a spinner to the checkbox group to indicate activity. Note that it\n * doesn't automatically disable the control.\n *\n * @default false\n */\n loading?: boolean;\n /** Whether the field is required. */\n required?: boolean;\n /** Whether to disable the checkbox group. */\n disabled?: boolean;\n /** Sets the checkbox group as read-only. */\n readOnly?: boolean;\n /** Default value of the checkbox group. */\n defaultValue?: string[];\n /** Value of the checkbox group. */\n value?: string[];\n /** Action to run whenever the checkbox group's value changes. */\n onValueChange?: (value: string[]) => void;\n /**\n * Function called when the focus moves out of the control as a whole.\n *\n * This is useful when there is a need to know when the user stops interacting\n * with the control.\n */\n onBlurToOutside?: (event: React.FocusEvent) => void;\n /** Properties to pass to the code component. */\n codeProps?: React.ComponentPropsWithRef<typeof ControlCode>;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the end element containing the spinner. */\n endContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n}\n\n/**\n * The `CheckboxGroup` component displays a set of `Checkbox` components,\n * allowing a user to check any combination of the included checkboxes.\n *\n * The state of the checkbox group is an array containing the `value` of every\n * checked checkbox.\n *\n * For accessibility purposes, checkbox groups are usually included within a\n * `Field` together with a `Label` and optionally `HelperText` and/or\n * `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { Checkbox, CheckboxGroup } from \"@ostack.tech/ui\";\n *\n * function FavoriteFlavors() {\n * return (\n * <CheckboxGroup>\n * <Checkbox value=\"chocolate\">Chocolate</Checkbox>\n * <Checkbox value=\"mint\">Mint</Checkbox>\n * <Checkbox value=\"vanilla\">Vanilla</Checkbox>\n * </CheckboxGroup>\n * );\n * }\n * ```\n */\nexport const CheckboxGroup = React.forwardRef<\n React.ComponentRef<\"div\">,\n CheckboxGroupProps\n>(function CheckboxGroup(\n {\n inline,\n variant,\n status,\n code,\n name,\n loading,\n required,\n disabled = false,\n readOnly = false,\n defaultValue,\n value: controlledValue,\n onValueChange,\n onBlurToOutside,\n codeProps,\n containerProps,\n endContainerProps,\n spinnerProps,\n id,\n className,\n onFocus,\n onBlur,\n onMouseDown,\n tabIndex: controlledTabIndex,\n children,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const labelId = useFieldLabelId();\n const dataTableColumnLabelId = useDataTableColumnLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const { controlId, codeId } = useSetFieldControl(\n id,\n \"DIV\",\n codeProps?.id,\n !!code,\n required,\n );\n const checkboxGroupRef = React.useRef<HTMLDivElement | null>(null);\n\n const isInTableCell = useIsInTableCell();\n inline ??= isInTableCell;\n variant ??= isInTableCell ? \"cell\" : \"default\";\n\n const [value, setValue] = useControllableState<string[]>(\n defaultValue ?? [],\n controlledValue,\n );\n const handleCheckedChange = React.useCallback(\n (checkboxValue: string, checked: boolean) => {\n const newValue = checked\n ? [...value, checkboxValue]\n : value.filter((v) => v !== checkboxValue);\n setValue(newValue);\n onValueChange?.(newValue);\n },\n [onValueChange, setValue, value],\n );\n\n // Focus the first checkbox when the group gets focus and control the group's\n // tabIndex based on whether we're inside or outside it\n const [tabIndex, setTabIndex] = useControllableState(\n disabled ? -1 : 0,\n controlledTabIndex ?? (disabled ? -1 : undefined),\n );\n // Prevent focus when clicking directly on the group\n const isMouseEvent = React.useRef(false);\n\n React.useEffect(() => {\n const handleFocusIn = (evt: FocusEvent) => {\n setTabIndex(\n evt.target instanceof Node &&\n checkboxGroupRef.current?.contains(evt.target)\n ? -1\n : 0,\n );\n };\n document.addEventListener(\"focusin\", handleFocusIn, { passive: true });\n return () => document.removeEventListener(\"focusin\", handleFocusIn);\n }, [setTabIndex]);\n\n const handleMouseDown = React.useCallback<\n React.MouseEventHandler<HTMLDivElement>\n >(() => {\n isMouseEvent.current = true;\n }, []);\n\n const setFieldControlFocused = useSetFieldControlFocused();\n const handleFocus = React.useCallback<\n React.FocusEventHandler<HTMLDivElement>\n >(\n (evt) => {\n setFieldControlFocused(true);\n if (evt.target === checkboxGroupRef.current && !isMouseEvent.current) {\n const firstCheckbox: HTMLElement | null =\n checkboxGroupRef.current?.querySelector(`.${prefix(\"checkbox\")}`);\n firstCheckbox?.focus();\n }\n isMouseEvent.current = false;\n },\n [prefix, setFieldControlFocused],\n );\n\n // Notify when the focus moves out of the checkbox group\n const handleBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n setFieldControlFocused(false);\n if (\n onBlurToOutside &&\n (!evt.relatedTarget ||\n !checkboxGroupRef.current?.contains(evt.relatedTarget))\n ) {\n onBlurToOutside(evt);\n }\n },\n [onBlurToOutside, setFieldControlFocused],\n );\n\n const combinedCheckboxGroupRef = useCombinedRef(\n checkboxGroupRef,\n forwardedRef,\n );\n return (\n <ClearContexts>\n <ControlContext.Provider value={{ variant, status, disabled, readOnly }}>\n <CheckboxGroupContext.Provider\n value={{ name, value, onCheckedChange: handleCheckedChange }}\n >\n <div\n role=\"group\"\n id={controlId}\n {...otherProps}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n className={cx(\n prefix(\"checkbox-group\"),\n inline && prefix(\"checkbox-group--inline\"),\n className,\n )}\n onMouseDown={combineEventHandlers(onMouseDown, handleMouseDown)}\n onFocus={combineEventHandlers(onFocus, handleFocus)}\n onBlur={combineEventHandlers(onBlur, handleBlur)}\n aria-readonly={readOnly ? \"true\" : undefined}\n aria-labelledby={mergeAriaIds(\n dataTableColumnLabelId,\n labelId,\n ariaLabelledBy,\n )}\n aria-describedby={mergeAriaIds(\n codeId,\n descriptionIds,\n errorMessageIds,\n ariaDescribedBy,\n )}\n tabIndex={tabIndex}\n ref={combinedCheckboxGroupRef}\n >\n {/* Code */}\n {code && (\n <ControlCode\n status={status}\n {...codeProps}\n id={codeId}\n className={cx(\n prefix(\"checkbox-group__code\"),\n codeProps?.className,\n )}\n >\n {code}\n </ControlCode>\n )}\n\n {/* Checkboxes container */}\n <div\n data-status={status}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...containerProps}\n className={cx(\n prefix(\"checkbox-group__container\"),\n containerProps?.className,\n )}\n >\n <ClearContexts>{children}</ClearContexts>\n </div>\n\n {/* Spinner */}\n {loading && (\n <div\n data-status={status}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...endContainerProps}\n className={cx(\n prefix(\"checkbox-group__end-container\"),\n endContainerProps?.className,\n )}\n >\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(disabled)}\n {...spinnerProps}\n className={cx(\n prefix(\"checkbox-group__spinner\"),\n spinnerProps?.className,\n )}\n />\n </div>\n )}\n </div>\n </CheckboxGroupContext.Provider>\n </ControlContext.Provider>\n </ClearContexts>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { type Breakpoint } from \"../../utils/breakpoints.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport {\n type Responsive,\n useResponsiveValues,\n} from \"../../utils/useResponsiveValues.ts\";\nimport { useSpacing } from \"../../utils/useSpacing.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Value specifying up to which breakpoint the container should be fluid. */\nexport type ContainerFluidUntil = Omit<Breakpoint, \"xs\">;\n\n/** Properties of the container component. */\nexport interface ContainerProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Sets the container's width to `100%` up to the specified breakpoint (or at\n * all times when `true`).\n *\n * @default \"sm\"\n */\n fluid?: ContainerFluidUntil | true;\n /**\n * Size of the left and right margins of the container. When a number `n` is\n * provided, each unit corresponds to `spacing(n)`.\n *\n * A responsive value may be provided to change the gutter size based on the\n * current breakpoint.\n *\n * @default 2.5\n */\n gutter?: Responsive<number | string>;\n /**\n * Size of the left margin of the container. When a number `n` is provided,\n * each unit corresponds to `spacing(n)`.\n *\n * A responsive value may be provided to change the gutter size based on the\n * current breakpoint.\n *\n * @default gutter\n */\n leftGutter?: Responsive<number | string>;\n /**\n * Size of the right margin of the container. When a number `n` is provided,\n * each unit corresponds to `spacing(n)`.\n *\n * A responsive value may be provided to change the gutter size based on the\n * current breakpoint.\n *\n * @default gutter\n */\n rightGutter?: Responsive<number | string>;\n}\n\n/**\n * The container component is used to constrain the maximum width of its\n * content.\n *\n * Example usage:\n *\n * ```tsx\n * import { Container } from \"@ostack.tech/ui\";\n *\n * function App() {\n * return <Container>…</Container>;\n * }\n * ```\n */\nexport const Container = React.forwardRef<\n React.ComponentRef<\"div\">,\n ContainerProps\n>(function Container(\n {\n asChild,\n fluid = \"sm\",\n gutter,\n leftGutter = gutter,\n rightGutter = gutter,\n className,\n style,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const spacing = useSpacing();\n const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();\n\n const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(\n \"container\",\n { leftGutter, rightGutter },\n {\n leftGutter: (v) => (typeof v === \"number\" ? spacing(v) : v),\n rightGutter: (v) => (typeof v === \"number\" ? spacing(v) : v),\n },\n );\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n className={cx(\n prefix(\"container\"),\n fluid !== true && prefix(`container--${fluid as string}`),\n className,\n )}\n style={{ ...cssVars, ...style }}\n {...dataAttrs}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\n/** Properties of the dropdown menu component. */\nexport interface DropdownMenuProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>,\n // We don't (yet) support `rtl`\n \"dir\"\n > {}\n\n/**\n * Menu displayed within a dropdown, containing a set of actions.\n *\n * Built on top of the [Radix Dropdown Menu\n * primitive](https://www.radix-ui.com/primitives/docs/components/dropdown-menu)\n * and the `MenuList` component.\n *\n * It composes the following subcomponents:\n *\n * - `DropdownMenuTrigger`: Contains the element that triggers the dropdown menu.\n * - `DropdownMenuContent`: Represents the menu itself. It appears once the\n * trigger is pressed.\n * - `DropdownMenuGroup`: Groups items under an optional label.\n * - `DropdownMenuItem`: An item of the dropdown menu.\n * - `DropdownMenuCheckboxItem`: An item that can be controlled and rendered like\n * a checkbox.\n * - `DropdownMenuRadioGroup`: Used to group multiple radio items.\n * - `DropdownMenuRadioItem`: An item that can be controlled and rendered like a\n * radio.\n * - `DropdownMenuSub`: Container of a submenu.\n * - `DropdownMenuSubTrigger`: An item that opens a submenu. Must be rendered\n * inside a submenu container.\n * - `DropdownMenuSubContent`: Content of a submenu. Must be rendered inside a\n * submenu container.\n *\n * Example usage:\n *\n * ```tsx\n * import {\n * Button,\n * DropdownMenu,\n * DropdownMenuContent,\n * DropdownMenuItem,\n * DropdownMenuTrigger,\n * } from \"@ostack.tech/ui\";\n *\n * function ActionsMenu() {\n * return (\n * <DropdownMenu>\n * <DropdownMenuTrigger>\n * <Button>Actions</Button>\n * </DropdownMenuTrigger>\n *\n * <DropdownMenuContent>\n * <DropdownMenuItem onSelect={openDocument}>\n * Open…\n * </DropdownMenuItem>\n * <DropdownMenuItem onSelect={editDocument}>\n * Edit…\n * </DropdownMenuItem>\n * <DropdownMenuItem onSelect={printDocument}>\n * Print…\n * </DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * );\n * }\n * ```\n */\nexport const DropdownMenu: React.ComponentType<DropdownMenuProps> =\n DropdownMenuPrimitive.Root;\n","import { faCheck, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { type CheckboxChecked } from \"../Checkbox\";\nimport { Icon } from \"../Icon\";\nimport { MenuListItem, type MenuListItemProps } from \"../MenuList\";\n\n/** Properties of the dropdown menu checkbox item. */\nexport interface DropdownMenuCheckboxItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n \"asChild\" | \"color\"\n >,\n Pick<\n MenuListItemProps,\n | \"color\"\n | \"loading\"\n | \"enabledWhenLoading\"\n | \"loadingContent\"\n | \"iconPlacement\"\n | \"actionProps\"\n | \"contentProps\"\n | \"iconProps\"\n | \"spinnerProps\"\n > {\n /**\n * Whether to show the checkbox.\n *\n * @default true\n */\n showCheckbox?: boolean;\n /**\n * Function called whenever the item's checked status changes.\n *\n * @param value Checked status.\n */\n onCheckedChange?: (value: CheckboxChecked) => void;\n /** Properties to pass to the checkbox indicator component. */\n indicatorProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, \"icon\">;\n}\n\n/** A dropdown menu item that can be controlled and rendered like a checkbox. */\nexport const DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuCheckboxItemProps\n>(function DropdownMenuCheckboxItem(\n {\n showCheckbox = true,\n defaultChecked,\n checked: controlledChecked,\n onCheckedChange,\n color,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n iconPlacement,\n actionProps,\n contentProps,\n iconProps,\n spinnerProps,\n indicatorProps,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const [checked, setChecked] = useControllableState(\n defaultChecked ?? false,\n controlledChecked,\n );\n const handleCheckedChange = React.useCallback(\n (checked: CheckboxChecked) => {\n onCheckedChange?.(checked);\n setChecked(checked);\n },\n [onCheckedChange, setChecked],\n );\n\n return (\n <MenuListItem\n type=\"text\"\n color={color}\n disabled={disabled}\n loading={loading}\n enabledWhenLoading={enabledWhenLoading}\n loadingContent={loadingContent}\n iconPlacement={iconPlacement}\n actionProps={actionProps}\n contentProps={contentProps}\n data-hide-control={boolDataAttr(!showCheckbox)}\n icon={\n showCheckbox ? (\n <div className={prefix(\"dropdown-menu__checkbox\")}>\n <DropdownMenuPrimitive.ItemIndicator asChild>\n <Icon\n {...indicatorProps}\n icon={checked === \"indeterminate\" ? faMinus : faCheck}\n className={cx(\n prefix(\"dropdown-menu__checkbox-indicator\"),\n indicatorProps?.className,\n )}\n />\n </DropdownMenuPrimitive.ItemIndicator>\n </div>\n ) : null\n }\n iconProps={iconProps}\n spinnerProps={spinnerProps}\n asChild\n >\n <DropdownMenuPrimitive.CheckboxItem\n checked={checked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n {...otherProps}\n className={cx(prefix(\"dropdown-menu__checkbox-item\"), className)}\n ref={forwardedRef}\n />\n </MenuListItem>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { MenuList, type MenuListProps } from \"../MenuList\";\nimport { usePortalContext } from \"../Portal\";\nimport { Root } from \"../Root\";\n\n/** Properties of the dropdown menu content component. */\nexport interface DropdownMenuContentProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>,\n \"asChild\"\n >,\n Pick<MenuListProps, \"variant\" | \"iconPlacement\"> {\n /**\n * Whether to show an arrow pointing to the anchor.\n *\n * @default true\n */\n showArrow?: boolean;\n /** Properties to pass to the portal component. */\n portalProps?: Omit<\n React.ComponentPropsWithRef<typeof DropdownMenuPrimitive.Portal>,\n \"forceMount\"\n >;\n /** Properties to pass to the arrow component. */\n arrowProps?: React.ComponentPropsWithRef<typeof DropdownMenuPrimitive.Arrow>;\n /** Properties to pass to the menu list component. */\n menuListProps?: Omit<\n React.ComponentPropsWithRef<typeof MenuList>,\n \"variant\" | \"iconPlacement\" | \"asChild\"\n >;\n}\n\n/** The component that pops out when the dropdown menu is open. */\nexport const DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(function DropdownMenuContent(\n {\n variant,\n iconPlacement = \"end\",\n showArrow = true,\n sideOffset = 4,\n collisionPadding = 4,\n forceMount,\n className,\n portalProps,\n arrowProps,\n menuListProps,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const portalContext = usePortalContext();\n\n return (\n <ClearContexts>\n <DropdownMenuPrimitive.Portal\n container={portalContext?.container}\n {...portalProps}\n forceMount={forceMount}\n >\n <Root asChild>\n {/* The dropdown menu content component has trouble with padding, so\n we cannot use `asChild` over the menu list. */}\n <DropdownMenuPrimitive.Content\n className={cx(prefix(\"dropdown-menu\"), className)}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n forceMount={forceMount}\n ref={forwardedRef}\n {...otherProps}\n >\n <MenuList\n {...menuListProps}\n variant={variant}\n iconPlacement={iconPlacement}\n asChild\n >\n <div>\n {children}\n {showArrow && (\n <DropdownMenuPrimitive.Arrow\n width={12}\n height={6}\n {...arrowProps}\n className={cx(\n prefix(\"dropdown-menu__arrow\"),\n arrowProps?.className,\n )}\n />\n )}\n </div>\n </MenuList>\n </DropdownMenuPrimitive.Content>\n </Root>\n </DropdownMenuPrimitive.Portal>\n </ClearContexts>\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the menu list group component. */\nexport interface MenuListGroupProps\n extends React.ComponentPropsWithoutRef<\"ul\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /** Optional label of the menu list group. */\n label?: React.ReactNode;\n /**\n * What the item element containing the group should be rendered as. Defaults\n * to `\"li\"` unless `asChild` is provided, in which case it defaults to\n * `\"div\"`.\n */\n itemAs?: React.ElementType;\n /** Properties to pass to the item element containing the group. */\n itemProps?: React.ComponentPropsWithRef<\"li\">;\n /** Properties to pass to the label element. */\n labelProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/** Menu list group component. */\nexport const MenuListGroup = React.forwardRef<\n React.ComponentRef<\"ul\">,\n MenuListGroupProps\n>(function MenuListGroup(\n {\n asChild,\n label,\n itemAs,\n className,\n itemProps,\n labelProps,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const generatedId = React.useId();\n const labelId =\n label == null\n ? undefined\n : (labelProps?.id ?? prefix(`menu-list-group-label-${generatedId}`));\n\n const ItemAs = itemAs ?? (asChild ? \"div\" : \"li\");\n const As = asChild ? Slot : \"ul\";\n return (\n <ItemAs\n {...itemProps}\n className={cx(prefix(\"menu-list__group-item\"), itemProps?.className)}\n >\n {label != null && (\n <div\n {...labelProps}\n id={labelId}\n className={cx(\n prefix(\"menu-list__group-label\"),\n labelProps?.className,\n )}\n >\n {label}\n </div>\n )}\n <As\n aria-labelledby={labelId}\n className={cx(prefix(\"menu-list__group\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {children}\n </As>\n </ItemAs>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport {\n MenuListGroup,\n type MenuListGroupProps,\n} from \"../MenuList/MenuListGroup.tsx\";\n\n/** Properties of the dropdown menu group. */\nexport interface DropdownMenuGroupProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>,\n \"asChild\"\n >,\n Pick<MenuListGroupProps, \"label\" | \"itemProps\" | \"labelProps\"> {}\n\n/** Component used to group multiple dropdown menu items. */\nexport const DropdownMenuGroup = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Group>,\n DropdownMenuGroupProps\n>(function DropdownMenuGroup(\n { label, itemProps, labelProps, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n return (\n <MenuListGroup\n label={label}\n itemProps={itemProps}\n labelProps={labelProps}\n asChild\n >\n <DropdownMenuPrimitive.Group\n {...otherProps}\n className={cx(prefix(\"dropdown-menu__group\"), className)}\n ref={forwardedRef}\n />\n </MenuListGroup>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { MenuListItem, type MenuListItemProps } from \"../MenuList\";\n\n/** Properties of the dropdown menu item. */\nexport interface DropdownMenuItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>,\n \"asChild\" | \"color\"\n >,\n Pick<\n MenuListItemProps,\n | \"selected\"\n | \"color\"\n | \"loading\"\n | \"enabledWhenLoading\"\n | \"loadingContent\"\n | \"icon\"\n | \"iconPlacement\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"actionProps\"\n | \"contentProps\"\n | \"iconProps\"\n | \"spinnerProps\"\n > {\n /**\n * Render the item as a link. When set, you can pass `href`, `target`, and\n * `rel` properties to the item.\n *\n * @default false\n */\n asLink?: boolean;\n}\n\n/** Component containing a dropdown menu item. */\nexport const DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(function DropdownMenuItem(\n {\n onSelect,\n asLink,\n selected,\n color,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n icon,\n iconPlacement,\n href,\n target,\n rel,\n actionProps,\n contentProps,\n iconProps,\n spinnerProps,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n const handleSelect = React.useCallback(() => {\n if (asLink) {\n window.open(href, target, rel?.split(\" \").join(\",\"));\n }\n }, [asLink, href, rel, target]);\n\n return (\n <MenuListItem\n type={asLink ? \"link\" : \"text\"}\n selected={selected}\n color={color}\n disabled={disabled}\n loading={loading}\n enabledWhenLoading={enabledWhenLoading}\n loadingContent={loadingContent}\n icon={icon}\n iconPlacement={iconPlacement}\n href={href}\n target={target}\n rel={rel}\n actionProps={actionProps}\n contentProps={contentProps}\n iconProps={iconProps}\n spinnerProps={spinnerProps}\n asChild\n >\n <DropdownMenuPrimitive.Item\n disabled={disabled || (loading && !enabledWhenLoading)}\n {...otherProps}\n onSelect={combineEventHandlers(onSelect, handleSelect, {\n checkDefaultPrevented: true,\n })}\n className={cx(prefix(\"dropdown-menu__item\"), className)}\n ref={forwardedRef}\n />\n </MenuListItem>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport {\n MenuListGroup,\n type MenuListGroupProps,\n} from \"../MenuList/MenuListGroup.tsx\";\n\n/** Properties of the dropdown menu radio group. */\nexport interface DropdownMenuRadioGroupProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>,\n \"asChild\"\n >,\n Pick<MenuListGroupProps, \"label\" | \"itemProps\" | \"labelProps\"> {}\n\n/** Component used to group multiple dropdown menu radio items. */\nexport const DropdownMenuRadioGroup = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioGroup>,\n DropdownMenuRadioGroupProps\n>(function DropdownMenuRadioGroup(\n { label, itemProps, labelProps, className, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n return (\n <MenuListGroup\n label={label}\n itemProps={itemProps}\n labelProps={labelProps}\n asChild\n >\n <DropdownMenuPrimitive.RadioGroup\n {...otherProps}\n className={cx(prefix(\"dropdown-menu__radio-group\"), className)}\n ref={forwardedRef}\n />\n </MenuListGroup>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { MenuListItem, type MenuListItemProps } from \"../MenuList\";\n\n/** Properties of the dropdown menu radio item. */\nexport interface DropdownMenuRadioItemProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>,\n \"asChild\" | \"color\"\n >,\n Pick<\n MenuListItemProps,\n | \"color\"\n | \"loading\"\n | \"enabledWhenLoading\"\n | \"loadingContent\"\n | \"iconPlacement\"\n | \"actionProps\"\n | \"contentProps\"\n | \"iconProps\"\n | \"spinnerProps\"\n > {\n /**\n * Whether to show the radio.\n *\n * @default true\n */\n showRadio?: boolean;\n /** Properties to pass to the indicator component. */\n indicatorProps?: React.ComponentPropsWithRef<\n typeof DropdownMenuPrimitive.ItemIndicator\n >;\n}\n\n/** A dropdown menu item that can be controlled and rendered like a radio. */\nexport const DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuRadioItemProps\n>(function DropdownMenuRadioItem(\n {\n showRadio = true,\n color,\n disabled,\n loading,\n enabledWhenLoading,\n loadingContent,\n iconPlacement,\n actionProps,\n contentProps,\n iconProps,\n spinnerProps,\n indicatorProps,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n return (\n <MenuListItem\n type=\"text\"\n color={color}\n disabled={disabled}\n loading={loading}\n enabledWhenLoading={enabledWhenLoading}\n loadingContent={loadingContent}\n iconPlacement={iconPlacement}\n actionProps={actionProps}\n contentProps={contentProps}\n data-hide-control={boolDataAttr(!showRadio)}\n icon={\n showRadio ? (\n <div className={prefix(\"dropdown-menu__radio\")}>\n <DropdownMenuPrimitive.ItemIndicator\n {...indicatorProps}\n className={cx(\n prefix(\"dropdown-menu__radio-indicator\"),\n indicatorProps?.className,\n )}\n />\n </div>\n ) : null\n }\n iconProps={iconProps}\n spinnerProps={spinnerProps}\n asChild\n >\n <DropdownMenuPrimitive.RadioItem\n disabled={disabled}\n className={cx(prefix(\"dropdown-menu__radio-item\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n </MenuListItem>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\n\n/** Container used to render a submenu. */\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { MenuList, type MenuListProps } from \"../MenuList\";\nimport { useMenuListContext } from \"../MenuList/MenuListContext.ts\";\n\n/** Properties of the dropdown menu sub content component. */\nexport interface DropdownMenuSubContentProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>,\n \"asChild\"\n >,\n Pick<MenuListProps, \"variant\" | \"iconPlacement\"> {\n /** Properties to pass to the menu list component. */\n menuListProps?: Omit<\n React.ComponentPropsWithRef<typeof MenuList>,\n \"variant\" | \"iconPlacement\" | \"asChild\"\n >;\n}\n\n/**\n * The component that pops out when a submenu is open. Must be rendered inside\n * `DropdownMenuSub`.\n */\nexport const DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuSubContentProps\n>(function DropdownMenuSubContent(\n {\n variant,\n iconPlacement,\n sideOffset = -4,\n alignOffset = -4,\n className,\n children,\n menuListProps,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const menuListContext = useMenuListContext();\n\n // The dropdown menu sub-content component has trouble with padding, so\n // we cannot use `asChild` over the menu list.\n return (\n <DropdownMenuPrimitive.SubContent\n className={cx(prefix(\"dropdown-menu\"), className)}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n ref={forwardedRef}\n {...otherProps}\n >\n <MenuList\n {...menuListProps}\n asChild\n variant={variant ?? menuListContext.variant}\n iconPlacement={iconPlacement ?? menuListContext.iconPlacement}\n >\n <div>{children}</div>\n </MenuList>\n </DropdownMenuPrimitive.SubContent>\n );\n});\n","import { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { MenuListItem, type MenuListItemProps } from \"../MenuList\";\n\n/** Properties of the dropdown menu submenu trigger. */\nexport interface DropdownMenuSubTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>,\n \"asChild\" | \"color\"\n >,\n Pick<\n MenuListItemProps,\n | \"color\"\n | \"icon\"\n | \"disabled\"\n | \"actionProps\"\n | \"contentProps\"\n | \"iconProps\"\n > {}\n\n/**\n * A dropdown menu item that opens a submenu. Must be rendered within a\n * `DropdownMenuSub`.\n */\nexport const DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuSubTriggerProps\n>(function DropdownMenuSubTrigger(\n {\n color,\n icon = faChevronRight,\n disabled,\n actionProps,\n contentProps,\n iconProps,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n\n return (\n <MenuListItem\n type=\"text\"\n color={color}\n icon={icon}\n iconPlacement=\"end\"\n disabled={disabled}\n actionProps={actionProps}\n contentProps={contentProps}\n iconProps={{\n ...iconProps,\n className: cx(\n prefix(\"dropdown-menu__sub-trigger-icon\"),\n iconProps?.className,\n ),\n }}\n asChild\n >\n <DropdownMenuPrimitive.SubTrigger\n {...otherProps}\n className={cx(prefix(\"dropdown-menu__sub-trigger\"), className)}\n ref={forwardedRef}\n />\n </MenuListItem>\n );\n});\n","import { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\n/** Properties of the dropdown menu trigger component. */\nexport interface DropdownMenuTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>,\n \"asChild\"\n > {}\n\n/** Trigger component for the dropdown menu. */\nexport const DropdownMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Trigger>,\n DropdownMenuTriggerProps\n>(function DropdownMenuTrigger(props, forwardedRef) {\n return (\n <DropdownMenuPrimitive.Trigger {...props} asChild ref={forwardedRef} />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCssVars } from \"../../utils/useCssVars.ts\";\nimport {\n type Responsive,\n useResponsiveValues,\n} from \"../../utils/useResponsiveValues.ts\";\nimport { useSpacing } from \"../../utils/useSpacing.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Grid context value. */\ninterface GridContextValue {\n container: boolean;\n columns?: Responsive<number>;\n rowGap?: Responsive<number | string>;\n columnGap?: Responsive<number | string>;\n}\n\n/** Grid context. */\nconst GridContext = React.createContext<GridContextValue | null>(null);\n\n/** Size of a column. */\nexport type GridColumnSize = number | \"auto\" | \"content\";\n\n/** Offset of a column. */\nexport type GridOffsetSize = number | \"auto\";\n\n/** Properties of the grid component. */\nexport interface GridProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n /**\n * Mark the component as a grid container that contains the grid items. `Grid`\n * components are otherwise always items.\n */\n container?: boolean;\n /**\n * Number of columns of the grid.\n *\n * A responsive value may be provided to change the number of columns based on\n * the current breakpoint.\n *\n * @default 12\n */\n columns?: Responsive<number>;\n /**\n * Gap between both rows and columns. When a number `n` is provided, each unit\n * corresponds to `spacing(n)`.\n *\n * A responsive value may be provided to change the gap based on the current\n * breakpoint.\n *\n * @default 5\n */\n gap?: Responsive<number | string>;\n /**\n * Gap between rows. When a number `n` is provided, each unit corresponds to\n * `spacing(n)`.\n *\n * A responsive value may be provided to change the row gap based on the\n * current breakpoint.\n *\n * @default gap\n */\n rowGap?: Responsive<number | string>;\n /**\n * Gap between columns. When a number `n` is provided, each unit corresponds\n * to `spacing(n)`.\n *\n * A responsive value may be provided to change the column gap based on the\n * current breakpoint.\n *\n * @default gap\n */\n columnGap?: Responsive<number | string>;\n /** Column size (number of columns) at the `xs` breakpoint. */\n xs?: GridColumnSize;\n /** Offset size (number of columns) at the `xs` breakpoint. */\n xsOffset?: GridOffsetSize;\n /** Column size (number of columns) at the `sm` breakpoint. */\n sm?: GridColumnSize;\n /** Offset size (number of columns) at the `sm` breakpoint. */\n smOffset?: GridOffsetSize;\n /** Column size (number of columns) at the `md` breakpoint. */\n md?: GridColumnSize;\n /** Offset size (number of columns) at the `md` breakpoint. */\n mdOffset?: GridOffsetSize;\n /** Column size (number of columns) at the `lg` breakpoint. */\n lg?: GridColumnSize;\n /** Offset size (number of columns) at the `lg` breakpoint. */\n lgOffset?: GridOffsetSize;\n /** Column size (number of columns) at the `xl` breakpoint. */\n xl?: GridColumnSize;\n /** Offset size (number of columns) at the `xl` breakpoint. */\n xlOffset?: GridOffsetSize;\n /** Column size (number of columns) at the `xxl` breakpoint. */\n xxl?: GridColumnSize;\n /** Offset size (number of columns) at the `xxl` breakpoint. */\n xxlOffset?: GridOffsetSize;\n}\n\n/**\n * The `Grid` component is designed for creating layouts with a defined number\n * of columns. It allows you to configure columns responsively by specifying\n * different column spans for each child at various breakpoints, enabling\n * flexible and adaptive designs across screen sizes.\n */\nexport const Grid = React.forwardRef<React.ComponentRef<\"div\">, GridProps>(\n function Grid(\n {\n asChild,\n container = false,\n columns,\n gap,\n rowGap = gap,\n columnGap = gap,\n xs,\n sm,\n md,\n lg,\n xl,\n xxl,\n xsOffset,\n smOffset,\n mdOffset,\n lgOffset,\n xlOffset,\n xxlOffset,\n className,\n style,\n ...otherProps\n },\n forwardedRef,\n ) {\n const prefix = usePrefix();\n const { cssToggler } = useCssVars();\n const spacing = useSpacing();\n const { responsiveValuesToCssVarsAndDataAttrs } = useResponsiveValues();\n const gridContext = React.useContext(GridContext);\n\n const sizes = { xs, sm, md, lg, xl, xxl };\n const offsets = {\n xs: xsOffset,\n sm: smOffset,\n md: mdOffset,\n lg: lgOffset,\n xl: xlOffset,\n xxl: xxlOffset,\n };\n\n const gapMapper = (v: number | string) =>\n typeof v === \"number\" ? spacing(v) : v;\n const { cssVars, dataAttrs } = responsiveValuesToCssVarsAndDataAttrs(\n \"grid\",\n {\n rowGap: container ? rowGap : undefined,\n columnGap: container ? columnGap : undefined,\n containerColumns: gridContext?.container\n ? gridContext?.columns\n : undefined,\n containerRowGap: gridContext?.container\n ? gridContext?.rowGap\n : undefined,\n containerColumnGap: gridContext?.container\n ? gridContext?.columnGap\n : undefined,\n itemSize: gridContext?.container ? sizes : undefined,\n itemAutoSize: gridContext?.container ? sizes : undefined,\n itemOffset: gridContext?.container ? offsets : undefined,\n itemAutoOffset: gridContext?.container ? offsets : undefined,\n },\n {\n rowGap: gapMapper,\n columnGap: gapMapper,\n containerRowGap: gapMapper,\n containerColumnGap: gapMapper,\n itemSize: (v) => (typeof v === \"number\" ? v : \"auto\"),\n itemAutoSize: (v) => cssToggler(v === \"auto\"),\n itemAutoOffset: (v) => cssToggler(v === \"auto\"),\n },\n );\n\n const As = asChild ? Slot : \"div\";\n return (\n <GridContext.Provider value={{ container, columns, rowGap, columnGap }}>\n <As\n className={cx(\n prefix(\"grid\"),\n // Grid container classes\n container && prefix(\"grid__container\"),\n gridContext?.container && prefix(\"grid__item\"),\n className,\n )}\n style={{ ...cssVars, ...style }}\n {...dataAttrs}\n ref={forwardedRef}\n {...otherProps}\n />\n </GridContext.Provider>\n );\n },\n);\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useSetFieldHelperText } from \"../Field\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the helper text component. */\nexport interface HelperTextProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/** Component used to provide helper text to a form control. */\nexport const HelperText = React.forwardRef<\n React.ComponentRef<\"div\">,\n HelperTextProps\n>(function HelperText({ asChild, id, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n const helperTextId = useSetFieldHelperText(id);\n\n const As = asChild ? Slot : \"div\";\n return (\n <As\n id={helperTextId}\n className={cx(prefix(\"helper-text\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Slot } from \"../Slot\";\n\n/** Properties of the keyboard component. */\nexport interface KeyboardProps extends React.ComponentPropsWithoutRef<\"kbd\"> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * This will merge the original component props with the props of the supplied\n * element/component and change the underlying DOM node.\n */\n asChild?: boolean;\n}\n\n/**\n * Component used to show which key or combination of keys performs a given\n * action.\n */\nexport const Keyboard = React.forwardRef<\n React.ComponentRef<\"kbd\">,\n KeyboardProps\n>(function Keyboard({ asChild, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n const As = asChild ? Slot : \"kbd\";\n return (\n <As\n className={cx(prefix(\"keyboard\"), className)}\n ref={forwardedRef}\n {...otherProps}\n />\n );\n});\n","import * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Input, type InputPropsBase } from \"../Input\";\n\n/** Properties of the output component. */\nexport interface OutputProps\n extends Omit<\n InputPropsBase,\n \"asChild\" | \"children\" | \"showClearButton\" | \"clearButtonLabel\"\n >,\n React.ComponentPropsWithoutRef<\"output\"> {}\n\n/**\n * The output component is used to display the result of a calculation or user\n * action. It is built on top of the browser's [`<output>`\n * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/output)\n * as well as our own `Input` component in “read-only” mode.\n *\n * For accessibility purposes, outputs are usually included within a `Field`\n * together with a `Label` and optionally `HelperText` and/or `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { Output } from \"@ostack.tech/ui\";\n *\n * function Total() {\n * return <Output>1,000.00 €</Output>;\n * }\n * ```\n */\nexport const Output = React.forwardRef<\n React.ComponentRef<\"output\">,\n OutputProps\n>(function Output({ className, children, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <Input\n {...(otherProps as any)}\n className={cx(prefix(\"output\"), className)}\n readOnly\n asChild\n >\n <output ref={forwardedRef}>{children}</output>\n </Input>\n );\n});\n","import { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { type ControlStatus, useControlContext } from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { ControlCode } from \"../ControlCode\";\nimport { Label } from \"../Label\";\nimport { Spinner } from \"../Spinner\";\n\n/** Properties of a radio component. */\nexport interface RadioProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n \"value\"\n > {\n /** Radio value. */\n value?: React.ComponentPropsWithoutRef<\"input\">[\"value\"];\n /** Sets the status of the radio. */\n status?: ControlStatus;\n /** Radio code. */\n code?: React.ReactNode;\n /** Sets the radio as read-only. */\n readOnly?: boolean;\n /**\n * Adds a spinner to the checkbox to indicate activity. Note that it doesn't\n * automatically disable the checkbox.\n *\n * @default false\n */\n loading?: boolean;\n /** Properties to pass to the root component. */\n rootProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the code component. */\n codeProps?: React.ComponentPropsWithRef<typeof ControlCode>;\n /** Properties to pass to the indicator component. */\n indicatorProps?: React.ComponentPropsWithRef<\n typeof RadioGroupPrimitive.Indicator\n >;\n /** Properties to pass to the label component. */\n labelProps?: React.ComponentPropsWithRef<typeof Label>;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n}\n\n/** Radio component. Must be used within a radio group. */\nexport const Radio = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n RadioProps\n>(function Radio(\n {\n value,\n status,\n code,\n loading,\n children,\n rootProps,\n codeProps,\n indicatorProps,\n labelProps,\n spinnerProps,\n id,\n disabled,\n readOnly,\n className,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const controlContext = useControlContext();\n const generatedId = React.useId();\n const radioId = id ?? prefix(`radio-${generatedId}`);\n const codeId = codeProps?.id ?? prefix(`control-code-${generatedId}`);\n status = controlContext?.status ?? status;\n disabled = controlContext?.disabled || disabled;\n readOnly = controlContext?.readOnly || readOnly;\n\n return (\n <div\n data-status={status}\n {...rootProps}\n className={cx(prefix(\"radio__root\"), rootProps?.className)}\n >\n {code && (\n <ControlCode\n status={status}\n {...codeProps}\n id={codeId}\n className={cx(prefix(\"radio__code\"), codeProps?.className)}\n >\n {code}\n </ControlCode>\n )}\n\n <RadioGroupPrimitive.Item\n id={radioId}\n className={cx(prefix(\"radio\"), className)}\n value={value?.toString() ?? \"\"}\n disabled={disabled}\n data-readonly={boolDataAttr(readOnly)}\n aria-readonly={readOnly ? \"true\" : undefined}\n data-status={status}\n aria-describedby={mergeAriaIds(\n code != null ? codeId : undefined,\n ariaDescribedBy,\n )}\n ref={forwardedRef}\n {...otherProps}\n >\n <RadioGroupPrimitive.Indicator\n {...indicatorProps}\n className={cx(prefix(\"radio__indicator\"), indicatorProps?.className)}\n />\n </RadioGroupPrimitive.Item>\n\n {children && (\n <Label\n htmlFor={radioId}\n data-status={status}\n {...labelProps}\n className={cx(prefix(\"radio__label\"), labelProps?.className)}\n containerProps={{\n ...labelProps?.containerProps,\n className: cx(\n prefix(\"radio__label-container\"),\n labelProps?.containerProps?.className,\n ),\n }}\n >\n {children}\n </Label>\n )}\n\n {/* Spinner */}\n {loading && (\n <Spinner\n data-status={status}\n data-disabled={boolDataAttr(disabled)}\n {...spinnerProps}\n className={cx(prefix(\"checkbox__spinner\"), spinnerProps?.className)}\n />\n )}\n </div>\n );\n});\n","import { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { useLocale } from \"../../providers/LocalizationProvider\";\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport {\n ControlContext,\n type ControlStatus,\n controlStatusToAccent,\n type ControlVariant,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { mergeAriaIds } from \"../../utils/mergeAriaIds.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { ClearContexts } from \"../ClearContexts\";\nimport { CloseButton } from \"../CloseButton\";\nimport { ControlCode } from \"../ControlCode\";\nimport { useDataTableColumnLabelId } from \"../DataTable\";\nimport {\n useFieldDescriptionIds,\n useFieldErrorMessageIds,\n useFieldLabelId,\n useSetFieldControl,\n useSetFieldControlFocused,\n} from \"../Field\";\nimport { type ShowClearButton } from \"../Input\";\nimport { Spinner } from \"../Spinner\";\nimport { useIsInTableCell } from \"../Table\";\n\n/** Properties of the radio group component. */\nexport interface RadioGroupProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,\n \"asChild\"\n > {\n /** Whether to display the radio group inline. */\n inline?: boolean;\n /**\n * Radio group style variant. Defaults to the default variant unless when\n * rendering inside a table cell (in which it defaults to `\"cell\"`).\n */\n variant?: ControlVariant;\n /** Sets the status of the radio group. */\n status?: ControlStatus;\n /** Sets the radio group as read-only. */\n readOnly?: boolean;\n /**\n * Adds a spinner to the radio group to indicate activity. Note that it\n * doesn't automatically disable the control.\n *\n * @default false\n */\n loading?: boolean;\n /** Radio group code. */\n code?: React.ReactNode;\n /**\n * Whether to show a button to clear the radio group.\n *\n * @default false\n */\n showClearButton?: ShowClearButton;\n /** Label of the clear button announced to assistive technologies. */\n clearButtonLabel?: string;\n /**\n * Function called when the focus moves out of the control as a whole.\n *\n * This is useful when there is a need to know when the user stops interacting\n * with the control.\n */\n onBlurToOutside?: (event: React.FocusEvent) => void;\n /** Properties to pass to the code component. */\n codeProps?: React.ComponentPropsWithRef<typeof ControlCode>;\n /** Properties to pass to the container component. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /**\n * Properties to pass to the end element containing the clear button and\n * spinner.\n */\n endContainerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the clear button component. */\n clearButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;\n /** Properties to pass to the spinner component. */\n spinnerProps?: Omit<React.ComponentPropsWithRef<typeof Spinner>, \"size\">;\n}\n\n/**\n * The `RadioGroup` component displays a set of `Radio` button components,\n * allowing a user to check at most one of the included radio buttons.\n *\n * For accessibility purposes, radio groups are usually included within a\n * `Field` together with a `Label` and optionally `HelperText` and/or\n * `Feedback`.\n *\n * Example usage:\n *\n * ```tsx\n * import { Radio, RadioGroup } from \"@ostack.tech/ui\";\n *\n * function FavoriteFlavor() {\n * return (\n * <RadioGroup>\n * <Radio value=\"chocolate\">Chocolate</Radio>\n * <Radio value=\"mint\">Mint</Radio>\n * <Radio value=\"vanilla\">Vanilla</Radio>\n * </RadioGroup>\n * );\n * }\n * ```\n */\nexport const RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(function RadioGroup(\n {\n defaultValue,\n value: controlledValue,\n onValueChange,\n inline,\n variant,\n status,\n loading,\n code,\n showClearButton,\n clearButtonLabel,\n onBlurToOutside,\n codeProps,\n containerProps,\n endContainerProps,\n clearButtonProps,\n spinnerProps,\n id,\n required,\n disabled,\n readOnly,\n className,\n children,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n onFocus,\n onBlur,\n onKeyDown,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const locale = useLocale();\n clearButtonLabel ??= locale.Input.clearButtonLabel;\n const labelId = useFieldLabelId();\n const dataTableColumnLabelId = useDataTableColumnLabelId();\n const descriptionIds = useFieldDescriptionIds();\n const errorMessageIds = useFieldErrorMessageIds();\n const [value, setValue] = useControllableState(\n defaultValue ?? \"\",\n controlledValue,\n );\n const { controlId, codeId } = useSetFieldControl(\n id,\n \"DIV\",\n codeProps?.id,\n !!code,\n required,\n );\n const radioGroupRef = React.useRef<React.ComponentRef<\n typeof RadioGroupPrimitive.Root\n > | null>(null);\n\n const isInTableCell = useIsInTableCell();\n inline ??= isInTableCell;\n variant ??= isInTableCell ? \"cell\" : \"default\";\n\n const handleValueChange = React.useCallback(\n (value: string) => {\n if (!readOnly) {\n setValue(value);\n onValueChange?.(value);\n }\n },\n [onValueChange, readOnly, setValue],\n );\n\n const setFieldControlFocused = useSetFieldControlFocused();\n const handleControlFocus = React.useCallback(() => {\n setFieldControlFocused(true);\n }, [setFieldControlFocused]);\n\n // Notify when the focus moves out of the radio group\n const handleControlBlur = React.useCallback(\n (evt: React.FocusEvent) => {\n setFieldControlFocused(false);\n if (\n !evt.relatedTarget ||\n !radioGroupRef.current?.contains(evt.relatedTarget)\n ) {\n onBlurToOutside?.(evt);\n }\n },\n [onBlurToOutside, setFieldControlFocused],\n );\n\n const handleClearButtonClick = React.useCallback(() => {\n handleValueChange(\"\");\n radioGroupRef.current?.focus();\n }, [handleValueChange]);\n\n const hasClearButton =\n !disabled &&\n !readOnly &&\n (showClearButton === true ||\n (showClearButton === \"auto\" && (value?.length ?? 0) > 0));\n\n // Clear value when pressing 'Delete' or 'Backspace'\n const handleKeyDown = React.useCallback(\n (evt: React.KeyboardEvent) => {\n if (\n hasClearButton &&\n (evt.code === \"Delete\" || evt.code === \"Backspace\")\n ) {\n handleClearButtonClick();\n }\n },\n [handleClearButtonClick, hasClearButton],\n );\n\n const combinedRadioGroupRef = useCombinedRef(radioGroupRef, forwardedRef);\n return (\n <ClearContexts>\n <ControlContext.Provider value={{ variant, status, disabled, readOnly }}>\n <RadioGroupPrimitive.Root\n value={value}\n onValueChange={handleValueChange}\n id={controlId}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n data-variant={variant}\n required={required}\n disabled={disabled}\n className={cx(\n prefix(\"radio-group\"),\n inline && prefix(\"radio-group--inline\"),\n className,\n )}\n aria-readonly={readOnly ? \"true\" : undefined}\n aria-labelledby={mergeAriaIds(\n dataTableColumnLabelId,\n labelId,\n ariaLabelledBy,\n )}\n aria-describedby={mergeAriaIds(\n codeId,\n errorMessageIds,\n descriptionIds,\n ariaDescribedBy,\n )}\n onFocus={combineEventHandlers(onFocus, handleControlFocus)}\n onBlur={combineEventHandlers(onBlur, handleControlBlur)}\n onKeyDown={combineEventHandlers(onKeyDown, handleKeyDown)}\n {...otherProps}\n ref={combinedRadioGroupRef}\n >\n {/* Code */}\n {code && (\n <ControlCode\n status={status}\n {...codeProps}\n id={codeId}\n className={cx(prefix(\"radio-group__code\"), codeProps?.className)}\n >\n {code}\n </ControlCode>\n )}\n\n {/* Radios container */}\n <div\n data-status={status}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...containerProps}\n className={cx(\n prefix(\"radio-group__container\"),\n containerProps?.className,\n )}\n >\n <ClearContexts>{children}</ClearContexts>\n </div>\n\n {/* Clear button + spinner */}\n {(hasClearButton || loading) && (\n <div\n data-status={status}\n data-variant={variant}\n data-disabled={boolDataAttr(disabled)}\n data-readonly={boolDataAttr(readOnly)}\n {...endContainerProps}\n className={cx(\n prefix(\"checkbox-group__end-container\"),\n endContainerProps?.className,\n )}\n >\n {hasClearButton && (\n <CloseButton\n aria-label={clearButtonLabel}\n tabIndex={-1}\n circle\n {...clearButtonProps}\n className={cx(\n prefix(\"radio-group__clear-button\"),\n clearButtonProps?.className,\n )}\n onClick={combineEventHandlers(\n clearButtonProps?.onClick,\n handleClearButtonClick,\n { checkDefaultPrevented: true },\n )}\n onFocus={combineEventHandlers(\n clearButtonProps?.onFocus,\n handleControlFocus,\n )}\n onBlur={combineEventHandlers(\n clearButtonProps?.onBlur,\n handleControlBlur,\n )}\n />\n )}\n\n {loading && (\n <Spinner\n color={controlStatusToAccent(status, \"neutral\")}\n data-disabled={boolDataAttr(disabled)}\n {...spinnerProps}\n className={cx(\n prefix(\"checkbox-group__spinner\"),\n spinnerProps?.className,\n )}\n />\n )}\n </div>\n )}\n </RadioGroupPrimitive.Root>\n </ControlContext.Provider>\n </ClearContexts>\n );\n});\n","import { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the separator component. */\nexport interface SeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {}\n\n/** Component that visually or semantically separates content. */\nexport const Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n SeparatorProps\n>(function Separator({ className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <SeparatorPrimitive.Root\n className={cx(prefix(\"separator\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import * as React from \"react\";\n\n/** Value of the stepper's context. */\nexport interface StepperContextValue {\n activeStep: number;\n}\n\n/** Stepper's context. */\nexport const StepperContext = React.createContext<StepperContextValue | null>(\n null,\n);\n\n/** Hook exposing the stepper's context. */\nexport function useStepperContext(): StepperContextValue {\n const stepperContext = React.useContext(StepperContext);\n if (!stepperContext) {\n throw new Error(\"Stepper context not in scope.\");\n }\n return stepperContext;\n}\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { boolDataAttr } from \"../../utils/boolDataAttr.ts\";\nimport {\n type ControlStatus,\n controlStatusToAccent,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Button } from \"../Button\";\nimport { Label } from \"../Label\";\nimport { useStepperContext } from \"./StepperContext.ts\";\n\n/** Properties of the step component. */\nexport interface StepProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>,\n \"asChild\" | \"value\"\n > {\n /** Index of the step. */\n index?: number;\n /** Status of the step. */\n status?: ControlStatus;\n /** Properties to pass to the container element. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the step's label component. */\n labelProps?: Omit<React.ComponentPropsWithRef<typeof Label>, \"htmlFor\">;\n}\n\n/** Step trigger component. */\nexport const Step = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.TabsTrigger>,\n StepProps\n>(function Step(\n {\n index,\n status,\n id,\n className,\n children,\n containerProps,\n labelProps,\n ...otherProps\n }: StepProps,\n forwardedRef,\n) {\n if (index == null) {\n throw new Error(\"Step has no `index`.\");\n }\n\n const prefix = usePrefix();\n const { activeStep } = useStepperContext();\n const visited = activeStep >= index;\n\n const generatedId = React.useId();\n const stepId = id ?? prefix(`step-${generatedId}`);\n\n return (\n <div\n data-visited={boolDataAttr(visited)}\n data-status={status}\n data-accent={controlStatusToAccent(\n status,\n visited ? \"primary\" : \"neutral\",\n )}\n {...containerProps}\n className={cx(\n prefix(\"stepper__step-container\"),\n containerProps?.className,\n )}\n >\n <Label\n data-visited={boolDataAttr(visited)}\n {...labelProps}\n className={cx(prefix(\"stepper__step-label\"), labelProps?.className)}\n htmlFor={stepId}\n >\n {children}\n </Label>\n <TabsPrimitive.Trigger\n asChild\n value={index.toString()}\n id={stepId}\n className={cx(prefix(\"stepper__step\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n <Button\n data-visited={boolDataAttr(visited)}\n variant={visited ? \"solid\" : \"subtle\"}\n data-status={status}\n color={controlStatusToAccent(status, visited ? \"primary\" : \"neutral\")}\n >\n {index + 1}\n </Button>\n </TabsPrimitive.Trigger>\n </div>\n );\n});\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the step content component. */\nexport interface StepContentProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>,\n \"value\"\n > {\n /** Index of the step that corresponds to this content. */\n index: number;\n}\n\n/** Step content component. */\nexport const StepContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.TabsContent>,\n StepContentProps\n>(function StepContent({ index, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <TabsPrimitive.Content\n value={index.toString()}\n className={cx(prefix(\"stepper__step-content\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { Step, type StepProps } from \"./Step.tsx\";\n\n/** Properties of the step list component. */\nexport interface StepListProps\n extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {}\n\n/**\n * Component containing the list of steps.\n *\n * The `index` of each `Step` is automatically added when `Step`s are direct\n * children of `StepList`.\n */\nexport const StepList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n StepListProps\n>(function StepList({ className, children, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n // Automatically set the `index` of each `Step` when they're direct children\n let currentIndex = 0;\n const indexedChildren = React.Children.toArray(children).map((child) => {\n if (!React.isValidElement(child) || child.type !== Step) {\n return child;\n }\n\n const { index, ...otherStepProps } = (\n child as React.ReactElement<StepProps, typeof Step>\n ).props;\n const stepIndex = index ?? currentIndex++;\n return React.cloneElement(\n child as React.ReactElement<StepProps, typeof Step>,\n { index: stepIndex, ...otherStepProps },\n );\n });\n\n return (\n <TabsPrimitive.List\n className={cx(prefix(\"stepper__step-list\"), className)}\n {...otherProps}\n ref={forwardedRef}\n >\n {indexedChildren}\n </TabsPrimitive.List>\n );\n});\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useControllableState } from \"../../utils/useControllableState.ts\";\nimport { StepperContext } from \"./StepperContext.ts\";\n\n/** Properties of the stepper component. */\nexport interface StepperProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n | \"defaultValue\"\n | \"value\"\n | \"onValueChange\"\n // TODO: Support vertical steps\n | \"orientation\"\n | \"dir\"\n | \"children\"\n > {\n /**\n * Index of the default active step.\n *\n * @default 0\n */\n defaultActiveStep?: number;\n /** Index of the active step. */\n activeStep?: number;\n /**\n * Function called when the active step changes.\n *\n * @param newActiveStep Index of the new active step.\n */\n onActiveStepChange?: (newActiveStep: number) => void;\n /** Reference to interact with the stepper's API. */\n apiRef?: React.Ref<StepperApi | undefined>;\n children?: React.ReactNode | ((api: StepperApi) => React.ReactNode);\n}\n\nexport interface StepperApi {\n /** Currently active step. */\n activeStep: number;\n /**\n * Navigates to the provided step.\n *\n * @param step Step to go to.\n */\n goTo: (step: number) => void;\n /** Navigates to the next step. */\n next: () => void;\n /** Navigates to the previous step. */\n previous: () => void;\n}\n\n/**\n * Component used to display progress through a sequence of numbered steps.\n *\n * It composes the following subcomponents:\n *\n * - `StepList`: Displays the `Step` in the sequence, helping users visualize\n * their progress and navigate between steps.\n * - `StepComponent`: Displays the content relevant to each `Step`, ensuring users\n * see detailed information as they progress through the steps.\n *\n * The component leverages the `StepperApi` interface to manage navigation and\n * active step tracking through the following props:\n *\n * - `activeStep`: Tracks the currently active step to synchronize navigation and\n * step content display.\n * - `previous`: Enables moving to the previous step. Prevents navigation beyond\n * the first step by disabling the relevant button.\n * - `next`: Allows progression to the next step. On the final step, disables\n * further navigation to maintain flow.\n * - `goTo`: Provides direct access to a specific step. While not used in all\n * implementations, it adds flexibility for custom navigation flows.\n */\nexport const Stepper = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Root>,\n StepperProps\n>(function Stepper(\n {\n defaultActiveStep,\n activeStep: controlledActiveStep,\n onActiveStepChange,\n activationMode = \"manual\",\n className,\n apiRef,\n children,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const [activeStep, setActiveStep] = useControllableState(\n defaultActiveStep ?? 0,\n controlledActiveStep,\n );\n\n const handleValueChange = React.useCallback(\n (value: number | string) => {\n const newActiveStep = +value;\n if (newActiveStep >= 0) {\n setActiveStep(newActiveStep);\n onActiveStepChange?.(newActiveStep);\n }\n },\n [onActiveStepChange, setActiveStep],\n );\n const next = React.useCallback(\n () => handleValueChange(activeStep + 1),\n [activeStep, handleValueChange],\n );\n const previous = React.useCallback(\n () => handleValueChange(activeStep - 1),\n [activeStep, handleValueChange],\n );\n\n const api = React.useMemo(\n () => ({\n activeStep,\n goTo: handleValueChange,\n next,\n previous,\n }),\n [activeStep, handleValueChange, next, previous],\n );\n React.useImperativeHandle(apiRef, () => api, [api]);\n\n return (\n <StepperContext.Provider value={{ activeStep }}>\n <TabsPrimitive.Root\n value={activeStep?.toString()}\n onValueChange={handleValueChange}\n className={cx(prefix(\"stepper\"), className)}\n activationMode={activationMode}\n {...otherProps}\n ref={forwardedRef}\n >\n {typeof children === \"function\" ? children(api) : children}\n </TabsPrimitive.Root>\n </StepperContext.Provider>\n );\n});\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { combineEventHandlers } from \"../../utils/combineEventHandlers.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { TabsContext, useCreateTabsContext } from \"./TabsContext.ts\";\n\n/** Tabs variants. */\nexport type TabsVariant = \"default\" | \"annexes\";\n\n/** Properties of the tabs component. */\nexport interface TabsProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n // TODO: Support vertical tabs\n \"defaultValue\" | \"value\" | \"orientation\" | \"dir\"\n > {\n /**\n * Tabs variant.\n *\n * @default default\n */\n variant?: TabsVariant;\n /** Value of the default active tab. */\n defaultValue?: string | number;\n /** Value of the active tab. */\n value?: string | number;\n}\n\n/**\n * The `Tabs` component allows content to be organised in tabs and displayed one\n * at a time.\n *\n * The `value` set on each tab should match the `value` of its content.\n *\n * It composes the following subcomponents:\n *\n * - `TabList`: A container holding the list of tabs.\n * - `Tab`: Representing an individual tab.\n * - `TabContent`: For holding the content of each tab.\n *\n * Example usage:\n *\n * ```tsx\n * import { Tab, TabContent, TabList, Tabs } from \"@ostack.tech/ui\";\n *\n * function Bills() {\n * return (\n * <Tabs>\n * <TabList>\n * <Tab value=\"water\">Water</Tab>\n * <Tab value=\"electricity\">Electricity</Tab>\n * <Tab value=\"gas\">Gas</Tab>\n * </TabList>\n * <TabContent value=\"water\">…</TabContent>\n * <TabContent value=\"electricity\">…</TabContent>\n * <TabContent value=\"gas\">…</TabContent>\n * </Tabs>\n * );\n * }\n * ```\n */\nexport const Tabs = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Root>,\n TabsProps\n>(function Tabs(\n {\n variant = \"default\",\n defaultValue,\n value,\n onValueChange,\n className,\n ...otherProps\n },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const tabsContextValue = useCreateTabsContext(variant, defaultValue, value);\n const handleValueChange = React.useCallback(\n (value: string) => tabsContextValue.store.setState({ activeTab: value }),\n [tabsContextValue.store],\n );\n\n return (\n <TabsContext.Provider value={tabsContextValue}>\n <TabsPrimitive.Root\n defaultValue={defaultValue?.toString()}\n value={value?.toString()}\n onValueChange={combineEventHandlers(onValueChange, handleValueChange)}\n className={cx(prefix(\"tabs\"), prefix(`tabs--${variant}`), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n </TabsContext.Provider>\n );\n});\n","import * as React from \"react\";\nimport { createStore } from \"zustand\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\n\nimport { useConstant } from \"../../utils/useConstant.ts\";\nimport { type ScrollPosition } from \"../../utils/useScrollPosition.ts\";\nimport { type TabsVariant } from \"./Tabs.tsx\";\n\n/** Value of the tabs' context. */\nexport interface TabsContextValue {\n variant: TabsVariant;\n store: TabsStore;\n}\n\n/** State of the tabs. */\nexport interface TabsState {\n activeTab?: string;\n showScrollButtons?: boolean;\n width: number;\n scrollPosition?: ScrollPosition;\n}\n\n/** Tabs' store. */\nexport type TabsStore = ReturnType<typeof useCreateTabsContext>[\"store\"];\n\n/** Tabs' context. */\nexport const TabsContext = React.createContext<TabsContextValue | null>(null);\n\n/** Hook which creates the tabs' store. */\nexport function useCreateTabsContext(\n variant: TabsVariant,\n defaultValue?: string | number,\n value?: string | number,\n) {\n const store = useConstant(() =>\n createStore<TabsState>()(\n subscribeWithSelector((_set) => ({\n activeTab: value?.toString() ?? defaultValue?.toString(),\n showScrollButtons: false,\n width: 0,\n scrollPosition: undefined,\n })),\n ),\n );\n\n React.useEffect(() => {\n if (value !== undefined) {\n store.setState({ activeTab: value.toString() });\n }\n }, [store, value]);\n\n return React.useMemo(() => ({ variant, store }), [store, variant]);\n}\n\n/** Hooks returning the tabs' context value. */\nexport function useTabsContext(): TabsContextValue {\n const tabsContext = React.useContext(TabsContext);\n if (!tabsContext) {\n throw new Error(\"Tabs context not in scope.\");\n }\n return tabsContext;\n}\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport {\n type ControlStatus,\n controlStatusToAccent,\n} from \"../../utils/control.ts\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useTabsContext } from \"./TabsContext.ts\";\n\n/** Properties of the tab component. */\nexport interface TabProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>,\n \"asChild\" | \"value\"\n > {\n /** Value representing this tab. */\n value: string | number;\n /** Status of the tab. */\n status?: ControlStatus;\n /** Properties to pass to the inner tab element. */\n tabInnerProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/** Tab trigger component. */\nexport const Tab = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.TabsTrigger>,\n TabProps\n>(function Tab(\n { value, status, tabInnerProps, className, children, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { variant, store } = useTabsContext();\n const stringValue = value.toString();\n const isActive = useStore(store, (state) => state.activeTab === stringValue);\n\n // Scroll tab into view when it becomes active\n const tabRef = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (isActive) {\n setTimeout(() => tabRef.current!.scrollIntoView({ block: \"nearest\" }));\n }\n }, [isActive]);\n\n const combinedTabRef = useCombinedRef(tabRef, forwardedRef);\n return (\n <TabsPrimitive.Trigger\n value={stringValue}\n className={cx(\n prefix(\"tabs__tab\"),\n prefix(`tabs__tab--${variant}`),\n className,\n )}\n data-status={status}\n data-accent={controlStatusToAccent(status)}\n {...otherProps}\n ref={combinedTabRef}\n >\n <span\n {...tabInnerProps}\n className={cx(prefix(\"tabs__tab-inner\"), tabInnerProps?.className)}\n >\n {children}\n </span>\n {/* The hidden tab element is styled similarly to an open tab, even when\n the tab isn't open. This is done to \"reserve\" space for the open tab\n styling, which can be larger than the unopen styling due to larger\n font size or weight. The non-hidden tab is positioned absolutely and\n doesn't affect the layout. */}\n <span\n {...tabInnerProps}\n className={cx(\n prefix(\"tabs__tab-inner\"),\n prefix(\"tabs__tab-inner--hidden\"),\n tabInnerProps?.className,\n )}\n >\n {children}\n </span>\n </TabsPrimitive.Trigger>\n );\n});\n","import { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\n\n/** Properties of the tab content component. */\nexport interface TabContentProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>,\n \"value\"\n > {\n /** Value of the tab that corresponds to this content. */\n value: string | number;\n}\n\n/** Tab content component. */\nexport const TabContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.TabsContent>,\n TabContentProps\n>(function TabContent({ value, className, ...otherProps }, forwardedRef) {\n const prefix = usePrefix();\n\n return (\n <TabsPrimitive.Content\n value={value.toString()}\n className={cx(prefix(\"tabs__tab-content\"), className)}\n {...otherProps}\n ref={forwardedRef}\n />\n );\n});\n","import {\n faChevronLeft,\n faChevronRight,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { useStore } from \"zustand\";\n\nimport { usePrefix } from \"../../providers/PrefixProvider\";\nimport { cx } from \"../../utils/cx.ts\";\nimport { useCombinedRef } from \"../../utils/useCombinedRef.ts\";\nimport { useMeasure } from \"../../utils/useMeasure.ts\";\nimport { useScrollPosition } from \"../../utils/useScrollPosition.ts\";\nimport { IconButton } from \"../IconButton\";\nimport { useTabsContext } from \"./TabsContext.ts\";\n\n/** Properties of the tab list component. */\nexport interface TabListProps\n extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {\n /** Properties to pass to the root element. */\n rootProps?: React.ComponentPropsWithRef<\"div\">;\n /** Properties to pass to the container element. */\n containerProps?: React.ComponentPropsWithRef<\"div\">;\n}\n\n/** Component containing all tabs. */\nexport const TabList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n TabListProps\n>(function TabList(\n { rootProps, containerProps, className, children, ...otherProps },\n forwardedRef,\n) {\n const prefix = usePrefix();\n const { variant, store } = useTabsContext();\n\n const [rootEl, setRootEl] = React.useState<HTMLDivElement | null>(null);\n const [containerEl, setContainerEl] = React.useState<HTMLDivElement | null>(\n null,\n );\n useMeasure(\n rootEl,\n React.useCallback(\n (measurement) => store.setState({ width: measurement?.width }),\n [store],\n ),\n );\n useScrollPosition(\n containerEl,\n React.useCallback(\n (scrollPosition) => store.setState({ scrollPosition }),\n [store],\n ),\n );\n React.useEffect(\n () =>\n store.subscribe(\n (state) => state.width,\n (width) => {\n store.setState({\n showScrollButtons:\n (containerEl?.scrollWidth ?? 0) > Math.ceil(width),\n });\n },\n { fireImmediately: true },\n ),\n // Adding `containerEl?.scrollWidth` to the dependencies instead causes\n // issues in Firefox, where `scrollWidth` doesn't seem to be stable (it\n // changes depending on whether the scroll buttons are rendered)\n [children, containerEl, store],\n );\n\n // Scroll tab list when clicking a scroll button\n const scrollTabs = (direction: \"left\" | \"right\") => {\n if (containerEl) {\n const containerSize = containerEl.clientWidth;\n const tabEls = Array.from(containerEl.children);\n let scrollAmount = 0;\n for (let i = 0; i < tabEls.length; ++i) {\n const tab = tabEls[i];\n if (scrollAmount + tab.clientWidth > containerSize) {\n // If the first item is longer than the container size, then only\n // scroll by the container size.\n if (i === 0) {\n scrollAmount = containerSize;\n }\n break;\n }\n scrollAmount += tab.clientWidth;\n }\n\n containerEl.scrollBy({\n left: direction === \"left\" ? -scrollAmount : scrollAmount,\n behavior: \"smooth\",\n });\n }\n };\n\n // Scroll tab list horizontally, when using a mouse wheel\n React.useEffect(() => {\n if (containerEl) {\n const handleWheel = (evt: Event) => {\n const deltaY = (evt as WheelEvent).deltaY;\n if (\n containerEl &&\n deltaY &&\n containerEl.scrollWidth > Math.ceil(store.getState().width)\n ) {\n evt.preventDefault();\n containerEl.scrollLeft += deltaY;\n }\n };\n\n containerEl.addEventListener(\"wheel\", handleWheel);\n return () => containerEl.removeEventListener(\"wheel\", handleWheel);\n }\n }, [containerEl, store]);\n\n const combinedRootRef = useCombinedRef(setRootEl, rootProps?.ref);\n const combinedContainerRef = useCombinedRef(\n setContainerEl,\n containerProps?.ref,\n );\n return (\n <div\n {...rootProps}\n className={cx(\n prefix(\"tabs__tab-list-root\"),\n prefix(`tabs__tab-list-root--${variant}`),\n rootProps?.className,\n )}\n ref={combinedRootRef}\n >\n <TabListScrollButton side=\"left\" onClick={() => scrollTabs(\"left\")} />\n {/* Tab list container (scrollable element) */}\n <div\n {...containerProps}\n className={cx(\n prefix(\"tabs__tab-list-container\"),\n prefix(`tabs__tab-list-container--${variant}`),\n containerProps?.className,\n )}\n ref={combinedContainerRef}\n >\n <TabsPrimitive.List\n className={cx(\n prefix(\"tabs__tab-list\"),\n prefix(`tabs__tab-list--${variant}`),\n className,\n )}\n {...otherProps}\n ref={forwardedRef}\n >\n {children}\n </TabsPrimitive.List>\n </div>\n <TabListScrollButton side=\"right\" onClick={() => scrollTabs(\"right\")} />\n </div>\n );\n});\n\n/** Properties of the tabs list scroll button component. */\ninterface TabListScrollButtonProps\n extends React.ComponentPropsWithoutRef<\"button\"> {\n side: \"left\" | \"right\";\n}\n\n/** Scroll button of the tabs list. */\nfunction TabListScrollButton({ side, onClick }: TabListScrollButtonProps) {\n const prefix = usePrefix();\n const { store } = useTabsContext();\n const showScrollButtons = useStore(store, (state) => state.showScrollButtons);\n const disabled = useStore(\n store,\n ({ scrollPosition }) =>\n scrollPosition &&\n (side === \"left\" ? scrollPosition.left === 0 : scrollPosition.right <= 1),\n );\n\n return (\n showScrollButtons && (\n <IconButton\n variant=\"ghost\"\n icon={side === \"left\" ? faChevronLeft : faChevronRight}\n label={null}\n className={cx(\n prefix(\"tabs__scroll-button\"),\n prefix(`tabs__scroll-button--${side}`),\n )}\n disabled={disabled}\n onClick={onClick}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n )\n );\n}\n","import * as React from \"react\";\n\nimport { Input, type InputPropsBase } from \"../Input\";\nimport { useIsInTableCell } from \"../Table\";\n\n/** Default number of rows (when not within a table cell). */\nconst DEFAULT_ROWS = 3;\n\n/** Properties of the text area component. */\nexport interface TextAreaProps\n extends Omit<InputPropsBase, \"asChild\" | \"children\">,\n React.ComponentPropsWithoutRef<\"textarea\"> {}\n\n/**\n * The `TextArea` component is a flexible, multiline input field designed for\n * text entry. This component is ideal for capturing larger amounts of text,\n * such as user feedback, comments, or descriptions.\n *\n * All extra properties are passed directly to the underlying textarea element,\n * offering full control over behavior and appearance. The TextArea component\n * can be combined with the `Field` component for better structure and\n * accessibility. The `Field` ensures proper associations between the `Label`,\n * `TextArea`, and related elements like `HelperText`, improving usability and\n * accessibility for users.\n *\n * This setup ensures that the `TextArea` can adapt to different use cases while\n * maintaining a consistent and accessible form structure.\n */\nexport const TextArea = React.forwardRef<\n React.ComponentRef<\"textarea\">,\n TextAreaProps\n>(function TextArea({ rows, ...props }, forwardedRef) {\n const isInTableCell = useIsInTableCell();\n rows ??= isInTableCell ? 1 : DEFAULT_ROWS;\n\n return (\n <Input asChild {...(props as Record<string, never>)}>\n <textarea rows={rows} ref={forwardedRef} />\n </Input>\n );\n});\n","import * as React from \"react\";\nimport { tinykeys } from \"tinykeys\";\n\nimport { useLatestValues } from \"./useLatestValues.ts\";\n\nconst FORM_CONTROLS = [\"INPUT\", \"TEXTAREA\", \"SELECT\"];\n\n/** Type of the shortcut action. */\nexport type KeyboardShortcutAction = (event: KeyboardEvent) => void;\n\n/** Options of the `registerKeyboardShortcut` function. */\nexport interface RegisterKeyboardShortcutOptions {\n /**\n * Target element on which to listen for the keybinds.\n *\n * @default window\n */\n target?: Window | HTMLElement;\n /**\n * Event type to listen for.\n *\n * @default keydown\n */\n eventType?: \"keydown\" | \"keyup\";\n /**\n * Keybinding sequences will wait this long (in milliseconds) between key\n * presses before cancelling.\n *\n * @default 1000\n */\n sequenceTimeout?: number;\n /**\n * Whether the triggered shortcut should be ignored.\n *\n * By default, no shortcuts are ignored. However, we provide an auxiliary\n * function {@link ignoreFormControlsKeyboardShortcut} which ignores keyboard\n * shortcuts occurring in form controls (`<input>`, `<textarea>`,\n * `<select>`).\n *\n * @param event Keyboard event which triggered the shortcut. `event.target`\n * should contain the element in which the event was triggered.\n * @returns Whether the keyboard shortcut should be ignored.\n */\n ignore?: (event: KeyboardEvent) => boolean;\n /**\n * Whether key presses should use a capture listener.\n *\n * @default false\n */\n capture?: boolean;\n /**\n * Whether the event's default behaviour should be prevented.\n *\n * @default false\n */\n preventDefault?: boolean;\n}\n\n/**\n * Function which registers an action to run when one of the provided keybinds\n * is triggered.\n *\n * Built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)\n * library. For more information on keybinding syntax, read the [`tinykeys`\n * documentation](https://github.com/jamiebuilds/tinykeys).\n *\n * @param keybinds Keybinds which should trigger the action.\n * @param action Action to run. Receives the keyboard event as an argument.\n * @param options Configuration options (see\n * {@link RegisterKeyboardShortcutOptions}).\n * @returns Function used to unregister the shortcut.\n * @see {@link useKeyboardShortcut} for a hook version of this function.\n */\nexport function registerKeyboardShortcut(\n keybinds: string | string[],\n action: KeyboardShortcutAction,\n {\n target = window,\n eventType = \"keydown\",\n sequenceTimeout = 1000,\n ignore,\n capture = false,\n preventDefault,\n }: RegisterKeyboardShortcutOptions = {},\n): () => void {\n const ignorableAction = (event: KeyboardEvent) => {\n if (!ignore?.(event)) {\n if (preventDefault) {\n event.preventDefault();\n }\n action(event);\n }\n };\n const keybindsMap =\n typeof keybinds === \"string\"\n ? { [keybinds]: ignorableAction }\n : keybinds.reduce(\n (keybindsMap: Record<string, KeyboardShortcutAction>, shortcut) => {\n keybindsMap[shortcut] = ignorableAction;\n return keybindsMap;\n },\n {},\n );\n\n return tinykeys(target, keybindsMap, {\n event: eventType,\n timeout: sequenceTimeout,\n capture,\n });\n}\n\n/** Options of the `useKeyboardShortcut` hook. */\nexport interface UseKeyboardShortcutOptions\n extends Omit<RegisterKeyboardShortcutOptions, \"target\"> {\n /**\n * Target element on which to listen for the keybinds. While set to `null`\n * keybinds will be ignored.\n *\n * @default window\n */\n target?: Window | HTMLElement | null;\n}\n\n/**\n * Hook which runs an action when one of the provided keybinds is triggered.\n *\n * Built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)\n * library. For more information on keybinding syntax, read the [`tinykeys`\n * documentation](https://github.com/jamiebuilds/tinykeys).\n *\n * Example usage:\n *\n * ```tsx\n * import { Button, useKeyboardShortcut } from \"@ostack.tech/ui\";\n *\n * function SaveAction() {\n * const saveFile = () => {\n * // ...\n * };\n * useKeyboardShortcut(\"$mod+S\", saveFile);\n *\n * return <Button onClick={saveFile}>Save</Button>;\n * }\n * ```\n *\n * @param keybinds Keybinds which should trigger the action.\n * @param action Action to run. Receives the keyboard event as an argument.\n * @param options Configuration options (see\n * {@link RegisterKeyboardShortcutOptions}).\n * @see {@link registerKeyboardShortcut} for a non-hook version of this\n * function.\n */\nexport function useKeyboardShortcut(\n keybinds: string | string[] | null | undefined,\n action: KeyboardShortcutAction,\n {\n target = window,\n eventType = \"keydown\",\n sequenceTimeout = 1000,\n ignore,\n capture = false,\n preventDefault,\n }: UseKeyboardShortcutOptions = {},\n): void {\n // No valid shortcut should have the string \"__\". This lets us bypass\n // `useEffect` remounting when the identity of the shortcuts' array changes.\n const shortcutsString = Array.isArray(keybinds)\n ? keybinds.join(\"__\")\n : keybinds;\n const latestCallbacks = useLatestValues({ action, ignore });\n\n React.useEffect(() => {\n if (shortcutsString && target !== null) {\n return registerKeyboardShortcut(\n shortcutsString.split(\"__\"),\n (evt) => latestCallbacks.action(evt),\n {\n target,\n eventType,\n sequenceTimeout,\n ignore: (evt) => latestCallbacks.ignore?.(evt) ?? false,\n capture,\n preventDefault,\n },\n );\n }\n }, [\n capture,\n eventType,\n latestCallbacks,\n preventDefault,\n sequenceTimeout,\n shortcutsString,\n target,\n ]);\n}\n\n/**\n * `ignore` function to use in `registerKeyboardShortcut`/`useKeyboardShortcut`\n * which ignores triggered shortcuts which occur in `<input>`, `<textarea>`, or\n * `<select>` elements.\n */\nexport function ignoreFormControlsKeyboardShortcut(\n event: KeyboardEvent,\n): boolean {\n return (\n event.target !== null &&\n event.target instanceof HTMLElement &&\n FORM_CONTROLS.includes(event.target.tagName)\n );\n}\n","import * as React from \"react\";\n\n/**\n * Hook wrapping an `IntersectionObserver` which tracks the intersection ratio\n * of an element.\n */\nexport function useIntersectionObserver<T extends Element = Element>(\n element: T | null,\n onIntersectionEntryChange: (entry: IntersectionObserverEntry) => void,\n options?: IntersectionObserverInit,\n): void {\n React.useEffect(() => {\n if (element !== null) {\n const observer = new IntersectionObserver(\n ([e]) => onIntersectionEntryChange(e),\n options,\n );\n observer.observe(element);\n return () => observer.unobserve(element);\n }\n }, [element, onIntersectionEntryChange, options]);\n}\n"],"names":["dateFnsPt","jsxs","Fragment","React","locale","jsx","Icon","FontAwesomeIcon","AccessibleIconPrimitive","SlotPrimitive","Spinner","Button","isValid","isDate","createStore","shallow","subscribeWithSelector","useStore","Field","Table","columnWidths","TableBody","TableCell","PopoverPrimitive","PopoverClose","Portal","PortalPrimitive","PopoverContent","PopoverTrigger","Stack","children","TableColumn","TableFoot","VisuallyHiddenPrimitive","TableRow","TableHead","numberOfRows","leafColumns","faCircleQuestion","width","faSortDown","faSortUp","DataTableCell","Mark","ControlCode","create","numberOfColumns","pageOffset","useShallow","useVirtualizer","virtualizer","observeElementRect","virtualItems","startIndex","DataTableBody","DataTableFoot","DataTableHead","ControlAddon","faClose","Input","InputWithContainerRef","DataTableFilter","faFilter","MenuList","CommandMenu","faSearch","CommandPrimitive","DialogPrimitive","Card","CardBody","CardFooter","Heading","CardTitle","DialogBody","DialogClose","Overlay","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","DialogTrigger","CommandMenuDialog","CommandMenuGroup","CommandMenuItem","Collapsible","CollapsiblePrimitive","CollapsibleContent","CollapsibleTrigger","faChevronUp","faChevronDown","Tag","value","createElement","Select","open","Option","faCheck","OptionsGroup","PagedDataTablePagination","faArrowLeft","faArrowRight","ScrolledDataTablePagination","DataTablePagination","DataTableRowsPerPage","DataTableSelectionTrigger","Label","LabelPrimitive","faAsterisk","Checkbox","CheckboxPrimitive","faMinus","selectedRows","window","DataTableRow","otherProps","DataTable","offset","limit","rows","filter","sortBy","sortDirection","loading","loadingCount","getRows","result","Link","faArrowUpRightFromSquare","Tooltip","TooltipPrimitive","IconButton","CalendarDay","useDayPicker","CalendarMonthCaption","addMonths","isAfter","isBefore","months","startOfMonth","setMonth","getYear","setYear","startOfYear","format","faChevronLeft","faChevronRight","getMonth","isSameYear","max","min","modifiers","lastDayOfMonth","composedDisabled","DayPicker","parseISO","parse","DateInput","isWithinInterval","formattedValue","dateValue","faCalendar","isEqual","DateRangeInput","SEVERITY_ICON","faCircleInfo","faCircleCheck","faCircleExclamation","faTriangleExclamation","Alert","AlertTitle","Code","ErrorBoundary","faRedo","ReactErrorBoundary","FeedbackList","FeedbackPopover","Feedback","FieldGroup","FieldGroupBody","FieldGroupHeader","FieldGroupTitle","removeNumericFormat","numericFormatter","NumericFormat","Toast","ToastPrimitive","ToastTitle","ToastViewport","AlertDialogPrimitive","AlertDialogAction","AlertDialogBody","AlertDialogCancel","AlertDialogContent","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogTitle","AlertDialogTrigger","dateFnsEnGB","dateFnsEnUS","dateFnsFr","breadcrumbs","toasts","toastId","Root","ButtonGroup","CheckboxGroup","Container","DropdownMenuPrimitive","DropdownMenuCheckboxItem","checked","DropdownMenuContent","MenuListGroup","DropdownMenuGroup","DropdownMenuItem","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","Grid","HelperText","Keyboard","Output","Radio","RadioGroupPrimitive","RadioGroup","Separator","SeparatorPrimitive","Step","TabsPrimitive","StepContent","StepList","Stepper","Tabs","Tab","TabContent","TabList","TextArea","keybindsMap","tinykeys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,OAA2B;AAAA,EACtC,aAAa;AAAA,EACb,eAAeA,OAAAA;AAAAA,EACf,aAAa;AAAA,IACX,QAAQ;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACR,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,EAAA;AAAA,EAElB,aAAa;AAAA,IACX,cAAc;AAAA,EAAA;AAAA,EAEhB,aAAa;AAAA,IACX,mBAAmB;AAA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