tharaday 0.8.2 → 0.8.3
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/dist/{src/components → components}/Accordion/Accordion.d.ts +0 -1
- package/dist/{src/components → components}/Avatar/Avatar.d.ts +0 -1
- package/dist/{src/components → components}/Badge/Badge.d.ts +0 -1
- package/dist/{src/components → components}/Box/Box.d.ts +0 -1
- package/dist/{src/components → components}/Box/Box.types.d.ts +11 -11
- package/dist/{src/components → components}/Box/helpers/getSpacingStyles.d.ts +2 -2
- package/dist/{src/components → components}/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/{src/components → components}/Button/Button.d.ts +0 -1
- package/dist/{src/components → components}/Card/Card.d.ts +0 -1
- package/dist/{src/components → components}/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/{src/components → components}/Divider/Divider.d.ts +0 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/{src/components → components}/Dropdown/Dropdown.d.ts +0 -1
- package/dist/components/EmptyState/EmptyState.d.ts +1 -0
- package/dist/{src/components → components}/Header/Header.d.ts +0 -1
- package/dist/{src/components → components}/Input/Input.d.ts +0 -1
- package/dist/{src/components → components}/List/List.d.ts +2 -2
- package/dist/{src/components → components}/List/List.types.d.ts +3 -3
- package/dist/{src/components → components}/List/ListItem.d.ts +1 -1
- package/dist/{src/components → components}/List/ListItem.types.d.ts +1 -1
- package/dist/{src/components → components}/Loader/Loader.d.ts +0 -1
- package/dist/{src/components → components}/Modal/Modal.d.ts +1 -2
- package/dist/{src/components → components}/NavBar/NavBar.d.ts +0 -1
- package/dist/{src/components → components}/Notification/Notification.d.ts +0 -1
- package/dist/{src/components → components}/Pagination/Pagination.d.ts +0 -1
- package/dist/components/Popover/Popover.d.ts +1 -0
- package/dist/{src/components → components}/ProgressBar/ProgressBar.d.ts +0 -1
- package/dist/{src/components → components}/RadioButton/RadioButton.d.ts +0 -1
- package/dist/{src/components → components}/Select/Select.d.ts +0 -1
- package/dist/{src/components → components}/Skeleton/Skeleton.d.ts +0 -1
- package/dist/{src/components → components}/Slider/Slider.d.ts +0 -1
- package/dist/{src/components → components}/Stepper/Step.d.ts +0 -1
- package/dist/{src/components → components}/Stepper/Stepper.d.ts +0 -1
- package/dist/{src/components → components}/Stepper/stepper.utils.d.ts +2 -2
- package/dist/{src/components → components}/Switch/Switch.d.ts +0 -1
- package/dist/{src/components → components}/Table/Table.d.ts +0 -1
- package/dist/{src/components → components}/Tabs/Tabs.d.ts +0 -1
- package/dist/components/Tag/Tag.d.ts +1 -0
- package/dist/{src/components → components}/Text/Text.d.ts +0 -1
- package/dist/{src/components → components}/Textarea/Textarea.d.ts +0 -1
- package/dist/{src/components → components}/Tooltip/Tooltip.d.ts +0 -1
- package/dist/{src/components → components}/Tree/Tree.d.ts +2 -2
- package/dist/{src/components → components}/Tree/Tree.types.d.ts +1 -1
- package/dist/{src/components → components}/Tree/TreeItem.d.ts +1 -1
- package/dist/{src/components → components}/Tree/TreeItem.types.d.ts +1 -1
- package/dist/ds.css +1 -1
- package/dist/ds.js +1294 -1149
- package/dist/ds.umd.cjs +1 -1
- package/dist/hooks/useClickOutside.d.ts +6 -0
- package/dist/{src/hooks → hooks}/useComponentId.d.ts +1 -1
- package/dist/hooks/useFocusTrap.d.ts +17 -0
- package/dist/{src/index.d.ts → index.d.ts} +10 -0
- package/dist/{src/layouts → layouts}/AppLayout/AppLayout.d.ts +0 -1
- package/dist/{src/layouts → layouts}/AuthLayout/AuthLayout.d.ts +0 -1
- package/dist/{src/layouts → layouts}/DashboardLayout/DashboardLayout.d.ts +0 -1
- package/dist/{src/layouts → layouts}/SettingsLayout/SettingsLayout.d.ts +0 -1
- package/package.json +11 -10
- package/src/components/Box/Box.module.css +0 -557
- package/src/components/Box/Box.test.tsx +4 -4
- package/src/components/Box/Box.tsx +8 -16
- package/src/components/Box/helpers/getSpacingStyles.ts +23 -17
- package/src/components/DatePicker/DatePicker.module.css +212 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +53 -0
- package/src/components/DatePicker/DatePicker.test.tsx +61 -0
- package/src/components/DatePicker/DatePicker.tsx +269 -0
- package/src/components/DatePicker/DatePicker.types.ts +11 -0
- package/src/components/Drawer/Drawer.module.css +126 -0
- package/src/components/Drawer/Drawer.stories.tsx +70 -0
- package/src/components/Drawer/Drawer.test.tsx +49 -0
- package/src/components/Drawer/Drawer.tsx +77 -0
- package/src/components/Drawer/Drawer.types.ts +17 -0
- package/src/components/EmptyState/EmptyState.module.css +73 -0
- package/src/components/EmptyState/EmptyState.stories.tsx +65 -0
- package/src/components/EmptyState/EmptyState.test.tsx +30 -0
- package/src/components/EmptyState/EmptyState.tsx +29 -0
- package/src/components/EmptyState/EmptyState.types.ts +12 -0
- package/src/components/Header/Header.test.tsx +5 -5
- package/src/components/Modal/Modal.tsx +2 -62
- package/src/components/Popover/Popover.module.css +52 -0
- package/src/components/Popover/Popover.stories.tsx +67 -0
- package/src/components/Popover/Popover.test.tsx +40 -0
- package/src/components/Popover/Popover.tsx +78 -0
- package/src/components/Popover/Popover.types.ts +13 -0
- package/src/components/Tag/Tag.module.css +115 -0
- package/src/components/Tag/Tag.stories.tsx +61 -0
- package/src/components/Tag/Tag.test.tsx +42 -0
- package/src/components/Tag/Tag.tsx +74 -0
- package/src/components/Tag/Tag.types.ts +15 -0
- package/src/components/Text/Text.module.css +0 -521
- package/src/components/Text/Text.test.tsx +4 -4
- package/src/components/Text/Text.tsx +0 -14
- package/src/components/Tooltip/Tooltip.module.css +1 -1
- package/src/components/Tooltip/Tooltip.test.tsx +5 -5
- package/src/components/Tooltip/Tooltip.tsx +2 -6
- package/src/hooks/useClickOutside.test.tsx +68 -0
- package/src/hooks/useClickOutside.ts +35 -0
- package/src/hooks/useFocusTrap.test.tsx +95 -0
- package/src/hooks/useFocusTrap.ts +88 -0
- package/src/index.ts +10 -0
- package/src/styles/themes.browser.test.ts +75 -0
- package/vite.config.ts +1 -1
- package/dist/src/components/Accordion/Accordion.stories.d.ts +0 -14
- package/dist/src/components/Accordion/Accordion.types.d.ts +0 -18
- package/dist/src/components/Avatar/Avatar.stories.d.ts +0 -14
- package/dist/src/components/Avatar/Avatar.types.d.ts +0 -10
- package/dist/src/components/Badge/Badge.stories.d.ts +0 -33
- package/dist/src/components/Badge/Badge.types.d.ts +0 -10
- package/dist/src/components/Box/Box.stories.d.ts +0 -38
- package/dist/src/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -13
- package/dist/src/components/Breadcrumbs/Breadcrumbs.types.d.ts +0 -11
- package/dist/src/components/Button/Button.stories.d.ts +0 -22
- package/dist/src/components/Button/Button.types.d.ts +0 -12
- package/dist/src/components/Card/Card.stories.d.ts +0 -27
- package/dist/src/components/Card/Card.types.d.ts +0 -16
- package/dist/src/components/Checkbox/Checkbox.stories.d.ts +0 -17
- package/dist/src/components/Checkbox/Checkbox.types.d.ts +0 -7
- package/dist/src/components/Divider/Divider.stories.d.ts +0 -15
- package/dist/src/components/Divider/Divider.types.d.ts +0 -10
- package/dist/src/components/Dropdown/Dropdown.stories.d.ts +0 -12
- package/dist/src/components/Dropdown/Dropdown.types.d.ts +0 -24
- package/dist/src/components/Header/Header.stories.d.ts +0 -20
- package/dist/src/components/Header/Header.types.d.ts +0 -16
- package/dist/src/components/Input/Input.stories.d.ts +0 -32
- package/dist/src/components/Input/Input.types.d.ts +0 -10
- package/dist/src/components/List/List.stories.d.ts +0 -25
- package/dist/src/components/Loader/Loader.stories.d.ts +0 -25
- package/dist/src/components/Loader/Loader.types.d.ts +0 -8
- package/dist/src/components/Modal/Modal.stories.d.ts +0 -28
- package/dist/src/components/Modal/Modal.types.d.ts +0 -12
- package/dist/src/components/NavBar/NavBar.stories.d.ts +0 -8
- package/dist/src/components/NavBar/NavBar.types.d.ts +0 -38
- package/dist/src/components/Notification/Notification.stories.d.ts +0 -26
- package/dist/src/components/Notification/Notification.types.d.ts +0 -9
- package/dist/src/components/Pagination/Pagination.stories.d.ts +0 -21
- package/dist/src/components/Pagination/Pagination.types.d.ts +0 -34
- package/dist/src/components/ProgressBar/ProgressBar.stories.d.ts +0 -32
- package/dist/src/components/ProgressBar/ProgressBar.types.d.ts +0 -12
- package/dist/src/components/RadioButton/RadioButton.stories.d.ts +0 -30
- package/dist/src/components/RadioButton/RadioButton.types.d.ts +0 -9
- package/dist/src/components/Select/Select.stories.d.ts +0 -32
- package/dist/src/components/Select/Select.types.d.ts +0 -23
- package/dist/src/components/Skeleton/Skeleton.stories.d.ts +0 -15
- package/dist/src/components/Skeleton/Skeleton.types.d.ts +0 -9
- package/dist/src/components/Slider/Slider.stories.d.ts +0 -23
- package/dist/src/components/Slider/Slider.types.d.ts +0 -15
- package/dist/src/components/Stepper/Step.types.d.ts +0 -18
- package/dist/src/components/Stepper/Stepper.stories.d.ts +0 -15
- package/dist/src/components/Stepper/Stepper.types.d.ts +0 -14
- package/dist/src/components/Switch/Switch.stories.d.ts +0 -16
- package/dist/src/components/Switch/Switch.types.d.ts +0 -6
- package/dist/src/components/Table/Table.stories.d.ts +0 -27
- package/dist/src/components/Table/Table.types.d.ts +0 -19
- package/dist/src/components/Tabs/Tabs.stories.d.ts +0 -19
- package/dist/src/components/Tabs/Tabs.types.d.ts +0 -16
- package/dist/src/components/Text/Text.stories.d.ts +0 -78
- package/dist/src/components/Text/Text.types.d.ts +0 -52
- package/dist/src/components/Textarea/Textarea.stories.d.ts +0 -32
- package/dist/src/components/Textarea/Textarea.types.d.ts +0 -11
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +0 -10
- package/dist/src/components/Tooltip/Tooltip.types.d.ts +0 -12
- package/dist/src/components/Tree/Tree.stories.d.ts +0 -27
- package/dist/src/layouts/AppLayout/AppLayout.stories.d.ts +0 -13
- package/dist/src/layouts/AppLayout/AppLayout.types.d.ts +0 -13
- package/dist/src/layouts/AuthLayout/AuthLayout.stories.d.ts +0 -12
- package/dist/src/layouts/AuthLayout/AuthLayout.types.d.ts +0 -8
- package/dist/src/layouts/DashboardLayout/DashboardLayout.stories.d.ts +0 -11
- package/dist/src/layouts/DashboardLayout/DashboardLayout.types.d.ts +0 -10
- package/dist/src/layouts/SettingsLayout/SettingsLayout.stories.d.ts +0 -11
- package/dist/src/layouts/SettingsLayout/SettingsLayout.types.d.ts +0 -9
|
@@ -121,524 +121,3 @@
|
|
|
121
121
|
text-overflow: ellipsis;
|
|
122
122
|
width: 100%;
|
|
123
123
|
}
|
|
124
|
-
/* Padding */
|
|
125
|
-
.p-0 {
|
|
126
|
-
padding: 0;
|
|
127
|
-
}
|
|
128
|
-
.p-1 {
|
|
129
|
-
padding: var(--ds-space-1);
|
|
130
|
-
}
|
|
131
|
-
.p-2 {
|
|
132
|
-
padding: var(--ds-space-2);
|
|
133
|
-
}
|
|
134
|
-
.p-3 {
|
|
135
|
-
padding: var(--ds-space-3);
|
|
136
|
-
}
|
|
137
|
-
.p-4 {
|
|
138
|
-
padding: var(--ds-space-4);
|
|
139
|
-
}
|
|
140
|
-
.p-5 {
|
|
141
|
-
padding: var(--ds-space-5);
|
|
142
|
-
}
|
|
143
|
-
.p-6 {
|
|
144
|
-
padding: var(--ds-space-6);
|
|
145
|
-
}
|
|
146
|
-
.p-8 {
|
|
147
|
-
padding: var(--ds-space-8);
|
|
148
|
-
}
|
|
149
|
-
.p-10 {
|
|
150
|
-
padding: var(--ds-space-10);
|
|
151
|
-
}
|
|
152
|
-
.p-12 {
|
|
153
|
-
padding: var(--ds-space-12);
|
|
154
|
-
}
|
|
155
|
-
.p-14 {
|
|
156
|
-
padding: var(--ds-space-14);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.px-0 {
|
|
160
|
-
padding-left: 0;
|
|
161
|
-
padding-right: 0;
|
|
162
|
-
}
|
|
163
|
-
.px-1 {
|
|
164
|
-
padding-left: var(--ds-space-1);
|
|
165
|
-
padding-right: var(--ds-space-1);
|
|
166
|
-
}
|
|
167
|
-
.px-2 {
|
|
168
|
-
padding-left: var(--ds-space-2);
|
|
169
|
-
padding-right: var(--ds-space-2);
|
|
170
|
-
}
|
|
171
|
-
.px-3 {
|
|
172
|
-
padding-left: var(--ds-space-3);
|
|
173
|
-
padding-right: var(--ds-space-3);
|
|
174
|
-
}
|
|
175
|
-
.px-4 {
|
|
176
|
-
padding-left: var(--ds-space-4);
|
|
177
|
-
padding-right: var(--ds-space-4);
|
|
178
|
-
}
|
|
179
|
-
.px-5 {
|
|
180
|
-
padding-left: var(--ds-space-5);
|
|
181
|
-
padding-right: var(--ds-space-5);
|
|
182
|
-
}
|
|
183
|
-
.px-6 {
|
|
184
|
-
padding-left: var(--ds-space-6);
|
|
185
|
-
padding-right: var(--ds-space-6);
|
|
186
|
-
}
|
|
187
|
-
.px-8 {
|
|
188
|
-
padding-left: var(--ds-space-8);
|
|
189
|
-
padding-right: var(--ds-space-8);
|
|
190
|
-
}
|
|
191
|
-
.px-10 {
|
|
192
|
-
padding-left: var(--ds-space-10);
|
|
193
|
-
padding-right: var(--ds-space-10);
|
|
194
|
-
}
|
|
195
|
-
.px-12 {
|
|
196
|
-
padding-left: var(--ds-space-12);
|
|
197
|
-
padding-right: var(--ds-space-12);
|
|
198
|
-
}
|
|
199
|
-
.px-14 {
|
|
200
|
-
padding-left: var(--ds-space-14);
|
|
201
|
-
padding-right: var(--ds-space-14);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.py-0 {
|
|
205
|
-
padding-top: 0;
|
|
206
|
-
padding-bottom: 0;
|
|
207
|
-
}
|
|
208
|
-
.py-1 {
|
|
209
|
-
padding-top: var(--ds-space-1);
|
|
210
|
-
padding-bottom: var(--ds-space-1);
|
|
211
|
-
}
|
|
212
|
-
.py-2 {
|
|
213
|
-
padding-top: var(--ds-space-2);
|
|
214
|
-
padding-bottom: var(--ds-space-2);
|
|
215
|
-
}
|
|
216
|
-
.py-3 {
|
|
217
|
-
padding-top: var(--ds-space-3);
|
|
218
|
-
padding-bottom: var(--ds-space-3);
|
|
219
|
-
}
|
|
220
|
-
.py-4 {
|
|
221
|
-
padding-top: var(--ds-space-4);
|
|
222
|
-
padding-bottom: var(--ds-space-4);
|
|
223
|
-
}
|
|
224
|
-
.py-5 {
|
|
225
|
-
padding-top: var(--ds-space-5);
|
|
226
|
-
padding-bottom: var(--ds-space-5);
|
|
227
|
-
}
|
|
228
|
-
.py-6 {
|
|
229
|
-
padding-top: var(--ds-space-6);
|
|
230
|
-
padding-bottom: var(--ds-space-6);
|
|
231
|
-
}
|
|
232
|
-
.py-8 {
|
|
233
|
-
padding-top: var(--ds-space-8);
|
|
234
|
-
padding-bottom: var(--ds-space-8);
|
|
235
|
-
}
|
|
236
|
-
.py-10 {
|
|
237
|
-
padding-top: var(--ds-space-10);
|
|
238
|
-
padding-bottom: var(--ds-space-10);
|
|
239
|
-
}
|
|
240
|
-
.py-12 {
|
|
241
|
-
padding-top: var(--ds-space-12);
|
|
242
|
-
padding-bottom: var(--ds-space-12);
|
|
243
|
-
}
|
|
244
|
-
.py-14 {
|
|
245
|
-
padding-top: var(--ds-space-14);
|
|
246
|
-
padding-bottom: var(--ds-space-14);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.pt-0 {
|
|
250
|
-
padding-top: 0;
|
|
251
|
-
}
|
|
252
|
-
.pt-1 {
|
|
253
|
-
padding-top: var(--ds-space-1);
|
|
254
|
-
}
|
|
255
|
-
.pt-2 {
|
|
256
|
-
padding-top: var(--ds-space-2);
|
|
257
|
-
}
|
|
258
|
-
.pt-3 {
|
|
259
|
-
padding-top: var(--ds-space-3);
|
|
260
|
-
}
|
|
261
|
-
.pt-4 {
|
|
262
|
-
padding-top: var(--ds-space-4);
|
|
263
|
-
}
|
|
264
|
-
.pt-5 {
|
|
265
|
-
padding-top: var(--ds-space-5);
|
|
266
|
-
}
|
|
267
|
-
.pt-6 {
|
|
268
|
-
padding-top: var(--ds-space-6);
|
|
269
|
-
}
|
|
270
|
-
.pt-8 {
|
|
271
|
-
padding-top: var(--ds-space-8);
|
|
272
|
-
}
|
|
273
|
-
.pt-10 {
|
|
274
|
-
padding-top: var(--ds-space-10);
|
|
275
|
-
}
|
|
276
|
-
.pt-12 {
|
|
277
|
-
padding-top: var(--ds-space-12);
|
|
278
|
-
}
|
|
279
|
-
.pt-14 {
|
|
280
|
-
padding-top: var(--ds-space-14);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.pb-0 {
|
|
284
|
-
padding-bottom: 0;
|
|
285
|
-
}
|
|
286
|
-
.pb-1 {
|
|
287
|
-
padding-bottom: var(--ds-space-1);
|
|
288
|
-
}
|
|
289
|
-
.pb-2 {
|
|
290
|
-
padding-bottom: var(--ds-space-2);
|
|
291
|
-
}
|
|
292
|
-
.pb-3 {
|
|
293
|
-
padding-bottom: var(--ds-space-3);
|
|
294
|
-
}
|
|
295
|
-
.pb-4 {
|
|
296
|
-
padding-bottom: var(--ds-space-4);
|
|
297
|
-
}
|
|
298
|
-
.pb-5 {
|
|
299
|
-
padding-bottom: var(--ds-space-5);
|
|
300
|
-
}
|
|
301
|
-
.pb-6 {
|
|
302
|
-
padding-bottom: var(--ds-space-6);
|
|
303
|
-
}
|
|
304
|
-
.pb-8 {
|
|
305
|
-
padding-bottom: var(--ds-space-8);
|
|
306
|
-
}
|
|
307
|
-
.pb-10 {
|
|
308
|
-
padding-bottom: var(--ds-space-10);
|
|
309
|
-
}
|
|
310
|
-
.pb-12 {
|
|
311
|
-
padding-bottom: var(--ds-space-12);
|
|
312
|
-
}
|
|
313
|
-
.pb-14 {
|
|
314
|
-
padding-bottom: var(--ds-space-14);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.pl-0 {
|
|
318
|
-
padding-left: 0;
|
|
319
|
-
}
|
|
320
|
-
.pl-1 {
|
|
321
|
-
padding-left: var(--ds-space-1);
|
|
322
|
-
}
|
|
323
|
-
.pl-2 {
|
|
324
|
-
padding-left: var(--ds-space-2);
|
|
325
|
-
}
|
|
326
|
-
.pl-3 {
|
|
327
|
-
padding-left: var(--ds-space-3);
|
|
328
|
-
}
|
|
329
|
-
.pl-4 {
|
|
330
|
-
padding-left: var(--ds-space-4);
|
|
331
|
-
}
|
|
332
|
-
.pl-5 {
|
|
333
|
-
padding-left: var(--ds-space-5);
|
|
334
|
-
}
|
|
335
|
-
.pl-6 {
|
|
336
|
-
padding-left: var(--ds-space-6);
|
|
337
|
-
}
|
|
338
|
-
.pl-8 {
|
|
339
|
-
padding-left: var(--ds-space-8);
|
|
340
|
-
}
|
|
341
|
-
.pl-10 {
|
|
342
|
-
padding-left: var(--ds-space-10);
|
|
343
|
-
}
|
|
344
|
-
.pl-12 {
|
|
345
|
-
padding-left: var(--ds-space-12);
|
|
346
|
-
}
|
|
347
|
-
.pl-14 {
|
|
348
|
-
padding-left: var(--ds-space-14);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.pr-0 {
|
|
352
|
-
padding-right: 0;
|
|
353
|
-
}
|
|
354
|
-
.pr-1 {
|
|
355
|
-
padding-right: var(--ds-space-1);
|
|
356
|
-
}
|
|
357
|
-
.pr-2 {
|
|
358
|
-
padding-right: var(--ds-space-2);
|
|
359
|
-
}
|
|
360
|
-
.pr-3 {
|
|
361
|
-
padding-right: var(--ds-space-3);
|
|
362
|
-
}
|
|
363
|
-
.pr-4 {
|
|
364
|
-
padding-right: var(--ds-space-4);
|
|
365
|
-
}
|
|
366
|
-
.pr-5 {
|
|
367
|
-
padding-right: var(--ds-space-5);
|
|
368
|
-
}
|
|
369
|
-
.pr-6 {
|
|
370
|
-
padding-right: var(--ds-space-6);
|
|
371
|
-
}
|
|
372
|
-
.pr-8 {
|
|
373
|
-
padding-right: var(--ds-space-8);
|
|
374
|
-
}
|
|
375
|
-
.pr-10 {
|
|
376
|
-
padding-right: var(--ds-space-10);
|
|
377
|
-
}
|
|
378
|
-
.pr-12 {
|
|
379
|
-
padding-right: var(--ds-space-12);
|
|
380
|
-
}
|
|
381
|
-
.pr-14 {
|
|
382
|
-
padding-right: var(--ds-space-14);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
/* Margin */
|
|
386
|
-
.m-0 {
|
|
387
|
-
margin: 0;
|
|
388
|
-
}
|
|
389
|
-
.m-1 {
|
|
390
|
-
margin: var(--ds-space-1);
|
|
391
|
-
}
|
|
392
|
-
.m-2 {
|
|
393
|
-
margin: var(--ds-space-2);
|
|
394
|
-
}
|
|
395
|
-
.m-3 {
|
|
396
|
-
margin: var(--ds-space-3);
|
|
397
|
-
}
|
|
398
|
-
.m-4 {
|
|
399
|
-
margin: var(--ds-space-4);
|
|
400
|
-
}
|
|
401
|
-
.m-5 {
|
|
402
|
-
margin: var(--ds-space-5);
|
|
403
|
-
}
|
|
404
|
-
.m-6 {
|
|
405
|
-
margin: var(--ds-space-6);
|
|
406
|
-
}
|
|
407
|
-
.m-8 {
|
|
408
|
-
margin: var(--ds-space-8);
|
|
409
|
-
}
|
|
410
|
-
.m-10 {
|
|
411
|
-
margin: var(--ds-space-10);
|
|
412
|
-
}
|
|
413
|
-
.m-12 {
|
|
414
|
-
margin: var(--ds-space-12);
|
|
415
|
-
}
|
|
416
|
-
.m-14 {
|
|
417
|
-
margin: var(--ds-space-14);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.mx-0 {
|
|
421
|
-
margin-left: 0;
|
|
422
|
-
margin-right: 0;
|
|
423
|
-
}
|
|
424
|
-
.mx-1 {
|
|
425
|
-
margin-left: var(--ds-space-1);
|
|
426
|
-
margin-right: var(--ds-space-1);
|
|
427
|
-
}
|
|
428
|
-
.mx-2 {
|
|
429
|
-
margin-left: var(--ds-space-2);
|
|
430
|
-
margin-right: var(--ds-space-2);
|
|
431
|
-
}
|
|
432
|
-
.mx-3 {
|
|
433
|
-
margin-left: var(--ds-space-3);
|
|
434
|
-
margin-right: var(--ds-space-3);
|
|
435
|
-
}
|
|
436
|
-
.mx-4 {
|
|
437
|
-
margin-left: var(--ds-space-4);
|
|
438
|
-
margin-right: var(--ds-space-4);
|
|
439
|
-
}
|
|
440
|
-
.mx-5 {
|
|
441
|
-
margin-left: var(--ds-space-5);
|
|
442
|
-
margin-right: var(--ds-space-5);
|
|
443
|
-
}
|
|
444
|
-
.mx-6 {
|
|
445
|
-
margin-left: var(--ds-space-6);
|
|
446
|
-
margin-right: var(--ds-space-6);
|
|
447
|
-
}
|
|
448
|
-
.mx-8 {
|
|
449
|
-
margin-left: var(--ds-space-8);
|
|
450
|
-
margin-right: var(--ds-space-8);
|
|
451
|
-
}
|
|
452
|
-
.mx-10 {
|
|
453
|
-
margin-left: var(--ds-space-10);
|
|
454
|
-
margin-right: var(--ds-space-10);
|
|
455
|
-
}
|
|
456
|
-
.mx-12 {
|
|
457
|
-
margin-left: var(--ds-space-12);
|
|
458
|
-
margin-right: var(--ds-space-12);
|
|
459
|
-
}
|
|
460
|
-
.mx-14 {
|
|
461
|
-
margin-left: var(--ds-space-14);
|
|
462
|
-
margin-right: var(--ds-space-14);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.my-0 {
|
|
466
|
-
margin-top: 0;
|
|
467
|
-
margin-bottom: 0;
|
|
468
|
-
}
|
|
469
|
-
.my-1 {
|
|
470
|
-
margin-top: var(--ds-space-1);
|
|
471
|
-
margin-bottom: var(--ds-space-1);
|
|
472
|
-
}
|
|
473
|
-
.my-2 {
|
|
474
|
-
margin-top: var(--ds-space-2);
|
|
475
|
-
margin-bottom: var(--ds-space-2);
|
|
476
|
-
}
|
|
477
|
-
.my-3 {
|
|
478
|
-
margin-top: var(--ds-space-3);
|
|
479
|
-
margin-bottom: var(--ds-space-3);
|
|
480
|
-
}
|
|
481
|
-
.my-4 {
|
|
482
|
-
margin-top: var(--ds-space-4);
|
|
483
|
-
margin-bottom: var(--ds-space-4);
|
|
484
|
-
}
|
|
485
|
-
.my-5 {
|
|
486
|
-
margin-top: var(--ds-space-5);
|
|
487
|
-
margin-bottom: var(--ds-space-5);
|
|
488
|
-
}
|
|
489
|
-
.my-6 {
|
|
490
|
-
margin-top: var(--ds-space-6);
|
|
491
|
-
margin-bottom: var(--ds-space-6);
|
|
492
|
-
}
|
|
493
|
-
.my-8 {
|
|
494
|
-
margin-top: var(--ds-space-8);
|
|
495
|
-
margin-bottom: var(--ds-space-8);
|
|
496
|
-
}
|
|
497
|
-
.my-10 {
|
|
498
|
-
margin-top: var(--ds-space-10);
|
|
499
|
-
margin-bottom: var(--ds-space-10);
|
|
500
|
-
}
|
|
501
|
-
.my-12 {
|
|
502
|
-
margin-top: var(--ds-space-12);
|
|
503
|
-
margin-bottom: var(--ds-space-12);
|
|
504
|
-
}
|
|
505
|
-
.my-14 {
|
|
506
|
-
margin-top: var(--ds-space-14);
|
|
507
|
-
margin-bottom: var(--ds-space-14);
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.mt-0 {
|
|
511
|
-
margin-top: 0;
|
|
512
|
-
}
|
|
513
|
-
.mt-1 {
|
|
514
|
-
margin-top: var(--ds-space-1);
|
|
515
|
-
}
|
|
516
|
-
.mt-2 {
|
|
517
|
-
margin-top: var(--ds-space-2);
|
|
518
|
-
}
|
|
519
|
-
.mt-3 {
|
|
520
|
-
margin-top: var(--ds-space-3);
|
|
521
|
-
}
|
|
522
|
-
.mt-4 {
|
|
523
|
-
margin-top: var(--ds-space-4);
|
|
524
|
-
}
|
|
525
|
-
.mt-5 {
|
|
526
|
-
margin-top: var(--ds-space-5);
|
|
527
|
-
}
|
|
528
|
-
.mt-6 {
|
|
529
|
-
margin-top: var(--ds-space-6);
|
|
530
|
-
}
|
|
531
|
-
.mt-8 {
|
|
532
|
-
margin-top: var(--ds-space-8);
|
|
533
|
-
}
|
|
534
|
-
.mt-10 {
|
|
535
|
-
margin-top: var(--ds-space-10);
|
|
536
|
-
}
|
|
537
|
-
.mt-12 {
|
|
538
|
-
margin-top: var(--ds-space-12);
|
|
539
|
-
}
|
|
540
|
-
.mt-14 {
|
|
541
|
-
margin-top: var(--ds-space-14);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
.mb-0 {
|
|
545
|
-
margin-bottom: 0;
|
|
546
|
-
}
|
|
547
|
-
.mb-1 {
|
|
548
|
-
margin-bottom: var(--ds-space-1);
|
|
549
|
-
}
|
|
550
|
-
.mb-2 {
|
|
551
|
-
margin-bottom: var(--ds-space-2);
|
|
552
|
-
}
|
|
553
|
-
.mb-3 {
|
|
554
|
-
margin-bottom: var(--ds-space-3);
|
|
555
|
-
}
|
|
556
|
-
.mb-4 {
|
|
557
|
-
margin-bottom: var(--ds-space-4);
|
|
558
|
-
}
|
|
559
|
-
.mb-5 {
|
|
560
|
-
margin-bottom: var(--ds-space-5);
|
|
561
|
-
}
|
|
562
|
-
.mb-6 {
|
|
563
|
-
margin-bottom: var(--ds-space-6);
|
|
564
|
-
}
|
|
565
|
-
.mb-8 {
|
|
566
|
-
margin-bottom: var(--ds-space-8);
|
|
567
|
-
}
|
|
568
|
-
.mb-10 {
|
|
569
|
-
margin-bottom: var(--ds-space-10);
|
|
570
|
-
}
|
|
571
|
-
.mb-12 {
|
|
572
|
-
margin-bottom: var(--ds-space-12);
|
|
573
|
-
}
|
|
574
|
-
.mb-14 {
|
|
575
|
-
margin-bottom: var(--ds-space-14);
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
.ml-0 {
|
|
579
|
-
margin-left: 0;
|
|
580
|
-
}
|
|
581
|
-
.ml-1 {
|
|
582
|
-
margin-left: var(--ds-space-1);
|
|
583
|
-
}
|
|
584
|
-
.ml-2 {
|
|
585
|
-
margin-left: var(--ds-space-2);
|
|
586
|
-
}
|
|
587
|
-
.ml-3 {
|
|
588
|
-
margin-left: var(--ds-space-3);
|
|
589
|
-
}
|
|
590
|
-
.ml-4 {
|
|
591
|
-
margin-left: var(--ds-space-4);
|
|
592
|
-
}
|
|
593
|
-
.ml-5 {
|
|
594
|
-
margin-left: var(--ds-space-5);
|
|
595
|
-
}
|
|
596
|
-
.ml-6 {
|
|
597
|
-
margin-left: var(--ds-space-6);
|
|
598
|
-
}
|
|
599
|
-
.ml-8 {
|
|
600
|
-
margin-left: var(--ds-space-8);
|
|
601
|
-
}
|
|
602
|
-
.ml-10 {
|
|
603
|
-
margin-left: var(--ds-space-10);
|
|
604
|
-
}
|
|
605
|
-
.ml-12 {
|
|
606
|
-
margin-left: var(--ds-space-12);
|
|
607
|
-
}
|
|
608
|
-
.ml-14 {
|
|
609
|
-
margin-left: var(--ds-space-14);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.mr-0 {
|
|
613
|
-
margin-right: 0;
|
|
614
|
-
}
|
|
615
|
-
.mr-1 {
|
|
616
|
-
margin-right: var(--ds-space-1);
|
|
617
|
-
}
|
|
618
|
-
.mr-2 {
|
|
619
|
-
margin-right: var(--ds-space-2);
|
|
620
|
-
}
|
|
621
|
-
.mr-3 {
|
|
622
|
-
margin-right: var(--ds-space-3);
|
|
623
|
-
}
|
|
624
|
-
.mr-4 {
|
|
625
|
-
margin-right: var(--ds-space-4);
|
|
626
|
-
}
|
|
627
|
-
.mr-5 {
|
|
628
|
-
margin-right: var(--ds-space-5);
|
|
629
|
-
}
|
|
630
|
-
.mr-6 {
|
|
631
|
-
margin-right: var(--ds-space-6);
|
|
632
|
-
}
|
|
633
|
-
.mr-8 {
|
|
634
|
-
margin-right: var(--ds-space-8);
|
|
635
|
-
}
|
|
636
|
-
.mr-10 {
|
|
637
|
-
margin-right: var(--ds-space-10);
|
|
638
|
-
}
|
|
639
|
-
.mr-12 {
|
|
640
|
-
margin-right: var(--ds-space-12);
|
|
641
|
-
}
|
|
642
|
-
.mr-14 {
|
|
643
|
-
margin-right: var(--ds-space-14);
|
|
644
|
-
}
|
|
@@ -33,9 +33,9 @@ describe('Text', () => {
|
|
|
33
33
|
expect(container.querySelector('span')).toBeInTheDocument();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('applies numeric padding as
|
|
36
|
+
it('applies numeric padding as inline style', () => {
|
|
37
37
|
const { container } = render(<Text padding={4}>Text</Text>);
|
|
38
|
-
expect(container.firstChild).
|
|
38
|
+
expect((container.firstChild as HTMLElement).style.padding).toBe('var(--ds-space-4)');
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
it('applies string padding as inline style', () => {
|
|
@@ -43,9 +43,9 @@ describe('Text', () => {
|
|
|
43
43
|
expect((container.firstChild as HTMLElement).style.padding).toBe('1.5rem');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
it('applies numeric margin as
|
|
46
|
+
it('applies numeric margin as inline style', () => {
|
|
47
47
|
const { container } = render(<Text margin={2}>Text</Text>);
|
|
48
|
-
expect(container.firstChild).
|
|
48
|
+
expect((container.firstChild as HTMLElement).style.margin).toBe('var(--ds-space-2)');
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it('applies noWrap class when noWrap is true', () => {
|
|
@@ -80,20 +80,6 @@ export const Text = ({
|
|
|
80
80
|
weight && styles[weight],
|
|
81
81
|
color && styles[`color-${color}`],
|
|
82
82
|
noWrap && styles.noWrap,
|
|
83
|
-
typeof padding === 'number' && styles[`p-${padding}`],
|
|
84
|
-
typeof paddingX === 'number' && styles[`px-${paddingX}`],
|
|
85
|
-
typeof paddingY === 'number' && styles[`py-${paddingY}`],
|
|
86
|
-
typeof paddingTop === 'number' && styles[`pt-${paddingTop}`],
|
|
87
|
-
typeof paddingBottom === 'number' && styles[`pb-${paddingBottom}`],
|
|
88
|
-
typeof paddingLeft === 'number' && styles[`pl-${paddingLeft}`],
|
|
89
|
-
typeof paddingRight === 'number' && styles[`pr-${paddingRight}`],
|
|
90
|
-
typeof margin === 'number' && styles[`m-${margin}`],
|
|
91
|
-
typeof marginX === 'number' && styles[`mx-${marginX}`],
|
|
92
|
-
typeof marginY === 'number' && styles[`my-${marginY}`],
|
|
93
|
-
typeof marginTop === 'number' && styles[`mt-${marginTop}`],
|
|
94
|
-
typeof marginBottom === 'number' && styles[`mb-${marginBottom}`],
|
|
95
|
-
typeof marginLeft === 'number' && styles[`ml-${marginLeft}`],
|
|
96
|
-
typeof marginRight === 'number' && styles[`mr-${marginRight}`],
|
|
97
83
|
className
|
|
98
84
|
)}
|
|
99
85
|
style={spacingStyles}
|
|
@@ -42,9 +42,9 @@ describe('Tooltip', () => {
|
|
|
42
42
|
</Tooltip>
|
|
43
43
|
);
|
|
44
44
|
const tooltip = screen.getByRole('tooltip');
|
|
45
|
-
expect(tooltip).
|
|
45
|
+
expect(tooltip).toHaveAttribute('data-state', 'hidden');
|
|
46
46
|
await userEvent.hover(screen.getByRole('button'));
|
|
47
|
-
expect(tooltip).
|
|
47
|
+
expect(tooltip).toHaveAttribute('data-state', 'visible');
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it('hides tooltip on mouse leave', async () => {
|
|
@@ -56,7 +56,7 @@ describe('Tooltip', () => {
|
|
|
56
56
|
const trigger = screen.getByRole('button');
|
|
57
57
|
await userEvent.hover(trigger);
|
|
58
58
|
await userEvent.unhover(trigger);
|
|
59
|
-
expect(screen.getByRole('tooltip')).
|
|
59
|
+
expect(screen.getByRole('tooltip')).toHaveAttribute('data-state', 'hidden');
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
it('hides tooltip on Escape key', async () => {
|
|
@@ -66,8 +66,8 @@ describe('Tooltip', () => {
|
|
|
66
66
|
</Tooltip>
|
|
67
67
|
);
|
|
68
68
|
await userEvent.tab(); // focuses the button, onFocus shows the tooltip
|
|
69
|
-
expect(screen.getByRole('tooltip')).
|
|
69
|
+
expect(screen.getByRole('tooltip')).toHaveAttribute('data-state', 'visible');
|
|
70
70
|
await userEvent.keyboard('{Escape}');
|
|
71
|
-
expect(screen.getByRole('tooltip')).
|
|
71
|
+
expect(screen.getByRole('tooltip')).toHaveAttribute('data-state', 'hidden');
|
|
72
72
|
});
|
|
73
73
|
});
|
|
@@ -68,12 +68,8 @@ export const Tooltip = ({
|
|
|
68
68
|
>
|
|
69
69
|
<div className={styles.trigger}>{trigger}</div>
|
|
70
70
|
<div
|
|
71
|
-
className={classnames(
|
|
72
|
-
|
|
73
|
-
styles[position],
|
|
74
|
-
styles[variant],
|
|
75
|
-
isVisible && styles.visible
|
|
76
|
-
)}
|
|
71
|
+
className={classnames(styles.tooltip, styles[position], styles[variant])}
|
|
72
|
+
data-state={isVisible ? 'visible' : 'hidden'}
|
|
77
73
|
id={tooltipId}
|
|
78
74
|
role="tooltip"
|
|
79
75
|
>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
import { useClickOutside } from './useClickOutside.ts';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TestComponent = ({ onClose, enabled }: Props) => {
|
|
13
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
14
|
+
useClickOutside(ref, onClose, enabled);
|
|
15
|
+
return (
|
|
16
|
+
<div data-testid="container">
|
|
17
|
+
<div ref={ref} data-testid="inside">
|
|
18
|
+
Inside
|
|
19
|
+
</div>
|
|
20
|
+
<div data-testid="outside">Outside</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
describe('useClickOutside', () => {
|
|
26
|
+
it('calls onClose when clicking outside the ref element', async () => {
|
|
27
|
+
const onClose = vi.fn();
|
|
28
|
+
render(<TestComponent onClose={onClose} enabled />);
|
|
29
|
+
await userEvent.click(screen.getByTestId('outside'));
|
|
30
|
+
expect(onClose).toHaveBeenCalledOnce();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('does not call onClose when clicking inside the ref element', async () => {
|
|
34
|
+
const onClose = vi.fn();
|
|
35
|
+
render(<TestComponent onClose={onClose} enabled />);
|
|
36
|
+
await userEvent.click(screen.getByTestId('inside'));
|
|
37
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('calls onClose when Escape is pressed', async () => {
|
|
41
|
+
const onClose = vi.fn();
|
|
42
|
+
render(<TestComponent onClose={onClose} enabled />);
|
|
43
|
+
await userEvent.keyboard('{Escape}');
|
|
44
|
+
expect(onClose).toHaveBeenCalledOnce();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('does not call onClose on outside click when disabled', async () => {
|
|
48
|
+
const onClose = vi.fn();
|
|
49
|
+
render(<TestComponent onClose={onClose} enabled={false} />);
|
|
50
|
+
await userEvent.click(screen.getByTestId('outside'));
|
|
51
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('does not call onClose on Escape when disabled', async () => {
|
|
55
|
+
const onClose = vi.fn();
|
|
56
|
+
render(<TestComponent onClose={onClose} enabled={false} />);
|
|
57
|
+
await userEvent.keyboard('{Escape}');
|
|
58
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('stops calling onClose after enabled becomes false', async () => {
|
|
62
|
+
const onClose = vi.fn();
|
|
63
|
+
const { rerender } = render(<TestComponent onClose={onClose} enabled />);
|
|
64
|
+
rerender(<TestComponent onClose={onClose} enabled={false} />);
|
|
65
|
+
await userEvent.click(screen.getByTestId('outside'));
|
|
66
|
+
expect(onClose).not.toHaveBeenCalled();
|
|
67
|
+
});
|
|
68
|
+
});
|