@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,121 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type LocalizationObject } from "../../locale";
|
|
3
|
+
import { DocumentTitleProvider } from "../../providers/DocumentTitleProvider";
|
|
4
|
+
import { ErrorReportingProvider } from "../../providers/ErrorReportingProvider";
|
|
5
|
+
import { ErrorBoundary } from "../ErrorBoundary";
|
|
6
|
+
import { type ToastSwipeDirection } from "../Toast";
|
|
7
|
+
/** Properties of the ostack/UI root component. */
|
|
8
|
+
export interface RootProps extends React.ComponentPropsWithoutRef<"div">, Pick<React.ComponentPropsWithoutRef<typeof ErrorReportingProvider>, "reportError" | "errorReportingUrl" | "errorReportingMethod" | "encodeErrorReport" | "encodedErrorReportMimeType" | "errorReportingOptions">, Pick<React.ComponentPropsWithoutRef<typeof DocumentTitleProvider>, "baseDocumentTitle"> {
|
|
9
|
+
/**
|
|
10
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
11
|
+
* This will merge the original component props with the props of the supplied
|
|
12
|
+
* element/component and change the underlying DOM node.
|
|
13
|
+
*/
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Custom prefix used to prefix all component classes, styles, _etc._
|
|
17
|
+
*
|
|
18
|
+
* This prefix should match the `$prefix` SCSS variable.
|
|
19
|
+
*/
|
|
20
|
+
prefix?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether error reporting should be enabled. By default, error reporting is
|
|
23
|
+
* enabled in production.
|
|
24
|
+
*/
|
|
25
|
+
enableErrorReporting?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Locale to use for the components.
|
|
28
|
+
*
|
|
29
|
+
* @default defaultLocale
|
|
30
|
+
*/
|
|
31
|
+
locale?: LocalizationObject;
|
|
32
|
+
/**
|
|
33
|
+
* String which separates the breadcrumbs from the base document title.
|
|
34
|
+
*
|
|
35
|
+
* @default " | "
|
|
36
|
+
*/
|
|
37
|
+
documentTitleBaseSeparator?: string;
|
|
38
|
+
/**
|
|
39
|
+
* String which separates the breadcrumbs of the document title.
|
|
40
|
+
*
|
|
41
|
+
* @default " ‹ "
|
|
42
|
+
*/
|
|
43
|
+
documentTitleBreadcrumbsSeparator?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Default container used by ostack/UI portals.
|
|
46
|
+
*
|
|
47
|
+
* @default document.body
|
|
48
|
+
*/
|
|
49
|
+
portalsContainer?: Element | DocumentFragment | null;
|
|
50
|
+
/**
|
|
51
|
+
* The duration from when the pointer enters the trigger until the tooltip
|
|
52
|
+
* gets opened.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue 700
|
|
55
|
+
*/
|
|
56
|
+
tooltipsDelayDuration?: number;
|
|
57
|
+
/**
|
|
58
|
+
* How much time a user has to enter another trigger without incurring a delay
|
|
59
|
+
* again.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue 300
|
|
62
|
+
*/
|
|
63
|
+
tooltipsSkipDelayDuration?: number;
|
|
64
|
+
/**
|
|
65
|
+
* When set, trying to hover the content will result in the tooltip closing as
|
|
66
|
+
* the pointer leaves the trigger.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue false
|
|
69
|
+
*/
|
|
70
|
+
disableTooltipsHoverableContent?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* A label for each toast. Used to help screen-reader users associate the
|
|
73
|
+
* interruption with a toast. By default, a translated version of the word
|
|
74
|
+
* “Notification” is used.
|
|
75
|
+
*/
|
|
76
|
+
toastsLabel?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Time in milliseconds that each toast should remain visible for.
|
|
79
|
+
*
|
|
80
|
+
* @defaultValue 5000
|
|
81
|
+
*/
|
|
82
|
+
toastsDuration?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Direction of pointer swipe that should close the toast.
|
|
85
|
+
*
|
|
86
|
+
* @defaultValue "right"
|
|
87
|
+
*/
|
|
88
|
+
toastsSwipeDirection?: ToastSwipeDirection;
|
|
89
|
+
/**
|
|
90
|
+
* Distance in pixels that the swipe must pass before a close is triggered.
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue 50
|
|
93
|
+
*/
|
|
94
|
+
toastsSwipeThreshold?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The keys to use as the keyboard shortcut that will move focus to the toast
|
|
97
|
+
* viewport.
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue ["F8"]
|
|
100
|
+
*/
|
|
101
|
+
toastViewportHotkey?: string[];
|
|
102
|
+
/**
|
|
103
|
+
* A label for the toast viewport to provide context for screen reader users
|
|
104
|
+
* when navigating page landmarks. The available `{hotkey}` placeholder will
|
|
105
|
+
* be automatically replaced. By default, a translated version of
|
|
106
|
+
* “Notifications ({hotkey})” is used.
|
|
107
|
+
*/
|
|
108
|
+
toastViewportLabel?: string;
|
|
109
|
+
/** Properties to pass to the `ToastViewport` component. */
|
|
110
|
+
toastViewportProps?: React.ComponentPropsWithRef<"ol">;
|
|
111
|
+
/** Properties to pass to the `ErrorBoundary` component. */
|
|
112
|
+
errorBoundaryProps?: React.ComponentPropsWithRef<typeof ErrorBoundary>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Root component that should wrap an ostack/UI application, exposing all
|
|
116
|
+
* ostack/UI providers and base styles.
|
|
117
|
+
*
|
|
118
|
+
* It further wraps the whole application in an error boundary with support for
|
|
119
|
+
* error reporting.
|
|
120
|
+
*/
|
|
121
|
+
export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommandMenuItem } from "../CommandMenu";
|
|
3
|
+
/** Properties of the option component. */
|
|
4
|
+
export interface OptionProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandMenuItem>, "value" | "asLink" | "onSelect" | "selected" | "icon" | "target" | "href"> {
|
|
5
|
+
/**
|
|
6
|
+
* A unique value for this item. If no value is provided, it will be inferred
|
|
7
|
+
* from `children` or the rendered `textContent`. If your `textContent`
|
|
8
|
+
* changes between renders, you must provide a stable, unique `value`.
|
|
9
|
+
*/
|
|
10
|
+
value?: string | number;
|
|
11
|
+
}
|
|
12
|
+
/** An option which can be selected in a `Select`. */
|
|
13
|
+
export declare const Option: React.NamedExoticComponent<OptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommandMenuGroup } from "../CommandMenu";
|
|
3
|
+
/** Properties of the options group component. */
|
|
4
|
+
export interface OptionsGroupProps extends React.ComponentPropsWithoutRef<typeof CommandMenuGroup> {
|
|
5
|
+
}
|
|
6
|
+
/** Component used to group options within a `Select`. */
|
|
7
|
+
export declare const OptionsGroup: React.ForwardRefExoticComponent<OptionsGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommandMenu } from "../CommandMenu";
|
|
3
|
+
import { type IconButton } from "../IconButton";
|
|
4
|
+
import { type Input } from "../Input";
|
|
5
|
+
import { PopoverContent, PopoverTrigger } from "../Popover";
|
|
6
|
+
import { type Tag } from "../Tag";
|
|
7
|
+
/** Base properties of the select component. */
|
|
8
|
+
export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends React.ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<React.ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<React.ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
|
|
9
|
+
/**
|
|
10
|
+
* Whether multiple options can be selected. If not set, at most one option
|
|
11
|
+
* can be selected at a time.
|
|
12
|
+
*
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
/** Default select value. */
|
|
17
|
+
defaultValue?: T;
|
|
18
|
+
/** Select value. */
|
|
19
|
+
value?: T;
|
|
20
|
+
/**
|
|
21
|
+
* Function called whenever the value of the select changes.
|
|
22
|
+
*
|
|
23
|
+
* @param value Select value. An array of values when `multiple` is set.
|
|
24
|
+
*/
|
|
25
|
+
onValueChange?: (value: Exclude<T, number>) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Default (uncontrolled) open state of the popover.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
defaultOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Controlled open state of the popover. Should be used together with
|
|
34
|
+
* `onOpenChange`.
|
|
35
|
+
*/
|
|
36
|
+
open?: boolean;
|
|
37
|
+
/** Function called whenever the menu's open state changes. */
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
/** Select's placeholder. */
|
|
40
|
+
placeholder?: React.ReactNode;
|
|
41
|
+
/** Accessible label for the list of options. Not shown visibly. */
|
|
42
|
+
optionsLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the options are loading.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
loadingOptions?: boolean;
|
|
49
|
+
/** Accessible label for the loading of options. Not shown visibly. */
|
|
50
|
+
loadingOptionsLabel?: string;
|
|
51
|
+
/** Estimated progress of loading the list of options. */
|
|
52
|
+
loadingOptionsProgress?: number;
|
|
53
|
+
/** Message to display when no options were found. */
|
|
54
|
+
emptyMessage?: React.ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* When `multiple` is set, this property controls the maximum width the
|
|
57
|
+
* content of a value tag representing a selected option can reach. By
|
|
58
|
+
* default, selected value tags have no width limit.
|
|
59
|
+
*/
|
|
60
|
+
valueTagMaxWidth?: React.CSSProperties["maxWidth"];
|
|
61
|
+
/** Properties to pass to the element holding the whole value or placeholder. */
|
|
62
|
+
valueProps?: React.ComponentPropsWithRef<"div">;
|
|
63
|
+
/** Properties to pass to each `Tag` holding a value, when `multiple` is set. */
|
|
64
|
+
valueTagProps?: Omit<React.ComponentPropsWithoutRef<typeof Tag>, "defaultOpen" | "open" | "onOpenChange" | "color" | "showCloseButton">;
|
|
65
|
+
/** Properties to pass to the arrow `Icon` component. */
|
|
66
|
+
arrowProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "icon" | "label">;
|
|
67
|
+
/** Properties to pass to the `Popover` component. */
|
|
68
|
+
popoverProps?: React.ComponentPropsWithRef<typeof PopoverContent>;
|
|
69
|
+
/** Options to pass to the `CommandMenu` component. */
|
|
70
|
+
commandMenuProps?: Omit<React.ComponentPropsWithRef<typeof CommandMenu>, "defaultValue" | "value" | "onValueChange" | "iconPlacement" | "searchPlaceholder" | "searchValue" | "onSearchValueChange" | "listLabel" | "loading" | "loadingLabel" | "loadingProgress" | "emptyMessage">;
|
|
71
|
+
}
|
|
72
|
+
/** Properties of the select component with `multiple` not set. */
|
|
73
|
+
export interface SelectSingleProps extends SelectPropsBase<string | number> {
|
|
74
|
+
multiple?: false;
|
|
75
|
+
}
|
|
76
|
+
/** Properties of the select component with `multiple` set. */
|
|
77
|
+
export interface SelectMultipleProps extends SelectPropsBase<string[]> {
|
|
78
|
+
multiple: true;
|
|
79
|
+
}
|
|
80
|
+
/** Properties of the select component. */
|
|
81
|
+
export type SelectProps = SelectSingleProps | SelectMultipleProps;
|
|
82
|
+
/**
|
|
83
|
+
* Control which displays a menu of options for the user to pick from. Provides
|
|
84
|
+
* an alternative to the browser's [`<select>`
|
|
85
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select)
|
|
86
|
+
* via the “combobox” pattern, allowing users to search for options. It is built
|
|
87
|
+
* on top of the `Input`, `Popover`, and `CommandMenu` components.
|
|
88
|
+
*
|
|
89
|
+
* It supports the selection of more than one option by setting the `multiple`
|
|
90
|
+
* property.
|
|
91
|
+
*
|
|
92
|
+
* For accessibility purposes, select components are usually included within a
|
|
93
|
+
* `Field` together with a `Label` and optionally `HelperText` and/or
|
|
94
|
+
* `Feedback`.
|
|
95
|
+
*
|
|
96
|
+
* It composes the following subcomponents:
|
|
97
|
+
*
|
|
98
|
+
* - `OptionsGroup`: Groups options under an optional label.
|
|
99
|
+
* - `Option`: An option that can be selected.
|
|
100
|
+
*
|
|
101
|
+
* Example usage:
|
|
102
|
+
*
|
|
103
|
+
* ```tsx
|
|
104
|
+
* import { Option, Select } from "@ostack.tech/ui";
|
|
105
|
+
*
|
|
106
|
+
* function FavoriteFruit() {
|
|
107
|
+
* return (
|
|
108
|
+
* <Select placeholder="Select your favourite fruit…">
|
|
109
|
+
* <Option value="apple">Apple</Option>
|
|
110
|
+
* <Option value="banana">Banana</Option>
|
|
111
|
+
* <Option value="cherry">Cherry</Option>
|
|
112
|
+
* </Select>
|
|
113
|
+
* );
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AccentColor } from "../../utils/accent.ts";
|
|
3
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
4
|
+
import { type SelectProps } from "./Select.tsx";
|
|
5
|
+
/** Value of the select context. */
|
|
6
|
+
export interface SelectContextValue {
|
|
7
|
+
registering?: boolean;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
value: string | string[];
|
|
10
|
+
setValue: React.Dispatch<React.SetStateAction<string | number | readonly string[]>>;
|
|
11
|
+
onOptionSelect: (value: string) => void;
|
|
12
|
+
status?: ControlStatus;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
valueTagProps?: SelectProps["valueTagProps"];
|
|
16
|
+
store: SelectStore;
|
|
17
|
+
}
|
|
18
|
+
/** State of an option. */
|
|
19
|
+
export interface OptionState {
|
|
20
|
+
content: React.ReactNode;
|
|
21
|
+
color?: AccentColor;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** State of the select. */
|
|
25
|
+
export interface SelectState {
|
|
26
|
+
optionsContent: [Map<string, OptionState>];
|
|
27
|
+
actions: SelectActions;
|
|
28
|
+
}
|
|
29
|
+
export interface SelectActions {
|
|
30
|
+
getOptionState: (value: string) => OptionState | undefined;
|
|
31
|
+
registerOption: (value: string, state: OptionState) => void;
|
|
32
|
+
unregisterOption: (value: string) => void;
|
|
33
|
+
}
|
|
34
|
+
/** Select store. */
|
|
35
|
+
export type SelectStore = ReturnType<typeof useCreateSelectContext>["store"];
|
|
36
|
+
/** Select context. */
|
|
37
|
+
export declare const SelectContext: React.Context<SelectContextValue | null>;
|
|
38
|
+
/** Options to pass to the `useCreateSelectContext` hook. */
|
|
39
|
+
export type UseCreateSelectContextOptions = Omit<SelectContextValue, "store">;
|
|
40
|
+
/** Hook which creates the select context. */
|
|
41
|
+
export declare function useCreateSelectContext({ multiple, value, setValue, onOptionSelect, status, disabled, readOnly, valueTagProps, }: UseCreateSelectContextOptions): {
|
|
42
|
+
multiple: boolean;
|
|
43
|
+
value: string | string[];
|
|
44
|
+
setValue: React.Dispatch<React.SetStateAction<string | number | readonly string[]>>;
|
|
45
|
+
onOptionSelect: (value: string) => void;
|
|
46
|
+
status: ControlStatus | undefined;
|
|
47
|
+
disabled: boolean | undefined;
|
|
48
|
+
readOnly: boolean | undefined;
|
|
49
|
+
valueTagProps: Omit<Omit<import("../Tag/Tag.tsx").TagProps & React.RefAttributes<HTMLSpanElement>, "ref">, "color" | "defaultOpen" | "open" | "onOpenChange" | "showCloseButton"> | undefined;
|
|
50
|
+
store: Omit<import("zustand").StoreApi<SelectState>, "subscribe"> & {
|
|
51
|
+
subscribe: {
|
|
52
|
+
(listener: (selectedState: SelectState, previousSelectedState: SelectState) => void): () => void;
|
|
53
|
+
<U>(selector: (state: SelectState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
54
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
55
|
+
fireImmediately?: boolean;
|
|
56
|
+
} | undefined): () => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/** Hooks returning the select context value. */
|
|
61
|
+
export declare function useSelectContext(): SelectContextValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SelectMultipleValue(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SelectSingleValue(): import("react").ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Properties of the separator component. */
|
|
4
|
+
export interface SeparatorProps extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
|
|
5
|
+
}
|
|
6
|
+
/** Component that visually or semantically separates content. */
|
|
7
|
+
export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Separator.tsx";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
2
|
+
/**
|
|
3
|
+
* Component that merges its props onto its immediate child.
|
|
4
|
+
*
|
|
5
|
+
* Used to support components with an `asChild` property.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Slot: import("react").ForwardRefExoticComponent<SlotPrimitive.SlotProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/** Properties of the `Slottable` component. */
|
|
3
|
+
export interface SlottableProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component that can be used a child of `Slot`, where the content shall be
|
|
8
|
+
* rendered.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Slottable: React.ComponentType<SlottableProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AccentColor } from "../../utils/accent.ts";
|
|
3
|
+
/** Possible sizes of the spinner. */
|
|
4
|
+
export type SpinnerSize = "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
|
|
5
|
+
/** Possible colours of the spinner. */
|
|
6
|
+
export type SpinnerColor = AccentColor;
|
|
7
|
+
/** Properties of the spinner component. */
|
|
8
|
+
export interface SpinnerProps extends React.ComponentPropsWithoutRef<"span"> {
|
|
9
|
+
/**
|
|
10
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
11
|
+
* This will merge the original component props with the props of the supplied
|
|
12
|
+
* element/component and change the underlying DOM node.
|
|
13
|
+
*/
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Size of the spinner. By default, the spinner will be sized according to the
|
|
17
|
+
* current font size.
|
|
18
|
+
*/
|
|
19
|
+
size?: SpinnerSize;
|
|
20
|
+
/**
|
|
21
|
+
* Colour of the spinner. By default, the spinner will have the current font's
|
|
22
|
+
* colour.
|
|
23
|
+
*/
|
|
24
|
+
color?: SpinnerColor;
|
|
25
|
+
/**
|
|
26
|
+
* Optional accessible label for the spinner.
|
|
27
|
+
*
|
|
28
|
+
* When provided, a visually hidden label is added so that assistive
|
|
29
|
+
* technologies correctly announce it.
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The spinner component provides a visual cue that an action is currently being
|
|
35
|
+
* processed.
|
|
36
|
+
*
|
|
37
|
+
* Example usage:
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* import { Spinner } from "@ostack.tech/ui";
|
|
41
|
+
*
|
|
42
|
+
* function Loading() {
|
|
43
|
+
* return <Spinner />;
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Spinner.tsx";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Responsive } from "../../utils/useResponsiveValues.ts";
|
|
3
|
+
/** Possible stack directions. */
|
|
4
|
+
export type FlexDirection = "column" | "column-reverse" | "row" | "row-reverse";
|
|
5
|
+
/** Properties of the stack component. */
|
|
6
|
+
export interface StackProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
7
|
+
/**
|
|
8
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
9
|
+
* This will merge the original component props with the props of the supplied
|
|
10
|
+
* element/component and change the underlying DOM node.
|
|
11
|
+
*/
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Direction of the stack.
|
|
15
|
+
*
|
|
16
|
+
* @default column
|
|
17
|
+
*/
|
|
18
|
+
direction?: Responsive<FlexDirection>;
|
|
19
|
+
/**
|
|
20
|
+
* Spacing between items. When a number is provided, each unit corresponds to
|
|
21
|
+
* `var(--oui-space)`.
|
|
22
|
+
*
|
|
23
|
+
* @default 5
|
|
24
|
+
*/
|
|
25
|
+
gap?: Responsive<number | string>;
|
|
26
|
+
/** Adds a divider between elements. */
|
|
27
|
+
divider?: React.ReactElement;
|
|
28
|
+
justifyContent?: Responsive<React.CSSProperties["justifyContent"]>;
|
|
29
|
+
alignItems?: Responsive<React.CSSProperties["alignItems"]>;
|
|
30
|
+
alignContent?: Responsive<React.CSSProperties["alignContent"]>;
|
|
31
|
+
wrap?: Responsive<React.CSSProperties["flexWrap"]>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The Stack component manages the layout of immediate children along the
|
|
35
|
+
* vertical or horizontal axis with optional spacing and/or dividers between
|
|
36
|
+
* each child.
|
|
37
|
+
*
|
|
38
|
+
* It uses a flex display together with a variant of the [lobotomised
|
|
39
|
+
* owl](https://css-tricks.com/lobotomized-owls/) selector (`* + *`) for
|
|
40
|
+
* spacing.
|
|
41
|
+
*/
|
|
42
|
+
export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Stack.tsx";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type ControlStatus } from "../../utils/control.ts";
|
|
4
|
+
import { Label } from "../Label";
|
|
5
|
+
/** Properties of the step component. */
|
|
6
|
+
export interface StepProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>, "asChild" | "value"> {
|
|
7
|
+
/** Index of the step. */
|
|
8
|
+
index?: number;
|
|
9
|
+
/** Status of the step. */
|
|
10
|
+
status?: ControlStatus;
|
|
11
|
+
/** Properties to pass to the container element. */
|
|
12
|
+
containerProps?: React.ComponentPropsWithRef<"div">;
|
|
13
|
+
/** Properties to pass to the step's label component. */
|
|
14
|
+
labelProps?: Omit<React.ComponentPropsWithRef<typeof Label>, "htmlFor">;
|
|
15
|
+
}
|
|
16
|
+
/** Step trigger component. */
|
|
17
|
+
export declare const Step: React.ForwardRefExoticComponent<StepProps & 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 step content component. */
|
|
4
|
+
export interface StepContentProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.TabsContent>, "value"> {
|
|
5
|
+
/** Index of the step that corresponds to this content. */
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
/** Step content component. */
|
|
9
|
+
export declare const StepContent: React.ForwardRefExoticComponent<StepContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Properties of the step list component. */
|
|
4
|
+
export interface StepListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component containing the list of steps.
|
|
8
|
+
*
|
|
9
|
+
* The `index` of each `Step` is automatically added when `Step`s are direct
|
|
10
|
+
* children of `StepList`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const StepList: React.ForwardRefExoticComponent<StepListProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** Properties of the stepper component. */
|
|
4
|
+
export interface StepperProps extends Omit<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>, "defaultValue" | "value" | "onValueChange" | "orientation" | "dir" | "children"> {
|
|
5
|
+
/**
|
|
6
|
+
* Index of the default active step.
|
|
7
|
+
*
|
|
8
|
+
* @default 0
|
|
9
|
+
*/
|
|
10
|
+
defaultActiveStep?: number;
|
|
11
|
+
/** Index of the active step. */
|
|
12
|
+
activeStep?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Function called when the active step changes.
|
|
15
|
+
*
|
|
16
|
+
* @param newActiveStep Index of the new active step.
|
|
17
|
+
*/
|
|
18
|
+
onActiveStepChange?: (newActiveStep: number) => void;
|
|
19
|
+
/** Reference to interact with the stepper's API. */
|
|
20
|
+
apiRef?: React.Ref<StepperApi | undefined>;
|
|
21
|
+
children?: React.ReactNode | ((api: StepperApi) => React.ReactNode);
|
|
22
|
+
}
|
|
23
|
+
export interface StepperApi {
|
|
24
|
+
/** Currently active step. */
|
|
25
|
+
activeStep: number;
|
|
26
|
+
/**
|
|
27
|
+
* Navigates to the provided step.
|
|
28
|
+
*
|
|
29
|
+
* @param step Step to go to.
|
|
30
|
+
*/
|
|
31
|
+
goTo: (step: number) => void;
|
|
32
|
+
/** Navigates to the next step. */
|
|
33
|
+
next: () => void;
|
|
34
|
+
/** Navigates to the previous step. */
|
|
35
|
+
previous: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Component used to display progress through a sequence of numbered steps.
|
|
39
|
+
*
|
|
40
|
+
* It composes the following subcomponents:
|
|
41
|
+
*
|
|
42
|
+
* - `StepList`: Displays the `Step` in the sequence, helping users visualize
|
|
43
|
+
* their progress and navigate between steps.
|
|
44
|
+
* - `StepComponent`: Displays the content relevant to each `Step`, ensuring users
|
|
45
|
+
* see detailed information as they progress through the steps.
|
|
46
|
+
*
|
|
47
|
+
* The component leverages the `StepperApi` interface to manage navigation and
|
|
48
|
+
* active step tracking through the following props:
|
|
49
|
+
*
|
|
50
|
+
* - `activeStep`: Tracks the currently active step to synchronize navigation and
|
|
51
|
+
* step content display.
|
|
52
|
+
* - `previous`: Enables moving to the previous step. Prevents navigation beyond
|
|
53
|
+
* the first step by disabling the relevant button.
|
|
54
|
+
* - `next`: Allows progression to the next step. On the final step, disables
|
|
55
|
+
* further navigation to maintain flow.
|
|
56
|
+
* - `goTo`: Provides direct access to a specific step. While not used in all
|
|
57
|
+
* implementations, it adds flexibility for custom navigation flows.
|
|
58
|
+
*/
|
|
59
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Value of the stepper's context. */
|
|
3
|
+
export interface StepperContextValue {
|
|
4
|
+
activeStep: number;
|
|
5
|
+
}
|
|
6
|
+
/** Stepper's context. */
|
|
7
|
+
export declare const StepperContext: React.Context<StepperContextValue | null>;
|
|
8
|
+
/** Hook exposing the stepper's context. */
|
|
9
|
+
export declare function useStepperContext(): StepperContextValue;
|