@ostack.tech/ui 0.9.1 → 0.10.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.
Files changed (68) hide show
  1. package/dist/chunks/{en-Dem8nwZz.js → en-DwZKZVGL.js} +16 -3
  2. package/dist/chunks/en-DwZKZVGL.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +15 -2
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +15 -2
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +59 -49
  10. package/dist/ostack-ui.js +1953 -939
  11. package/dist/ostack-ui.js.map +1 -1
  12. package/dist/types/components/Alert/Alert.d.ts +17 -0
  13. package/dist/types/components/Alert/AlertContext.d.ts +8 -0
  14. package/dist/types/components/AlertDialog/AlertDialog.d.ts +2 -1
  15. package/dist/types/components/Button/Button.d.ts +2 -1
  16. package/dist/types/components/Calendar/CalendarMonthGrid.d.ts +1 -0
  17. package/dist/types/components/CommandMenu/CommandMenu.d.ts +4 -3
  18. package/dist/types/components/CommandMenu/CommandMenuGroup.d.ts +1 -1
  19. package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +1 -1
  20. package/dist/types/components/CommandMenu/cmdk/command-score.d.ts +1 -0
  21. package/dist/types/components/CommandMenu/cmdk/index.d.ts +320 -0
  22. package/dist/types/components/DataTable/DataTable.d.ts +4 -0
  23. package/dist/types/components/DataTable/DataTableContext.d.ts +7 -1
  24. package/dist/types/components/DataTable/DataTablePagination.d.ts +2 -0
  25. package/dist/types/components/DataTable/PagedDataTablePagination.d.ts +1 -1
  26. package/dist/types/components/Dialog/Dialog.d.ts +2 -1
  27. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +2 -1
  28. package/dist/types/components/Field/Field.d.ts +35 -6
  29. package/dist/types/components/Field/FieldProvider.d.ts +13 -0
  30. package/dist/types/components/Field/index.d.ts +1 -0
  31. package/dist/types/components/Heading/Heading.d.ts +3 -1
  32. package/dist/types/components/Icon/Icon.d.ts +5 -6
  33. package/dist/types/components/IconButton/IconButton.d.ts +7 -0
  34. package/dist/types/components/Input/Input.d.ts +11 -2
  35. package/dist/types/components/Keyboard/Keyboard.d.ts +17 -2
  36. package/dist/types/components/NumericInput/NumericInput.d.ts +27 -14
  37. package/dist/types/components/RadioGroup/RadioGroup.d.ts +5 -0
  38. package/dist/types/components/Select/Select.d.ts +8 -4
  39. package/dist/types/components/Select/SelectContext.d.ts +3 -1
  40. package/dist/types/components/Tabs/Tabs.d.ts +3 -0
  41. package/dist/types/components/TextArea/TextArea.d.ts +14 -11
  42. package/dist/types/components/Tooltip/Tooltip.d.ts +25 -14
  43. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +7 -4
  44. package/dist/types/utils/numericStringUtils.d.ts +2 -2
  45. package/package.json +2 -5
  46. package/scss/components/Code/_Code-variables.scss +1 -1
  47. package/scss/components/CommandMenu/_CommandMenu.scss +1 -7
  48. package/scss/components/DataTable/_DataTable-variables.scss +6 -0
  49. package/scss/components/DataTable/_DataTable.scss +7 -0
  50. package/scss/components/Dialog/_Dialog.scss +2 -1
  51. package/scss/components/DropdownMenu/_DropdownMenu.scss +3 -3
  52. package/scss/components/Keyboard/_Keyboard-variables.scss +2 -2
  53. package/scss/components/Keyboard/_Keyboard.scss +1 -0
  54. package/scss/components/MenuList/_MenuList.scss +3 -3
  55. package/scss/components/Select/_Select-variables.scss +4 -0
  56. package/scss/components/Select/_Select.scss +6 -0
  57. package/scss/components/Tag/_Tag-variables.scss +1 -1
  58. package/scss/components/Toast/_Toast.scss +4 -0
  59. package/scss/index.scss +1 -0
  60. package/scss/scss/helpers/_keyframes.scss +114 -0
  61. package/scss/scss/placeholders/menu/_menu-variables.scss +24 -15
  62. package/scss/scss/placeholders/menu/_menu.scss +1 -3
  63. package/scss/scss/placeholders/notification/_notification-variables.scss +2 -2
  64. package/scss/scss/placeholders/notification/_notification.scss +1 -0
  65. package/scss/scss/utils/_animation.scss +0 -104
  66. package/scss/scss/utils/_spinner.scss +2 -7
  67. package/dist/chunks/en-Dem8nwZz.js.map +0 -1
  68. package/dist/ostack-ui.css.map +0 -1
@@ -77,6 +77,15 @@ export interface InputPropsBase {
77
77
  showClearButton?: ShowClearButton;
78
78
  /** Label of the clear button announced to assistive technologies. */
79
79
  clearButtonLabel?: string;
80
+ /**
81
+ * Accessible description for how to clear the control when the clear button
82
+ * is visible.
83
+ *
84
+ * This field should be provided when adding extra keybinds to clear the
85
+ * control (_e.g._ the input is a file input and pressing Backspace/Delete
86
+ * clears it).
87
+ */
88
+ clearDescription?: ReactNode;
80
89
  /**
81
90
  * Function called whenever the value changes.
82
91
  *
@@ -114,8 +123,8 @@ export interface InputPropsBase {
114
123
  * ```tsx
115
124
  * import { Input } from "@ostack.tech/ui";
116
125
  *
117
- * function Search() {
118
- * return <Input placeholder="Search…" />;
126
+ * function UsernameInput() {
127
+ * return <Input placeholder="Enter username…" />;
119
128
  * }
120
129
  * ```
121
130
  */
@@ -9,7 +9,22 @@ export interface KeyboardProps extends ComponentPropsWithoutRef<"kbd"> {
9
9
  asChild?: boolean;
10
10
  }
11
11
  /**
12
- * Component used to show which key or combination of keys performs a given
13
- * action.
12
+ * Component which represents a span of inline text denoting textual user input
13
+ * from a keyboard, voice input, or any other text entry device. It is built on
14
+ * top of the browser's [`<kbd>` (keyboard input)
15
+ * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd).
16
+ *
17
+ * Example usage:
18
+ *
19
+ * ```tsx
20
+ * function BookmarkInstructions() {
21
+ * return (
22
+ * <>
23
+ * Press <Keyboard>Ctrl</Keyboard> + <Keyboard>D</Keyboard> to
24
+ * bookmark this page.
25
+ * </>
26
+ * );
27
+ * }
28
+ * ```
14
29
  */
15
30
  export declare const Keyboard: import('react').ForwardRefExoticComponent<KeyboardProps & import('react').RefAttributes<HTMLElement>>;
@@ -5,9 +5,9 @@ import { Input } from '../Input';
5
5
  export interface NumericInputProps extends NumericTransformerOptions, Omit<ComponentPropsWithoutRef<typeof Input>, "defaultValue" | "value" | "onValueChange" | "type" | "min" | "max"> {
6
6
  type?: "text" | "tel" | "password";
7
7
  /** Numeric input's default value. */
8
- defaultValue?: string | number | null;
8
+ defaultValue?: string | number | bigint | null;
9
9
  /** Numeric input's controlled value. */
10
- value?: string | number | null;
10
+ value?: string | number | bigint | null;
11
11
  /**
12
12
  * Function called whenever the value of the numeric input changes.
13
13
  *
@@ -34,28 +34,28 @@ export interface NumericInputProps extends NumericTransformerOptions, Omit<Compo
34
34
  * `"999 999,99 €"`, i.e. `valueIsUnformattedString` has no effect on this
35
35
  * property.
36
36
  */
37
- min?: string | number | null;
37
+ min?: string | number | bigint | null;
38
38
  /**
39
39
  * Maximum number allowed. If a string is provided, it should **not** be the
40
40
  * formatted representation, e.g. `"999999.99" should be provided instead of
41
41
  * `"999 999,99 €"`, i.e. `valueIsUnformattedString` has no effect on this
42
42
  * property.
43
43
  */
44
- max?: string | number | null;
44
+ max?: string | number | bigint | null;
45
45
  /**
46
46
  * Value that the number should be greater than. If a string is provided, it
47
47
  * should **not** be the formatted representation, e.g. `"999999.99" should be
48
48
  * provided instead of `"999 999,99 €"`, i.e. `valueIsUnformattedString` has
49
49
  * no effect on this property.
50
50
  */
51
- exclusiveMin?: string | number | null;
51
+ exclusiveMin?: string | number | bigint | null;
52
52
  /**
53
53
  * Value that the number should be less than. If a string is provided, it
54
54
  * should **not** be the formatted representation, e.g. `"999999.99" should be
55
55
  * provided instead of `"999 999,99 €"`, i.e. `valueIsUnformattedString` has
56
56
  * no effect on this property.
57
57
  */
58
- exclusiveMax?: string | number | null;
58
+ exclusiveMax?: string | number | bigint | null;
59
59
  /**
60
60
  * Whether the numeric value should be allowed.
61
61
  *
@@ -73,14 +73,27 @@ export interface NumericValueRepresentations {
73
73
  numberValue: number | null;
74
74
  }
75
75
  /**
76
- * The `NumericInput` component is designed for numeric data entry, offering
77
- * features like digit grouping, adornments, and precision control to enhance
78
- * the user experience when dealing with numbers.
76
+ * The numeric input component is used to collect numeric user input. It is
77
+ * built on top of the [`Input`
78
+ * component](https://ui.ostack.tech/?path=/docs/ostack-ui-forms-input--docs)
79
+ * and the [`react-number-format`
80
+ * library](https://s-yadav.github.io/react-number-format/).
79
81
  *
80
- * Similar to the [Input](/docs/ostack-ui-forms-input--docs)
81
- * component,`NumericInput` works seamlessly with the `Field` component to
82
- * create structured, accessible form groups. By combining it with `Field`, you
83
- * can ensure proper associations between `Label`, `NumericInput`, and
84
- * `HelperText`, improving clarity and accessibility for users.
82
+ * It supports specifying the precision, scale, separators, grouping of digits,
83
+ * restrictions, or affixes of a number.
84
+ *
85
+ * For accessibility purposes, numeric inputs are usually included within a
86
+ * `Field` together with a `Label` and optionally `HelperText` and/or
87
+ * `Feedback`.
88
+ *
89
+ * Example usage:
90
+ *
91
+ * ```tsx
92
+ * import { NumericInput } from "@ostack.tech/ui";
93
+ *
94
+ * function NumberOfTickets() {
95
+ * return <NumericInput placeholder="Enter number of tickets…" />;
96
+ * }
97
+ * ```
85
98
  */
86
99
  export declare const NumericInput: import('react').ForwardRefExoticComponent<NumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -57,6 +57,11 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof Ra
57
57
  * @default false
58
58
  */
59
59
  showClearButton?: ShowClearButton;
60
+ /**
61
+ * Accessible description for how to clear the radio group when the clear
62
+ * button is visible.
63
+ */
64
+ clearDescription?: ReactNode;
60
65
  /** Label of the clear button announced to assistive technologies. */
61
66
  clearButtonLabel?: string;
62
67
  /**
@@ -5,7 +5,7 @@ import { Input } from '../Input';
5
5
  import { PopoverContent, PopoverTrigger } from '../Popover';
6
6
  import { Tag } from '../Tag';
7
7
  /** Base properties of the select component. */
8
- export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "loadingDescription" | "showSpinner" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
8
+ export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "loadingDescription" | "showSpinner" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "clearDescription" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
9
9
  /**
10
10
  * Whether multiple options can be selected. If not set, at most one option
11
11
  * can be selected at a time.
@@ -38,6 +38,8 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
38
38
  onOpenChange?: (open: boolean) => void;
39
39
  /** Select's placeholder. */
40
40
  placeholder?: ReactNode;
41
+ /** Accessible label for the search input. Not shown visibly. */
42
+ searchLabel?: string;
41
43
  /** Accessible label for the list of options. Not shown visibly. */
42
44
  optionsLabel?: string;
43
45
  /**
@@ -52,6 +54,8 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
52
54
  loadingOptionsProgress?: number;
53
55
  /** Message to display when no options were found. */
54
56
  emptyMessage?: ReactNode;
57
+ /** Label of the close button shown on each value tag. */
58
+ valueTagCloseButtonLabel?: ReactNode;
55
59
  /**
56
60
  * When `multiple` is set, this property controls the maximum width the
57
61
  * content of a value tag representing a selected option can reach. By
@@ -67,7 +71,7 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
67
71
  /** Properties to pass to the `Popover` component. */
68
72
  popoverProps?: ComponentPropsWithRef<typeof PopoverContent>;
69
73
  /** Options to pass to the `CommandMenu` component. */
70
- commandMenuProps?: Omit<ComponentPropsWithRef<typeof CommandMenu>, "defaultValue" | "value" | "onValueChange" | "iconPlacement" | "searchPlaceholder" | "searchValue" | "onSearchValueChange" | "listLabel" | "loading" | "loadingLabel" | "loadingProgress" | "emptyMessage">;
74
+ commandMenuProps?: Omit<ComponentPropsWithRef<typeof CommandMenu>, "defaultValue" | "value" | "onValueChange" | "iconPlacement" | "searchPlaceholder" | "searchValue" | "onSearchValueChange" | "label" | "listLabel" | "loading" | "loadingLabel" | "loadingProgress" | "emptyMessage">;
71
75
  }
72
76
  /** Properties of the select component with `multiple` not set. */
73
77
  export interface SelectSingleProps extends SelectPropsBase<string | number> {
@@ -83,8 +87,8 @@ export type SelectProps = SelectSingleProps | SelectMultipleProps;
83
87
  * Control which displays a menu of options for the user to pick from. Provides
84
88
  * an alternative to the browser's [`<select>`
85
89
  * 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.
90
+ * while also allowing users to search for options. It is built on top of the
91
+ * `Input`, `Popover`, and `CommandMenu` components.
88
92
  *
89
93
  * It supports the selection of more than one option by setting the `multiple`
90
94
  * property.
@@ -11,6 +11,7 @@ export interface SelectContextValue {
11
11
  status?: ControlStatus;
12
12
  disabled?: boolean;
13
13
  readOnly?: boolean;
14
+ valueTagCloseButtonLabel?: SelectProps["valueTagCloseButtonLabel"];
14
15
  valueTagProps?: SelectProps["valueTagProps"];
15
16
  store: SelectStore;
16
17
  }
@@ -37,13 +38,14 @@ export declare const SelectContext: import('react').Context<SelectContextValue |
37
38
  /** Options to pass to the `useCreateSelectContext` hook. */
38
39
  export type UseCreateSelectContextOptions = Omit<SelectContextValue, "store">;
39
40
  /** Hook which creates the select context. */
40
- export declare function useCreateSelectContext({ multiple, value, onOptionSelect, status, disabled, readOnly, valueTagProps, }: UseCreateSelectContextOptions): {
41
+ export declare function useCreateSelectContext({ multiple, value, onOptionSelect, status, disabled, readOnly, valueTagCloseButtonLabel, valueTagProps, }: UseCreateSelectContextOptions): {
41
42
  multiple: boolean;
42
43
  value: string | string[];
43
44
  onOptionSelect: (value: string) => void;
44
45
  status: ControlStatus | undefined;
45
46
  disabled: boolean | undefined;
46
47
  readOnly: boolean | undefined;
48
+ valueTagCloseButtonLabel: ReactNode;
47
49
  valueTagProps: Omit<Omit<import('../Tag/Tag.tsx').TagProps & import('react').RefAttributes<HTMLSpanElement>, "ref">, "color" | "open" | "defaultOpen" | "onOpenChange" | "showCloseButton"> | undefined;
48
50
  store: Omit<import('zustand').StoreApi<SelectState>, "subscribe"> & {
49
51
  subscribe: {
@@ -23,6 +23,9 @@ export interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrim
23
23
  *
24
24
  * The `value` set on each tab should match the `value` of its content.
25
25
  *
26
+ * Built on top of the [Radix Tabs
27
+ * primitive](https://radix-ui.com/primitives/docs/components/tabs).
28
+ *
26
29
  * It composes the following subcomponents:
27
30
  *
28
31
  * - `TabList`: A container holding the list of tabs.
@@ -4,18 +4,21 @@ import { InputPropsBase } from '../Input';
4
4
  export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">, ComponentPropsWithoutRef<"textarea"> {
5
5
  }
6
6
  /**
7
- * The `TextArea` component is a flexible, multiline input field designed for
8
- * text entry. This component is ideal for capturing larger amounts of text,
9
- * such as user feedback, comments, or descriptions.
7
+ * The text area component is used to collect multi-line user input. It is built
8
+ * on top of the browser's [`<textarea>`
9
+ * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea).
10
10
  *
11
- * All extra properties are passed directly to the underlying textarea element,
12
- * offering full control over behavior and appearance. The TextArea component
13
- * can be combined with the `Field` component for better structure and
14
- * accessibility. The `Field` ensures proper associations between the `Label`,
15
- * `TextArea`, and related elements like `HelperText`, improving usability and
16
- * accessibility for users.
11
+ * For accessibility purposes, text areas are usually included within a `Field`
12
+ * together with a `Label` and optionally `HelperText` and/or `Feedback`.
17
13
  *
18
- * This setup ensures that the `TextArea` can adapt to different use cases while
19
- * maintaining a consistent and accessible form structure.
14
+ * Example usage:
15
+ *
16
+ * ```tsx
17
+ * import { TextArea } from "@ostack.tech/ui";
18
+ *
19
+ * function CommentArea() {
20
+ * return <TextArea placeholder="Leave a comment…" />;
21
+ * }
22
+ * ```
20
23
  */
21
24
  export declare const TextArea: import('react').ForwardRefExoticComponent<TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
@@ -12,14 +12,18 @@ export interface TooltipProps extends Omit<ComponentPropsWithoutRef<typeof Toolt
12
12
  showArrow?: boolean;
13
13
  /** Tooltip's trigger element. */
14
14
  children: ReactElement;
15
- /** The open state of the tooltip when it is initially rendered. */
15
+ /** Default open state of the tooltip. */
16
16
  defaultOpen?: boolean;
17
17
  /**
18
- * The controlled open state of the tooltip. Should be used in conjunction
19
- * with `onOpenChange`.
18
+ * Controlled open state of the tooltip.
19
+ *
20
+ * Use together with `onOpenChange`.
20
21
  */
21
22
  open?: boolean;
22
- /** Event handler called when the open state of the tooltip changes. */
23
+ /**
24
+ * Function called when the open state of the tooltip changes. Use it to
25
+ * control the tooltip's open state together with the `open` property.
26
+ */
23
27
  onOpenChange?: (open: boolean) => void;
24
28
  /**
25
29
  * Override the duration given to the `TooltipProvider` to customise the open
@@ -39,17 +43,24 @@ export interface TooltipProps extends Omit<ComponentPropsWithoutRef<typeof Toolt
39
43
  arrowProps?: ComponentPropsWithRef<typeof TooltipPrimitive.Arrow>;
40
44
  }
41
45
  /**
42
- * The `Tooltip` component renders a popup that displays information related to
43
- * an element (trigger) when the element receives keyboard focus or the mouse
44
- * hovers over it.
46
+ * The tooltip component displays a popup containing information related to an
47
+ * element when the user focuses or hovers over it.
48
+ *
49
+ * Built on top of the [Radix Tooltip
50
+ * primitive](https://www.radix-ui.com/primitives/docs/components/tooltip).
51
+ *
52
+ * Example usage:
45
53
  *
46
- * In ostack/UI applications, `TooltipProvider` is already integrated into the
47
- * root container to ensure consistent tooltip behavior throughout the
48
- * application. Developers typically don't need to configure it manually, as the
49
- * default setup handles delay times and interactions seamlessly.
54
+ * ```tsx
55
+ * import { Button, Tooltip } from "@ostack.tech/ui";
50
56
  *
51
- * For detailed information on these props, which do not have descriptions,
52
- * please refer to the
53
- * [docs](https://www.radix-ui.com/primitives/docs/components/tooltip).
57
+ * function BookmarkButton() {}
58
+ * return (
59
+ * <Tooltip content="Save for later…">
60
+ * <Button>Bookmark</Button>
61
+ * </Tooltip>
62
+ * );
63
+ * }
64
+ * ```
54
65
  */
55
66
  export declare const Tooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -3,7 +3,7 @@ import { CalendarProps } from '../../components/Calendar';
3
3
  import { CloseButtonProps } from '../../components/CloseButton';
4
4
  import { CommandMenuDialogProps, CommandMenuProps } from '../../components/CommandMenu';
5
5
  import { ControlCodeProps } from '../../components/ControlCode';
6
- import { DataTableContentProps, DataTableFilterProps, DataTablePaginationProps, DataTableRowsPerPageProps } from '../../components/DataTable';
6
+ import { DataTableContentProps, DataTableFilterProps, DataTablePaginationProps, DataTableProps, DataTableRowsPerPageProps } from '../../components/DataTable';
7
7
  import { DateInputProps } from '../../components/DateInput';
8
8
  import { DateRangeInputProps } from '../../components/DateRangeInput';
9
9
  import { ErrorBoundaryProps } from '../../components/ErrorBoundary';
@@ -14,6 +14,7 @@ import { InputProps } from '../../components/Input';
14
14
  import { KeybindsProps } from '../../components/Keybinds';
15
15
  import { LabelProps } from '../../components/Label';
16
16
  import { NumericInputProps } from '../../components/NumericInput';
17
+ import { RadioGroupProps } from '../../components/RadioGroup';
17
18
  import { SelectProps } from '../../components/Select';
18
19
  import { TableColumnProps, TableHeadProps } from '../../components/Table';
19
20
  import { TabListProps } from '../../components/Tabs';
@@ -30,9 +31,10 @@ export interface LocalizationObject {
30
31
  CommandMenuDialog: Pick<CommandMenuDialogProps, "title" | "description">;
31
32
  ConfirmDialog: Pick<ConfirmDialogOptions, "okText" | "cancelText">;
32
33
  ControlCode: Pick<ControlCodeProps, "visuallyHiddenPrefix">;
33
- DataTable: Pick<DataTableContentProps, "emptyMessage">;
34
+ DataTable: Pick<DataTableProps, "selectAllRowsLabel" | "selectRowLabel">;
35
+ DataTableContent: Pick<DataTableContentProps, "emptyMessage">;
34
36
  DataTableFilter: Pick<DataTableFilterProps, "aria-label" | "placeholder">;
35
- DataTablePagination: Pick<DataTablePaginationProps, "rowsRange" | "previousPageButtonLabel" | "nextPageButtonLabel">;
37
+ DataTablePagination: Pick<DataTablePaginationProps, "aria-label" | "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel">;
36
38
  DataTableRowsPerPage: Pick<DataTableRowsPerPageProps, "label">;
37
39
  DateInput: Pick<DateInputProps, "format" | "announcedFormat" | "placeholder" | "formatDescription" | "selectedDateDescription" | "calendarButtonLabel">;
38
40
  DateRangeInput: Pick<DateRangeInputProps, "startInputLabel" | "endInputLabel" | "selectedDateRangeDescription" | "calendarButtonLabel">;
@@ -44,7 +46,8 @@ export interface LocalizationObject {
44
46
  Keybinds: Pick<KeybindsProps, "keybindsSeparatorLabel" | "keyPressesSeparatorLabel" | "keysSeparatorLabel" | "keySymbols" | "keyLabels">;
45
47
  Label: Pick<LabelProps, "helperButtonLabel">;
46
48
  NumericInput: Pick<NumericInputProps, "decimalSeparator" | "groupingStyle" | "groupSeparator">;
47
- Select: Pick<SelectProps, "searchPlaceholder" | "emptyMessage" | "optionsLabel" | "loadingOptionsLabel">;
49
+ RadioGroup: Pick<RadioGroupProps, "clearDescription">;
50
+ Select: Pick<SelectProps, "placeholder" | "clearDescription" | "searchLabel" | "searchPlaceholder" | "emptyMessage" | "optionsLabel" | "loadingOptionsLabel" | "valueTagCloseButtonLabel">;
48
51
  TableColumn: Pick<TableColumnProps, "helperButtonLabel">;
49
52
  TableHead: Pick<TableHeadProps, "sortByColumnDescription">;
50
53
  TabList: Pick<TabListProps, "scrollLeftButtonLabel" | "scrollRightButtonLabel">;
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Converts a numberic value to a string, removing exponential notation. Nullish
2
+ * Converts a numeric value to a string, removing exponential notation. Nullish
3
3
  * or `NaN` values become the empty string.
4
4
  */
5
- export declare function numericToString(v: string | number | null | undefined): string;
5
+ export declare function numericToString(v: string | number | bigint | null | undefined): string;
6
6
  /** Whether a numeric string represents a negative number. */
7
7
  export declare function isNumericStringNegative(v: string): boolean;
8
8
  /** Whether a numeric string represents the `null` value. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ostack.tech/ui",
3
3
  "description": "ostack/UI component library.",
4
- "version": "0.9.1",
4
+ "version": "0.10.0",
5
5
  "homepage": "https://ui.ostack.tech/",
6
6
  "author": {
7
7
  "name": "Opensoft",
@@ -38,15 +38,12 @@
38
38
  ],
39
39
  "scripts": {
40
40
  "clean": "rimraf dist/ scss/",
41
- "build": "npm run build:js && npm run build:css",
42
- "build:js": "vite build",
43
- "build:css": "npm run copy:scss && sass -I ../../node_modules/ scss/index.scss dist/ostack-ui.css",
41
+ "build": "vite build && npm run copy:scss",
44
42
  "copy:scss": "cpy 'src/**/*.scss' '!src/**/*.stories.scss' scss/"
45
43
  },
46
44
  "dependencies": {
47
45
  "@fortawesome/react-fontawesome": "^3.1.1",
48
46
  "@tanstack/react-virtual": "^3.13.18",
49
- "cmdk": "^1.1.1",
50
47
  "from-exponential": "^1.1.1",
51
48
  "radix-ui": "^1.4.3",
52
49
  "react-day-picker": "^9.13.0",
@@ -6,7 +6,7 @@ $code-padding-x: spacing(1) !default;
6
6
  $code-border-radius: var(--#{$prefix}border-radius-sm) !default;
7
7
  $code-font-family: var(--#{$prefix}font-family-code) !default;
8
8
  $code-font-weight: $font-weight-normal !default;
9
- $code-font-size: 0.975em !default;
9
+ $code-font-size: 0.875em !default;
10
10
  $code-line-height: 1.25 !default;
11
11
  $code-background-color: var(--#{$prefix}accent-a3) !default;
12
12
  $code-color: var(--#{$prefix}accent-a11) !default;
@@ -131,13 +131,7 @@
131
131
  $command-menu-list-transition-timing-function;
132
132
  }
133
133
 
134
- &__item
135
- &__item-action:not(
136
- a,
137
- :disabled,
138
- [data-disabled=""],
139
- [data-disabled="true"]
140
- ) {
134
+ &__item &__item-action:not(a, :disabled, [data-disabled]) {
141
135
  cursor: $command-menu-item-button-cursor;
142
136
  }
143
137
 
@@ -13,9 +13,15 @@ $data-table-filter-max-width: 250px !default;
13
13
 
14
14
  // Rows per page
15
15
  $data-table-rows-per-page-gap-x: spacing(1) !default;
16
+ $data-table-rows-per-page-font-size: var(--#{$prefix}font-size-sm) !default;
17
+ $data-table-rows-per-page-line-height: var(--#{$prefix}line-height-sm) !default;
18
+ $data-table-rows-per-page-font-weight: $font-weight-normal !default;
16
19
 
17
20
  // Pagination
18
21
  $data-table-pagination-gap-x: spacing(2) !default;
22
+ $data-table-pagination-font-size: var(--#{$prefix}font-size-sm) !default;
23
+ $data-table-pagination-line-height: var(--#{$prefix}line-height-sm) !default;
24
+ $data-table-pagination-font-weight: null !default;
19
25
 
20
26
  // Pagination arrows
21
27
  $data-table-pagination-arrows-gap-x: spacing(1) !default;
@@ -4,6 +4,7 @@
4
4
  @use "../../scss/utils/breakpoints" as *;
5
5
  @use "../../scss/utils/spacing" as *;
6
6
  @use "../../scss/utils/transition" as *;
7
+ @use "../../scss/utils/maybe-important" as *;
7
8
 
8
9
  .#{$prefix}data-table {
9
10
  $data-table: &;
@@ -48,6 +49,9 @@
48
49
 
49
50
  &__rows-per-page-label {
50
51
  margin-right: $data-table-rows-per-page-gap-x;
52
+ font-size: $data-table-rows-per-page-font-size;
53
+ line-height: $data-table-rows-per-page-line-height;
54
+ font-weight: maybe-important($data-table-rows-per-page-font-weight);
51
55
  }
52
56
 
53
57
  &__rows-per-page-select-root,
@@ -59,6 +63,9 @@
59
63
  display: flex;
60
64
  flex-wrap: wrap;
61
65
  align-items: center;
66
+ font-size: $data-table-pagination-font-size;
67
+ line-height: $data-table-pagination-line-height;
68
+ font-weight: $data-table-pagination-font-weight;
62
69
  }
63
70
 
64
71
  &__pagination-arrows {
@@ -60,7 +60,8 @@
60
60
 
61
61
  // Variants
62
62
  @each $variant in $dialog-variants {
63
- &#{$card}--#{$variant} {
63
+ &#{$card}--#{$variant},
64
+ #{$card}--#{$variant} {
64
65
  @include declare-var(
65
66
  --#{$prefix}card-border-color,
66
67
  map.get($dialog-border-color-by-variant, $variant)
@@ -19,9 +19,9 @@
19
19
  }
20
20
 
21
21
  :is(&__item, &__checkbox-item, &__radio-item)
22
- #{$menu-list-item-action}:not(a):not(:disabled):not([data-disabled=""]):not(
23
- [data-disabled="true"]
24
- ):not([data-loading]) {
22
+ #{$menu-list-item-action}:not(a):not(:disabled):not([data-disabled]):not(
23
+ [data-loading]
24
+ ) {
25
25
  cursor: $menu-item-button-cursor;
26
26
  }
27
27
 
@@ -2,13 +2,13 @@
2
2
  @use "../../scss/utils/spacing" as *;
3
3
  @use "../../scss/utils/css-color-functions" as *;
4
4
 
5
- $keyboard-padding: 0 0.25em !default;
5
+ $keyboard-padding: 1px 0.25em 0 !default;
6
6
  $keyboard-border-radius: var(--#{$prefix}border-radius-sm) !default;
7
7
 
8
8
  $keyboard-font-family: var(--#{$prefix}font-family-code) !default;
9
9
  $keyboard-font-weight: $font-weight-normal !default;
10
10
  $keyboard-font-size: 0.875em !default;
11
- $keyboard-line-height: 1 !default;
11
+ $keyboard-line-height: 1.25 !default;
12
12
  $keyboard-word-wrap: break-word !default;
13
13
 
14
14
  $keyboard-border-width: 1px 1px 2px !default;
@@ -3,6 +3,7 @@
3
3
  @use "../../scss/utils/spacing" as *;
4
4
 
5
5
  .#{$prefix}keyboard {
6
+ display: inline-block;
6
7
  padding: $keyboard-padding;
7
8
  border-radius: $keyboard-border-radius;
8
9
 
@@ -33,9 +33,9 @@
33
33
 
34
34
  // Highlight action on hover only if the item isn't styled as selected
35
35
  &:not([data-state="checked"][data-hide-control]) {
36
- &:is([data-highlighted], [data-state="open"], [data-selected="true"])
36
+ &:is([data-highlighted], [data-state="open"], [data-selected])
37
37
  #{$menu-list}__item-action--#{$variant},
38
- #{$menu-list}__item-action--#{$variant}:hover {
38
+ #{$menu-list}__item-action--#{$variant}:not([data-loading]):hover {
39
39
  @extend %#{$prefix}menu__item-action--#{$variant}--highlighted;
40
40
  }
41
41
  }
@@ -49,7 +49,7 @@
49
49
  &--#{$variant} {
50
50
  @extend %#{$prefix}menu__item-action--#{$variant};
51
51
 
52
- &:is([data-selected=""], [data-selected="true"]) {
52
+ &[data-selected] {
53
53
  @extend %#{$prefix}menu__item-action--#{$variant}--selected;
54
54
  }
55
55
  }
@@ -66,6 +66,10 @@ $select-option-font-family: null !default;
66
66
  $select-option-font-weight: null !default;
67
67
  $select-option-text-transform: null !default;
68
68
 
69
+ // Option - Selected
70
+ $select-option-selected-font-weight: null !default;
71
+ $select-option-selected-text-transform: null !default;
72
+
69
73
  // Option indicator
70
74
  $select-option-indicator-font-size: var(--#{$prefix}font-size-sm) !default;
71
75
 
@@ -160,6 +160,12 @@
160
160
  text-transform: $select-option-text-transform;
161
161
  }
162
162
 
163
+ // Option - Selected
164
+ &__option[aria-selected="true"] > &__option-action {
165
+ font-weight: $select-option-selected-font-weight;
166
+ text-transform: $select-option-selected-text-transform;
167
+ }
168
+
163
169
  // Option indicator
164
170
  &__option-indicator {
165
171
  font-size: $select-option-indicator-font-size;
@@ -23,7 +23,7 @@ $tag-subtle-box-shadow: null !default;
23
23
 
24
24
  // Outlined variant
25
25
  $tag-outlined-background-color: null !default;
26
- $tag-outlined-color: var(--#{$prefix}accent-a11) !default;
26
+ $tag-outlined-color: var(--#{$prefix}accent-a12) !default;
27
27
  $tag-outlined-box-shadow: inset 0 0 0 2px var(--#{$prefix}accent-a11) !default;
28
28
 
29
29
  // Icon
@@ -178,4 +178,8 @@
178
178
  @extend %#{$prefix}notification--#{$variant};
179
179
  }
180
180
  }
181
+
182
+ &--outlined {
183
+ background-color: var(--#{$prefix}background-color);
184
+ }
181
185
  }
package/scss/index.scss CHANGED
@@ -1,6 +1,7 @@
1
1
  @forward "utils";
2
2
 
3
3
  // Helpers
4
+ @forward "scss/helpers/keyframes";
4
5
  @forward "scss/helpers/print-utils";
5
6
  @forward "scss/helpers/visually-hidden";
6
7