@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,122 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
|
+
/** Default column width in `"fixed"` mode. */
|
|
4
|
+
export declare const DEFAULT_TABLE_COLUMN_WIDTH = 150;
|
|
5
|
+
/** Table variant. */
|
|
6
|
+
export type TableVariant = "default" | "control";
|
|
7
|
+
/** Possible table layouts. */
|
|
8
|
+
export type TableLayout = "auto" | "fixed";
|
|
9
|
+
/** Properties of the table component. */
|
|
10
|
+
export interface TableProps extends React.ComponentPropsWithoutRef<"table"> {
|
|
11
|
+
/**
|
|
12
|
+
* Marks the table as being meant for editable content (cells containing form
|
|
13
|
+
* controls).
|
|
14
|
+
*
|
|
15
|
+
* In effect, this changes the default table variant to `"control"` and
|
|
16
|
+
* defaults all cells as `framed`, as well as all non-header cells as
|
|
17
|
+
* `paddingless`.
|
|
18
|
+
*/
|
|
19
|
+
editable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Table's style variant. The default variant should typically be used for
|
|
22
|
+
* readable data, while the control variant (which resembles other form
|
|
23
|
+
* controls) for writable data.
|
|
24
|
+
*
|
|
25
|
+
* Defaults to `"default"` for non-`editable` tables and to `"control"`
|
|
26
|
+
* otherwise.
|
|
27
|
+
*/
|
|
28
|
+
variant?: TableVariant;
|
|
29
|
+
/** Sets the status of the table. */
|
|
30
|
+
status?: ControlStatus;
|
|
31
|
+
/**
|
|
32
|
+
* How to lay out the table:
|
|
33
|
+
*
|
|
34
|
+
* - `"auto"` lets the browser automatically adjust the size of cells to fit
|
|
35
|
+
* their content.
|
|
36
|
+
* - `"fixed"` sizes each cell according to the width provided by each column.
|
|
37
|
+
*
|
|
38
|
+
* The table layout defaults to `"auto"` when the table isn't editable, and
|
|
39
|
+
* `"fixed"` otherwise.
|
|
40
|
+
*/
|
|
41
|
+
layout?: TableLayout;
|
|
42
|
+
/** Marks the table as "required" when it is being used as a control. */
|
|
43
|
+
required?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When the table layout is set to `"fixed"`, this property specifies the
|
|
46
|
+
* default minimum width of all columns (in pixels).
|
|
47
|
+
*
|
|
48
|
+
* @default 150
|
|
49
|
+
*/
|
|
50
|
+
defaultColumnWidth?: number;
|
|
51
|
+
/** Sets the maximum height of the table. */
|
|
52
|
+
maxHeight?: React.CSSProperties["maxHeight"];
|
|
53
|
+
/** Properties to pass to the container element. */
|
|
54
|
+
containerProps?: React.ComponentPropsWithRef<"div">;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Use the table component to display structured data in a tabular format.
|
|
58
|
+
*
|
|
59
|
+
* It composes the following subcomponents:
|
|
60
|
+
*
|
|
61
|
+
* - `TableHead`: Header of the table (corresponds to the
|
|
62
|
+
* [`<thead>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/thead)
|
|
63
|
+
* HTML element).
|
|
64
|
+
* - `TableColumn`: Component used inside `TableHead` to represent a column of the
|
|
65
|
+
* table.
|
|
66
|
+
* - `TableBody`: Body of the table (corresponds to the
|
|
67
|
+
* [`<tbody>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tbody)
|
|
68
|
+
* HTML element).
|
|
69
|
+
* - `TableFoot`: Footer of the table (corresponds to the
|
|
70
|
+
* [`<tfoot>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tfoot)
|
|
71
|
+
* HTML element).
|
|
72
|
+
* - `TableRow`: Row of the table (corresponds to the
|
|
73
|
+
* [`<tr>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/tr)
|
|
74
|
+
* HTML element).
|
|
75
|
+
* - `TableCell`: Cell of the table (corresponds to the
|
|
76
|
+
* [`<th>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/th)
|
|
77
|
+
* and
|
|
78
|
+
* [`<td>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/td)
|
|
79
|
+
* HTML elements). Set the `header` property to switch from `td` to `th`.
|
|
80
|
+
*
|
|
81
|
+
* Example usage:
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* import {
|
|
85
|
+
* Table,
|
|
86
|
+
* TableBody,
|
|
87
|
+
* TableCell,
|
|
88
|
+
* TableColumn,
|
|
89
|
+
* TableFoot,
|
|
90
|
+
* TableHead,
|
|
91
|
+
* TableRow,
|
|
92
|
+
* } from "@ostack.tech/ui";
|
|
93
|
+
*
|
|
94
|
+
* function PriceTable() {
|
|
95
|
+
* return (
|
|
96
|
+
* <Table>
|
|
97
|
+
* <TableHead>
|
|
98
|
+
* <TableColumn label="Item" />
|
|
99
|
+
* <TableColumn label="Price" />
|
|
100
|
+
* </TableHead>
|
|
101
|
+
* <TableBody>
|
|
102
|
+
* <TableRow>
|
|
103
|
+
* <TableCell header>Olive oil</TableCell>
|
|
104
|
+
* <TableCell>3,99 €</TableCell>
|
|
105
|
+
* </TableRow>
|
|
106
|
+
* <TableRow>
|
|
107
|
+
* <TableCell header>Vinegar</TableCell>
|
|
108
|
+
* <TableCell>0,95 €</TableCell>
|
|
109
|
+
* </TableRow>
|
|
110
|
+
* </TableBody>
|
|
111
|
+
* <TableFoot>
|
|
112
|
+
* <TableRow>
|
|
113
|
+
* <TableCell header>Total</TableCell>
|
|
114
|
+
* <TableCell>4,94 €</TableCell>
|
|
115
|
+
* </TableRow>
|
|
116
|
+
* </TableFoot>
|
|
117
|
+
* </Table>
|
|
118
|
+
* );
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Properties of the table body component. */
|
|
3
|
+
export interface TableBodyProps extends React.ComponentPropsWithoutRef<"tbody"> {
|
|
4
|
+
}
|
|
5
|
+
/** Table body component. */
|
|
6
|
+
export declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
|
+
/** Type of table cell. */
|
|
4
|
+
export type TableCellVariant = "header" | "data";
|
|
5
|
+
/** Sticky position of the table cell. */
|
|
6
|
+
export type TableCellSticky = "left" | "right";
|
|
7
|
+
/** Properties of the table row component. */
|
|
8
|
+
export interface TableCellProps extends Omit<React.ComponentPropsWithoutRef<"td" | "th">, "align"> {
|
|
9
|
+
/**
|
|
10
|
+
* Whether this cell should be rendered as a table header cell (`th` element).
|
|
11
|
+
* By default, `true` within a `TableHead` component, and `false` otherwise.
|
|
12
|
+
*/
|
|
13
|
+
header?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Specifies how to align the cell's content. Numeric fields should typically
|
|
16
|
+
* be right aligned.
|
|
17
|
+
*/
|
|
18
|
+
align?: React.CSSProperties["textAlign"];
|
|
19
|
+
/**
|
|
20
|
+
* Style variant to use. By default, defaults to `"header"` when the cell is a
|
|
21
|
+
* `header`, and to `"data"` otherwise.
|
|
22
|
+
*/
|
|
23
|
+
variant?: TableCellVariant;
|
|
24
|
+
/**
|
|
25
|
+
* Cell status, used to render the cell in the style of the given status, when
|
|
26
|
+
* the table is of the "control" variant.
|
|
27
|
+
*
|
|
28
|
+
* By default, `header` cells inherit the `Table`'s `status`.
|
|
29
|
+
*/
|
|
30
|
+
status?: ControlStatus | null;
|
|
31
|
+
/**
|
|
32
|
+
* Renders the cell with borders. This property defaults to `true` when the
|
|
33
|
+
* table is editable and to `false` otherwise.
|
|
34
|
+
*/
|
|
35
|
+
framed?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Removes the cell's padding. This property defaults to `true` when the table
|
|
38
|
+
* is editable and the cell is not a `header`, and to `false` otherwise.
|
|
39
|
+
*/
|
|
40
|
+
paddingless?: boolean;
|
|
41
|
+
/** Makes the table cell stick to one of the sides of table. */
|
|
42
|
+
sticky?: TableCellSticky;
|
|
43
|
+
}
|
|
44
|
+
/** Table row component. */
|
|
45
|
+
export declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
|
+
import { type Button } from "../Button";
|
|
4
|
+
import { type Icon } from "../Icon";
|
|
5
|
+
import { type IconButton } from "../IconButton";
|
|
6
|
+
import { type Popover, type PopoverContent } from "../Popover";
|
|
7
|
+
import { type Stack } from "../Stack";
|
|
8
|
+
import { type TableCell } from "./TableCell.tsx";
|
|
9
|
+
/** Properties of a table column. */
|
|
10
|
+
export interface TableColumnProps extends Omit<React.ComponentPropsWithoutRef<typeof TableCell>, "rowSpan" | "scope"> {
|
|
11
|
+
/** Column's label. */
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
/** String representation of the label (defaults to `label`). */
|
|
14
|
+
labelText?: string;
|
|
15
|
+
/** Optional helper text displayed as a popover triggered by an icon button. */
|
|
16
|
+
helperText?: React.ReactNode;
|
|
17
|
+
/** Label of the helper button announced to assistive technologies. */
|
|
18
|
+
helperButtonLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Minimum width of a column (in pixels).
|
|
21
|
+
*
|
|
22
|
+
* In "fixed" layout, this property is only relevant when applied to "leaf"
|
|
23
|
+
* columns (columns that don't contain other columns).
|
|
24
|
+
*
|
|
25
|
+
* An array may be provided (with a length matching `colSpan`) to specify the
|
|
26
|
+
* `width` of each column that this column spans over.
|
|
27
|
+
*/
|
|
28
|
+
width?: number | number[];
|
|
29
|
+
/**
|
|
30
|
+
* When the table has a "fixed" layout, this property specifies that a column
|
|
31
|
+
* should not grow.
|
|
32
|
+
*/
|
|
33
|
+
fixed?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Marks the column as sortable by displaying a sorting icon and listening to
|
|
36
|
+
* click events on it.
|
|
37
|
+
*/
|
|
38
|
+
sortable?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Direction to initially sort the column by when first clicking on the sort
|
|
41
|
+
* button.
|
|
42
|
+
*
|
|
43
|
+
* @default asc
|
|
44
|
+
*/
|
|
45
|
+
defaultSortDirection?: SortDirection;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the data is currently sorted by this column and, if so, in which
|
|
48
|
+
* direction.
|
|
49
|
+
*/
|
|
50
|
+
sorted?: SortDirection;
|
|
51
|
+
/**
|
|
52
|
+
* Callback called when the sort button is clicked. The direction provided is
|
|
53
|
+
* the new sort direction for the column or `null` when the table should no
|
|
54
|
+
* longer be sorted by this column.
|
|
55
|
+
*/
|
|
56
|
+
onSort?: (direction: SortDirection | null) => void;
|
|
57
|
+
/** Properties to pass to the container component. */
|
|
58
|
+
containerProps?: React.ComponentPropsWithRef<typeof Stack>;
|
|
59
|
+
/** Properties to pass to the label component. */
|
|
60
|
+
labelProps?: React.ComponentPropsWithRef<"div">;
|
|
61
|
+
/** Properties to pass to the sort button. */
|
|
62
|
+
sortButtonProps?: React.ComponentPropsWithRef<typeof Button>;
|
|
63
|
+
/** Properties to pass to the component containing the sort icons. */
|
|
64
|
+
sortIconContainerProps?: React.ComponentPropsWithRef<"div">;
|
|
65
|
+
/** Properties to pass to the sort ascending icon component. */
|
|
66
|
+
sortAscIconProps?: React.ComponentPropsWithRef<typeof Icon>;
|
|
67
|
+
/** Properties to pass to the sort descending icon component. */
|
|
68
|
+
sortDescIconProps?: React.ComponentPropsWithRef<typeof Icon>;
|
|
69
|
+
/** Properties to pass to the helper button component. */
|
|
70
|
+
helperButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "icon">;
|
|
71
|
+
/** Properties to pass to the helper popover component. */
|
|
72
|
+
helperPopoverProps?: React.ComponentPropsWithRef<typeof Popover>;
|
|
73
|
+
/** Properties to pass to the helper popover content component. */
|
|
74
|
+
helperPopoverContentProps?: React.ComponentPropsWithRef<typeof PopoverContent>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Table column component.
|
|
78
|
+
*
|
|
79
|
+
* This component doesn't actually render anything by itself; it is used by the
|
|
80
|
+
* `TableHead` component to automatically create an appropriate header based on
|
|
81
|
+
* the columns.
|
|
82
|
+
*/
|
|
83
|
+
export declare const TableColumn: React.ForwardRefExoticComponent<TableColumnProps & React.RefAttributes<HTMLTableDataCellElement>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
3
|
+
import { type ScrollPosition } from "../../utils/useScrollPosition.ts";
|
|
4
|
+
import { type TableLayout } from "./Table.tsx";
|
|
5
|
+
/** Value of the table context. */
|
|
6
|
+
export interface TableContextValue {
|
|
7
|
+
editable: boolean;
|
|
8
|
+
status?: ControlStatus;
|
|
9
|
+
layout: TableLayout;
|
|
10
|
+
defaultColumnWidth: number;
|
|
11
|
+
store: TableStore;
|
|
12
|
+
}
|
|
13
|
+
/** State of the table. */
|
|
14
|
+
export interface TableState {
|
|
15
|
+
scrollPosition?: ScrollPosition;
|
|
16
|
+
numberOfColumns?: number;
|
|
17
|
+
columnWidths?: (string | undefined)[];
|
|
18
|
+
actions: TableActions;
|
|
19
|
+
}
|
|
20
|
+
/** Actions of the table. */
|
|
21
|
+
export interface TableActions {
|
|
22
|
+
setTableMinWidth: (minWidth: string | undefined) => void;
|
|
23
|
+
setTableMaxWidth: (maxWidth: string | undefined) => void;
|
|
24
|
+
}
|
|
25
|
+
/** Table store. */
|
|
26
|
+
export type TableStore = ReturnType<typeof useCreateTableContext>["store"];
|
|
27
|
+
/** Table context. */
|
|
28
|
+
export declare const TableContext: React.Context<TableContextValue | null>;
|
|
29
|
+
/** Hook which creates the table store. */
|
|
30
|
+
export declare function useCreateTableContext(editable: boolean, status: ControlStatus | undefined, layout: TableLayout, defaultColumnWidth: number, onTableMinWidthChange: (minWidth: string | undefined) => void, onTableMaxWidthChange: (maxWidth: string | undefined) => void): {
|
|
31
|
+
editable: boolean;
|
|
32
|
+
status: ControlStatus | undefined;
|
|
33
|
+
layout: TableLayout;
|
|
34
|
+
defaultColumnWidth: number;
|
|
35
|
+
store: Omit<import("zustand").StoreApi<TableState>, "subscribe"> & {
|
|
36
|
+
subscribe: {
|
|
37
|
+
(listener: (selectedState: TableState, previousSelectedState: TableState) => void): () => void;
|
|
38
|
+
<U>(selector: (state: TableState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
39
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
40
|
+
fireImmediately?: boolean;
|
|
41
|
+
} | undefined): () => void;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** Hook returning the table's context value. */
|
|
46
|
+
export declare function useTableContext(): TableContextValue;
|
|
47
|
+
/** Hook returning the number of columns of the table. */
|
|
48
|
+
export declare function useTableNumberOfColumns(): number | undefined;
|
|
49
|
+
/** Table head context. */
|
|
50
|
+
export declare const TableHeadContext: React.Context<boolean>;
|
|
51
|
+
/** Hook exposing whether a component is being rendered within a table head. */
|
|
52
|
+
export declare function useIsInTableHead(): boolean;
|
|
53
|
+
/** Table foot context. */
|
|
54
|
+
export declare const TableFootContext: React.Context<boolean>;
|
|
55
|
+
/** Hook exposing whether a component is being rendered within a table foot. */
|
|
56
|
+
export declare function useIsInTableFoot(): boolean;
|
|
57
|
+
/** Context present within a table cell. */
|
|
58
|
+
export declare const TableCellContext: React.Context<boolean>;
|
|
59
|
+
/** Hook exposing whether a component is being rendered within a table cell. */
|
|
60
|
+
export declare function useIsInTableCell(): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Properties of the table foot component. */
|
|
3
|
+
export interface TableFootProps extends React.ComponentPropsWithoutRef<"tfoot"> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the table foot should be sticky.
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
sticky?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Table foot component. */
|
|
12
|
+
export declare const TableFoot: React.ForwardRefExoticComponent<TableFootProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SortDirection } from "../../utils/sorting.ts";
|
|
3
|
+
/** Properties of the table head component. */
|
|
4
|
+
export interface TableHeadProps extends React.ComponentPropsWithoutRef<"thead"> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the table head should be sticky.
|
|
7
|
+
*
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Function that should return the description of the "sort by" button of each
|
|
13
|
+
* column (passed to each sort button as `aria-description`).
|
|
14
|
+
*
|
|
15
|
+
* @param columnName Name of the column to sort.
|
|
16
|
+
* @param direction Sort direction.
|
|
17
|
+
*/
|
|
18
|
+
sortByColumnDescription?: (columnName: string, sortDirection: SortDirection | null) => string;
|
|
19
|
+
/** Properties to pass to each row component. */
|
|
20
|
+
rowProps?: React.ComponentPropsWithoutRef<"tr"> | ((index: number) => React.ComponentPropsWithoutRef<"tr">);
|
|
21
|
+
}
|
|
22
|
+
/** Table head component. */
|
|
23
|
+
export declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Default table row height (with a single line of text or with form controls). */
|
|
3
|
+
export declare const DEFAULT_TABLE_ROW_HEIGHT = 41;
|
|
4
|
+
/** Properties of the table row component. */
|
|
5
|
+
export interface TableRowProps extends React.ComponentPropsWithoutRef<"tr"> {
|
|
6
|
+
/** Whether this row should be marked as being selected. */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Table row component. */
|
|
10
|
+
export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./Table.tsx";
|
|
2
|
+
export * from "./TableBody.tsx";
|
|
3
|
+
export * from "./TableCell.tsx";
|
|
4
|
+
export * from "./TableColumn.tsx";
|
|
5
|
+
export { useIsInTableCell, useTableNumberOfColumns } from "./TableContext.ts";
|
|
6
|
+
export * from "./TableFoot.tsx";
|
|
7
|
+
export * from "./TableHead.tsx";
|
|
8
|
+
export * from "./TableRow.tsx";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
4
|
+
/** Properties of the tab component. */
|
|
5
|
+
export interface TabProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>, "asChild" | "value"> {
|
|
6
|
+
/** Value representing this tab. */
|
|
7
|
+
value: string | number;
|
|
8
|
+
/** Status of the tab. */
|
|
9
|
+
status?: ControlStatus;
|
|
10
|
+
/** Properties to pass to the inner tab element. */
|
|
11
|
+
tabInnerProps?: React.ComponentPropsWithRef<"div">;
|
|
12
|
+
}
|
|
13
|
+
/** Tab trigger component. */
|
|
14
|
+
export declare const Tab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Properties of the tab content component. */
|
|
4
|
+
export interface TabContentProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>, "value"> {
|
|
5
|
+
/** Value of the tab that corresponds to this content. */
|
|
6
|
+
value: string | number;
|
|
7
|
+
}
|
|
8
|
+
/** Tab content component. */
|
|
9
|
+
export declare const TabContent: React.ForwardRefExoticComponent<TabContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Properties of the tab list component. */
|
|
4
|
+
export interface TabListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
5
|
+
/** Properties to pass to the root element. */
|
|
6
|
+
rootProps?: React.ComponentPropsWithRef<"div">;
|
|
7
|
+
/** Properties to pass to the container element. */
|
|
8
|
+
containerProps?: React.ComponentPropsWithRef<"div">;
|
|
9
|
+
}
|
|
10
|
+
/** Component containing all tabs. */
|
|
11
|
+
export declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Tabs variants. */
|
|
4
|
+
export type TabsVariant = "default" | "annexes";
|
|
5
|
+
/** Properties of the tabs component. */
|
|
6
|
+
export interface TabsProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "defaultValue" | "value" | "orientation" | "dir"> {
|
|
7
|
+
/**
|
|
8
|
+
* Tabs variant.
|
|
9
|
+
*
|
|
10
|
+
* @default default
|
|
11
|
+
*/
|
|
12
|
+
variant?: TabsVariant;
|
|
13
|
+
/** Value of the default active tab. */
|
|
14
|
+
defaultValue?: string | number;
|
|
15
|
+
/** Value of the active tab. */
|
|
16
|
+
value?: string | number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The `Tabs` component allows content to be organised in tabs and displayed one
|
|
20
|
+
* at a time.
|
|
21
|
+
*
|
|
22
|
+
* The `value` set on each tab should match the `value` of its content.
|
|
23
|
+
*
|
|
24
|
+
* It composes the following subcomponents:
|
|
25
|
+
*
|
|
26
|
+
* - `TabList`: A container holding the list of tabs.
|
|
27
|
+
* - `Tab`: Representing an individual tab.
|
|
28
|
+
* - `TabContent`: For holding the content of each tab.
|
|
29
|
+
*
|
|
30
|
+
* Example usage:
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { Tab, TabContent, TabList, Tabs } from "@ostack.tech/ui";
|
|
34
|
+
*
|
|
35
|
+
* function Bills() {
|
|
36
|
+
* return (
|
|
37
|
+
* <Tabs>
|
|
38
|
+
* <TabList>
|
|
39
|
+
* <Tab value="water">Water</Tab>
|
|
40
|
+
* <Tab value="electricity">Electricity</Tab>
|
|
41
|
+
* <Tab value="gas">Gas</Tab>
|
|
42
|
+
* </TabList>
|
|
43
|
+
* <TabContent value="water">…</TabContent>
|
|
44
|
+
* <TabContent value="electricity">…</TabContent>
|
|
45
|
+
* <TabContent value="gas">…</TabContent>
|
|
46
|
+
* </Tabs>
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ScrollPosition } from "../../utils/useScrollPosition.ts";
|
|
3
|
+
import { type TabsVariant } from "./Tabs.tsx";
|
|
4
|
+
/** Value of the tabs' context. */
|
|
5
|
+
export interface TabsContextValue {
|
|
6
|
+
variant: TabsVariant;
|
|
7
|
+
store: TabsStore;
|
|
8
|
+
}
|
|
9
|
+
/** State of the tabs. */
|
|
10
|
+
export interface TabsState {
|
|
11
|
+
activeTab?: string;
|
|
12
|
+
showScrollButtons?: boolean;
|
|
13
|
+
width: number;
|
|
14
|
+
scrollPosition?: ScrollPosition;
|
|
15
|
+
}
|
|
16
|
+
/** Tabs' store. */
|
|
17
|
+
export type TabsStore = ReturnType<typeof useCreateTabsContext>["store"];
|
|
18
|
+
/** Tabs' context. */
|
|
19
|
+
export declare const TabsContext: React.Context<TabsContextValue | null>;
|
|
20
|
+
/** Hook which creates the tabs' store. */
|
|
21
|
+
export declare function useCreateTabsContext(variant: TabsVariant, defaultValue?: string | number, value?: string | number): {
|
|
22
|
+
variant: TabsVariant;
|
|
23
|
+
store: Omit<import("zustand").StoreApi<TabsState>, "subscribe"> & {
|
|
24
|
+
subscribe: {
|
|
25
|
+
(listener: (selectedState: TabsState, previousSelectedState: TabsState) => void): () => void;
|
|
26
|
+
<U>(selector: (state: TabsState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
27
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
28
|
+
fireImmediately?: boolean;
|
|
29
|
+
} | undefined): () => void;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
/** Hooks returning the tabs' context value. */
|
|
34
|
+
export declare function useTabsContext(): TabsContextValue;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type TagColor, type TagProps, type TagVariant } from "./Tag.tsx";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated `Badge` component was renamed to `Tag`, please use
|
|
4
|
+
* {@link TagVariant} instead.
|
|
5
|
+
*/
|
|
6
|
+
export type BadgeVariant = TagVariant;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated `Badge` component was renamed to `Tag`, please use
|
|
9
|
+
* {@link TagColor} instead.
|
|
10
|
+
*/
|
|
11
|
+
export type BadgeColor = TagColor;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated `Badge` component was renamed to `Tag`, please use
|
|
14
|
+
* {@link TagProps} instead.
|
|
15
|
+
*/
|
|
16
|
+
export type BadgeProps = TagProps;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated `Badge` component was renamed to `Tag`, please use {@link Tag}
|
|
19
|
+
* instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Badge: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AccentColor } from "../../utils/accent.ts";
|
|
3
|
+
import { CloseButton } from "../CloseButton";
|
|
4
|
+
import { CollapsibleContent } from "../Collapsible";
|
|
5
|
+
import { Icon, type IconProp } from "../Icon";
|
|
6
|
+
/** Tag variants. */
|
|
7
|
+
export type TagVariant = "solid" | "subtle" | "outlined";
|
|
8
|
+
/** Tag colours. */
|
|
9
|
+
export type TagColor = AccentColor;
|
|
10
|
+
/** Tag's icon placement. */
|
|
11
|
+
export type TagIconPlacement = "start" | "end";
|
|
12
|
+
/** Properties of the tag component. */
|
|
13
|
+
export interface TagProps extends React.ComponentPropsWithoutRef<"span"> {
|
|
14
|
+
/**
|
|
15
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
16
|
+
* This will merge the original component props with the props of the supplied
|
|
17
|
+
* element/component and change the underlying DOM node.
|
|
18
|
+
*/
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Tag variant.
|
|
22
|
+
*
|
|
23
|
+
* @defualt filled
|
|
24
|
+
*/
|
|
25
|
+
variant?: TagVariant;
|
|
26
|
+
/**
|
|
27
|
+
* Tag colour.
|
|
28
|
+
*
|
|
29
|
+
* @default neutral
|
|
30
|
+
*/
|
|
31
|
+
color?: TagColor;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the tag should be open by default.
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
defaultOpen?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Property controlling whether the tag should be open. Use together with
|
|
40
|
+
* `onOpenChange` to control the tag's open state.
|
|
41
|
+
*/
|
|
42
|
+
open?: boolean;
|
|
43
|
+
/** Function called when the open state changes. */
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Font Awesome icon to show within the tag. The position of the icon may be
|
|
47
|
+
* controlled via `iconPlacement`.
|
|
48
|
+
*
|
|
49
|
+
* @default null
|
|
50
|
+
*/
|
|
51
|
+
icon?: IconProp | null;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to display the icon at the start or end of the tag.
|
|
54
|
+
*
|
|
55
|
+
* @default start
|
|
56
|
+
*/
|
|
57
|
+
iconPlacement?: TagIconPlacement;
|
|
58
|
+
/**
|
|
59
|
+
* Display the tag as a pill (with rounder corners).
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
pill?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show a close button.
|
|
66
|
+
*
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
showCloseButton?: boolean;
|
|
70
|
+
/** Properties to pass to the container element. */
|
|
71
|
+
containerProps?: React.ComponentPropsWithRef<typeof CollapsibleContent>;
|
|
72
|
+
/** Properties to pass to the content element. */
|
|
73
|
+
contentProps?: React.ComponentPropsWithRef<"span">;
|
|
74
|
+
/** Properties to pass to the icon component. */
|
|
75
|
+
iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, "icon">;
|
|
76
|
+
/** Properties to pass to the close button component. */
|
|
77
|
+
closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Component displaying a stylised tag.
|
|
81
|
+
*
|
|
82
|
+
* Example usage:
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* import { Tag } from "@ostack.tech/ui";
|
|
86
|
+
*
|
|
87
|
+
* function InProgressIndicator() {
|
|
88
|
+
* return <Tag>In progress</Tag>;
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type InputPropsBase } from "../Input";
|
|
3
|
+
/** Properties of the text area component. */
|
|
4
|
+
export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">, React.ComponentPropsWithoutRef<"textarea"> {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The `TextArea` component is a flexible, multiline input field designed for
|
|
8
|
+
* text entry. This component is ideal for capturing larger amounts of text,
|
|
9
|
+
* such as user feedback, comments, or descriptions.
|
|
10
|
+
*
|
|
11
|
+
* All extra properties are passed directly to the underlying textarea element,
|
|
12
|
+
* offering full control over behavior and appearance. The TextArea component
|
|
13
|
+
* can be combined with the `Field` component for better structure and
|
|
14
|
+
* accessibility. The `Field` ensures proper associations between the `Label`,
|
|
15
|
+
* `TextArea`, and related elements like `HelperText`, improving usability and
|
|
16
|
+
* accessibility for users.
|
|
17
|
+
*
|
|
18
|
+
* This setup ensures that the `TextArea` can adapt to different use cases while
|
|
19
|
+
* maintaining a consistent and accessible form structure.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TextArea.tsx";
|