@ostack.tech/ui 0.1.0
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/README.md +3 -0
- package/dist/ostack-ui.cjs +11095 -0
- package/dist/ostack-ui.cjs.map +1 -0
- package/dist/ostack-ui.css +4191 -0
- package/dist/ostack-ui.css.map +1 -0
- package/dist/ostack-ui.js +11077 -0
- package/dist/ostack-ui.js.map +1 -0
- package/dist/types/components/Alert/Alert.d.ts +82 -0
- package/dist/types/components/Alert/AlertTitle.d.ts +12 -0
- package/dist/types/components/Alert/index.d.ts +2 -0
- package/dist/types/components/AlertDialog/AlertDialog.d.ts +81 -0
- package/dist/types/components/AlertDialog/AlertDialogAction.d.ts +10 -0
- package/dist/types/components/AlertDialog/AlertDialogBody.d.ts +7 -0
- package/dist/types/components/AlertDialog/AlertDialogCancel.d.ts +10 -0
- package/dist/types/components/AlertDialog/AlertDialogContent.d.ts +45 -0
- package/dist/types/components/AlertDialog/AlertDialogDescription.d.ts +14 -0
- package/dist/types/components/AlertDialog/AlertDialogFooter.d.ts +7 -0
- package/dist/types/components/AlertDialog/AlertDialogHeader.d.ts +7 -0
- package/dist/types/components/AlertDialog/AlertDialogTitle.d.ts +7 -0
- package/dist/types/components/AlertDialog/AlertDialogTrigger.d.ts +7 -0
- package/dist/types/components/AlertDialog/index.d.ts +10 -0
- package/dist/types/components/Button/Button.d.ts +111 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +32 -0
- package/dist/types/components/ButtonGroup/index.d.ts +1 -0
- package/dist/types/components/Calendar/Calendar.d.ts +41 -0
- package/dist/types/components/Calendar/CalendarContext.d.ts +18 -0
- package/dist/types/components/Calendar/CalendarDay.d.ts +11 -0
- package/dist/types/components/Calendar/CalendarMonthCaption.d.ts +9 -0
- package/dist/types/components/Calendar/index.d.ts +1 -0
- package/dist/types/components/Card/Card.d.ts +70 -0
- package/dist/types/components/Card/CardBody.d.ts +12 -0
- package/dist/types/components/Card/CardFooter.d.ts +12 -0
- package/dist/types/components/Card/CardHeader.d.ts +12 -0
- package/dist/types/components/Card/CardTitle.d.ts +19 -0
- package/dist/types/components/Card/index.d.ts +5 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +67 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +85 -0
- package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +8 -0
- package/dist/types/components/CheckboxGroup/index.d.ts +1 -0
- package/dist/types/components/ClearContexts/ClearContexts.d.ts +31 -0
- package/dist/types/components/ClearContexts/index.d.ts +1 -0
- package/dist/types/components/CloseButton/CloseButton.d.ts +7 -0
- package/dist/types/components/CloseButton/index.d.ts +1 -0
- package/dist/types/components/Code/Code.d.ts +35 -0
- package/dist/types/components/Code/index.d.ts +1 -0
- package/dist/types/components/Collapsible/Collapsible.d.ts +25 -0
- package/dist/types/components/Collapsible/CollapsibleContent.d.ts +7 -0
- package/dist/types/components/Collapsible/CollapsibleContext.d.ts +11 -0
- package/dist/types/components/Collapsible/CollapsibleTrigger.d.ts +10 -0
- package/dist/types/components/Collapsible/index.d.ts +3 -0
- package/dist/types/components/CommandMenu/CommandMenu.d.ts +91 -0
- package/dist/types/components/CommandMenu/CommandMenuDialog.d.ts +45 -0
- package/dist/types/components/CommandMenu/CommandMenuGroup.d.ts +9 -0
- package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +13 -0
- package/dist/types/components/CommandMenu/index.d.ts +4 -0
- package/dist/types/components/Container/Container.d.ts +66 -0
- package/dist/types/components/Container/index.d.ts +1 -0
- package/dist/types/components/ControlAddon/ControlAddon.d.ts +36 -0
- package/dist/types/components/ControlAddon/index.d.ts +1 -0
- package/dist/types/components/ControlCode/ControlCode.d.ts +22 -0
- package/dist/types/components/ControlCode/index.d.ts +1 -0
- package/dist/types/components/DataTable/DataTable.d.ts +256 -0
- package/dist/types/components/DataTable/DataTableApi.d.ts +37 -0
- package/dist/types/components/DataTable/DataTableBody.d.ts +9 -0
- package/dist/types/components/DataTable/DataTableCell.d.ts +9 -0
- package/dist/types/components/DataTable/DataTableColumn.d.ts +70 -0
- package/dist/types/components/DataTable/DataTableContent.d.ts +28 -0
- package/dist/types/components/DataTable/DataTableContext.d.ts +141 -0
- package/dist/types/components/DataTable/DataTableEmptyOrLoadingRows.d.ts +9 -0
- package/dist/types/components/DataTable/DataTableFilter.d.ts +7 -0
- package/dist/types/components/DataTable/DataTableFoot.d.ts +8 -0
- package/dist/types/components/DataTable/DataTableHead.d.ts +7 -0
- package/dist/types/components/DataTable/DataTablePagination.d.ts +18 -0
- package/dist/types/components/DataTable/DataTableRow.d.ts +11 -0
- package/dist/types/components/DataTable/DataTableRowsPerPage.d.ts +19 -0
- package/dist/types/components/DataTable/DataTableSelectionTrigger.d.ts +21 -0
- package/dist/types/components/DataTable/PagedDataTablePagination.d.ts +7 -0
- package/dist/types/components/DataTable/PagedDataTableRows.d.ts +2 -0
- package/dist/types/components/DataTable/ScrolledDataTablePagination.d.ts +7 -0
- package/dist/types/components/DataTable/ScrolledDataTableRows.d.ts +7 -0
- package/dist/types/components/DataTable/getRowKey.d.ts +4 -0
- package/dist/types/components/DataTable/index.d.ts +12 -0
- package/dist/types/components/DataTable/spliceWindow.d.ts +24 -0
- package/dist/types/components/DataTable/transformRows.d.ts +10 -0
- package/dist/types/components/DataTable/useDataTableSelectionColumn.d.ts +4 -0
- package/dist/types/components/DateInput/DateInput.d.ts +87 -0
- package/dist/types/components/DateInput/index.d.ts +1 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +27 -0
- package/dist/types/components/DatePicker/index.d.ts +1 -0
- package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +197 -0
- package/dist/types/components/DateRangeInput/index.d.ts +1 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +41 -0
- package/dist/types/components/DateRangePicker/index.d.ts +1 -0
- package/dist/types/components/Dialog/Dialog.d.ts +68 -0
- package/dist/types/components/Dialog/DialogBody.d.ts +7 -0
- package/dist/types/components/Dialog/DialogClose.d.ts +7 -0
- package/dist/types/components/Dialog/DialogContent.d.ts +45 -0
- package/dist/types/components/Dialog/DialogDescription.d.ts +13 -0
- package/dist/types/components/Dialog/DialogFooter.d.ts +7 -0
- package/dist/types/components/Dialog/DialogHeader.d.ts +16 -0
- package/dist/types/components/Dialog/DialogTitle.d.ts +7 -0
- package/dist/types/components/Dialog/DialogTrigger.d.ts +7 -0
- package/dist/types/components/Dialog/index.d.ts +9 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +65 -0
- package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +24 -0
- package/dist/types/components/DropdownMenu/DropdownMenuContent.d.ts +20 -0
- package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts +8 -0
- package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +15 -0
- package/dist/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +8 -0
- package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +16 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSub.d.ts +3 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +13 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +11 -0
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +7 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +97 -0
- package/dist/types/components/ErrorBoundary/index.d.ts +2 -0
- package/dist/types/components/ErrorBoundary/useErrorBoundary.d.ts +1 -0
- package/dist/types/components/Feedback/Feedback.d.ts +22 -0
- package/dist/types/components/Feedback/index.d.ts +1 -0
- package/dist/types/components/FeedbackList/FeedbackList.d.ts +6 -0
- package/dist/types/components/FeedbackList/FeedbackListContext.d.ts +5 -0
- package/dist/types/components/FeedbackList/index.d.ts +2 -0
- package/dist/types/components/FeedbackPopover/FeedbackPopover.d.ts +34 -0
- package/dist/types/components/FeedbackPopover/FeedbackPopoverContext.d.ts +11 -0
- package/dist/types/components/FeedbackPopover/index.d.ts +2 -0
- package/dist/types/components/Field/Field.d.ts +20 -0
- package/dist/types/components/Field/FieldContext.d.ts +86 -0
- package/dist/types/components/Field/index.d.ts +2 -0
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +30 -0
- package/dist/types/components/FieldGroup/FieldGroupBody.d.ts +12 -0
- package/dist/types/components/FieldGroup/FieldGroupContext.d.ts +10 -0
- package/dist/types/components/FieldGroup/FieldGroupHeader.d.ts +18 -0
- package/dist/types/components/FieldGroup/FieldGroupTitle.d.ts +19 -0
- package/dist/types/components/FieldGroup/index.d.ts +4 -0
- package/dist/types/components/Grid/Grid.d.ts +90 -0
- package/dist/types/components/Grid/index.d.ts +1 -0
- package/dist/types/components/Heading/Heading.d.ts +34 -0
- package/dist/types/components/Heading/index.d.ts +1 -0
- package/dist/types/components/HelperText/HelperText.d.ts +12 -0
- package/dist/types/components/HelperText/index.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +57 -0
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/IconButton/IconButton.d.ts +101 -0
- package/dist/types/components/IconButton/index.d.ts +1 -0
- package/dist/types/components/Input/Input.d.ts +92 -0
- package/dist/types/components/Input/InputWithContainerRef.d.ts +14 -0
- package/dist/types/components/Input/index.d.ts +2 -0
- package/dist/types/components/Keyboard/Keyboard.d.ts +15 -0
- package/dist/types/components/Keyboard/index.d.ts +1 -0
- package/dist/types/components/Label/Label.d.ts +47 -0
- package/dist/types/components/Label/index.d.ts +1 -0
- package/dist/types/components/Link/Link.d.ts +58 -0
- package/dist/types/components/Link/LinkContext.d.ts +15 -0
- package/dist/types/components/Link/index.d.ts +1 -0
- package/dist/types/components/Mark/Mark.d.ts +41 -0
- package/dist/types/components/Mark/index.d.ts +1 -0
- package/dist/types/components/MenuList/MenuList.d.ts +48 -0
- package/dist/types/components/MenuList/MenuListContext.d.ts +11 -0
- package/dist/types/components/MenuList/MenuListGroup.d.ts +24 -0
- package/dist/types/components/MenuList/MenuListItem.d.ts +86 -0
- package/dist/types/components/MenuList/index.d.ts +3 -0
- package/dist/types/components/NumericInput/NumericInput.d.ts +86 -0
- package/dist/types/components/NumericInput/index.d.ts +1 -0
- package/dist/types/components/Output/Output.d.ts +25 -0
- package/dist/types/components/Output/index.d.ts +1 -0
- package/dist/types/components/Overlay/Overlay.d.ts +6 -0
- package/dist/types/components/Overlay/index.d.ts +1 -0
- package/dist/types/components/Popover/Popover.d.ts +27 -0
- package/dist/types/components/Popover/PopoverAnchor.d.ts +6 -0
- package/dist/types/components/Popover/PopoverClose.d.ts +7 -0
- package/dist/types/components/Popover/PopoverContent.d.ts +17 -0
- package/dist/types/components/Popover/PopoverTrigger.d.ts +10 -0
- package/dist/types/components/Popover/index.d.ts +5 -0
- package/dist/types/components/Portal/Portal.d.ts +13 -0
- package/dist/types/components/Portal/PortalContext.d.ts +10 -0
- package/dist/types/components/Portal/index.d.ts +2 -0
- package/dist/types/components/RadioGroup/Radio.d.ts +36 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +83 -0
- package/dist/types/components/RadioGroup/index.d.ts +2 -0
- package/dist/types/components/Root/Root.d.ts +121 -0
- package/dist/types/components/Root/RootContext.d.ts +8 -0
- package/dist/types/components/Root/index.d.ts +2 -0
- package/dist/types/components/Select/Option.d.ts +13 -0
- package/dist/types/components/Select/OptionsGroup.d.ts +7 -0
- package/dist/types/components/Select/Select.d.ts +117 -0
- package/dist/types/components/Select/SelectContext.d.ts +61 -0
- package/dist/types/components/Select/SelectMultipleValue.d.ts +1 -0
- package/dist/types/components/Select/SelectSingleValue.d.ts +1 -0
- package/dist/types/components/Select/index.d.ts +3 -0
- package/dist/types/components/Separator/Separator.d.ts +7 -0
- package/dist/types/components/Separator/index.d.ts +1 -0
- package/dist/types/components/Slot/Slot.d.ts +7 -0
- package/dist/types/components/Slot/Slottable.d.ts +10 -0
- package/dist/types/components/Slot/index.d.ts +2 -0
- package/dist/types/components/Spinner/Spinner.d.ts +47 -0
- package/dist/types/components/Spinner/index.d.ts +1 -0
- package/dist/types/components/Stack/Stack.d.ts +42 -0
- package/dist/types/components/Stack/index.d.ts +1 -0
- package/dist/types/components/Stepper/Step.d.ts +17 -0
- package/dist/types/components/Stepper/StepContent.d.ts +9 -0
- package/dist/types/components/Stepper/StepList.d.ts +12 -0
- package/dist/types/components/Stepper/Stepper.d.ts +59 -0
- package/dist/types/components/Stepper/StepperContext.d.ts +9 -0
- package/dist/types/components/Stepper/index.d.ts +4 -0
- package/dist/types/components/Table/Table.d.ts +122 -0
- package/dist/types/components/Table/TableBody.d.ts +6 -0
- package/dist/types/components/Table/TableCell.d.ts +45 -0
- package/dist/types/components/Table/TableColumn.d.ts +83 -0
- package/dist/types/components/Table/TableContext.d.ts +60 -0
- package/dist/types/components/Table/TableFoot.d.ts +12 -0
- package/dist/types/components/Table/TableHead.d.ts +23 -0
- package/dist/types/components/Table/TableRow.d.ts +10 -0
- package/dist/types/components/Table/index.d.ts +8 -0
- package/dist/types/components/Tabs/Tab.d.ts +14 -0
- package/dist/types/components/Tabs/TabContent.d.ts +9 -0
- package/dist/types/components/Tabs/TabList.d.ts +11 -0
- package/dist/types/components/Tabs/Tabs.d.ts +51 -0
- package/dist/types/components/Tabs/TabsContext.d.ts +34 -0
- package/dist/types/components/Tabs/index.d.ts +4 -0
- package/dist/types/components/Tag/Badge.d.ts +21 -0
- package/dist/types/components/Tag/Tag.d.ts +92 -0
- package/dist/types/components/Tag/index.d.ts +2 -0
- package/dist/types/components/TextArea/TextArea.d.ts +21 -0
- package/dist/types/components/TextArea/index.d.ts +1 -0
- package/dist/types/components/Toast/Toast.d.ts +79 -0
- package/dist/types/components/Toast/ToastDescription.d.ts +3 -0
- package/dist/types/components/Toast/ToastProvider.d.ts +12 -0
- package/dist/types/components/Toast/ToastTitle.d.ts +7 -0
- package/dist/types/components/Toast/ToastViewport.d.ts +10 -0
- package/dist/types/components/Toast/index.d.ts +5 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +55 -0
- package/dist/types/components/Tooltip/TooltipProvider.d.ts +3 -0
- package/dist/types/components/Tooltip/index.d.ts +2 -0
- package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +3 -0
- package/dist/types/components/VisuallyHidden/index.d.ts +1 -0
- package/dist/types/index.d.ts +96 -0
- package/dist/types/locale/LocalizationObject.d.ts +49 -0
- package/dist/types/locale/defaultLocale.d.ts +3 -0
- package/dist/types/locale/en-GB.d.ts +3 -0
- package/dist/types/locale/en-US.d.ts +3 -0
- package/dist/types/locale/en.d.ts +3 -0
- package/dist/types/locale/fr-FR.d.ts +3 -0
- package/dist/types/locale/index.d.ts +6 -0
- package/dist/types/locale/pt-PT.d.ts +3 -0
- package/dist/types/providers/AlertDialogProvider/AlertDialogProvider.d.ts +7 -0
- package/dist/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +97 -0
- package/dist/types/providers/AlertDialogProvider/index.d.ts +3 -0
- package/dist/types/providers/AlertDialogProvider/useAlertDialog.d.ts +68 -0
- package/dist/types/providers/DocumentTitleProvider/DocumentTitle.d.ts +12 -0
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProvider.d.ts +25 -0
- package/dist/types/providers/DocumentTitleProvider/DocumentTitleProviderContext.d.ts +44 -0
- package/dist/types/providers/DocumentTitleProvider/index.d.ts +2 -0
- package/dist/types/providers/ErrorReportingProvider/ErrorReport.d.ts +35 -0
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingContext.d.ts +7 -0
- package/dist/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +70 -0
- package/dist/types/providers/ErrorReportingProvider/index.d.ts +4 -0
- package/dist/types/providers/ErrorReportingProvider/useErrorReporter.d.ts +3 -0
- package/dist/types/providers/LocalizationProvider/LocalizationContext.d.ts +6 -0
- package/dist/types/providers/LocalizationProvider/LocalizationProvider.d.ts +10 -0
- package/dist/types/providers/LocalizationProvider/index.d.ts +3 -0
- package/dist/types/providers/LocalizationProvider/useLocale.d.ts +3 -0
- package/dist/types/providers/PrefixProvider/PrefixContext.d.ts +5 -0
- package/dist/types/providers/PrefixProvider/PrefixProvider.d.ts +9 -0
- package/dist/types/providers/PrefixProvider/index.d.ts +3 -0
- package/dist/types/providers/PrefixProvider/usePrefix.d.ts +10 -0
- package/dist/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +35 -0
- package/dist/types/providers/ToastManagerProvider/ToastManagerProvider.d.ts +11 -0
- package/dist/types/providers/ToastManagerProvider/index.d.ts +3 -0
- package/dist/types/providers/ToastManagerProvider/useToastManager.d.ts +23 -0
- package/dist/types/utils/accent.d.ts +2 -0
- package/dist/types/utils/boolDataAttr.d.ts +4 -0
- package/dist/types/utils/breakpoints.d.ts +32 -0
- package/dist/types/utils/changeCase.d.ts +2 -0
- package/dist/types/utils/combineEventHandlers.d.ts +24 -0
- package/dist/types/utils/control.d.ts +23 -0
- package/dist/types/utils/cx.d.ts +14 -0
- package/dist/types/utils/filtering.d.ts +14 -0
- package/dist/types/utils/keyboardShortcut.d.ts +111 -0
- package/dist/types/utils/mergeAriaIds.d.ts +2 -0
- package/dist/types/utils/nativeControls.d.ts +2 -0
- package/dist/types/utils/numericStringUtils.d.ts +27 -0
- package/dist/types/utils/parseDateStrict.d.ts +7 -0
- package/dist/types/utils/promiseUtils.d.ts +7 -0
- package/dist/types/utils/setNativeValue.d.ts +7 -0
- package/dist/types/utils/sorting.d.ts +9 -0
- package/dist/types/utils/stringHash.d.ts +7 -0
- package/dist/types/utils/typeUtils.d.ts +2 -0
- package/dist/types/utils/useCombinedRef.d.ts +9 -0
- package/dist/types/utils/useConstant.d.ts +7 -0
- package/dist/types/utils/useControllableState.d.ts +3 -0
- package/dist/types/utils/useCssVars.d.ts +47 -0
- package/dist/types/utils/useDateTransformer.d.ts +53 -0
- package/dist/types/utils/useIntersectionObserver.d.ts +5 -0
- package/dist/types/utils/useLatestValues.d.ts +8 -0
- package/dist/types/utils/useLayoutEffect.d.ts +3 -0
- package/dist/types/utils/useMeasure.d.ts +5 -0
- package/dist/types/utils/useMediaQuery.d.ts +12 -0
- package/dist/types/utils/useNumericTransformer.d.ts +60 -0
- package/dist/types/utils/useResponsiveValues.d.ts +31 -0
- package/dist/types/utils/useScrollPosition.d.ts +15 -0
- package/dist/types/utils/useScrollbarSize.d.ts +8 -0
- package/dist/types/utils/useSpacing.d.ts +7 -0
- package/dist/types/utils/warnOnce.d.ts +6 -0
- package/dist/types/utils/zustandUtils.d.ts +4 -0
- package/package.json +75 -0
- package/scss/_utils.scss +59 -0
- package/scss/components/Alert/_Alert-variables.scss +5 -0
- package/scss/components/Alert/_Alert.scss +56 -0
- package/scss/components/Button/_Button-variables.scss +164 -0
- package/scss/components/Button/_Button.scss +136 -0
- package/scss/components/ButtonGroup/_ButtonGroup-variables.scss +41 -0
- package/scss/components/ButtonGroup/_ButtonGroup.scss +48 -0
- package/scss/components/Calendar/_Calendar-variables.scss +127 -0
- package/scss/components/Calendar/_Calendar.scss +341 -0
- package/scss/components/Card/_Card-variables.scss +202 -0
- package/scss/components/Card/_Card.scss +253 -0
- package/scss/components/Checkbox/_Checkbox-variables.scss +25 -0
- package/scss/components/Checkbox/_Checkbox.scss +106 -0
- package/scss/components/CheckboxGroup/_CheckboxGroup.scss +68 -0
- package/scss/components/CloseButton/_CloseButton-variables.scss +2 -0
- package/scss/components/CloseButton/_CloseButton.scss +14 -0
- package/scss/components/Code/_Code-variables.scss +16 -0
- package/scss/components/Code/_Code.scss +30 -0
- package/scss/components/Collapsible/_Collapsible-variables.scss +5 -0
- package/scss/components/Collapsible/_Collapsible.scss +56 -0
- package/scss/components/CommandMenu/_CommandMenu-variables.scss +66 -0
- package/scss/components/CommandMenu/_CommandMenu.scss +162 -0
- package/scss/components/Container/_Container-variables.scss +21 -0
- package/scss/components/Container/_Container.scss +46 -0
- package/scss/components/ControlAddon/_ControlAddon-variables.scss +303 -0
- package/scss/components/ControlAddon/_ControlAddon.scss +331 -0
- package/scss/components/ControlCode/_ControlCode-variables.scss +61 -0
- package/scss/components/ControlCode/_ControlCode.scss +68 -0
- package/scss/components/DataTable/_DataTable.scss +134 -0
- package/scss/components/DateInput/_DateInput.scss +11 -0
- package/scss/components/DateRangeInput/_DateRangeInput-variables.scss +37 -0
- package/scss/components/DateRangeInput/_DateRangeInput.scss +130 -0
- package/scss/components/Dialog/_Dialog-variables.scss +195 -0
- package/scss/components/Dialog/_Dialog.scss +142 -0
- package/scss/components/DropdownMenu/_DropdownMenu-variables.scss +3 -0
- package/scss/components/DropdownMenu/_DropdownMenu.scss +50 -0
- package/scss/components/Feedback/_Feedback-variables.scss +8 -0
- package/scss/components/Feedback/_Feedback.scss +21 -0
- package/scss/components/FeedbackList/_FeedbackList-variables.scss +6 -0
- package/scss/components/FeedbackList/_FeedbackList.scss +31 -0
- package/scss/components/FeedbackPopover/_FeedbackPopover-variables.scss +26 -0
- package/scss/components/FeedbackPopover/_FeedbackPopover.scss +66 -0
- package/scss/components/Field/_Field.scss +51 -0
- package/scss/components/FieldGroup/_FieldGroup-variables.scss +31 -0
- package/scss/components/FieldGroup/_FieldGroup.scss +68 -0
- package/scss/components/Grid/_Grid.scss +101 -0
- package/scss/components/Heading/_Heading-variables.scss +78 -0
- package/scss/components/Heading/_Heading.scss +22 -0
- package/scss/components/HelperText/_HelperText-variables.scss +7 -0
- package/scss/components/HelperText/_HelperText.scss +18 -0
- package/scss/components/Icon/_Icon-variables.scss +3 -0
- package/scss/components/Icon/_Icon.scss +17 -0
- package/scss/components/IconButton/_IconButton-variables.scss +34 -0
- package/scss/components/IconButton/_IconButton.scss +41 -0
- package/scss/components/Input/_Input-variables.scss +6 -0
- package/scss/components/Input/_Input.scss +235 -0
- package/scss/components/Keyboard/_Keyboard.scss +17 -0
- package/scss/components/Label/_Label-variables.scss +26 -0
- package/scss/components/Label/_Label.scss +63 -0
- package/scss/components/Link/_Link-variables.scss +46 -0
- package/scss/components/Link/_Link.scss +63 -0
- package/scss/components/Mark/_Mark-variables.scss +8 -0
- package/scss/components/Mark/_Mark.scss +11 -0
- package/scss/components/MenuList/_MenuList.scss +86 -0
- package/scss/components/Output/_Output.scss +5 -0
- package/scss/components/Overlay/_Overlay-variables.scss +14 -0
- package/scss/components/Overlay/_Overlay.scss +32 -0
- package/scss/components/Popover/_Popover.scss +10 -0
- package/scss/components/RadioGroup/_Radio-variables.scss +1 -0
- package/scss/components/RadioGroup/_Radio.scss +49 -0
- package/scss/components/RadioGroup/_RadioGroup.scss +74 -0
- package/scss/components/Root/_Root-variables.scss +10 -0
- package/scss/components/Root/_Root.scss +107 -0
- package/scss/components/Select/_Select-variables.scss +101 -0
- package/scss/components/Select/_Select.scss +167 -0
- package/scss/components/Separator/_Separator.scss +16 -0
- package/scss/components/Spinner/_Spinner-variables.scss +3 -0
- package/scss/components/Spinner/_Spinner.scss +18 -0
- package/scss/components/Stack/_Stack-variables.scss +4 -0
- package/scss/components/Stack/_Stack.scss +47 -0
- package/scss/components/Stepper/_Stepper-variables.scss +38 -0
- package/scss/components/Stepper/_Stepper.scss +86 -0
- package/scss/components/Table/_Table-variables.scss +471 -0
- package/scss/components/Table/_Table.scss +632 -0
- package/scss/components/Tabs/_Tabs-variables.scss +403 -0
- package/scss/components/Tabs/_Tabs.scss +443 -0
- package/scss/components/Tag/_Tag-variables.scss +37 -0
- package/scss/components/Tag/_Tag.scss +86 -0
- package/scss/components/Toast/_Toast.scss +181 -0
- package/scss/components/Tooltip/_Tooltip-variables.scss +21 -0
- package/scss/components/Tooltip/_Tooltip.scss +44 -0
- package/scss/index.scss +57 -0
- package/scss/scss/_base-variables.scss +501 -0
- package/scss/scss/_colors.scss +188 -0
- package/scss/scss/helpers/_visually-hidden.scss +18 -0
- package/scss/scss/placeholders/_calendar-popover.scss +16 -0
- package/scss/scss/placeholders/button/_button-variables.scss +254 -0
- package/scss/scss/placeholders/button/_button.scss +153 -0
- package/scss/scss/placeholders/checkable/_checkable-variables.scss +78 -0
- package/scss/scss/placeholders/checkable/_checkable.scss +354 -0
- package/scss/scss/placeholders/checkable-group/_checkable-group-variables.scss +43 -0
- package/scss/scss/placeholders/checkable-group/_checkable-group.scss +141 -0
- package/scss/scss/placeholders/control/_control-variables.scss +300 -0
- package/scss/scss/placeholders/control/_control.scss +372 -0
- package/scss/scss/placeholders/menu/_menu-variables.scss +325 -0
- package/scss/scss/placeholders/menu/_menu.scss +364 -0
- package/scss/scss/placeholders/notification/_notification-variables.scss +76 -0
- package/scss/scss/placeholders/notification/_notification.scss +83 -0
- package/scss/scss/placeholders/popover/_popover-variables.scss +22 -0
- package/scss/scss/placeholders/popover/_popover.scss +70 -0
- package/scss/scss/utils/_animation.scss +125 -0
- package/scss/scss/utils/_breakpoints.scss +64 -0
- package/scss/scss/utils/_button-reset.scss +17 -0
- package/scss/scss/utils/_css-color-functions.scss +15 -0
- package/scss/scss/utils/_declare-var.scss +8 -0
- package/scss/scss/utils/_maybe-important.scss +5 -0
- package/scss/scss/utils/_responsive-values.scss +28 -0
- package/scss/scss/utils/_space-toggle.scss +25 -0
- package/scss/scss/utils/_spacing.scss +12 -0
- package/scss/scss/utils/_spinner.scss +31 -0
- package/scss/scss/utils/_transition.scss +15 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ControlStatus, type ControlVariant } from "../../utils/control.ts";
|
|
3
|
+
/** Properties of the control's code component. */
|
|
4
|
+
export interface ControlCodeProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
5
|
+
/**
|
|
6
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
7
|
+
* This will merge the original component props with the props of the supplied
|
|
8
|
+
* element/component and change the underlying DOM node.
|
|
9
|
+
*/
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
/** Variant of the control code. */
|
|
12
|
+
variant?: ControlVariant;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the status of the code (this should typically be the same as the
|
|
15
|
+
* control's status).
|
|
16
|
+
*/
|
|
17
|
+
status?: ControlStatus;
|
|
18
|
+
/** Text prefixed to the code to be announced by assistive technologies. */
|
|
19
|
+
visuallyHiddenPrefix?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** Component used to display the "code" of a form control. */
|
|
22
|
+
export declare const ControlCode: React.ForwardRefExoticComponent<ControlCodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ControlCode.tsx";
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
|
+
import { type DataTableApi } from "./DataTableApi.ts";
|
|
4
|
+
import { type DataTableCellProps } from "./DataTableCell.tsx";
|
|
5
|
+
import { type DataTableColumns } from "./DataTableColumn.tsx";
|
|
6
|
+
import { type DataTableRowProps } from "./DataTableRow.tsx";
|
|
7
|
+
/** Display mode of the data table. */
|
|
8
|
+
export type DataTableDisplayMode = "paged" | "scrolled";
|
|
9
|
+
/**
|
|
10
|
+
* Options passed to the `getRows` function to get the rows meant to be
|
|
11
|
+
* rendered.
|
|
12
|
+
*/
|
|
13
|
+
export interface DataTableGetRowsOptions {
|
|
14
|
+
/** Index from which to fetch rows. */
|
|
15
|
+
offset: number;
|
|
16
|
+
/** Limit of rows to fetch. */
|
|
17
|
+
limit: number;
|
|
18
|
+
/**
|
|
19
|
+
* Filter to apply. An empty string will be passed when the results shouldn't
|
|
20
|
+
* be filtered.
|
|
21
|
+
*/
|
|
22
|
+
filter: string;
|
|
23
|
+
/** Column to sort by. `null` is passed when the results shouldn't be sorted. */
|
|
24
|
+
sortBy: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Direction of the sorting. `null` is passed when the results shouldn't be
|
|
27
|
+
* sorted.
|
|
28
|
+
*/
|
|
29
|
+
sortDirection: SortDirection | null;
|
|
30
|
+
/**
|
|
31
|
+
* Abort signal provided by the data table which is cancelled when the result
|
|
32
|
+
* of this `getRows` call is no longer needed.
|
|
33
|
+
*/
|
|
34
|
+
signal: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
/** Object which should be returned by `getRows`. */
|
|
37
|
+
export interface DataTableGetRowsResult<T = unknown> {
|
|
38
|
+
/** Fetched rows for the given options. */
|
|
39
|
+
rows: T[];
|
|
40
|
+
/** Total number of rows of the data table. */
|
|
41
|
+
totalCount: number;
|
|
42
|
+
}
|
|
43
|
+
/** Properties of the data table component. */
|
|
44
|
+
export interface DataTableProps<T = any> extends React.ComponentPropsWithoutRef<"div"> {
|
|
45
|
+
/**
|
|
46
|
+
* Display mode of the data table. Rows are displayed either in pages or
|
|
47
|
+
* within an infinite scroll component.
|
|
48
|
+
*
|
|
49
|
+
* @default paged
|
|
50
|
+
*/
|
|
51
|
+
displayMode?: DataTableDisplayMode;
|
|
52
|
+
/** Data table columns. */
|
|
53
|
+
columns: DataTableColumns<T>;
|
|
54
|
+
/**
|
|
55
|
+
* Rows of the data table.
|
|
56
|
+
*
|
|
57
|
+
* Either this property or `getRows` should be provided.
|
|
58
|
+
*/
|
|
59
|
+
rows?: T[];
|
|
60
|
+
/**
|
|
61
|
+
* Function used to dynamically get the rows of the data table.
|
|
62
|
+
*
|
|
63
|
+
* Either this property or `rows` should be provided.
|
|
64
|
+
*/
|
|
65
|
+
getRows?: (options: DataTableGetRowsOptions) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;
|
|
66
|
+
/**
|
|
67
|
+
* Property of the row that contains the row's key, or a function used to get
|
|
68
|
+
* it, given the row.
|
|
69
|
+
*
|
|
70
|
+
* Keys should be of type `React.Key`, i.e. `string | number | bigint`.
|
|
71
|
+
*/
|
|
72
|
+
rowKey: string | number | symbol | ((row: T) => React.Key);
|
|
73
|
+
/**
|
|
74
|
+
* Number of rows to show when `loading` is `true`, or using `getRows` and the
|
|
75
|
+
* total count isn't yet known.
|
|
76
|
+
*
|
|
77
|
+
* @default 2
|
|
78
|
+
*/
|
|
79
|
+
loadingCount?: number;
|
|
80
|
+
/** Marks the data table as "required" when it is being used as a control. */
|
|
81
|
+
required?: boolean;
|
|
82
|
+
/** Marks the data table as currently loading data. */
|
|
83
|
+
loading?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Default offset from which to display rows. When in paged mode, the actually
|
|
86
|
+
* used offset will always be a multiple of `limit`.
|
|
87
|
+
*
|
|
88
|
+
* @default 0
|
|
89
|
+
*/
|
|
90
|
+
defaultOffset?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Controlled offset from which to display rows. When in paged mode, the
|
|
93
|
+
* actually used offset will always be a multiple of `limit`.
|
|
94
|
+
*
|
|
95
|
+
* Use together with `onOffsetChange` to control the offset.
|
|
96
|
+
*/
|
|
97
|
+
offset?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Function called whenever the offset changes.
|
|
100
|
+
*
|
|
101
|
+
* @param offset New offset.
|
|
102
|
+
*/
|
|
103
|
+
onOffsetChange?: (offset: number) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Default value used to limit the number of rows shown on screen.
|
|
106
|
+
*
|
|
107
|
+
* @default 10
|
|
108
|
+
*/
|
|
109
|
+
defaultLimit?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Controlled value used to limit the number of rows shown on screen.
|
|
112
|
+
*
|
|
113
|
+
* Use together with `onLimitChange` to control the limit.
|
|
114
|
+
*/
|
|
115
|
+
limit?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Function called whenever the limit changes.
|
|
118
|
+
*
|
|
119
|
+
* @param limit New limit.
|
|
120
|
+
*/
|
|
121
|
+
onLimitChange?: (limit: number) => void;
|
|
122
|
+
/** Default string to filter by. */
|
|
123
|
+
defaultFilter?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Controlled string to filter by. Use together with `onFilterChange` to
|
|
126
|
+
* change the filter.
|
|
127
|
+
*/
|
|
128
|
+
filter?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Function called whenever the string to filter by changes.
|
|
131
|
+
*
|
|
132
|
+
* @param filter New filter.
|
|
133
|
+
*/
|
|
134
|
+
onFilterChange?: (filter: string) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Default column to sort by. When `null`, the table is sorted according to
|
|
137
|
+
* the rows' natural order.
|
|
138
|
+
*
|
|
139
|
+
* @default null
|
|
140
|
+
*/
|
|
141
|
+
defaultSortBy?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Controlled column to sort by. When `null`, the table is sorted according to
|
|
144
|
+
* the rows' natural order.
|
|
145
|
+
*
|
|
146
|
+
* Use together with `onSort` to change the sorting order.
|
|
147
|
+
*/
|
|
148
|
+
sortBy?: string | null;
|
|
149
|
+
/** Default sort direction. */
|
|
150
|
+
defaultSortDirection?: SortDirection;
|
|
151
|
+
/**
|
|
152
|
+
* Controlled sort direction.
|
|
153
|
+
*
|
|
154
|
+
* Use together with `onSort` to change the sort direction.
|
|
155
|
+
*/
|
|
156
|
+
sortDirection?: SortDirection;
|
|
157
|
+
/**
|
|
158
|
+
* Function called whenever the sorting of data changes.
|
|
159
|
+
*
|
|
160
|
+
* @param sortBy New column to sort by.
|
|
161
|
+
* @param sortDirection New direction to sort by.
|
|
162
|
+
*/
|
|
163
|
+
onSort?: (sortBy: string | null, sortDirection: SortDirection) => void;
|
|
164
|
+
/**
|
|
165
|
+
* Prepend a column containing checkboxes used to select rows of the data
|
|
166
|
+
* table.
|
|
167
|
+
*
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
showSelectionColumn?: boolean;
|
|
171
|
+
/** Default keys of the selected rows. */
|
|
172
|
+
defaultSelectedRows?: React.Key[];
|
|
173
|
+
/**
|
|
174
|
+
* Controlled keys of the selected rows.
|
|
175
|
+
*
|
|
176
|
+
* Use together with `onSelectedRowsChange` to change the selected rows.
|
|
177
|
+
*/
|
|
178
|
+
selectedRows?: React.Key[];
|
|
179
|
+
/**
|
|
180
|
+
* Function called whenever the selected rows of the data table change.
|
|
181
|
+
*
|
|
182
|
+
* @param selectedRows Array containing the keys of the newly selected rows.
|
|
183
|
+
*/
|
|
184
|
+
onSelectedRowsChange?: (selectedRows: React.Key[]) => void;
|
|
185
|
+
/**
|
|
186
|
+
* Function used to render each row. This function should typically return a
|
|
187
|
+
* `DataTableRow` with the provided properties. This function is useful to
|
|
188
|
+
* wrap each row in its own context.
|
|
189
|
+
*
|
|
190
|
+
* @default props => <DataTableRow {...props} />
|
|
191
|
+
* @param props Properties to pass to the data table row to render.
|
|
192
|
+
*/
|
|
193
|
+
renderRow?: (props: DataTableRowProps) => React.ReactNode;
|
|
194
|
+
/**
|
|
195
|
+
* Function used to render each cell. This function should typically return a
|
|
196
|
+
* `DataTableCell` with the provided properties. This function is useful to
|
|
197
|
+
* wrap each cell in its own context.
|
|
198
|
+
*
|
|
199
|
+
* @default props => <DataTableCell {...props} />
|
|
200
|
+
* @param props Properties to pass to the data table cell to render.
|
|
201
|
+
*/
|
|
202
|
+
renderCell?: (props: DataTableCellProps) => React.ReactNode;
|
|
203
|
+
/**
|
|
204
|
+
* Whether the height of each row should be computed dynamically (only
|
|
205
|
+
* relevant for scrolled mode).
|
|
206
|
+
*
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
dynamicRowHeight?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Estimated height of each table row.
|
|
212
|
+
*
|
|
213
|
+
* A function may be provided to return the actual or estimated height of each
|
|
214
|
+
* row.
|
|
215
|
+
*
|
|
216
|
+
* @default DEFAULT_TABLE_ROW_HEIGHT
|
|
217
|
+
*/
|
|
218
|
+
estimatedRowHeight?: number | ((index: number) => number);
|
|
219
|
+
/**
|
|
220
|
+
* Number of items to render above and below the visible area (only relevant
|
|
221
|
+
* for scrolled mode).
|
|
222
|
+
*
|
|
223
|
+
* @default 5
|
|
224
|
+
*/
|
|
225
|
+
overscan?: number;
|
|
226
|
+
/** Reference to interact with the data table's API. */
|
|
227
|
+
apiRef?: React.Ref<DataTableApi<T> | undefined>;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The `DataTable` component is the root component used for displaying a data
|
|
231
|
+
* table. It supports features such as different display modes (paged or
|
|
232
|
+
* scrolled), pagination, dynamic data loading, custom rows and cells, sorting,
|
|
233
|
+
* and filtering, allowing flexible data table functionality via configuration.
|
|
234
|
+
*
|
|
235
|
+
* It composes the following subcomponents:
|
|
236
|
+
*
|
|
237
|
+
* - `DataTableContent`: Represents the core content area of the `DataTable`,
|
|
238
|
+
* containing the table itself, including its head and body. It is responsible
|
|
239
|
+
* for rendering the main parts of the `DataTable`.
|
|
240
|
+
* - `DataTableFilter`: Implements filtering functionality, allowing users to
|
|
241
|
+
* filter displayed data based on specific conditions.
|
|
242
|
+
* - `DataTablePagination`: Component responsible for handling the pagination
|
|
243
|
+
* functionality of the `DataTable`. Allows control over which page of the
|
|
244
|
+
* table to display (when in "paged" mode), or insight into the rows being
|
|
245
|
+
* currently rendered (in "scrolled" mode).
|
|
246
|
+
* - `DataTableRowsPerPage`: Component which allows the user to control the
|
|
247
|
+
* `limit` property of the `DataTable`, i.e. how many rows to display per page
|
|
248
|
+
* in "paged" mode or how many rows to display at once in "scrolled" mode.
|
|
249
|
+
* - `DataTableRow`: Represents an individual row of the `DataTable`. This
|
|
250
|
+
* component is only relevant when providing a custom data table row via
|
|
251
|
+
* `renderRow`.
|
|
252
|
+
* - `DataTableCell`: Represents an individual cell of the `DataTable`. This
|
|
253
|
+
* component is only relevant when providing a custom data table cell via
|
|
254
|
+
* `renderCell`.
|
|
255
|
+
*/
|
|
256
|
+
export declare const DataTable: React.ForwardRefExoticComponent<DataTableProps<any> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ScrollToOptions } from "@tanstack/react-virtual";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Options used when using the `goTo` function of the `DataTableApi`. */
|
|
4
|
+
export type DataTableScrollToOptions = ScrollToOptions;
|
|
5
|
+
/** Imperative data table API. */
|
|
6
|
+
export interface DataTableApi<T = unknown> {
|
|
7
|
+
/**
|
|
8
|
+
* Function that provides a way of notifying that changes have been made to
|
|
9
|
+
* the table rows when using the `getRows`/`count` API. Either this function
|
|
10
|
+
* or `refresh` should be called after changing the table's `count`.
|
|
11
|
+
*
|
|
12
|
+
* @param startIndex Index of where to change started.
|
|
13
|
+
* @param deleteCount Number of rows deleted from `startIndex`. Defaults to
|
|
14
|
+
* `0`.
|
|
15
|
+
* @param added Either the number of rows added, or an array with the added
|
|
16
|
+
* rows themselves. Defaults to `0`.
|
|
17
|
+
*/
|
|
18
|
+
splice: (startIndex: number, deleted?: number, added?: number | T[]) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Refreshes the data table provided its new total count (if it changed).
|
|
21
|
+
*
|
|
22
|
+
* @param newTotalCount New total number of rows, in case it changed. Set to
|
|
23
|
+
* `null` to specify that the new total count is unknown. Set to `undefined`
|
|
24
|
+
* when the new total count shouldn't change.
|
|
25
|
+
*/
|
|
26
|
+
refresh: (newTotalCount?: number | null) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Navigates to the row with the provided index.
|
|
29
|
+
*
|
|
30
|
+
* @param index Index of row to navigate to.
|
|
31
|
+
* @param scrollOptions Options used to configure to scrolling to the row
|
|
32
|
+
* (only relevant in scrolled display mode).
|
|
33
|
+
*/
|
|
34
|
+
goTo: (index: number, scrollOptions?: DataTableScrollToOptions) => void;
|
|
35
|
+
}
|
|
36
|
+
/** Hook used to access the data table API. */
|
|
37
|
+
export declare function useDataTableApiRef(): React.RefObject<DataTableApi | null>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableBody } from "../Table";
|
|
3
|
+
import { type DataTableContentProps } from "./DataTableContent.tsx";
|
|
4
|
+
/** Properties of the data table foot component. */
|
|
5
|
+
export interface DataTableBodyProps extends React.ComponentPropsWithoutRef<typeof TableBody>, Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
|
|
6
|
+
containerRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
7
|
+
}
|
|
8
|
+
/** Body of the data table. */
|
|
9
|
+
export declare const DataTableBody: React.ForwardRefExoticComponent<DataTableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableCell } from "../Table";
|
|
3
|
+
/** Properties of a data table cell. */
|
|
4
|
+
export interface DataTableCellProps extends React.ComponentPropsWithoutRef<typeof TableCell> {
|
|
5
|
+
columnLabel?: React.ReactNode;
|
|
6
|
+
columnLabelId?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Data table cell. */
|
|
9
|
+
export declare const DataTableCell: React.ForwardRefExoticComponent<DataTableCellProps & React.RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type MatchAgainstFilter } from "../../utils/filtering.ts";
|
|
3
|
+
import { type TableColumn } from "../Table";
|
|
4
|
+
/** Data table columns. */
|
|
5
|
+
export type DataTableColumns<T = unknown> = Record<string, DataTableColumn<T>>;
|
|
6
|
+
/** Data table column. */
|
|
7
|
+
export interface DataTableColumn<T = unknown, TValue = any> extends Omit<React.ComponentPropsWithRef<typeof TableColumn>, "sorted" | "onSort"> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether values of this column can be filtered.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
filterable?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Locale of the formatted value.
|
|
16
|
+
*
|
|
17
|
+
* Used to perform locale-specific transformations (`toLocaleLowerCase`) on
|
|
18
|
+
* the formatted value when filtering.
|
|
19
|
+
*/
|
|
20
|
+
locale?: string;
|
|
21
|
+
/** Sub columns of this column. */
|
|
22
|
+
subColumns?: DataTableColumns<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional function used to get the value associated with this column from
|
|
25
|
+
* the row. The default getter uses the column identifier as a property to
|
|
26
|
+
* access the row.
|
|
27
|
+
*/
|
|
28
|
+
getValue?: (getValueData: DataTableColumnGetValueData<T>) => TValue;
|
|
29
|
+
/**
|
|
30
|
+
* Function used to format the value as a string. Automatic filtering is based
|
|
31
|
+
* on this string. By default, `.toString()` is used.
|
|
32
|
+
*/
|
|
33
|
+
format?: (formatData: DataTableColumnFormatData<T, TValue>) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Function used to render the cell's content. By default, the formatted value
|
|
36
|
+
* is rendered, possibly highlighted when it matches the filter.
|
|
37
|
+
*/
|
|
38
|
+
render?: (renderData: DataTableColumnRenderData<T, TValue>) => React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Comparison function used when sorting values of this column. The default
|
|
41
|
+
* sorting function can handle primitive values and dates. When sorting other
|
|
42
|
+
* objects, their string representation is used in the comparison.
|
|
43
|
+
*/
|
|
44
|
+
compare?: (value1: TValue, value2: TValue) => number;
|
|
45
|
+
}
|
|
46
|
+
/** Data passed to a data table column's `getValue` function. */
|
|
47
|
+
export interface DataTableColumnGetValueData<T = unknown> {
|
|
48
|
+
/** Table row. */
|
|
49
|
+
row: T;
|
|
50
|
+
/** Index of the row. */
|
|
51
|
+
index: number;
|
|
52
|
+
}
|
|
53
|
+
/** Data passed to a data table column's `format` function. */
|
|
54
|
+
export interface DataTableColumnFormatData<T = unknown, TValue = unknown> extends DataTableColumnGetValueData<T> {
|
|
55
|
+
/** Value to format. */
|
|
56
|
+
value: TValue;
|
|
57
|
+
}
|
|
58
|
+
/** Data passed to a data column's `render` function. */
|
|
59
|
+
export interface DataTableColumnRenderData<T = unknown, TValue = unknown> extends DataTableColumnFormatData<T, TValue> {
|
|
60
|
+
/** Formatted value. */
|
|
61
|
+
formattedValue: string;
|
|
62
|
+
/** Match of the formatted value against the filter. */
|
|
63
|
+
match: MatchAgainstFilter | null;
|
|
64
|
+
/**
|
|
65
|
+
* Formatted value possibly marked by the filter. When the formatted value
|
|
66
|
+
* doesn't match the filter, this property will be the same as
|
|
67
|
+
* `formattedValue`.
|
|
68
|
+
*/
|
|
69
|
+
markedValue: React.ReactNode;
|
|
70
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Table, type TableBody, type TableFoot, type TableHead } from "../Table";
|
|
3
|
+
/** Properties of the data table content component. */
|
|
4
|
+
export interface DataTableContentProps extends Omit<React.ComponentPropsWithoutRef<typeof Table>, "layout"> {
|
|
5
|
+
/** Message to display when the data table contains no rows. */
|
|
6
|
+
emptyMessage?: React.ReactNode;
|
|
7
|
+
/** Content of the table foot component. */
|
|
8
|
+
tableFootContent?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the table foot show be shown when the data table is empty.
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
showTableFootWhenEmpty?: boolean;
|
|
15
|
+
/** Properties to pass to the table head component. */
|
|
16
|
+
tableHeadProps?: React.ComponentPropsWithRef<typeof TableHead>;
|
|
17
|
+
/** Properties to pass to the table body component. */
|
|
18
|
+
tableBodyProps?: React.ComponentPropsWithRef<typeof TableBody>;
|
|
19
|
+
/** Properties to pass to the table foot component, when one exists. */
|
|
20
|
+
tableFootProps?: React.ComponentPropsWithRef<typeof TableFoot>;
|
|
21
|
+
/** Properties to pass to the component containing the empty message. */
|
|
22
|
+
emptyMessageProps?: React.ComponentPropsWithRef<"div">;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Component containing the "main content" of the data table, i.e. the table
|
|
26
|
+
* itself.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DataTableContent: React.ForwardRefExoticComponent<DataTableContentProps & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
|
+
import { type DataTableDisplayMode, type DataTableGetRowsOptions, type DataTableGetRowsResult } from "./DataTable.tsx";
|
|
4
|
+
import { type DataTableApi } from "./DataTableApi.ts";
|
|
5
|
+
import { type DataTableCellProps } from "./DataTableCell.tsx";
|
|
6
|
+
import { type DataTableColumns } from "./DataTableColumn.tsx";
|
|
7
|
+
import { type DataTableRowProps } from "./DataTableRow.tsx";
|
|
8
|
+
/** Value of the data table context. */
|
|
9
|
+
export interface DataTableContextValue<T = any> {
|
|
10
|
+
displayMode: DataTableDisplayMode;
|
|
11
|
+
rowKey: string | number | symbol | ((row: T) => React.Key);
|
|
12
|
+
required?: boolean;
|
|
13
|
+
showSelectionColumn: boolean;
|
|
14
|
+
renderRow?: (props: DataTableRowProps) => React.ReactNode;
|
|
15
|
+
renderCell?: (props: DataTableCellProps) => React.ReactNode;
|
|
16
|
+
dynamicRowHeight: boolean;
|
|
17
|
+
estimatedRowHeight: number | ((index: number) => number);
|
|
18
|
+
overscan: number;
|
|
19
|
+
generatedId: string;
|
|
20
|
+
apiRef?: React.Ref<DataTableApi<T> | undefined>;
|
|
21
|
+
store: DataTableStore<T>;
|
|
22
|
+
}
|
|
23
|
+
/** State of the data table. */
|
|
24
|
+
export interface DataTableState<T = any> {
|
|
25
|
+
columns: DataTableColumns<T>;
|
|
26
|
+
leafColumns: DataTableColumns<T>;
|
|
27
|
+
headCount: number;
|
|
28
|
+
_rows?: T[];
|
|
29
|
+
_filteredRows: () => T[] | undefined;
|
|
30
|
+
transformedRows: () => T[] | undefined;
|
|
31
|
+
getRows?: (options: DataTableGetRowsOptions) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;
|
|
32
|
+
loading: boolean;
|
|
33
|
+
loadingCount: number;
|
|
34
|
+
updateCounter: number;
|
|
35
|
+
ongoingGetRows?: {
|
|
36
|
+
from: number;
|
|
37
|
+
to: number;
|
|
38
|
+
};
|
|
39
|
+
abortController?: AbortController;
|
|
40
|
+
cachedRows?: Record<number, T | undefined>;
|
|
41
|
+
rowsWindow: (offset: number, limit: number) => (T | undefined)[];
|
|
42
|
+
_totalCount?: number;
|
|
43
|
+
totalCount: () => number | undefined;
|
|
44
|
+
bodyCount: () => number;
|
|
45
|
+
_offset: number;
|
|
46
|
+
offset: () => number;
|
|
47
|
+
currentPage: () => number;
|
|
48
|
+
pageOffset: () => number;
|
|
49
|
+
limit: number;
|
|
50
|
+
pageLimit: () => number | undefined;
|
|
51
|
+
filter: string;
|
|
52
|
+
sortBy: string | null;
|
|
53
|
+
sortDirection: SortDirection;
|
|
54
|
+
selectedRows: [Set<React.Key>];
|
|
55
|
+
scrolledRangeStart: number;
|
|
56
|
+
scrolledRangeEnd: number;
|
|
57
|
+
tableHeadHeight?: number;
|
|
58
|
+
tableFootHeight?: number;
|
|
59
|
+
actions: DataTableActions<T>;
|
|
60
|
+
}
|
|
61
|
+
/** Actions of the data table. */
|
|
62
|
+
export interface DataTableActions<T> {
|
|
63
|
+
setGetRows: (getRows: DataTableState["getRows"]) => void;
|
|
64
|
+
setOffset: (offset: number) => void;
|
|
65
|
+
setLimit: (limit: number) => void;
|
|
66
|
+
setFilter: (filter: string) => void;
|
|
67
|
+
setSort: (sortBy: string | null, sortDirection: SortDirection) => void;
|
|
68
|
+
selectRows: (keys: React.Key[]) => void;
|
|
69
|
+
unselectRows: (keys: React.Key[]) => void;
|
|
70
|
+
updateWindow: (offset: number, limit: number) => void;
|
|
71
|
+
spliceWindow: (offset: number, limit: number, startIndex: number, deleted?: number, added?: number | T[]) => void;
|
|
72
|
+
refresh: (newTotalCount?: number | null) => void;
|
|
73
|
+
}
|
|
74
|
+
/** Data table store. */
|
|
75
|
+
export type DataTableStore<T> = ReturnType<typeof useCreateDataTableContext<T>>["store"];
|
|
76
|
+
/** Data table context. */
|
|
77
|
+
export declare const DataTableContext: React.Context<DataTableContextValue<any> | null>;
|
|
78
|
+
/** Options used to create the data table context value. */
|
|
79
|
+
export interface UseCreateDataTableContextOptions<T> extends Omit<DataTableContextValue, "generatedId" | "store"> {
|
|
80
|
+
columns: DataTableColumns<T>;
|
|
81
|
+
leafColumns: DataTableColumns<T>;
|
|
82
|
+
headCount: number;
|
|
83
|
+
rows?: T[];
|
|
84
|
+
getRows?: (options: DataTableGetRowsOptions) => DataTableGetRowsResult<T> | PromiseLike<DataTableGetRowsResult<T>>;
|
|
85
|
+
loading: boolean;
|
|
86
|
+
loadingCount: number;
|
|
87
|
+
defaultOffset: number;
|
|
88
|
+
offset?: number;
|
|
89
|
+
onOffsetChange?: (offset: number) => void;
|
|
90
|
+
defaultLimit: number;
|
|
91
|
+
limit?: number;
|
|
92
|
+
onLimitChange?: (limit: number) => void;
|
|
93
|
+
defaultFilter: string;
|
|
94
|
+
filter?: string;
|
|
95
|
+
onFilterChange?: (filter: string) => void;
|
|
96
|
+
defaultSortBy: string | null;
|
|
97
|
+
sortBy?: string | null;
|
|
98
|
+
defaultSortDirection: SortDirection | undefined;
|
|
99
|
+
sortDirection?: SortDirection;
|
|
100
|
+
onSort?: (sortBy: string | null, sortDirection: SortDirection) => void;
|
|
101
|
+
showSelectionColumn: boolean;
|
|
102
|
+
defaultSelectedRows?: React.Key[];
|
|
103
|
+
selectedRows?: React.Key[];
|
|
104
|
+
onSelectedRowsChange?: (selectedRows: React.Key[]) => void;
|
|
105
|
+
}
|
|
106
|
+
/** Hook which creates the data table context value. */
|
|
107
|
+
export declare function useCreateDataTableContext<T>({ displayMode, columns, rows, getRows, rowKey, loadingCount, required, loading, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, apiRef, leafColumns, headCount, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, defaultSelectedRows, selectedRows, onSelectedRowsChange, }: UseCreateDataTableContextOptions<T>): {
|
|
108
|
+
displayMode: DataTableDisplayMode;
|
|
109
|
+
rowKey: string | number | symbol | ((row: any) => React.Key);
|
|
110
|
+
required: boolean | undefined;
|
|
111
|
+
showSelectionColumn: boolean;
|
|
112
|
+
renderRow: ((props: DataTableRowProps) => React.ReactNode) | undefined;
|
|
113
|
+
renderCell: ((props: DataTableCellProps) => React.ReactNode) | undefined;
|
|
114
|
+
dynamicRowHeight: boolean;
|
|
115
|
+
estimatedRowHeight: number | ((index: number) => number);
|
|
116
|
+
overscan: number;
|
|
117
|
+
generatedId: string;
|
|
118
|
+
apiRef: React.Ref<DataTableApi<any> | undefined> | undefined;
|
|
119
|
+
store: Omit<import("zustand").StoreApi<DataTableState<T>>, "subscribe"> & {
|
|
120
|
+
subscribe: {
|
|
121
|
+
(listener: (selectedState: DataTableState<T>, previousSelectedState: DataTableState<T>) => void): () => void;
|
|
122
|
+
<U>(selector: (state: DataTableState<T>) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
123
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
124
|
+
fireImmediately?: boolean;
|
|
125
|
+
} | undefined): () => void;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/** Hook providing access to the data table context. */
|
|
130
|
+
export declare function useDataTableContext<T = unknown>(): DataTableContextValue<T>;
|
|
131
|
+
/** Context value of a data table cell. */
|
|
132
|
+
export interface DataTableCellContextValue {
|
|
133
|
+
columnLabel?: React.ReactNode;
|
|
134
|
+
columnLabelId?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Data table cell context. */
|
|
137
|
+
export declare const DataTableCellContext: React.Context<DataTableCellContextValue | null>;
|
|
138
|
+
/** Column label accessible within a data table cell. */
|
|
139
|
+
export declare function useDataTableColumnLabel(): React.ReactNode;
|
|
140
|
+
/** Column label id accessible within a data table cell. */
|
|
141
|
+
export declare function useDataTableColumnLabelId(): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DataTableContentProps } from "./DataTableContent.tsx";
|
|
2
|
+
/** Properties of the data table empty/loading row. */
|
|
3
|
+
export interface DataTableEmptyOrLoadingRowProps extends Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Data table rows displayed when the data table is either loading or has no
|
|
7
|
+
* rows.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DataTableEmptyOrLoadingRows({ emptyMessage, emptyMessageProps, }: DataTableEmptyOrLoadingRowProps): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Input } from "../Input";
|
|
3
|
+
/** Properties of the data table filter component. */
|
|
4
|
+
export interface DataTableFilterProps extends Omit<React.ComponentPropsWithoutRef<typeof Input>, "defaultValue" | "value"> {
|
|
5
|
+
}
|
|
6
|
+
/** Input used to globally filter a data table. */
|
|
7
|
+
export declare const DataTableFilter: React.ForwardRefExoticComponent<DataTableFilterProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableFoot } from "../Table";
|
|
3
|
+
/** Properties of the data table foot component. */
|
|
4
|
+
export interface DataTableFootProps extends React.ComponentPropsWithoutRef<typeof TableFoot> {
|
|
5
|
+
showWhenEmpty: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Foot of the data table. */
|
|
8
|
+
export declare const DataTableFoot: React.ForwardRefExoticComponent<DataTableFootProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableHead } from "../Table";
|
|
3
|
+
/** Properties of the data table head component. */
|
|
4
|
+
export interface DataTableHeadProps extends React.ComponentPropsWithoutRef<typeof TableHead> {
|
|
5
|
+
}
|
|
6
|
+
/** Head of the data table. */
|
|
7
|
+
export declare const DataTableHead: React.ForwardRefExoticComponent<DataTableHeadProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Properties of the data table pagination component. */
|
|
3
|
+
export interface DataTablePaginationProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
/**
|
|
5
|
+
* Function used to render the range of displayed rows.
|
|
6
|
+
*
|
|
7
|
+
* @param range Node representing the range of rows (note that, in paged mode,
|
|
8
|
+
* this is a select).
|
|
9
|
+
* @param total Total number of rows.
|
|
10
|
+
*/
|
|
11
|
+
rowsRange?: (range: React.ReactNode, total: number) => React.ReactNode;
|
|
12
|
+
/** Label of the previous page button (only relevant in paged mode). */
|
|
13
|
+
previousPageButtonLabel?: string;
|
|
14
|
+
/** Label of the next page button (only relevant in paged mode). */
|
|
15
|
+
nextPageButtonLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Component used to provide pagination to the data table. */
|
|
18
|
+
export declare const DataTablePagination: React.ForwardRefExoticComponent<DataTablePaginationProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableRow } from "../Table";
|
|
3
|
+
/** Properties of a data table row. */
|
|
4
|
+
export interface DataTableRowProps<T = any> extends React.ComponentPropsWithoutRef<typeof TableRow> {
|
|
5
|
+
/** Row data. When `undefined`, the row is rendered as "loading". */
|
|
6
|
+
row: T | undefined;
|
|
7
|
+
/** Row index. */
|
|
8
|
+
index: number;
|
|
9
|
+
}
|
|
10
|
+
/** Data table row. */
|
|
11
|
+
export declare const DataTableRow: React.NamedExoticComponent<DataTableRowProps<any> & React.RefAttributes<HTMLTableRowElement>>;
|