@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,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Value of the document title provider context. */
|
|
3
|
+
export interface DocumentTitleProviderContextValue {
|
|
4
|
+
baseDocumentTitle: string | null;
|
|
5
|
+
baseSeparator: string;
|
|
6
|
+
breadcrumbsSeparator: string;
|
|
7
|
+
}
|
|
8
|
+
/** Document title provider context. */
|
|
9
|
+
export declare const DocumentTitleProviderContext: React.Context<DocumentTitleProviderContextValue | null>;
|
|
10
|
+
/** State of the document title component. */
|
|
11
|
+
export interface DocumentTitleState {
|
|
12
|
+
breadcrumbs: string[];
|
|
13
|
+
childrenDocumentTitles: number;
|
|
14
|
+
actions: DocumentTitleActions;
|
|
15
|
+
}
|
|
16
|
+
/** Document title actions. */
|
|
17
|
+
export interface DocumentTitleActions {
|
|
18
|
+
addChildDocumentTitle: () => void;
|
|
19
|
+
removeChildDocumentTitle: () => void;
|
|
20
|
+
}
|
|
21
|
+
/** Document title store. */
|
|
22
|
+
export type DocumentTitleStore = ReturnType<typeof useCreateDocumentTitleStore>;
|
|
23
|
+
/** Document title context. */
|
|
24
|
+
export declare const DocumentTitleContext: React.Context<(Omit<import("zustand").StoreApi<DocumentTitleState>, "subscribe"> & {
|
|
25
|
+
subscribe: {
|
|
26
|
+
(listener: (selectedState: DocumentTitleState, previousSelectedState: DocumentTitleState) => void): () => void;
|
|
27
|
+
<U>(selector: (state: DocumentTitleState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
28
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
29
|
+
fireImmediately?: boolean;
|
|
30
|
+
} | undefined): () => void;
|
|
31
|
+
};
|
|
32
|
+
}) | null>;
|
|
33
|
+
/** Hook used to create the context of a document title component. */
|
|
34
|
+
export declare function useCreateDocumentTitleStore(breadcrumbs?: string[]): Omit<import("zustand").StoreApi<DocumentTitleState>, "subscribe"> & {
|
|
35
|
+
subscribe: {
|
|
36
|
+
(listener: (selectedState: DocumentTitleState, previousSelectedState: DocumentTitleState) => void): () => void;
|
|
37
|
+
<U>(selector: (state: DocumentTitleState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
38
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
39
|
+
fireImmediately?: boolean;
|
|
40
|
+
} | undefined): () => void;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** Hook that returns access to the document title's store. */
|
|
44
|
+
export declare function useDocumentTitleStore<T>(selector: (state: Partial<DocumentTitleState>) => T): T;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/** Error report. */
|
|
3
|
+
export interface ErrorReport {
|
|
4
|
+
/** Hash of the error information, providing a unique identifier for the error. */
|
|
5
|
+
digest: string;
|
|
6
|
+
/** Error message. */
|
|
7
|
+
message: string;
|
|
8
|
+
/** Error stack, when available. */
|
|
9
|
+
stack: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Component error stack (React component tree of where the error occurred),
|
|
12
|
+
* when available.
|
|
13
|
+
*/
|
|
14
|
+
componentStack: string | null;
|
|
15
|
+
/** Timestamp of when the error occurred. */
|
|
16
|
+
timestamp: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Browser's user agent.
|
|
19
|
+
*
|
|
20
|
+
* **NOTE**: This could also be obtained from the `User-Agent` header of the
|
|
21
|
+
* HTTP request. However, it is included here since it is possible for the
|
|
22
|
+
* reporting to go through a proxy, which is free to alter the HTTP header.
|
|
23
|
+
*/
|
|
24
|
+
userAgent: string;
|
|
25
|
+
/** URL where the error occurred. */
|
|
26
|
+
url: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the error report.
|
|
30
|
+
*
|
|
31
|
+
* @param error Error that occurred.
|
|
32
|
+
* @param info Optional React error information.
|
|
33
|
+
* @returns Error report.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildErrorReport(error: unknown, info?: React.ErrorInfo): ErrorReport;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Value of the error reporting context. */
|
|
3
|
+
export interface ErrorReportingContextValue {
|
|
4
|
+
onError: (error: Error, info?: React.ErrorInfo) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Error reporting context. */
|
|
7
|
+
export declare const ErrorReportingContext: React.Context<ErrorReportingContextValue | null>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ErrorReport } from "./ErrorReport.ts";
|
|
3
|
+
/** Properties of the error reporting provider. */
|
|
4
|
+
export interface ErrorReportingProviderProps {
|
|
5
|
+
/**
|
|
6
|
+
* Whether error reporting is enabled. By default, error reporting is only
|
|
7
|
+
* enabled in production.
|
|
8
|
+
*/
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Function used to report an error. This function completely overrides the
|
|
12
|
+
* default error reporting and, as such, properties related to error reporting
|
|
13
|
+
* such as the `errorReportingUrl` are ignored.
|
|
14
|
+
*
|
|
15
|
+
* The default `reportError` function uses `fetch` with the remaining
|
|
16
|
+
* properties such as `errorReportingUrl` to perform the reporting.
|
|
17
|
+
*
|
|
18
|
+
* @param report Error report that should be reported.
|
|
19
|
+
*/
|
|
20
|
+
reportError?: (report: ErrorReport) => void | Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* URL to report the error to when using the default `reportError` function.
|
|
23
|
+
*
|
|
24
|
+
* This property is ignored when a custom `reportError` is provided.
|
|
25
|
+
*/
|
|
26
|
+
errorReportingUrl?: string | URL;
|
|
27
|
+
/**
|
|
28
|
+
* Method to use when reporting the error.
|
|
29
|
+
*
|
|
30
|
+
* This property is ignored when a custom `reportError` is provided.
|
|
31
|
+
*
|
|
32
|
+
* @default POST
|
|
33
|
+
*/
|
|
34
|
+
errorReportingMethod?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Function used to encode the error report.
|
|
37
|
+
*
|
|
38
|
+
* By default, the report is encoded into JSON via `JSON.stringify`.
|
|
39
|
+
*
|
|
40
|
+
* This property is ignored when a custom `reportError` is provided.
|
|
41
|
+
*
|
|
42
|
+
* @param report Report to encode.
|
|
43
|
+
*/
|
|
44
|
+
encodeErrorReport?: (report: ErrorReport) => BodyInit;
|
|
45
|
+
/**
|
|
46
|
+
* MIME type of the error report encoding.
|
|
47
|
+
*
|
|
48
|
+
* This property is ignored when a custom `reportError` is provided.
|
|
49
|
+
*
|
|
50
|
+
* @default application/json
|
|
51
|
+
*/
|
|
52
|
+
encodedErrorReportMimeType?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Options to provide to the `fetch` call when reporting an error, such as
|
|
55
|
+
* headers or others. By default, the request is a `POST` with JSON
|
|
56
|
+
* content-type.
|
|
57
|
+
*
|
|
58
|
+
* This property is ignored when a custom `reportError` is provided.
|
|
59
|
+
*/
|
|
60
|
+
errorReportingOptions?: Omit<RequestInit, "method" | "body">;
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Provider used to report errors caught in error boundaries throughout the
|
|
65
|
+
* application.
|
|
66
|
+
*
|
|
67
|
+
* Note that this provider does **not** automatically set an error boundary, so
|
|
68
|
+
* at least one should be manually set.
|
|
69
|
+
*/
|
|
70
|
+
export declare function ErrorReportingProvider({ enabled, reportError, errorReportingUrl, errorReportingMethod, encodeErrorReport, encodedErrorReportMimeType, errorReportingOptions, children, }: ErrorReportingProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type LocalizationObject } from "../../locale/LocalizationObject.ts";
|
|
3
|
+
/** Value of the localisation context. */
|
|
4
|
+
export type LocalizationContextValue = LocalizationObject;
|
|
5
|
+
/** Localisation context. */
|
|
6
|
+
export declare const LocalizationContext: React.Context<LocalizationObject>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type LocalizationObject } from "../../locale/LocalizationObject.ts";
|
|
3
|
+
/** Properties of the localisation provider. */
|
|
4
|
+
export interface LocalizationProviderProps {
|
|
5
|
+
/** Locale to use for the components. */
|
|
6
|
+
locale?: LocalizationObject;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Localisation provider. */
|
|
10
|
+
export declare function LocalizationProvider({ locale, children, }: LocalizationProviderProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Properties of the prefix provider. */
|
|
3
|
+
export interface PrefixProviderProps {
|
|
4
|
+
/** Prefix to use. */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Prefix provider. */
|
|
9
|
+
export declare function PrefixProvider({ prefix, children }: PrefixProviderProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function which prefixes the provided `toPrefix` string. If no argument is
|
|
3
|
+
* provided, the prefix is returned as-is.
|
|
4
|
+
*/
|
|
5
|
+
export type PrefixFn = (toPrefix: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Hook which returns a function which can be used to prefix a string with the
|
|
8
|
+
* current prefix.
|
|
9
|
+
*/
|
|
10
|
+
export declare function usePrefix(): PrefixFn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Toast, type ToastDescription, type ToastTitle } from "../../components/Toast";
|
|
3
|
+
import { type DistributedOmit } from "../../utils/typeUtils.ts";
|
|
4
|
+
/** Toast options. */
|
|
5
|
+
export type ToastOptions = DistributedOmit<React.ComponentPropsWithRef<typeof Toast>, "defaultOpen" | "open" | "title"> & {
|
|
6
|
+
/** Toast's title. */
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
/** HTML `title` prop. */
|
|
9
|
+
htmlTitle?: string;
|
|
10
|
+
/** Properties to pass to the title component. */
|
|
11
|
+
titleProps?: React.ComponentPropsWithRef<typeof ToastTitle>;
|
|
12
|
+
/** Properties to pass to the description component. */
|
|
13
|
+
descriptionProps?: React.ComponentPropsWithRef<typeof ToastDescription>;
|
|
14
|
+
};
|
|
15
|
+
/** Toast identifier. */
|
|
16
|
+
export type ToastId = number;
|
|
17
|
+
/** Value of the toast manager context. */
|
|
18
|
+
export interface ToastManagerContextValue {
|
|
19
|
+
/**
|
|
20
|
+
* Adds a new toast.
|
|
21
|
+
*
|
|
22
|
+
* @param description Toast's description.
|
|
23
|
+
* @param toastOptions Toast's options.
|
|
24
|
+
* @returns Toast's unique identifier.
|
|
25
|
+
*/
|
|
26
|
+
addToast: (description: React.ReactNode, toastOptions?: ToastOptions) => ToastId;
|
|
27
|
+
/**
|
|
28
|
+
* Removes an existing toast with the given identifier.
|
|
29
|
+
*
|
|
30
|
+
* @param toastId Toast identifier.
|
|
31
|
+
*/
|
|
32
|
+
removeToast: (toastId: ToastId) => void;
|
|
33
|
+
}
|
|
34
|
+
/** Toast manager context. */
|
|
35
|
+
export declare const ToastManagerContext: React.Context<ToastManagerContextValue | undefined>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Properties of the toast manager provider. */
|
|
3
|
+
export interface ToastManagerProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Toast manager provider.
|
|
8
|
+
*
|
|
9
|
+
* Note that this provider should be within a `ToastProvider`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ToastManagerProvider({ children }: ToastManagerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ToastManagerContextValue } from "./ToastManagerContext.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Hook used to programmatically manage toasts within an application.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const { addToast } = useToastManager();
|
|
9
|
+
*
|
|
10
|
+
* async function handleNewItemClick() {
|
|
11
|
+
* try {
|
|
12
|
+
* await api.createNewItem();
|
|
13
|
+
* addToast("New item created successfully!", { severity: "success" });
|
|
14
|
+
* } catch (err) {
|
|
15
|
+
* addToast(err.message, {
|
|
16
|
+
* title: "Error creating new item. :-(",
|
|
17
|
+
* severity: "danger",
|
|
18
|
+
* });
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function useToastManager(): ToastManagerContextValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Value for a data attribute given a condition. */
|
|
2
|
+
export declare function boolDataAttr(condition: boolean | null | undefined): string | undefined;
|
|
3
|
+
/** Sets the provided data attribute on the provided element given a condition. */
|
|
4
|
+
export declare function setBoolDataAttr(element: HTMLElement | null, attr: string, condition: boolean | null | undefined): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type UseMediaQueryOptions } from "./useMediaQuery.ts";
|
|
2
|
+
/** Available breakpoints. */
|
|
3
|
+
export declare const BREAKPOINTS: {
|
|
4
|
+
readonly xs: 0;
|
|
5
|
+
readonly sm: 576;
|
|
6
|
+
readonly md: 768;
|
|
7
|
+
readonly lg: 992;
|
|
8
|
+
readonly xl: 1200;
|
|
9
|
+
readonly xxl: 1400;
|
|
10
|
+
};
|
|
11
|
+
/** Type of available breakpoints. */
|
|
12
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
|
13
|
+
/**
|
|
14
|
+
* Hook that returns `true` when the screen size is greater or equal than the
|
|
15
|
+
* width of the provided breakpoint.
|
|
16
|
+
*
|
|
17
|
+
* @param breakpoint Breakpoint from which to match.
|
|
18
|
+
* @param options Media query options.
|
|
19
|
+
* @returns Whether the screen size is greater or equal than the width of the
|
|
20
|
+
* provided breakpoint.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useMediaBreakpointUp(breakpoint: Breakpoint, options?: UseMediaQueryOptions): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Hook that returns `true` when the screen size is less than the width of the
|
|
25
|
+
* provided breakpoint.
|
|
26
|
+
*
|
|
27
|
+
* @param breakpoint Breakpoint to up to which to match.
|
|
28
|
+
* @param options Media query options.
|
|
29
|
+
* @returns Whether the screen size is less than the width of the provided
|
|
30
|
+
* breakpoint.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useMediaBreakpointDown(breakpoint: Breakpoint, options?: UseMediaQueryOptions): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type EventHandler<T extends unknown[] = unknown[]> = (...args: T) => void;
|
|
2
|
+
/** Options to pass to the `combineEventHandlers` function. */
|
|
3
|
+
export interface CombineEventHandlersOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to check whether an event's default behaviour has been cancelled
|
|
6
|
+
* before running the second handler.
|
|
7
|
+
*
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
checkDefaultPrevented?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Combines two event handlers into a single event handler.
|
|
14
|
+
*
|
|
15
|
+
* @param handler1 First event handler.
|
|
16
|
+
* @param handler2 Second event handler.
|
|
17
|
+
* @param options Options.
|
|
18
|
+
* @returns Combined handler.
|
|
19
|
+
*/
|
|
20
|
+
export declare function combineEventHandlers<T extends unknown[] = unknown[]>(handler1: EventHandler<T>, handler2: EventHandler<T> | undefined, options?: CombineEventHandlersOptions): EventHandler<T>;
|
|
21
|
+
export declare function combineEventHandlers<T extends unknown[] = unknown[]>(handler1: EventHandler<T> | undefined, handler2: EventHandler<T>, options?: CombineEventHandlersOptions): EventHandler<T>;
|
|
22
|
+
export declare function combineEventHandlers(handler1: undefined, handler2: undefined, options?: CombineEventHandlersOptions): undefined;
|
|
23
|
+
export declare function combineEventHandlers<T extends unknown[] = unknown[]>(handler1: EventHandler<T> | undefined, handler2: EventHandler<T> | undefined, options?: CombineEventHandlersOptions): EventHandler<T> | undefined;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type AccentColor } from "./accent.ts";
|
|
3
|
+
/** Possible status of a control. */
|
|
4
|
+
export type ControlStatus = "valid" | "invalid" | "warned";
|
|
5
|
+
/**
|
|
6
|
+
* Style variants of a control.
|
|
7
|
+
*
|
|
8
|
+
* The `cell` variant should be used to display controls within table cells.
|
|
9
|
+
*/
|
|
10
|
+
export type ControlVariant = "default" | "cell";
|
|
11
|
+
/** Value of the control context. */
|
|
12
|
+
export interface ControlContextValue {
|
|
13
|
+
variant?: ControlVariant;
|
|
14
|
+
status?: ControlStatus;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Control context. */
|
|
19
|
+
export declare const ControlContext: React.Context<ControlContextValue | null>;
|
|
20
|
+
/** Hook providing access to the control context. */
|
|
21
|
+
export declare function useControlContext(): ControlContextValue | null;
|
|
22
|
+
/** Transforms a control status into a colour accent. */
|
|
23
|
+
export declare function controlStatusToAccent(status?: ControlStatus, defaultAccent?: AccentColor): AccentColor | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function used to join class names together.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* cx("foo", "bar", [false, "baz"]); // "foo bar baz"
|
|
8
|
+
* cx({ foo: true, bar: false }, "baz"); // "foo baz"
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @param args Class arguments to join.
|
|
12
|
+
* @returns Joined class names.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cx(...args: unknown[]): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Result of matching a formatted value against a filter. */
|
|
2
|
+
export interface MatchAgainstFilter {
|
|
3
|
+
/** Content before the matched content. */
|
|
4
|
+
before: string;
|
|
5
|
+
/** Matched content. */
|
|
6
|
+
matched: string;
|
|
7
|
+
/** Content after the matched content. */
|
|
8
|
+
after: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Matches a string value against a filter and returns the match or `null` when
|
|
12
|
+
* the value doesn't match.
|
|
13
|
+
*/
|
|
14
|
+
export declare function matchAgainstFilter(value: string, filter: string, locale: string): MatchAgainstFilter | null;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Type of the shortcut action. */
|
|
2
|
+
export type KeyboardShortcutAction = (event: KeyboardEvent) => void;
|
|
3
|
+
/** Options of the `registerKeyboardShortcut` function. */
|
|
4
|
+
export interface RegisterKeyboardShortcutOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Target element on which to listen for the keybinds.
|
|
7
|
+
*
|
|
8
|
+
* @default window
|
|
9
|
+
*/
|
|
10
|
+
target?: Window | HTMLElement;
|
|
11
|
+
/**
|
|
12
|
+
* Event type to listen for.
|
|
13
|
+
*
|
|
14
|
+
* @default keydown
|
|
15
|
+
*/
|
|
16
|
+
eventType?: "keydown" | "keyup";
|
|
17
|
+
/**
|
|
18
|
+
* Keybinding sequences will wait this long (in milliseconds) between key
|
|
19
|
+
* presses before cancelling.
|
|
20
|
+
*
|
|
21
|
+
* @default 1000
|
|
22
|
+
*/
|
|
23
|
+
sequenceTimeout?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the triggered shortcut should be ignored.
|
|
26
|
+
*
|
|
27
|
+
* By default, no shortcuts are ignored. However, we provide an auxiliary
|
|
28
|
+
* function {@link ignoreFormControlsKeyboardShortcut} which ignores keyboard
|
|
29
|
+
* shortcuts occurring in form controls (`<input>`, `<textarea>`,
|
|
30
|
+
* `<select>`).
|
|
31
|
+
*
|
|
32
|
+
* @param event Keyboard event which triggered the shortcut. `event.target`
|
|
33
|
+
* should contain the element in which the event was triggered.
|
|
34
|
+
* @returns Whether the keyboard shortcut should be ignored.
|
|
35
|
+
*/
|
|
36
|
+
ignore?: (event: KeyboardEvent) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether key presses should use a capture listener.
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
capture?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the event's default behaviour should be prevented.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
preventDefault?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Function which registers an action to run when one of the provided keybinds
|
|
52
|
+
* is triggered.
|
|
53
|
+
*
|
|
54
|
+
* Built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
|
|
55
|
+
* library. For more information on keybinding syntax, read the [`tinykeys`
|
|
56
|
+
* documentation](https://github.com/jamiebuilds/tinykeys).
|
|
57
|
+
*
|
|
58
|
+
* @param keybinds Keybinds which should trigger the action.
|
|
59
|
+
* @param action Action to run. Receives the keyboard event as an argument.
|
|
60
|
+
* @param options Configuration options (see
|
|
61
|
+
* {@link RegisterKeyboardShortcutOptions}).
|
|
62
|
+
* @returns Function used to unregister the shortcut.
|
|
63
|
+
* @see {@link useKeyboardShortcut} for a hook version of this function.
|
|
64
|
+
*/
|
|
65
|
+
export declare function registerKeyboardShortcut(keybinds: string | string[], action: KeyboardShortcutAction, { target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: RegisterKeyboardShortcutOptions): () => void;
|
|
66
|
+
/** Options of the `useKeyboardShortcut` hook. */
|
|
67
|
+
export interface UseKeyboardShortcutOptions extends Omit<RegisterKeyboardShortcutOptions, "target"> {
|
|
68
|
+
/**
|
|
69
|
+
* Target element on which to listen for the keybinds. While set to `null`
|
|
70
|
+
* keybinds will be ignored.
|
|
71
|
+
*
|
|
72
|
+
* @default window
|
|
73
|
+
*/
|
|
74
|
+
target?: Window | HTMLElement | null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Hook which runs an action when one of the provided keybinds is triggered.
|
|
78
|
+
*
|
|
79
|
+
* Built on top of the [`tinykeys`](https://jamiebuilds.github.io/tinykeys)
|
|
80
|
+
* library. For more information on keybinding syntax, read the [`tinykeys`
|
|
81
|
+
* documentation](https://github.com/jamiebuilds/tinykeys).
|
|
82
|
+
*
|
|
83
|
+
* Example usage:
|
|
84
|
+
*
|
|
85
|
+
* ```tsx
|
|
86
|
+
* import { Button, useKeyboardShortcut } from "@ostack.tech/ui";
|
|
87
|
+
*
|
|
88
|
+
* function SaveAction() {
|
|
89
|
+
* const saveFile = () => {
|
|
90
|
+
* // ...
|
|
91
|
+
* };
|
|
92
|
+
* useKeyboardShortcut("$mod+S", saveFile);
|
|
93
|
+
*
|
|
94
|
+
* return <Button onClick={saveFile}>Save</Button>;
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @param keybinds Keybinds which should trigger the action.
|
|
99
|
+
* @param action Action to run. Receives the keyboard event as an argument.
|
|
100
|
+
* @param options Configuration options (see
|
|
101
|
+
* {@link RegisterKeyboardShortcutOptions}).
|
|
102
|
+
* @see {@link registerKeyboardShortcut} for a non-hook version of this
|
|
103
|
+
* function.
|
|
104
|
+
*/
|
|
105
|
+
export declare function useKeyboardShortcut(keybinds: string | string[] | null | undefined, action: KeyboardShortcutAction, { target, eventType, sequenceTimeout, ignore, capture, preventDefault, }?: UseKeyboardShortcutOptions): void;
|
|
106
|
+
/**
|
|
107
|
+
* `ignore` function to use in `registerKeyboardShortcut`/`useKeyboardShortcut`
|
|
108
|
+
* which ignores triggered shortcuts which occur in `<input>`, `<textarea>`, or
|
|
109
|
+
* `<select>` elements.
|
|
110
|
+
*/
|
|
111
|
+
export declare function ignoreFormControlsKeyboardShortcut(event: KeyboardEvent): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a numberic value to a string, removing exponential notation. Nullish
|
|
3
|
+
* or `NaN` values become the empty string.
|
|
4
|
+
*/
|
|
5
|
+
export declare function numericToString(v: string | number | null | undefined): string;
|
|
6
|
+
/** Whether a numeric string represents a negative number. */
|
|
7
|
+
export declare function isNumericStringNegative(v: string): boolean;
|
|
8
|
+
/** Whether a numeric string represents the `null` value. */
|
|
9
|
+
export declare function numericStringRepresentsNull(v: string): boolean;
|
|
10
|
+
/** Removes leading and trailing zeros from a numeric string. */
|
|
11
|
+
export declare function normalizeNumericString(v: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Compares two numeric strings and returns a positive number if the first one
|
|
14
|
+
* is greater than the second one, a negative number if the opposite is true, or
|
|
15
|
+
* zero when they're equal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function compareNumericStrings(v1: string, v2: string): number;
|
|
18
|
+
/**
|
|
19
|
+
* Transforms an integer numeric string into a float numeric string, given the
|
|
20
|
+
* scale.
|
|
21
|
+
*/
|
|
22
|
+
export declare function numericStringIntToFloat(v: string, scale: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Transforms a float numeric string into an integer numeric string, given the
|
|
25
|
+
* scale.
|
|
26
|
+
*/
|
|
27
|
+
export declare function numericStringFloatToInt(v: string, scale: number): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormatOptions, type ParseOptions } from "date-fns";
|
|
2
|
+
/**
|
|
3
|
+
* Strictly parses a string date into a date.
|
|
4
|
+
*
|
|
5
|
+
* Workaround for: https://github.com/date-fns/date-fns/issues/942
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseDateStrict(dateString: string, dateFormat: string, options?: ParseOptions & FormatOptions): Date | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a given value is [promise-like]{@link PromiseLike}.
|
|
3
|
+
*
|
|
4
|
+
* @param value Value to check if it is promise-like.
|
|
5
|
+
* @returns Whether the provided value is like a promise.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sets the native value of an HTML element in a way that isn't detected by
|
|
3
|
+
* React; meaning that we can then dispatch an event that React will handle.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/facebook/react/issues/10135
|
|
6
|
+
*/
|
|
7
|
+
export declare function setNativeValue(element: HTMLElement, value: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Sort direction (ascending or descending). */
|
|
2
|
+
export type SortDirection = "asc" | "desc";
|
|
3
|
+
/** Stable sort implementation. */
|
|
4
|
+
export declare function stableSort<T>(array: T[], comparator?: (v1: T, v2: T, i1: number, i2: number) => number, sortDirection?: SortDirection): T[];
|
|
5
|
+
/**
|
|
6
|
+
* Comparison function allowing comparison of values of multiple types,
|
|
7
|
+
* including all primitive types, as well as dates.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compare<T>(v1: T, v2: T): number;
|