@ostack.tech/ui 1.3.0-beta.1 → 1.3.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 (63) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +13 -1
  3. package/dist/chunks/{en-W4OWqPrv.js → en-Czf-_HZt.js} +9 -11
  4. package/dist/chunks/en-Czf-_HZt.js.map +1 -0
  5. package/dist/locales/en-GB.js +1 -1
  6. package/dist/locales/en-US.js +1 -1
  7. package/dist/locales/fr-FR.js +8 -10
  8. package/dist/locales/fr-FR.js.map +1 -1
  9. package/dist/locales/pt-PT.js +8 -10
  10. package/dist/locales/pt-PT.js.map +1 -1
  11. package/dist/ostack-ui.css +69 -6
  12. package/dist/ostack-ui.js +904 -557
  13. package/dist/ostack-ui.js.map +1 -1
  14. package/package.json +4 -2
  15. package/scss/_utils.scss +1 -0
  16. package/scss/components/ButtonGroup/_ButtonGroup.scss +2 -5
  17. package/scss/components/Pagination/_Pagination-variables.scss +89 -0
  18. package/scss/components/Pagination/_Pagination.scss +135 -0
  19. package/scss/components/Select/_Select-variables.scss +1 -1
  20. package/scss/components/Tabs/_Tabs-variables.scss +1 -1
  21. package/scss/components/Tabs/_Tabs.scss +3 -2
  22. package/scss/index.scss +1 -0
  23. package/scss/scss/placeholders/button/_button-variables.scss +3 -0
  24. package/scss/scss/placeholders/button/_button.scss +4 -3
  25. package/scss/scss/placeholders/menu/_menu-variables.scss +4 -1
  26. package/scss/scss/placeholders/menu/_menu.scss +4 -0
  27. package/types/components/Alert/Alert.d.ts +1 -1
  28. package/types/components/AlertDialog/AlertDialog.d.ts +0 -1
  29. package/types/components/AlertDialog/AlertDialogBody.d.ts +2 -2
  30. package/types/components/AlertDialog/AlertDialogFooter.d.ts +2 -2
  31. package/types/components/Box/Box.d.ts +1 -1
  32. package/types/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
  33. package/types/components/CommandMenu/CommandMenuItem.d.ts +6 -0
  34. package/types/components/CommandMenu/cmdk/index.d.ts +2 -2
  35. package/types/components/Container/Container.d.ts +1 -1
  36. package/types/components/DataTable/DataTable.d.ts +13 -6
  37. package/types/components/DataTable/DataTableContent.d.ts +1 -1
  38. package/types/components/DataTable/DataTablePagination.d.ts +7 -16
  39. package/types/components/DataTable/DataTableRowsPerPage.d.ts +1 -5
  40. package/types/components/DataTable/PagedDataTablePagination.d.ts +5 -5
  41. package/types/components/DataTable/sanitizeProps.d.ts +0 -2
  42. package/types/components/DateInput/DateInput.d.ts +4 -4
  43. package/types/components/DateRangeInput/DateRangeInput.d.ts +1 -1
  44. package/types/components/DropdownMenu/DropdownMenuItem.d.ts +6 -0
  45. package/types/components/Form/Form.d.ts +12 -3
  46. package/types/components/Form/FormError.d.ts +3 -2
  47. package/types/components/Keyboard/Keyboard.d.ts +1 -5
  48. package/types/components/Link/Link.d.ts +1 -1
  49. package/types/components/NumericInput/NumericInput.d.ts +4 -4
  50. package/types/components/Output/Output.d.ts +12 -0
  51. package/types/components/Pagination/Pagination.d.ts +93 -0
  52. package/types/components/Pagination/index.d.ts +1 -0
  53. package/types/components/Pagination/paginationItems.d.ts +7 -0
  54. package/types/components/Select/Select.d.ts +1 -1
  55. package/types/components/Separator/Separator.d.ts +1 -1
  56. package/types/components/Table/TableCell.d.ts +2 -2
  57. package/types/components/Text/Text.d.ts +2 -6
  58. package/types/components/Tooltip/Tooltip.d.ts +1 -1
  59. package/types/index.d.ts +1 -0
  60. package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +1 -1
  61. package/types/providers/LocalizationProvider/LocalizationObject.d.ts +3 -1
  62. package/types/utils/sanitizeProps.d.ts +2 -0
  63. package/dist/chunks/en-W4OWqPrv.js.map +0 -1
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@ostack.tech/ui",
3
- "version": "1.3.0-beta.1",
4
- "description": "ostack/UI component library.",
3
+ "version": "1.3.0",
4
+ "description": "Accessible React component library.",
5
5
  "homepage": "https://ui.ostack.tech/",
6
+ "license": "Apache-2.0",
6
7
  "author": {
7
8
  "name": "Opensoft",
8
9
  "url": "https://opensoft.pt/en/"
@@ -43,6 +44,7 @@
43
44
  "./package.json": "./package.json"
44
45
  },
45
46
  "scripts": {
47
+ "prepack": "cpy ../../LICENSE ./",
46
48
  "build": "tsc -b && vite build && npm run copy:scss",
47
49
  "copy:scss": "cpy 'src/**/*.scss' '!src/**/*.stories.scss' scss/",
48
50
  "test": "vitest --run"
package/scss/_utils.scss CHANGED
@@ -50,6 +50,7 @@
50
50
  @forward "components/Link/Link-variables";
51
51
  @forward "components/Mark/Mark-variables";
52
52
  @forward "components/Overlay/Overlay-variables";
53
+ @forward "components/Pagination/Pagination-variables";
53
54
  @forward "components/RadioGroup/Radio-variables";
54
55
  @forward "components/Root/Root-variables";
55
56
  @forward "components/Select/Select-variables";
@@ -6,14 +6,11 @@
6
6
  @use "../../scss/utils/spacing" as *;
7
7
 
8
8
  .#{$prefix}button-group {
9
- $button: ".#{$prefix}button";
10
- $icon-button: ".#{$prefix}icon-button";
11
-
12
9
  position: relative;
13
10
  display: inline-flex;
14
11
 
15
- > #{$button},
16
- > #{$icon-button} {
12
+ > .#{$prefix}button,
13
+ > .#{$prefix}icon-button {
17
14
  position: relative;
18
15
  flex: 1 1 auto;
19
16
 
@@ -0,0 +1,89 @@
1
+ @use "../../scss/base-variables" as *;
2
+ @use "../../scss/utils/spacing" as *;
3
+ @use "../../scss/utils/css-color-functions" as *;
4
+ @use "../../scss/placeholders/button/button-variables" as *;
5
+ @use "../IconButton/IconButton-variables" as *;
6
+
7
+ // Layout
8
+ $pagination-grouped: false !default;
9
+ $pagination-gap-x: spacing(0.5) !default;
10
+
11
+ // Button
12
+ $pagination-button-padding-y: 0 !default;
13
+ $pagination-button-padding-x: 0.25em !default;
14
+ $pagination-button-background-color: null !default;
15
+ $pagination-button-background-image: null !default;
16
+ $pagination-button-color: var(--#{$prefix}neutral-a12) !default;
17
+ $pagination-button-border-color: null !default;
18
+ $pagination-button-box-shadow: null !default;
19
+ $pagination-button-font-family: null !default;
20
+ $pagination-button-font-weight: $font-weight-normal !default;
21
+
22
+ // Button - Hover
23
+ $pagination-button-hover-background-color: null !default;
24
+ $pagination-button-hover-background-image: null !default;
25
+ $pagination-button-hover-color: null !default;
26
+ $pagination-button-hover-border-color: null !default;
27
+ $pagination-button-hover-box-shadow: null !default;
28
+ $pagination-button-hover-z-index: null !default;
29
+
30
+ // Button - Current
31
+ $pagination-button-current-background-color: var(--#{$prefix}neutral-a4) !default;
32
+ $pagination-button-current-background-image: null !default;
33
+ $pagination-button-current-color: null !default;
34
+ $pagination-button-current-border-color: null !default;
35
+ $pagination-button-current-box-shadow: null !default;
36
+ $pagination-button-current-z-index: $pagination-button-hover-z-index !default;
37
+
38
+ // Button - Current + Hover
39
+ $pagination-button-current-hover-background-color: null !default;
40
+ $pagination-button-current-hover-background-image: null !default;
41
+ $pagination-button-current-hover-color: null !default;
42
+ $pagination-button-current-hover-border-color: null !default;
43
+ $pagination-button-current-hover-box-shadow: null !default;
44
+
45
+ // Button - Current + Active
46
+ $pagination-button-current-active-background-color: null !default;
47
+ $pagination-button-current-active-background-image: null !default;
48
+ $pagination-button-current-active-color: null !default;
49
+ $pagination-button-current-active-border-color: null !default;
50
+ $pagination-button-current-active-box-shadow: null !default;
51
+
52
+ // Button - Current + Focus
53
+ $pagination-button-current-focus-outline-offset: null !default;
54
+ $pagination-button-current-focus-outline-color: null !default;
55
+ $pagination-button-current-focus-z-index: null !default;
56
+
57
+ // Button - Size
58
+ $pagination-button-sm-min-size: $icon-button-sm-min-size !default;
59
+ $pagination-button-md-min-size: $icon-button-md-min-size !default;
60
+ $pagination-button-lg-min-size: $icon-button-lg-min-size !default;
61
+ $pagination-button-xl-min-size: $icon-button-xl-min-size !default;
62
+
63
+ // Arrow
64
+ $pagination-arrow-color: var(--#{$prefix}neutral-a12) !default;
65
+
66
+ // Arrow - Size
67
+ $pagination-arrow-sm-font-size: var(--#{$prefix}font-size-2xs) !default;
68
+ $pagination-arrow-md-font-size: var(--#{$prefix}font-size-xs) !default;
69
+ $pagination-arrow-lg-font-size: var(--#{$prefix}font-size-sm) !default;
70
+ $pagination-arrow-xl-font-size: var(--#{$prefix}font-size-md) !default;
71
+
72
+ // Ellipsis
73
+ $pagination-ellipsis-color: var(--#{$prefix}neutral-a11) !default;
74
+
75
+ // Sizes
76
+ $pagination-sizes: $icon-button-sizes !default;
77
+
78
+ $pagination-button-min-size-by-size: (
79
+ sm: $pagination-button-sm-min-size,
80
+ md: $pagination-button-md-min-size,
81
+ lg: $pagination-button-lg-min-size,
82
+ xl: $pagination-button-xl-min-size,
83
+ ) !default;
84
+ $pagination-arrow-font-size-by-size: (
85
+ sm: $pagination-arrow-sm-font-size,
86
+ md: $pagination-arrow-md-font-size,
87
+ lg: $pagination-arrow-lg-font-size,
88
+ xl: $pagination-arrow-xl-font-size,
89
+ ) !default;
@@ -0,0 +1,135 @@
1
+ @use "sass:map";
2
+ @use "Pagination-variables" as *;
3
+ @use "../../scss/base-variables" as *;
4
+ @use "../../scss/utils/declare-var" as *;
5
+ @use "../../scss/utils/spacing" as *;
6
+
7
+ .#{$prefix}pagination {
8
+ min-width: 0;
9
+ width: auto;
10
+
11
+ &__list {
12
+ display: inline-flex;
13
+ align-items: stretch;
14
+ margin: 0;
15
+ padding: 0;
16
+ list-style: none;
17
+ }
18
+
19
+ &__item {
20
+ display: flex;
21
+ }
22
+
23
+ &__item:not(:first-child) > &__button {
24
+ margin-left: $pagination-gap-x;
25
+
26
+ @if $pagination-grouped {
27
+ border-top-left-radius: 0;
28
+ border-bottom-left-radius: 0;
29
+ }
30
+ }
31
+
32
+ @if $pagination-grouped {
33
+ &__item:not(:last-child) > &__button {
34
+ border-top-right-radius: 0;
35
+ border-bottom-right-radius: 0;
36
+ }
37
+ }
38
+
39
+ // Button
40
+ &__button {
41
+ position: relative;
42
+ min-width: var(--#{$prefix}pagination-button-min-size);
43
+ min-height: var(--#{$prefix}pagination-button-min-size);
44
+
45
+ background-color: $pagination-button-background-color;
46
+ background-image: $pagination-button-background-image;
47
+ color: $pagination-button-color;
48
+ border-color: $pagination-button-border-color;
49
+ box-shadow: $pagination-button-box-shadow;
50
+ font-family: $pagination-button-font-family;
51
+ font-weight: $pagination-button-font-weight;
52
+
53
+ &:not([data-current]:hover) {
54
+ transition: none;
55
+ }
56
+
57
+ &:hover:not(:disabled, [data-disabled]) {
58
+ background-color: $pagination-button-hover-background-color;
59
+ background-image: $pagination-button-hover-background-image;
60
+ color: $pagination-button-hover-color;
61
+ border-color: $pagination-button-hover-border-color;
62
+ box-shadow: $pagination-button-hover-box-shadow;
63
+ z-index: $pagination-button-hover-z-index;
64
+ }
65
+
66
+ &[data-current] {
67
+ background-color: $pagination-button-current-background-color;
68
+ background-image: $pagination-button-current-background-image;
69
+ color: $pagination-button-current-color;
70
+ border-color: $pagination-button-current-border-color;
71
+ box-shadow: $pagination-button-current-box-shadow;
72
+ z-index: $pagination-button-current-z-index;
73
+
74
+ &:hover:not(:disabled, [data-disabled]) {
75
+ background-color: $pagination-button-current-hover-background-color;
76
+ background-image: $pagination-button-current-hover-background-image;
77
+ color: $pagination-button-current-hover-color;
78
+ border-color: $pagination-button-current-hover-border-color;
79
+ box-shadow: $pagination-button-current-hover-box-shadow;
80
+ }
81
+
82
+ &:active:not(:disabled, [data-disabled]) {
83
+ background-color: $pagination-button-current-active-background-color;
84
+ background-image: $pagination-button-current-active-background-image;
85
+ color: $pagination-button-current-active-color;
86
+ border-color: $pagination-button-current-active-border-color;
87
+ box-shadow: $pagination-button-current-active-box-shadow;
88
+ }
89
+
90
+ &:focus-visible {
91
+ outline-offset: $pagination-button-current-focus-outline-offset;
92
+ outline-color: $pagination-button-current-focus-outline-color;
93
+ z-index: $pagination-button-current-focus-z-index;
94
+ }
95
+ }
96
+ }
97
+
98
+ &__page,
99
+ &__ellipsis {
100
+ padding: $pagination-button-padding-y $pagination-button-padding-x;
101
+ }
102
+
103
+ // Ellipsis
104
+ &__ellipsis {
105
+ color: $pagination-ellipsis-color;
106
+ pointer-events: none;
107
+ }
108
+
109
+ // Arrow
110
+ &__arrow {
111
+ @if ($pagination-arrow-color != NULL) {
112
+ color: $pagination-arrow-color;
113
+ }
114
+ font-size: var(--#{$prefix}pagination-arrow-font-size);
115
+ }
116
+
117
+ // Loading
118
+ &__loading > .#{$prefix}button__spinner {
119
+ margin: 0;
120
+ }
121
+
122
+ // Sizes
123
+ @each $size in $pagination-sizes {
124
+ &__button:is(.#{$prefix}button--#{$size}, .#{$prefix}icon-button--#{$size}) {
125
+ @include declare-var(
126
+ --#{$prefix}pagination-button-min-size,
127
+ map.get($pagination-button-min-size-by-size, $size)
128
+ );
129
+ @include declare-var(
130
+ --#{$prefix}pagination-arrow-font-size,
131
+ map.get($pagination-arrow-font-size-by-size, $size)
132
+ );
133
+ }
134
+ }
135
+ }
@@ -45,7 +45,7 @@ $select-multiple-value-tag-line-height: var(--#{$prefix}line-height-xs) !default
45
45
  $select-multiple-value-tag-text-transform: null !default;
46
46
 
47
47
  // Arrow
48
- $select-arrow-font-size: var(--#{$prefix}font-size-2xs) !default;
48
+ $select-arrow-font-size: var(--#{$prefix}font-size-xs) !default;
49
49
  $select-arrow-color: var(--#{$prefix}neutral-11) !default;
50
50
 
51
51
  // Status
@@ -169,7 +169,7 @@ $tabs-tab-inner-annexes-active-status-background-color: null !default;
169
169
  // Scroll button
170
170
  $tabs-scroll-button-padding-x: spacing(2) !default;
171
171
  $tabs-scroll-button-color: null !default;
172
- $tabs-scroll-button-font-size: var(--#{$prefix}font-size-sm) !default;
172
+ $tabs-scroll-button-font-size: null !default;
173
173
  $tabs-scroll-button-overflow-indicator-width: 4px !default;
174
174
  $tabs-scroll-button-overflow-indicator-extra-height: 4px !default;
175
175
  $tabs-scroll-button-overflow-indicator-color: var(--#{$prefix}neutral-a8) !default;
@@ -5,6 +5,7 @@
5
5
  @use "../../scss/utils/animation" as *;
6
6
  @use "../../scss/utils/button-reset" as *;
7
7
  @use "../../scss/utils/declare-var" as *;
8
+ @use "../../scss/utils/maybe-important" as *;
8
9
  @use "../../scss/utils/transition" as *;
9
10
 
10
11
  .#{$prefix}tabs {
@@ -364,8 +365,8 @@
364
365
  min-width: auto;
365
366
  min-height: auto;
366
367
  padding: 0 $tabs-scroll-button-padding-x;
367
- font-size: $tabs-scroll-button-font-size !important;
368
- color: $tabs-scroll-button-color !important;
368
+ font-size: maybe-important($tabs-scroll-button-font-size);
369
+ color: maybe-important($tabs-scroll-button-color);
369
370
 
370
371
  border-bottom-left-radius: 0;
371
372
  border-bottom-right-radius: 0;
package/scss/index.scss CHANGED
@@ -48,6 +48,7 @@
48
48
  @forward "components/MenuList/MenuList";
49
49
  @forward "components/Output/Output";
50
50
  @forward "components/Overlay/Overlay";
51
+ @forward "components/Pagination/Pagination";
51
52
  @forward "components/Popover/Popover";
52
53
  @forward "components/RadioGroup/Radio";
53
54
  @forward "components/RadioGroup/RadioGroup";
@@ -22,6 +22,9 @@ $button-disabled-opacity: 0.65 !default;
22
22
  $button-disabled-cursor: not-allowed !default;
23
23
  $button-disabled-box-shadow: none !default;
24
24
 
25
+ // Spinning
26
+ $button-spinning-cursor: progress !default;
27
+
25
28
  // Solid variant
26
29
  $button-solid-background-color: var(--#{$prefix}accent-a9) !default;
27
30
  $button-solid-background-image: null !default;
@@ -39,15 +39,16 @@
39
39
  cursor: $button-disabled-cursor;
40
40
  opacity: $button-disabled-opacity;
41
41
  box-shadow: $button-disabled-box-shadow;
42
- }
43
42
 
44
- &:focus {
45
- z-index: $button-focus-z-index;
43
+ &[data-spinning] {
44
+ cursor: $button-spinning-cursor;
45
+ }
46
46
  }
47
47
 
48
48
  &:focus-visible {
49
49
  outline: $button-focus-outline-width solid $button-focus-outline-color;
50
50
  outline-offset: var(--#{$prefix}button-focus-outline-offset);
51
+ z-index: $button-focus-z-index;
51
52
  }
52
53
 
53
54
  &[aria-haspopup][aria-expanded="true"]:not([data-inactive]) {
@@ -41,6 +41,9 @@ $menu-item-text-cursor: null !default;
41
41
  $menu-item-disabled-cursor: not-allowed !default;
42
42
  $menu-item-disabled-opacity: 0.5 !default;
43
43
 
44
+ // Item - Spinning
45
+ $menu-item-spinning-cursor: progress !default;
46
+
44
47
  // Item - Focus
45
48
  $menu-item-focus-outline-width: 2px !default;
46
49
  $menu-item-focus-outline-color: var(--#{$prefix}primary-8) !default;
@@ -208,7 +211,7 @@ $menu-item-keybinds-subtle-highlighted-selected-color: $menu-item-keybinds-subtl
208
211
  $menu-item-keybinds-subtle-highlighted-selected-accent-color: null !default;
209
212
 
210
213
  // Sub trigger icon
211
- $menu-sub-trigger-icon-font-size: var(--#{$prefix}font-size-2xs) !default;
214
+ $menu-sub-trigger-icon-font-size: var(--#{$prefix}font-size-xs) !default;
212
215
 
213
216
  // Checkable
214
217
  $menu-checkable-size: 16px !default;
@@ -101,6 +101,10 @@
101
101
  &:is(:disabled, [data-disabled]) {
102
102
  cursor: $menu-item-disabled-cursor;
103
103
  opacity: $menu-item-disabled-opacity;
104
+
105
+ &[data-spinning] {
106
+ cursor: $menu-item-spinning-cursor;
107
+ }
104
108
  }
105
109
 
106
110
  &:focus-visible {
@@ -83,7 +83,7 @@ export interface AlertProps extends UseMarginPropsOptions, ComponentProps<"div">
83
83
  * ```tsx
84
84
  * import { Alert, AlertTitle } from "@ostack.tech/ui";
85
85
  *
86
- * function TermsAndConditionsNotice {
86
+ * function TermsAndConditionsNotice() {
87
87
  * return (
88
88
  * <Alert>
89
89
  * <AlertTitle>Notice</AlertTitle>
@@ -39,7 +39,6 @@ export interface AlertDialogProps extends ComponentProps<typeof AlertDialogPrimi
39
39
  * AlertDialogAction,
40
40
  * AlertDialogBody,
41
41
  * AlertDialogCancel,
42
- * AlertDialogClose,
43
42
  * AlertDialogContent,
44
43
  * AlertDialogDescription,
45
44
  * AlertDialogFooter,
@@ -1,5 +1,5 @@
1
- import { DialogBody, type DialogBodyProps } from "../Dialog";
1
+ import { type DialogBodyProps } from "../Dialog";
2
2
  /** Properties to the alert dialog body component. */
3
3
  export type AlertDialogBodyProps = DialogBodyProps;
4
4
  /** Body section of the alert dialog. */
5
- export declare const AlertDialogBody: typeof DialogBody;
5
+ export declare function AlertDialogBody(props: DialogBodyProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { DialogFooter, type DialogFooterProps } from "../Dialog";
1
+ import { type DialogFooterProps } from "../Dialog";
2
2
  /** Properties to the alert dialog footer component. */
3
3
  export type AlertDialogFooterProps = DialogFooterProps;
4
4
  /** Footer section of the alert dialog. */
5
- export declare const AlertDialogFooter: typeof DialogFooter;
5
+ export declare function AlertDialogFooter(props: DialogFooterProps): import("react").JSX.Element;
@@ -18,7 +18,7 @@ export interface BoxOwnProps extends UseMarginPropsOptions, UsePaddingPropsOptio
18
18
  /**
19
19
  * Basic layout component. Built on top of the browser's [`<div>`
20
20
  * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div) with access to
21
- * margin, padding, sizing, and other layout-related properties.
21
+ * margin, padding, and sizing properties.
22
22
  *
23
23
  * Example usage:
24
24
  *
@@ -8,8 +8,8 @@ import { type SpinnerProps } from "../Spinner";
8
8
  /** Properties of the checkbox group component. */
9
9
  export interface CheckboxGroupProps extends UseMarginPropsOptions, ComponentProps<"div"> {
10
10
  /**
11
- * Whether to display the checkbox group inline. Defaults to `false` unless when rending inside a
12
- * table cell.
11
+ * Whether to display the checkbox group inline. Defaults to `false` unless when rendering inside
12
+ * a table cell.
13
13
  */
14
14
  inline?: boolean;
15
15
  /**
@@ -10,6 +10,12 @@ export interface CommandMenuItemProps extends Omit<ComponentProps<typeof Command
10
10
  * @default false
11
11
  */
12
12
  asLink?: boolean;
13
+ /** Href for the link, when `asLink` is set. */
14
+ href?: ComponentProps<"a">["href"];
15
+ /** Target of the link, when `asLink` is set. */
16
+ target?: ComponentProps<"a">["target"];
17
+ /** Rel of the link, when `asLink` is set. */
18
+ rel?: ComponentProps<"a">["rel"];
13
19
  }
14
20
  /** Item of the command menu. */
15
21
  export declare function CommandMenuItem({ onSelect, selected, asLink, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, keywords, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, children, "aria-disabled": ariaDisabled, ...otherProps }: CommandMenuItemProps): import("react").JSX.Element;
@@ -42,7 +42,7 @@ declare const Command: React.ForwardRefExoticComponent<Children & Omit<React.Det
42
42
  */
43
43
  shouldFilter?: boolean;
44
44
  /**
45
- * Custom filter function for whether each command menu item should matches the given search
45
+ * Custom filter function for whether each command menu item should match the given search
46
46
  * query. It should return a number between 0 and 1, with 1 being the best match and 0 being
47
47
  * hidden entirely. By default, uses the `command-score` library.
48
48
  */
@@ -170,7 +170,7 @@ declare const pkg: React.ForwardRefExoticComponent<Children & Omit<React.Detaile
170
170
  */
171
171
  shouldFilter?: boolean;
172
172
  /**
173
- * Custom filter function for whether each command menu item should matches the given search
173
+ * Custom filter function for whether each command menu item should match the given search
174
174
  * query. It should return a number between 0 and 1, with 1 being the best match and 0 being
175
175
  * hidden entirely. By default, uses the `command-score` library.
176
176
  */
@@ -45,7 +45,7 @@ export interface ContainerProps extends UseMarginPropsOptions, ComponentProps<"d
45
45
  */
46
46
  leftGutter?: Responsive<number | string>;
47
47
  /**
48
- * Size of the right margin of the container.When a number is provided, each unit corresponds to
48
+ * Size of the right margin of the container. When a number is provided, each unit corresponds to
49
49
  * `var(--o-ui-space)`.
50
50
  *
51
51
  * A responsive value may be provided to change the gutter size based on the current breakpoint.
@@ -296,7 +296,14 @@ export interface DataTableProps<T = any> extends ComponentProps<"div"> {
296
296
  * Example usage:
297
297
  *
298
298
  * ```tsx
299
- * import { DataTable, DataTablePagination, DataTableRowsPerPage } from "@ostack.tech/ui";
299
+ * import {
300
+ * DataTable,
301
+ * DataTableColumn,
302
+ * DataTableColumns,
303
+ * DataTableContent,
304
+ * DataTablePagination,
305
+ * DataTableRowsPerPage,
306
+ * } from "@ostack.tech/ui";
300
307
  *
301
308
  * function InventoryTable() {
302
309
  * return (
@@ -314,11 +321,11 @@ export interface DataTableProps<T = any> extends ComponentProps<"div"> {
314
321
  * ]}
315
322
  * >
316
323
  * <DataTableColumns>
317
- * <DataTableColumn name="sku" label="SKU" header />
318
- * <DataTableColumn name="product" label="Product" />
319
- * <DataTableColumn name="category" label="Category" />
320
- * <DataTableColumn name="stock" label="Stock" />
321
- * <DataTableColumn name="condition" label="Condition" />
324
+ * <DataTableColumn id="sku" label="SKU" header />
325
+ * <DataTableColumn id="product" label="Product" />
326
+ * <DataTableColumn id="category" label="Category" />
327
+ * <DataTableColumn id="stock" label="Stock" />
328
+ * <DataTableColumn id="condition" label="Condition" />
322
329
  * </DataTableColumns>
323
330
  * <DataTableContent caption="Inventory" />
324
331
  * <DataTableRowsPerPage />
@@ -7,7 +7,7 @@ export interface DataTableContentProps extends Omit<TableProps, "layout"> {
7
7
  /** Content of the table foot component. */
8
8
  tableFootContent?: ReactNode;
9
9
  /**
10
- * Whether the table foot show be shown when the data table is empty.
10
+ * Whether the table foot should be shown when the data table is empty.
11
11
  *
12
12
  * @default false
13
13
  */
@@ -1,21 +1,16 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
2
  import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
- import type { IconButtonProps } from "../IconButton";
3
+ import type { PaginationProps } from "../Pagination";
4
4
  /** Properties of the data table pagination component. */
5
- export interface DataTablePaginationProps extends UseMarginPropsOptions, ComponentProps<"div"> {
5
+ export interface DataTablePaginationProps extends UseMarginPropsOptions, ComponentProps<"div">, Pick<PaginationProps, "size" | "siblingCount" | "boundaryCount" | "label" | "previousPageButtonLabel" | "nextPageButtonLabel" | "pageButtonLabel" | "previousPageButtonProps" | "nextPageButtonProps" | "pageButtonProps" | "ellipsisButtonProps" | "loadingButtonProps"> {
6
6
  /**
7
- * Function used to render the range of displayed rows.
7
+ * Function used to render the range of displayed rows (only relevant is scrolled mode).
8
8
  *
9
- * @param range Node representing the range of rows (note that, in paged mode, this is a select).
9
+ * @param rangeStart Start of the range.
10
+ * @param rangeEnd End of the range.
10
11
  * @param total Total number of rows.
11
12
  */
12
- rowsRange?: (range: ReactNode, total: number) => ReactNode;
13
- /** Label of the rows range select (only relevant in paged mode). */
14
- rowsRangeSelectLabel?: (total: number) => string;
15
- /** Label of the previous page button (only relevant in paged mode). */
16
- previousPageButtonLabel?: string;
17
- /** Label of the next page button (only relevant in paged mode). */
18
- nextPageButtonLabel?: string;
13
+ rowsRange?: (rangeStart: number, rangeEnd: number, total: number) => ReactNode;
19
14
  /**
20
15
  * Whether the component should preferably be aligned to the right. This only has an effect when
21
16
  * the component is nested directly under the `DataTable`.
@@ -23,10 +18,6 @@ export interface DataTablePaginationProps extends UseMarginPropsOptions, Compone
23
18
  * @default true
24
19
  */
25
20
  preferRightAlignment?: boolean;
26
- /** Properties to pass to the previous page button (only relevant in paged mode). */
27
- previousPageButtonProps?: IconButtonProps;
28
- /** Properties to pass to the next page button (only relevant in paged mode). */
29
- nextPageButtonProps?: IconButtonProps;
30
21
  }
31
22
  /** Component used to provide pagination to the data table. */
32
- export declare function DataTablePagination({ rowsRange: rowsRangeProp, rowsRangeSelectLabel: rowsRangeSelectLabelProp, previousPageButtonLabel: previousPageButtonLabelProp, nextPageButtonLabel: nextPageButtonLabelProp, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, style, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
23
+ export declare function DataTablePagination({ rowsRange: rowsRangeProp, size, siblingCount, boundaryCount, label: labelProp, previousPageButtonLabel: previousPageButtonLabelProp, nextPageButtonLabel: nextPageButtonLabelProp, pageButtonLabel: pageButtonLabelProp, previousPageButtonProps, nextPageButtonProps, pageButtonProps, ellipsisButtonProps, loadingButtonProps, preferRightAlignment, style, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
@@ -8,11 +8,7 @@ export interface DataTableRowsPerPageProps extends UseMarginPropsOptions, Compon
8
8
  * @default [10, 15, 25, 50]
9
9
  */
10
10
  limitOptions?: number[];
11
- /**
12
- * Function used to render the number of rows per page.
13
- *
14
- * @param rows Node representing the number of rows (a select).
15
- */
11
+ /** Label of the rows per page select. */
16
12
  label?: ReactNode;
17
13
  /**
18
14
  * Whether the component should preferably be aligned to the right. This only has an effect when
@@ -1,7 +1,7 @@
1
- import { type ComponentProps } from "react";
1
+ import { type PaginationProps } from "../Pagination";
2
2
  import type { DataTablePaginationProps } from "./DataTablePagination.tsx";
3
- /** Properties of the scrolled data table pagination. */
4
- export interface PagedDataTablePaginationProps extends ComponentProps<"div">, Pick<DataTablePaginationProps, "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
3
+ /** Properties of the paged data table pagination. */
4
+ export interface PagedDataTablePaginationProps extends Pick<DataTablePaginationProps, "preferRightAlignment">, Omit<PaginationProps, "count" | "defaultPage" | "page" | "onPageChange" | "disabled" | "loading"> {
5
5
  }
6
- /** Pagination component of the scrolled data table. */
7
- export declare function PagedDataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, preferRightAlignment, previousPageButtonProps, nextPageButtonProps, className, "aria-label": ariaLabelProp, ...otherProps }: PagedDataTablePaginationProps): import("react").JSX.Element;
6
+ /** Pagination component of the paged data table. */
7
+ export declare function PagedDataTablePagination({ preferRightAlignment, className, ...otherProps }: PagedDataTablePaginationProps): import("react").JSX.Element;
@@ -1,7 +1,5 @@
1
1
  import type { SortDirection } from "../../utils/sorting.ts";
2
2
  import type { DataTableColumnObject } from "./DataTableColumn.tsx";
3
- /** Sanitizes an integer property. */
4
- export declare function sanitizeInt(value: number | string | undefined): number | undefined;
5
3
  /** Sanitizes the `sortBy` property. */
6
4
  export declare function sanitizeSortBy<T>(sortBy: string | null | undefined, leaves: Record<string, DataTableColumnObject<T>>): string | null | undefined;
7
5
  /** Sanitizes the `sortDirection` property. */
@@ -20,22 +20,22 @@ export interface DateInputProps extends Omit<ControlNonFileInputProps, "defaultV
20
20
  */
21
21
  onValueChange?: (valueRepresentations: DateValueRepresentations) => void;
22
22
  /**
23
- * Minimum date allowed. When a string it provided, it should represent the date in the ISO 8601
23
+ * Minimum date allowed. When a string is provided, it should represent the date in the ISO 8601
24
24
  * format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
25
25
  */
26
26
  minDate?: string | Date | null;
27
27
  /**
28
- * Maximum date allowed. When a string it provided, it should represent the date in the ISO 8601
28
+ * Maximum date allowed. When a string is provided, it should represent the date in the ISO 8601
29
29
  * format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
30
30
  */
31
31
  maxDate?: string | Date | null;
32
32
  /**
33
- * Minimum month allowed. When a string it provided, it should represent the date in the ISO 8601
33
+ * Minimum month allowed. When a string is provided, it should represent the date in the ISO 8601
34
34
  * format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
35
35
  */
36
36
  minMonth?: string | Date | null;
37
37
  /**
38
- * Maximum month allowed. When a string it provided, it should represent the date in the ISO 8601
38
+ * Maximum month allowed. When a string is provided, it should represent the date in the ISO 8601
39
39
  * format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
40
40
  */
41
41
  maxMonth?: string | Date | null;