@westpac/ui 0.50.3 → 0.53.1
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/CHANGELOG.md +58 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.component.js +15 -4
- package/dist/components/accordion/components/accordion-item/accordion-item.styles.d.ts +27 -0
- package/dist/components/accordion/components/accordion-item/accordion-item.styles.js +10 -1
- package/dist/components/alert/alert.styles.js +1 -1
- package/dist/components/autocomplete/autocomplete.styles.js +1 -1
- package/dist/components/badge/badge.styles.d.ts +2 -2
- package/dist/components/badge/badge.styles.js +2 -2
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.js +2 -2
- package/dist/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.js +1 -1
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.d.ts +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.js +5 -3
- package/dist/components/button-dropdown/button-dropdown.types.d.ts +7 -2
- package/dist/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.styles.js +1 -1
- package/dist/components/collapsible/collapsible.styles.js +1 -1
- package/dist/components/compacta/compacta.styles.js +1 -1
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.d.ts +2 -2
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.js +1 -1
- package/dist/components/filter/components/filter-buttons/filter-buttons.component.js +2 -3
- package/dist/components/filter/components/filter-buttons/filter-buttons.styles.js +5 -5
- package/dist/components/filter/filter.component.js +1 -1
- package/dist/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.d.ts +2 -2
- package/dist/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.js +1 -1
- package/dist/components/flexi-cell/flexi-cell.styles.js +1 -1
- package/dist/components/footer/footer.styles.js +1 -1
- package/dist/components/header/header.component.d.ts +1 -1
- package/dist/components/header/header.component.js +13 -10
- package/dist/components/header/header.styles.js +1 -1
- package/dist/components/header/header.types.d.ts +7 -1
- package/dist/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.d.ts +2 -2
- package/dist/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.js +3 -3
- package/dist/components/input-group/input-group.component.js +2 -1
- package/dist/components/modal/components/modal-dialog/index.d.ts +1 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +1 -1
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/pagination/components/pagination-item/pagination-item.component.js +8 -2
- package/dist/components/pagination/components/pagination-item/pagination-item.styles.d.ts +12 -0
- package/dist/components/pagination/components/pagination-item/pagination-item.styles.js +5 -1
- package/dist/components/pagination/components/pagination-presentational/pagination-presentational.styles.js +1 -1
- package/dist/components/panel/components/panel-footer/panel-footer.styles.js +1 -1
- package/dist/components/panel/panel.styles.js +1 -1
- package/dist/components/popover/components/panel/panel.component.js +5 -4
- package/dist/components/popover/components/panel/panel.styles.js +2 -2
- package/dist/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.component.js +37 -19
- package/dist/components/repeater/repeater.styles.js +1 -1
- package/dist/components/select/components/index.d.ts +2 -0
- package/dist/components/select/components/index.js +2 -0
- package/dist/components/select/components/select-with-tooltip/select-with-tooltip.component.d.ts +13 -0
- package/dist/components/select/components/select-with-tooltip/select-with-tooltip.component.js +22 -0
- package/dist/components/select/components/select-with-tooltip/select-with-tooltip.styles.d.ts +56 -0
- package/dist/components/select/components/select-with-tooltip/select-with-tooltip.styles.js +30 -0
- package/dist/components/select/components/styled-select/styled-select.component.d.ts +13 -0
- package/dist/components/select/components/styled-select/styled-select.component.js +19 -0
- package/dist/components/select/components/styled-select/styled-select.styles.d.ts +104 -0
- package/dist/components/select/components/styled-select/styled-select.styles.js +46 -0
- package/dist/components/select/select.component.d.ts +1 -0
- package/dist/components/select/select.component.js +7 -14
- package/dist/components/select/select.styles.d.ts +180 -45
- package/dist/components/select/select.styles.js +60 -15
- package/dist/components/select/select.types.d.ts +6 -0
- package/dist/components/table/table.styles.js +1 -1
- package/dist/components/tabs/components/tabs-tab/tabs-tab.styles.js +1 -1
- package/dist/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.d.ts +2 -2
- package/dist/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.js +1 -1
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.component.d.ts +2 -0
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.component.js +9 -0
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.styles.d.ts +1 -0
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.styles.js +4 -0
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.types.d.ts +5 -0
- package/dist/components/tooltip/components/tooltip-content/tooltip-content.types.js +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.component.d.ts +2 -0
- package/dist/components/tooltip/tooltip.component.js +55 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.styles.js +4 -0
- package/dist/components/tooltip/tooltip.types.d.ts +7 -0
- package/dist/components/tooltip/tooltip.types.js +1 -0
- package/dist/components/well/well.styles.d.ts +2 -2
- package/dist/components/well/well.styles.js +1 -1
- package/dist/css/westpac-ui.css +113 -9
- package/dist/css/westpac-ui.min.css +113 -9
- package/package.json +3 -3
- package/src/components/accordion/components/accordion-item/accordion-item.component.tsx +22 -4
- package/src/components/accordion/components/accordion-item/accordion-item.styles.ts +10 -1
- package/src/components/alert/alert.styles.ts +1 -1
- package/src/components/autocomplete/autocomplete.styles.ts +1 -1
- package/src/components/badge/badge.styles.ts +2 -2
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.ts +2 -2
- package/src/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.tsx +1 -1
- package/src/components/button/button.styles.ts +1 -1
- package/src/components/button-dropdown/button-dropdown.component.tsx +8 -1
- package/src/components/button-dropdown/button-dropdown.types.ts +7 -2
- package/src/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.styles.ts +1 -1
- package/src/components/collapsible/collapsible.styles.ts +1 -1
- package/src/components/compacta/compacta.styles.ts +1 -1
- package/src/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.ts +1 -1
- package/src/components/filter/components/filter-buttons/filter-buttons.component.tsx +1 -2
- package/src/components/filter/components/filter-buttons/filter-buttons.styles.ts +5 -5
- package/src/components/filter/filter.component.tsx +1 -1
- package/src/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.ts +1 -1
- package/src/components/flexi-cell/flexi-cell.styles.ts +1 -1
- package/src/components/footer/footer.styles.ts +1 -1
- package/src/components/header/header.component.tsx +17 -4
- package/src/components/header/header.styles.ts +1 -1
- package/src/components/header/header.types.ts +7 -1
- package/src/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.ts +3 -3
- package/src/components/input-group/input-group.component.tsx +1 -0
- package/src/components/modal/components/modal-dialog/index.ts +1 -0
- package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +1 -1
- package/src/components/modal/index.ts +1 -0
- package/src/components/pagination/components/pagination-item/pagination-item.component.tsx +9 -2
- package/src/components/pagination/components/pagination-item/pagination-item.styles.ts +5 -1
- package/src/components/pagination/components/pagination-presentational/pagination-presentational.styles.ts +1 -1
- package/src/components/panel/components/panel-footer/panel-footer.styles.ts +1 -1
- package/src/components/panel/panel.styles.ts +1 -1
- package/src/components/popover/components/panel/panel.component.tsx +8 -5
- package/src/components/popover/components/panel/panel.styles.ts +2 -2
- package/src/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.component.tsx +62 -38
- package/src/components/repeater/repeater.styles.ts +1 -1
- package/src/components/select/components/index.ts +2 -0
- package/src/components/select/components/select-with-tooltip/select-with-tooltip.component.tsx +31 -0
- package/src/components/select/components/select-with-tooltip/select-with-tooltip.styles.ts +26 -0
- package/src/components/select/components/styled-select/styled-select.component.tsx +25 -0
- package/src/components/select/components/styled-select/styled-select.styles.ts +42 -0
- package/src/components/select/select.component.tsx +9 -14
- package/src/components/select/select.styles.ts +18 -15
- package/src/components/select/select.types.ts +6 -0
- package/src/components/table/table.styles.ts +1 -1
- package/src/components/tabs/components/tabs-tab/tabs-tab.styles.ts +1 -1
- package/src/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.ts +1 -1
- package/src/components/tooltip/components/tooltip-content/tooltip-content.component.tsx +12 -0
- package/src/components/tooltip/components/tooltip-content/tooltip-content.styles.ts +5 -0
- package/src/components/tooltip/components/tooltip-content/tooltip-content.types.ts +6 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.component.tsx +61 -0
- package/src/components/tooltip/tooltip.styles.ts +3 -0
- package/src/components/tooltip/tooltip.types.ts +8 -0
- package/src/components/well/well.styles.ts +1 -1
|
@@ -16,22 +16,67 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
16
16
|
true: string;
|
|
17
17
|
};
|
|
18
18
|
width: {
|
|
19
|
-
auto:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
auto: {
|
|
20
|
+
base: string;
|
|
21
|
+
tooltip: string;
|
|
22
|
+
};
|
|
23
|
+
full: {
|
|
24
|
+
base: string;
|
|
25
|
+
tooltip: string;
|
|
26
|
+
};
|
|
27
|
+
1: {
|
|
28
|
+
base: string;
|
|
29
|
+
tooltip: string;
|
|
30
|
+
};
|
|
31
|
+
2: {
|
|
32
|
+
base: string;
|
|
33
|
+
tooltip: string;
|
|
34
|
+
};
|
|
35
|
+
3: {
|
|
36
|
+
base: string;
|
|
37
|
+
tooltip: string;
|
|
38
|
+
};
|
|
39
|
+
4: {
|
|
40
|
+
base: string;
|
|
41
|
+
tooltip: string;
|
|
42
|
+
};
|
|
43
|
+
5: {
|
|
44
|
+
base: string;
|
|
45
|
+
tooltip: string;
|
|
46
|
+
};
|
|
47
|
+
6: {
|
|
48
|
+
base: string;
|
|
49
|
+
tooltip: string;
|
|
50
|
+
};
|
|
51
|
+
7: {
|
|
52
|
+
base: string;
|
|
53
|
+
tooltip: string;
|
|
54
|
+
};
|
|
55
|
+
8: {
|
|
56
|
+
base: string;
|
|
57
|
+
tooltip: string;
|
|
58
|
+
};
|
|
59
|
+
9: {
|
|
60
|
+
base: string;
|
|
61
|
+
tooltip: string;
|
|
62
|
+
};
|
|
63
|
+
10: {
|
|
64
|
+
base: string;
|
|
65
|
+
tooltip: string;
|
|
66
|
+
};
|
|
67
|
+
20: {
|
|
68
|
+
base: string;
|
|
69
|
+
tooltip: string;
|
|
70
|
+
};
|
|
71
|
+
30: {
|
|
72
|
+
base: string;
|
|
73
|
+
tooltip: string;
|
|
74
|
+
};
|
|
33
75
|
};
|
|
34
|
-
},
|
|
76
|
+
}, {
|
|
77
|
+
base: string;
|
|
78
|
+
tooltip: string;
|
|
79
|
+
}, undefined, {
|
|
35
80
|
responsiveVariants: string[];
|
|
36
81
|
}, {
|
|
37
82
|
size: {
|
|
@@ -51,22 +96,67 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
51
96
|
true: string;
|
|
52
97
|
};
|
|
53
98
|
width: {
|
|
54
|
-
auto:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
99
|
+
auto: {
|
|
100
|
+
base: string;
|
|
101
|
+
tooltip: string;
|
|
102
|
+
};
|
|
103
|
+
full: {
|
|
104
|
+
base: string;
|
|
105
|
+
tooltip: string;
|
|
106
|
+
};
|
|
107
|
+
1: {
|
|
108
|
+
base: string;
|
|
109
|
+
tooltip: string;
|
|
110
|
+
};
|
|
111
|
+
2: {
|
|
112
|
+
base: string;
|
|
113
|
+
tooltip: string;
|
|
114
|
+
};
|
|
115
|
+
3: {
|
|
116
|
+
base: string;
|
|
117
|
+
tooltip: string;
|
|
118
|
+
};
|
|
119
|
+
4: {
|
|
120
|
+
base: string;
|
|
121
|
+
tooltip: string;
|
|
122
|
+
};
|
|
123
|
+
5: {
|
|
124
|
+
base: string;
|
|
125
|
+
tooltip: string;
|
|
126
|
+
};
|
|
127
|
+
6: {
|
|
128
|
+
base: string;
|
|
129
|
+
tooltip: string;
|
|
130
|
+
};
|
|
131
|
+
7: {
|
|
132
|
+
base: string;
|
|
133
|
+
tooltip: string;
|
|
134
|
+
};
|
|
135
|
+
8: {
|
|
136
|
+
base: string;
|
|
137
|
+
tooltip: string;
|
|
138
|
+
};
|
|
139
|
+
9: {
|
|
140
|
+
base: string;
|
|
141
|
+
tooltip: string;
|
|
142
|
+
};
|
|
143
|
+
10: {
|
|
144
|
+
base: string;
|
|
145
|
+
tooltip: string;
|
|
146
|
+
};
|
|
147
|
+
20: {
|
|
148
|
+
base: string;
|
|
149
|
+
tooltip: string;
|
|
150
|
+
};
|
|
151
|
+
30: {
|
|
152
|
+
base: string;
|
|
153
|
+
tooltip: string;
|
|
154
|
+
};
|
|
68
155
|
};
|
|
69
|
-
},
|
|
156
|
+
}, {
|
|
157
|
+
base: string;
|
|
158
|
+
tooltip: string;
|
|
159
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
70
160
|
size: {
|
|
71
161
|
small: string;
|
|
72
162
|
medium: string;
|
|
@@ -84,21 +174,66 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
84
174
|
true: string;
|
|
85
175
|
};
|
|
86
176
|
width: {
|
|
87
|
-
auto:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
177
|
+
auto: {
|
|
178
|
+
base: string;
|
|
179
|
+
tooltip: string;
|
|
180
|
+
};
|
|
181
|
+
full: {
|
|
182
|
+
base: string;
|
|
183
|
+
tooltip: string;
|
|
184
|
+
};
|
|
185
|
+
1: {
|
|
186
|
+
base: string;
|
|
187
|
+
tooltip: string;
|
|
188
|
+
};
|
|
189
|
+
2: {
|
|
190
|
+
base: string;
|
|
191
|
+
tooltip: string;
|
|
192
|
+
};
|
|
193
|
+
3: {
|
|
194
|
+
base: string;
|
|
195
|
+
tooltip: string;
|
|
196
|
+
};
|
|
197
|
+
4: {
|
|
198
|
+
base: string;
|
|
199
|
+
tooltip: string;
|
|
200
|
+
};
|
|
201
|
+
5: {
|
|
202
|
+
base: string;
|
|
203
|
+
tooltip: string;
|
|
204
|
+
};
|
|
205
|
+
6: {
|
|
206
|
+
base: string;
|
|
207
|
+
tooltip: string;
|
|
208
|
+
};
|
|
209
|
+
7: {
|
|
210
|
+
base: string;
|
|
211
|
+
tooltip: string;
|
|
212
|
+
};
|
|
213
|
+
8: {
|
|
214
|
+
base: string;
|
|
215
|
+
tooltip: string;
|
|
216
|
+
};
|
|
217
|
+
9: {
|
|
218
|
+
base: string;
|
|
219
|
+
tooltip: string;
|
|
220
|
+
};
|
|
221
|
+
10: {
|
|
222
|
+
base: string;
|
|
223
|
+
tooltip: string;
|
|
224
|
+
};
|
|
225
|
+
20: {
|
|
226
|
+
base: string;
|
|
227
|
+
tooltip: string;
|
|
228
|
+
};
|
|
229
|
+
30: {
|
|
230
|
+
base: string;
|
|
231
|
+
tooltip: string;
|
|
232
|
+
};
|
|
101
233
|
};
|
|
102
|
-
},
|
|
234
|
+
}, {
|
|
235
|
+
base: string;
|
|
236
|
+
tooltip: string;
|
|
237
|
+
}, undefined, {
|
|
103
238
|
responsiveVariants: string[];
|
|
104
239
|
}, unknown, unknown, undefined>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'form-control overflow-hidden overflow-ellipsis whitespace-nowrap bg-no-repeat select-caret disabled:form-control-disabled group-first/add-on-before:!rounded-l group-first/add-on-before:rounded-r-none group-first/add-on-before:!border-x group-last/add-on-after:!rounded-r group-last/add-on-after:rounded-l-none group-last/add-on-after:!border-x group-[.input-group-after]:rounded-r-none group-[.input-group-before]:rounded-l-none group-[.input-group-after]:border-r-0 group-[.input-group-before]:border-l-0',
|
|
5
|
+
tooltip: ''
|
|
6
|
+
},
|
|
4
7
|
variants: {
|
|
5
8
|
size: {
|
|
6
9
|
small: 'form-control-small bg-[right_0.5625rem_center] pr-[calc(0.5rem+14px+0.5625rem)]',
|
|
@@ -19,20 +22,62 @@ export const styles = tv({
|
|
|
19
22
|
true: 'outline-none'
|
|
20
23
|
},
|
|
21
24
|
width: {
|
|
22
|
-
auto:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
auto: {
|
|
26
|
+
base: 'flex-1',
|
|
27
|
+
tooltip: 'flex-1'
|
|
28
|
+
},
|
|
29
|
+
full: {
|
|
30
|
+
base: 'w-full flex-1',
|
|
31
|
+
tooltip: 'w-full flex-1'
|
|
32
|
+
},
|
|
33
|
+
1: {
|
|
34
|
+
base: 'box-content w-[1.81ex]',
|
|
35
|
+
tooltip: 'w-[1.81ex]'
|
|
36
|
+
},
|
|
37
|
+
2: {
|
|
38
|
+
base: 'box-content w-[3.62ex]',
|
|
39
|
+
tooltip: 'w-[3.62ex]'
|
|
40
|
+
},
|
|
41
|
+
3: {
|
|
42
|
+
base: 'box-content w-[5.43ex]',
|
|
43
|
+
tooltip: 'w-[5.43ex]'
|
|
44
|
+
},
|
|
45
|
+
4: {
|
|
46
|
+
base: 'box-content w-[7.24ex]',
|
|
47
|
+
tooltip: 'w-[7.24ex]'
|
|
48
|
+
},
|
|
49
|
+
5: {
|
|
50
|
+
base: 'box-content w-[9.05ex]',
|
|
51
|
+
tooltip: 'w-[9.05ex]'
|
|
52
|
+
},
|
|
53
|
+
6: {
|
|
54
|
+
base: 'box-content w-[10.86ex]',
|
|
55
|
+
tooltip: 'w-[10.86ex]'
|
|
56
|
+
},
|
|
57
|
+
7: {
|
|
58
|
+
base: 'box-content w-[12.67ex]',
|
|
59
|
+
tooltip: 'w-[12.67ex]'
|
|
60
|
+
},
|
|
61
|
+
8: {
|
|
62
|
+
base: 'box-content w-[14.48ex]',
|
|
63
|
+
tooltip: 'w-[14.48ex]'
|
|
64
|
+
},
|
|
65
|
+
9: {
|
|
66
|
+
base: 'box-content w-[16.29ex]',
|
|
67
|
+
tooltip: 'w-[16.29ex]'
|
|
68
|
+
},
|
|
69
|
+
10: {
|
|
70
|
+
base: 'box-content w-[18.1ex]',
|
|
71
|
+
tooltip: 'w-[18.1ex]'
|
|
72
|
+
},
|
|
73
|
+
20: {
|
|
74
|
+
base: 'box-content w-[36.2ex]',
|
|
75
|
+
tooltip: 'w-[36.2ex]'
|
|
76
|
+
},
|
|
77
|
+
30: {
|
|
78
|
+
base: 'box-content w-[54.3ex]',
|
|
79
|
+
tooltip: 'w-[54.3ex]'
|
|
80
|
+
}
|
|
36
81
|
}
|
|
37
82
|
}
|
|
38
83
|
}, {
|
|
@@ -3,6 +3,12 @@ import { type VariantProps } from 'tailwind-variants';
|
|
|
3
3
|
import { styles } from './select.styles.js';
|
|
4
4
|
type Variants = VariantProps<typeof styles>;
|
|
5
5
|
export type SelectProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to set the title for the select to the currently selected option for use with truncation.
|
|
8
|
+
* Optional for accessibility reasons as it should only be enabled when required. Will not be read by screen readers.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
enableTooltip?: boolean;
|
|
6
12
|
/**
|
|
7
13
|
* Whether select is invalid
|
|
8
14
|
* @default false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'mb-4 w-full',
|
|
4
|
+
base: 'mb-4 w-full [&_:focus-visible]:focus-outline',
|
|
5
5
|
wrapper: 'max-xsl:mb-3 max-xsl:w-full max-xsl:overflow-x-auto max-xsl:overflow-y-hidden'
|
|
6
6
|
},
|
|
7
7
|
variants: {}
|
|
@@ -6,7 +6,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
isFocused: {
|
|
7
7
|
true: string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "flex-1 bg-white p-4", {
|
|
9
|
+
}, undefined, "flex-1 bg-white p-4 [&_:focus-visible]:focus-outline", {
|
|
10
10
|
responsiveVariants: string[];
|
|
11
11
|
}, {
|
|
12
12
|
look: {
|
|
@@ -24,6 +24,6 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
24
24
|
isFocused: {
|
|
25
25
|
true: string;
|
|
26
26
|
};
|
|
27
|
-
}, undefined, "flex-1 bg-white p-4", {
|
|
27
|
+
}, undefined, "flex-1 bg-white p-4 [&_:focus-visible]:focus-outline", {
|
|
28
28
|
responsiveVariants: string[];
|
|
29
29
|
}, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "absolute left-1 top-full z-10 mt-2 whitespace-nowrap rounded-sm border border-border bg-background p-0.5 text-text", TVConfig<V, EV>, {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "absolute left-1 top-full z-10 mt-2 whitespace-nowrap rounded-sm border border-border bg-background p-0.5 text-text", TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip.component.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip.component.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
3
|
+
import { mergeProps, useHover, useFocusRing } from 'react-aria';
|
|
4
|
+
import { TooltipContent } from './components/tooltip-content/tooltip-content.component.js';
|
|
5
|
+
import { styles } from './tooltip.styles.js';
|
|
6
|
+
export function Tooltip({ children, tooltip, id, className }) {
|
|
7
|
+
const localId = useId();
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const tooltipWaitTime = useRef(null);
|
|
10
|
+
const handleKeyDown = (e)=>{
|
|
11
|
+
if (e.key === 'Escape' && isOpen) {
|
|
12
|
+
setIsOpen(false);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const { hoverProps, isHovered } = useHover({});
|
|
16
|
+
const { isFocusVisible, focusProps } = useFocusRing({
|
|
17
|
+
within: true
|
|
18
|
+
});
|
|
19
|
+
const startTimer = useCallback(()=>{
|
|
20
|
+
tooltipWaitTime.current = setTimeout(()=>{
|
|
21
|
+
setIsOpen(true);
|
|
22
|
+
}, 1000);
|
|
23
|
+
}, []);
|
|
24
|
+
const stopTimer = useCallback(()=>{
|
|
25
|
+
if (tooltipWaitTime.current) {
|
|
26
|
+
clearTimeout(tooltipWaitTime.current);
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
useEffect(()=>{
|
|
30
|
+
setIsOpen(isFocusVisible);
|
|
31
|
+
}, [
|
|
32
|
+
isFocusVisible
|
|
33
|
+
]);
|
|
34
|
+
useEffect(()=>{
|
|
35
|
+
if (isHovered && !isOpen) startTimer();
|
|
36
|
+
if (!isHovered) setIsOpen(false);
|
|
37
|
+
return ()=>stopTimer();
|
|
38
|
+
}, [
|
|
39
|
+
isHovered
|
|
40
|
+
]);
|
|
41
|
+
useEffect(()=>{
|
|
42
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
43
|
+
return ()=>window.removeEventListener('keydown', handleKeyDown);
|
|
44
|
+
}, [
|
|
45
|
+
isOpen
|
|
46
|
+
]);
|
|
47
|
+
return React.createElement("span", {
|
|
48
|
+
...mergeProps(hoverProps, focusProps),
|
|
49
|
+
className: styles({
|
|
50
|
+
className
|
|
51
|
+
})
|
|
52
|
+
}, children, isOpen && React.createElement(TooltipContent, {
|
|
53
|
+
id: id !== null && id !== void 0 ? id : localId
|
|
54
|
+
}, tooltip));
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "relative", TVConfig<V, EV>, {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "relative", TVConfig<V, EV>, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -3,7 +3,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
3
3
|
light: string;
|
|
4
4
|
white: string;
|
|
5
5
|
};
|
|
6
|
-
}, undefined, "rounded border border-border p-2 sm:p-4", {
|
|
6
|
+
}, undefined, "rounded border border-border p-2 sm:p-4 [&_:focus-visible]:focus-outline", {
|
|
7
7
|
responsiveVariants: string[];
|
|
8
8
|
}, {
|
|
9
9
|
color: {
|
|
@@ -15,6 +15,6 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
15
15
|
light: string;
|
|
16
16
|
white: string;
|
|
17
17
|
};
|
|
18
|
-
}, undefined, "rounded border border-border p-2 sm:p-4", {
|
|
18
|
+
}, undefined, "rounded border border-border p-2 sm:p-4 [&_:focus-visible]:focus-outline", {
|
|
19
19
|
responsiveVariants: string[];
|
|
20
20
|
}, unknown, unknown, undefined>>;
|