@qasa/qds-ui 0.10.0-next.1 → 0.10.0-next.10

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 (58) hide show
  1. package/dist/cjs/index.js +1322 -1328
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/checkbox/checkbox.d.ts +70 -0
  4. package/dist/cjs/types/components/checkbox/index.d.ts +1 -0
  5. package/dist/cjs/types/components/display-text/display-text.d.ts +29 -0
  6. package/dist/cjs/types/components/display-text/index.d.ts +1 -0
  7. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
  8. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
  9. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
  10. package/dist/cjs/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
  11. package/dist/cjs/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
  12. package/dist/cjs/types/components/dropdown-menu/index.d.ts +1 -0
  13. package/dist/cjs/types/components/heading/heading.d.ts +1 -445
  14. package/dist/cjs/types/components/index.d.ts +4 -1
  15. package/dist/cjs/types/components/radio-group/radio-card.d.ts +5 -2
  16. package/dist/cjs/types/components/radio-group/radio-group-label.d.ts +2 -2
  17. package/dist/cjs/types/components/radio-group/radio-group.d.ts +1 -1
  18. package/dist/cjs/types/components/switch/index.d.ts +1 -0
  19. package/dist/cjs/types/components/switch/switch.d.ts +35 -0
  20. package/dist/cjs/types/components/toast/index.d.ts +1 -0
  21. package/dist/cjs/types/components/toast/toast-provider.d.ts +4 -0
  22. package/dist/cjs/types/components/toast/toast-store.d.ts +44 -0
  23. package/dist/cjs/types/components/toast/toast-styles.d.ts +410 -0
  24. package/dist/cjs/types/components/toast/toast.d.ts +13 -0
  25. package/dist/cjs/types/styles/common-styles.d.ts +1 -1
  26. package/dist/cjs/types/utils/html-attributes.d.ts +1 -0
  27. package/dist/esm/index.js +1323 -1328
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/types/components/checkbox/checkbox.d.ts +70 -0
  30. package/dist/esm/types/components/checkbox/index.d.ts +1 -0
  31. package/dist/esm/types/components/display-text/display-text.d.ts +29 -0
  32. package/dist/esm/types/components/display-text/index.d.ts +1 -0
  33. package/dist/esm/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
  34. package/dist/esm/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
  35. package/dist/esm/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
  36. package/dist/esm/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
  37. package/dist/esm/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
  38. package/dist/esm/types/components/dropdown-menu/index.d.ts +1 -0
  39. package/dist/esm/types/components/heading/heading.d.ts +1 -445
  40. package/dist/esm/types/components/index.d.ts +4 -1
  41. package/dist/esm/types/components/radio-group/radio-card.d.ts +5 -2
  42. package/dist/esm/types/components/radio-group/radio-group-label.d.ts +2 -2
  43. package/dist/esm/types/components/radio-group/radio-group.d.ts +1 -1
  44. package/dist/esm/types/components/switch/index.d.ts +1 -0
  45. package/dist/esm/types/components/switch/switch.d.ts +35 -0
  46. package/dist/esm/types/components/toast/index.d.ts +1 -0
  47. package/dist/esm/types/components/toast/toast-provider.d.ts +4 -0
  48. package/dist/esm/types/components/toast/toast-store.d.ts +44 -0
  49. package/dist/esm/types/components/toast/toast-styles.d.ts +410 -0
  50. package/dist/esm/types/components/toast/toast.d.ts +13 -0
  51. package/dist/esm/types/styles/common-styles.d.ts +1 -1
  52. package/dist/esm/types/utils/html-attributes.d.ts +1 -0
  53. package/dist/index.d.ts +323 -541
  54. package/package.json +11 -4
  55. package/dist/cjs/types/components/image/image.d.ts +0 -16
  56. package/dist/cjs/types/components/image/index.d.ts +0 -1
  57. package/dist/esm/types/components/image/image.d.ts +0 -16
  58. package/dist/esm/types/components/image/index.d.ts +0 -1
@@ -1,454 +1,10 @@
1
- import type { VariantProps } from '../../styles';
2
1
  import type * as Polymorphic from '../../utils/polymorphic';
3
2
  import type { Theme } from '../../theme';
4
- declare const getSizeStyles: (theme: {
5
- mediaQueries: {
6
- readonly smUp: "@media(min-width: 480px)";
7
- readonly mdUp: "@media(min-width: 768px)";
8
- readonly lgUp: "@media(min-width: 1024px)";
9
- readonly xlUp: "@media(min-width: 1280px)";
10
- readonly '2xlUp': "@media(min-width: 1536px)";
11
- };
12
- spacing: {
13
- '0x': string;
14
- '1x': string;
15
- '2x': string;
16
- '3x': string;
17
- '4x': string;
18
- '5x': string;
19
- '6x': string;
20
- '8x': string;
21
- '12x': string;
22
- '16x': string;
23
- '20x': string;
24
- '24x': string;
25
- };
26
- breakpoints: {
27
- readonly base: 0;
28
- readonly sm: 480;
29
- readonly md: 768;
30
- readonly lg: 1024;
31
- readonly xl: 1280;
32
- readonly '2xl': 1536;
33
- };
34
- zIndices: {
35
- hide: number;
36
- auto: string;
37
- base: number;
38
- docked: number;
39
- dropdown: number;
40
- sticky: number;
41
- banner: number;
42
- overlay: number;
43
- modal: number;
44
- popover: number;
45
- skipLink: number;
46
- toast: number;
47
- tooltip: number;
48
- };
49
- colors: {
50
- core: {
51
- black: string;
52
- white: string;
53
- gray90: string;
54
- gray80: string;
55
- gray70: string;
56
- gray60: string;
57
- gray50: string;
58
- gray40: string;
59
- gray30: string;
60
- gray20: string;
61
- gray10: string;
62
- uiPink: string;
63
- uiPinkDark: string;
64
- uiPinkLight: string;
65
- brown: string;
66
- brownDark: string;
67
- brownLight: string;
68
- offWhite: string;
69
- offWhiteDark: string;
70
- offWhiteLight: string;
71
- softPink: string;
72
- warmYellow: string;
73
- softYellow: string;
74
- red10: string;
75
- red20: string;
76
- red30: string;
77
- red40: string;
78
- red50: string;
79
- red60: string;
80
- red70: string;
81
- red80: string;
82
- red90: string;
83
- green90: string;
84
- green80: string;
85
- green70: string;
86
- green60: string;
87
- green50: string;
88
- green40: string;
89
- green30: string;
90
- green20: string;
91
- green10: string;
92
- blue90: string;
93
- blue80: string;
94
- blue70: string;
95
- blue60: string;
96
- blue50: string;
97
- blue40: string;
98
- blue30: string;
99
- blue20: string;
100
- blue10: string;
101
- yellow90: string;
102
- yellow80: string;
103
- yellow70: string;
104
- yellow60: string;
105
- yellow50: string;
106
- yellow40: string;
107
- yellow30: string;
108
- yellow20: string;
109
- yellow10: string;
110
- blackAlpha20: string;
111
- };
112
- bg: {
113
- default: string;
114
- brandPrimary: string;
115
- brandPrimaryHover: string;
116
- brandPrimaryActive: string;
117
- brandSecondary: string;
118
- brandSecondaryHover: string;
119
- brandSecondaryActive: string;
120
- brandTertiary: string;
121
- brandTertiaryHover: string;
122
- brandTertiaryActive: string;
123
- negative: string;
124
- warning: string;
125
- positive: string;
126
- inset: string;
127
- backdrop: string;
128
- };
129
- text: {
130
- strong: string;
131
- default: string;
132
- subtle: string;
133
- disabled: string;
134
- negative: string;
135
- warning: string;
136
- positive: string;
137
- onBrandPrimary: string;
138
- onBrandSecondary: string;
139
- onBrandTertiary: string;
140
- };
141
- icon: {
142
- default: string;
143
- strong: string;
144
- subtle: string;
145
- disabled: string;
146
- negative: string;
147
- warning: string;
148
- positive: string;
149
- onBrandPrimary: string;
150
- onBrandSecondary: string;
151
- onBrandTertiary: string;
152
- };
153
- border: {
154
- default: string;
155
- defaultHover: string;
156
- defaultSelected: string;
157
- strong: string;
158
- subtle: string;
159
- negative: string;
160
- warning: string;
161
- positive: string;
162
- };
163
- };
164
- sizes: {
165
- 112: string;
166
- 128: string;
167
- 144: string;
168
- 160: string;
169
- 176: string;
170
- 192: string;
171
- 224: string;
172
- 256: string;
173
- 288: string;
174
- 320: string;
175
- 384: string;
176
- 448: string;
177
- 512: string;
178
- 576: string;
179
- 672: string;
180
- 768: string;
181
- 896: string;
182
- 1024: string;
183
- '0x': string;
184
- '1x': string;
185
- '2x': string;
186
- '3x': string;
187
- '4x': string;
188
- '5x': string;
189
- '6x': string;
190
- '8x': string;
191
- '12x': string;
192
- '16x': string;
193
- '20x': string;
194
- '24x': string;
195
- };
196
- radii: {
197
- none: string;
198
- '2xs': string;
199
- xs: string;
200
- sm: string;
201
- md: string;
202
- lg: string;
203
- xl: string;
204
- full: string;
205
- };
206
- shadows: {
207
- none: string;
208
- sm: string;
209
- md: string;
210
- lg: string;
211
- xl: string;
212
- };
213
- typography: {
214
- display: {
215
- '3xl': {
216
- fontFamily: string;
217
- fontWeight: string;
218
- fontSize: string;
219
- lineHeight: string;
220
- letterSpacing: string;
221
- fontFeatureSettings: string;
222
- };
223
- '2xl': {
224
- fontFamily: string;
225
- fontWeight: string;
226
- fontSize: string;
227
- lineHeight: string;
228
- letterSpacing: string;
229
- fontFeatureSettings: string;
230
- };
231
- xl: {
232
- fontFamily: string;
233
- fontWeight: string;
234
- fontSize: string;
235
- lineHeight: string;
236
- letterSpacing: string;
237
- fontFeatureSettings: string;
238
- };
239
- lg: {
240
- fontFamily: string;
241
- fontWeight: string;
242
- fontSize: string;
243
- lineHeight: string;
244
- letterSpacing: string;
245
- fontFeatureSettings: string;
246
- };
247
- md: {
248
- fontFamily: string;
249
- fontWeight: string;
250
- fontSize: string;
251
- lineHeight: string;
252
- letterSpacing: string;
253
- fontFeatureSettings: string;
254
- };
255
- sm: {
256
- fontFamily: string;
257
- fontWeight: string;
258
- fontSize: string;
259
- lineHeight: string;
260
- letterSpacing: string;
261
- fontFeatureSettings: string;
262
- };
263
- xs: {
264
- fontFamily: string;
265
- fontWeight: string;
266
- fontSize: string;
267
- lineHeight: string;
268
- letterSpacing: string;
269
- fontFeatureSettings: string;
270
- };
271
- };
272
- title: {
273
- lg: {
274
- fontFamily: string;
275
- fontWeight: string;
276
- fontSize: string;
277
- lineHeight: string;
278
- letterSpacing: string;
279
- };
280
- md: {
281
- fontFamily: string;
282
- fontWeight: string;
283
- fontSize: string;
284
- lineHeight: string;
285
- letterSpacing: string;
286
- };
287
- sm: {
288
- fontFamily: string;
289
- fontWeight: string;
290
- fontSize: string;
291
- lineHeight: string;
292
- letterSpacing: string;
293
- };
294
- xs: {
295
- fontFamily: string;
296
- fontWeight: string;
297
- fontSize: string;
298
- lineHeight: string;
299
- letterSpacing: string;
300
- };
301
- '2xs': {
302
- fontFamily: string;
303
- fontWeight: string;
304
- fontSize: string;
305
- lineHeight: string;
306
- letterSpacing: string;
307
- };
308
- '3xs': {
309
- fontFamily: string;
310
- fontWeight: string;
311
- fontSize: string;
312
- lineHeight: string;
313
- letterSpacing: string;
314
- };
315
- };
316
- body: {
317
- xl: {
318
- fontFamily: string;
319
- fontWeight: string;
320
- fontSize: string;
321
- lineHeight: string;
322
- letterSpacing: string;
323
- };
324
- lg: {
325
- fontFamily: string;
326
- fontWeight: string;
327
- fontSize: string;
328
- lineHeight: string;
329
- letterSpacing: string;
330
- };
331
- md: {
332
- fontFamily: string;
333
- fontWeight: string;
334
- fontSize: string;
335
- lineHeight: string;
336
- letterSpacing: string;
337
- };
338
- sm: {
339
- fontFamily: string;
340
- fontWeight: string;
341
- fontSize: string;
342
- lineHeight: string;
343
- letterSpacing: string;
344
- };
345
- xs: {
346
- fontFamily: string;
347
- fontWeight: string;
348
- fontSize: string;
349
- lineHeight: string;
350
- letterSpacing: string;
351
- };
352
- };
353
- label: {
354
- md: {
355
- fontFamily: string;
356
- fontWeight: string;
357
- fontSize: string;
358
- lineHeight: string;
359
- letterSpacing: string;
360
- };
361
- sm: {
362
- fontFamily: string;
363
- fontWeight: string;
364
- fontSize: string;
365
- lineHeight: string;
366
- letterSpacing: string;
367
- };
368
- };
369
- button: {
370
- md: {
371
- fontFamily: string;
372
- fontWeight: string;
373
- fontSize: string;
374
- lineHeight: string;
375
- letterSpacing: string;
376
- };
377
- sm: {
378
- fontFamily: string;
379
- fontWeight: string;
380
- fontSize: string;
381
- lineHeight: string;
382
- letterSpacing: string;
383
- };
384
- };
385
- caption: {
386
- md: {
387
- fontFamily: string;
388
- fontWeight: string;
389
- fontSize: string;
390
- lineHeight: string;
391
- letterSpacing: string;
392
- };
393
- sm: {
394
- fontFamily: string;
395
- fontWeight: string;
396
- fontSize: string;
397
- lineHeight: string;
398
- letterSpacing: string;
399
- };
400
- };
401
- };
402
- }) => {
403
- lg: {
404
- fontFamily: string;
405
- fontWeight: string;
406
- fontSize: string;
407
- lineHeight: string;
408
- letterSpacing: string;
409
- };
410
- md: {
411
- fontFamily: string;
412
- fontWeight: string;
413
- fontSize: string;
414
- lineHeight: string;
415
- letterSpacing: string;
416
- };
417
- sm: {
418
- fontFamily: string;
419
- fontWeight: string;
420
- fontSize: string;
421
- lineHeight: string;
422
- letterSpacing: string;
423
- };
424
- xs: {
425
- fontFamily: string;
426
- fontWeight: string;
427
- fontSize: string;
428
- lineHeight: string;
429
- letterSpacing: string;
430
- };
431
- '2xs': {
432
- fontFamily: string;
433
- fontWeight: string;
434
- fontSize: string;
435
- lineHeight: string;
436
- letterSpacing: string;
437
- };
438
- '3xs': {
439
- fontFamily: string;
440
- fontWeight: string;
441
- fontSize: string;
442
- lineHeight: string;
443
- letterSpacing: string;
444
- };
445
- };
446
- declare type HeadingSize = VariantProps<typeof getSizeStyles>;
3
+ declare type HeadingSize = keyof Theme['typography']['title'];
447
4
  declare type HeadingColor = keyof Theme['colors']['text'];
448
5
  interface HeadingOptions {
449
6
  /**
450
7
  * Sets the visual size of the heading.
451
- * Also sets the HTML tag used for the heading.
452
8
  * To override the rendered tag, use the `as` prop.
453
9
  *
454
10
  * @default 'md'
@@ -1,11 +1,12 @@
1
1
  export * from './avatar';
2
2
  export * from './button';
3
+ export * from './checkbox';
3
4
  export * from './divider';
5
+ export * from './dropdown-menu';
4
6
  export * from './heading';
5
7
  export * from './hint-box';
6
8
  export * from './icon';
7
9
  export * from './icon-button';
8
- export * from './image';
9
10
  export * from './text-field';
10
11
  export * from './label';
11
12
  export * from './link';
@@ -16,4 +17,6 @@ export * from './radio-group';
16
17
  export * from './select';
17
18
  export * from './spacer';
18
19
  export * from './stack';
20
+ export * from './switch';
19
21
  export * from './textarea';
22
+ export * from './toast';
@@ -1,18 +1,21 @@
1
1
  /// <reference types="react" />
2
2
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
3
  interface RadioCardOptions {
4
+ /**
5
+ * The label for the radio card
6
+ */
4
7
  label: string;
5
8
  /**
6
9
  * Text that provides additional guidance to the user
7
10
  */
8
11
  helperText?: string;
9
12
  /**
10
- * If `true` the radio card will be required using the HTML `required` attribute.
13
+ * If `true` the user must check the radio item before the owning form can be submitted.
11
14
  * @default false
12
15
  */
13
16
  isRequired?: boolean;
14
17
  /**
15
- * If `true` the radio card will be disabled using the HTML `disabled` attribute.
18
+ * If `true` it prevents the user from interacting with the radio item.
16
19
  * @default false
17
20
  */
18
21
  isDisabled?: boolean;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { HTMLQdsProps } from '../../types';
3
- export declare type RadioGroupLabelProps = HTMLQdsProps<'label'>;
4
- export declare const RadioGroupLabel: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof import("react").LabelHTMLAttributes<HTMLLabelElement>> & import("react").RefAttributes<HTMLLabelElement>>;
3
+ export declare type RadioGroupLabelProps = HTMLQdsProps<'span'>;
4
+ export declare const RadioGroupLabel: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -45,6 +45,6 @@ export interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProp
45
45
  }
46
46
  export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>> & {
47
47
  Card: import("react").ForwardRefExoticComponent<RadioCardProps & import("react").RefAttributes<HTMLButtonElement>>;
48
- Label: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof import("react").LabelHTMLAttributes<HTMLLabelElement>> & import("react").RefAttributes<HTMLLabelElement>>;
48
+ Label: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & import("react").RefAttributes<HTMLSpanElement>>;
49
49
  };
50
50
  export type { RadioGroupLabelProps, RadioCardProps };
@@ -0,0 +1 @@
1
+ export * from './switch';
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import * as RadixSwitch from '@radix-ui/react-switch';
3
+ interface SwitchOptions {
4
+ /**
5
+ * The label for the switch
6
+ */
7
+ label: string;
8
+ /**
9
+ * The text that appears below the label
10
+ * to provide additional guidance to the user
11
+ */
12
+ helperText?: string;
13
+ /**
14
+ * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
15
+ */
16
+ isDefaultChecked?: boolean;
17
+ /**
18
+ * If `true`, the switch will be checked
19
+ */
20
+ isChecked?: boolean;
21
+ /**
22
+ * If `true`, the switch will be disabled and
23
+ * cannot be interacted with
24
+ */
25
+ isDisabled?: boolean;
26
+ /**
27
+ * If `true`, indicates that the switch is required
28
+ */
29
+ isRequired?: boolean;
30
+ onCheckedChange?: (isChecked: boolean) => void;
31
+ }
32
+ interface SwitchProps extends Omit<RadixSwitch.SwitchProps, 'asChild' | keyof SwitchOptions>, SwitchOptions {
33
+ }
34
+ export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
35
+ export {};
@@ -0,0 +1 @@
1
+ export { toast } from './toast-store';
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function ToastProvider({ children }: {
3
+ children: ReactNode;
4
+ }): JSX.Element;
@@ -0,0 +1,44 @@
1
+ import type { ToastVariant } from './toast-styles';
2
+ declare type Id = number | string;
3
+ interface Toast {
4
+ id: Id;
5
+ /**
6
+ * The text for the toast
7
+ */
8
+ text: string;
9
+ /**
10
+ * Sets the style variant of the toast, currently supports 'neutral' and 'negative'
11
+ * @default 'neutral'
12
+ */
13
+ variant?: ToastVariant;
14
+ }
15
+ interface ToastOptions {
16
+ /**
17
+ * Unique identifier for the toast (can be used for removing it prematurely). If a toast with this
18
+ * identifier already exists it will be removed before the new toast is added.
19
+ * @default a random unique id will be set and returned
20
+ */
21
+ id?: Id;
22
+ }
23
+ declare type Subscriber = () => void;
24
+ declare class ToastStore {
25
+ toasts: Toast[];
26
+ subscribers: Subscriber[];
27
+ id: number;
28
+ constructor();
29
+ subscribe: (subscriber: Subscriber) => () => void;
30
+ notify: () => void;
31
+ add: (toast: Omit<Toast, 'id'> & ToastOptions) => Id;
32
+ addNeutral: (text: string, options?: ToastOptions) => Id;
33
+ addError: (text: string, options?: ToastOptions) => Id;
34
+ remove: (id: Id) => void;
35
+ removeAll: () => void;
36
+ getSnapshot: () => Toast[];
37
+ }
38
+ export declare const toastStore: ToastStore;
39
+ export declare const toast: ((text: string, options?: ToastOptions) => Id) & {
40
+ error: (text: string, options?: ToastOptions) => Id;
41
+ remove: (id: Id) => void;
42
+ removeAll: () => void;
43
+ };
44
+ export {};