@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.
- package/LICENSE +202 -0
- package/README.md +13 -1
- package/dist/chunks/{en-W4OWqPrv.js → en-Czf-_HZt.js} +9 -11
- package/dist/chunks/en-Czf-_HZt.js.map +1 -0
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +8 -10
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +8 -10
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +69 -6
- package/dist/ostack-ui.js +904 -557
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +4 -2
- package/scss/_utils.scss +1 -0
- package/scss/components/ButtonGroup/_ButtonGroup.scss +2 -5
- package/scss/components/Pagination/_Pagination-variables.scss +89 -0
- package/scss/components/Pagination/_Pagination.scss +135 -0
- package/scss/components/Select/_Select-variables.scss +1 -1
- package/scss/components/Tabs/_Tabs-variables.scss +1 -1
- package/scss/components/Tabs/_Tabs.scss +3 -2
- package/scss/index.scss +1 -0
- package/scss/scss/placeholders/button/_button-variables.scss +3 -0
- package/scss/scss/placeholders/button/_button.scss +4 -3
- package/scss/scss/placeholders/menu/_menu-variables.scss +4 -1
- package/scss/scss/placeholders/menu/_menu.scss +4 -0
- package/types/components/Alert/Alert.d.ts +1 -1
- package/types/components/AlertDialog/AlertDialog.d.ts +0 -1
- package/types/components/AlertDialog/AlertDialogBody.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogFooter.d.ts +2 -2
- package/types/components/Box/Box.d.ts +1 -1
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/types/components/CommandMenu/CommandMenuItem.d.ts +6 -0
- package/types/components/CommandMenu/cmdk/index.d.ts +2 -2
- package/types/components/Container/Container.d.ts +1 -1
- package/types/components/DataTable/DataTable.d.ts +13 -6
- package/types/components/DataTable/DataTableContent.d.ts +1 -1
- package/types/components/DataTable/DataTablePagination.d.ts +7 -16
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +1 -5
- package/types/components/DataTable/PagedDataTablePagination.d.ts +5 -5
- package/types/components/DataTable/sanitizeProps.d.ts +0 -2
- package/types/components/DateInput/DateInput.d.ts +4 -4
- package/types/components/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuItem.d.ts +6 -0
- package/types/components/Form/Form.d.ts +12 -3
- package/types/components/Form/FormError.d.ts +3 -2
- package/types/components/Keyboard/Keyboard.d.ts +1 -5
- package/types/components/Link/Link.d.ts +1 -1
- package/types/components/NumericInput/NumericInput.d.ts +4 -4
- package/types/components/Output/Output.d.ts +12 -0
- package/types/components/Pagination/Pagination.d.ts +93 -0
- package/types/components/Pagination/index.d.ts +1 -0
- package/types/components/Pagination/paginationItems.d.ts +7 -0
- package/types/components/Select/Select.d.ts +1 -1
- package/types/components/Separator/Separator.d.ts +1 -1
- package/types/components/Table/TableCell.d.ts +2 -2
- package/types/components/Text/Text.d.ts +2 -6
- package/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +1 -1
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +3 -1
- package/types/utils/sanitizeProps.d.ts +2 -0
- 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
|
|
4
|
-
"description": "
|
|
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
|
-
>
|
|
16
|
-
>
|
|
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-
|
|
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:
|
|
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
|
|
368
|
-
color: $tabs-scroll-button-color
|
|
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
|
-
|
|
45
|
-
|
|
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-
|
|
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;
|
|
@@ -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>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
|
5
|
+
export declare function AlertDialogBody(props: DialogBodyProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
318
|
-
* <DataTableColumn
|
|
319
|
-
* <DataTableColumn
|
|
320
|
-
* <DataTableColumn
|
|
321
|
-
* <DataTableColumn
|
|
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
|
|
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 {
|
|
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
|
|
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?: (
|
|
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,
|
|
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
|
|
1
|
+
import { type PaginationProps } from "../Pagination";
|
|
2
2
|
import type { DataTablePaginationProps } from "./DataTablePagination.tsx";
|
|
3
|
-
/** Properties of the
|
|
4
|
-
export interface PagedDataTablePaginationProps extends
|
|
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
|
|
7
|
-
export declare function PagedDataTablePagination({
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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;
|