@qasa/qds-ui 0.10.0-next.3 → 0.10.0-next.5

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.
@@ -17,3 +17,4 @@ export * from './select';
17
17
  export * from './spacer';
18
18
  export * from './stack';
19
19
  export * from './textarea';
20
+ 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 { 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 {};
@@ -0,0 +1,410 @@
1
+ import type { VariantProps } from '../../styles';
2
+ export declare const getVariantStyles: (theme: {
3
+ mediaQueries: {
4
+ readonly smUp: "@media(min-width: 480px)";
5
+ readonly mdUp: "@media(min-width: 768px)";
6
+ readonly lgUp: "@media(min-width: 1024px)";
7
+ readonly xlUp: "@media(min-width: 1280px)";
8
+ readonly '2xlUp': "@media(min-width: 1536px)";
9
+ };
10
+ spacing: {
11
+ '0x': string;
12
+ '1x': string;
13
+ '2x': string;
14
+ '3x': string;
15
+ '4x': string;
16
+ '5x': string;
17
+ '6x': string;
18
+ '8x': string;
19
+ '12x': string;
20
+ '16x': string;
21
+ '20x': string;
22
+ '24x': string;
23
+ };
24
+ breakpoints: {
25
+ readonly base: 0;
26
+ readonly sm: 480;
27
+ readonly md: 768;
28
+ readonly lg: 1024;
29
+ readonly xl: 1280;
30
+ readonly '2xl': 1536;
31
+ };
32
+ zIndices: {
33
+ hide: number;
34
+ auto: string;
35
+ base: number;
36
+ docked: number;
37
+ dropdown: number;
38
+ sticky: number;
39
+ banner: number;
40
+ overlay: number;
41
+ modal: number;
42
+ popover: number;
43
+ skipLink: number;
44
+ toast: number;
45
+ tooltip: number;
46
+ };
47
+ colors: {
48
+ core: {
49
+ black: string;
50
+ white: string;
51
+ gray90: string;
52
+ gray80: string;
53
+ gray70: string;
54
+ gray60: string;
55
+ gray50: string;
56
+ gray40: string;
57
+ gray30: string;
58
+ gray20: string;
59
+ gray10: string;
60
+ uiPink: string;
61
+ uiPinkDark: string;
62
+ uiPinkLight: string;
63
+ brown: string;
64
+ brownDark: string;
65
+ brownLight: string;
66
+ offWhite: string;
67
+ offWhiteDark: string;
68
+ offWhiteLight: string;
69
+ softPink: string;
70
+ warmYellow: string;
71
+ softYellow: string;
72
+ red10: string;
73
+ red20: string;
74
+ red30: string;
75
+ red40: string;
76
+ red50: string;
77
+ red60: string;
78
+ red70: string;
79
+ red80: string;
80
+ red90: string;
81
+ green90: string;
82
+ green80: string;
83
+ green70: string;
84
+ green60: string;
85
+ green50: string;
86
+ green40: string;
87
+ green30: string;
88
+ green20: string;
89
+ green10: string;
90
+ blue90: string;
91
+ blue80: string;
92
+ blue70: string;
93
+ blue60: string;
94
+ blue50: string;
95
+ blue40: string;
96
+ blue30: string;
97
+ blue20: string;
98
+ blue10: string;
99
+ yellow90: string;
100
+ yellow80: string;
101
+ yellow70: string;
102
+ yellow60: string;
103
+ yellow50: string;
104
+ yellow40: string;
105
+ yellow30: string;
106
+ yellow20: string;
107
+ yellow10: string;
108
+ blackAlpha20: string;
109
+ };
110
+ bg: {
111
+ default: string;
112
+ brandPrimary: string;
113
+ brandPrimaryHover: string;
114
+ brandPrimaryActive: string;
115
+ brandSecondary: string;
116
+ brandSecondaryHover: string;
117
+ brandSecondaryActive: string;
118
+ brandTertiary: string;
119
+ brandTertiaryHover: string;
120
+ brandTertiaryActive: string;
121
+ negative: string;
122
+ warning: string;
123
+ positive: string;
124
+ inset: string;
125
+ backdrop: string;
126
+ };
127
+ text: {
128
+ strong: string;
129
+ default: string;
130
+ subtle: string;
131
+ disabled: string;
132
+ negative: string;
133
+ warning: string;
134
+ positive: string;
135
+ onBrandPrimary: string;
136
+ onBrandSecondary: string;
137
+ onBrandTertiary: string;
138
+ };
139
+ icon: {
140
+ default: string;
141
+ strong: string;
142
+ subtle: string;
143
+ disabled: string;
144
+ negative: string;
145
+ warning: string;
146
+ positive: string;
147
+ onBrandPrimary: string;
148
+ onBrandSecondary: string;
149
+ onBrandTertiary: string;
150
+ };
151
+ border: {
152
+ default: string;
153
+ defaultHover: string;
154
+ defaultSelected: string;
155
+ strong: string;
156
+ subtle: string;
157
+ negative: string;
158
+ warning: string;
159
+ positive: string;
160
+ };
161
+ };
162
+ sizes: {
163
+ 112: string;
164
+ 128: string;
165
+ 144: string;
166
+ 160: string;
167
+ 176: string;
168
+ 192: string;
169
+ 224: string;
170
+ 256: string;
171
+ 288: string;
172
+ 320: string;
173
+ 384: string;
174
+ 448: string;
175
+ 512: string;
176
+ 576: string;
177
+ 672: string;
178
+ 768: string;
179
+ 896: string;
180
+ 1024: string;
181
+ '0x': string;
182
+ '1x': string;
183
+ '2x': string;
184
+ '3x': string;
185
+ '4x': string;
186
+ '5x': string;
187
+ '6x': string;
188
+ '8x': string;
189
+ '12x': string;
190
+ '16x': string;
191
+ '20x': string;
192
+ '24x': string;
193
+ };
194
+ radii: {
195
+ none: string;
196
+ '2xs': string;
197
+ xs: string;
198
+ sm: string;
199
+ md: string;
200
+ lg: string;
201
+ xl: string;
202
+ full: string;
203
+ };
204
+ shadows: {
205
+ none: string;
206
+ sm: string;
207
+ md: string;
208
+ lg: string;
209
+ xl: string;
210
+ };
211
+ typography: {
212
+ display: {
213
+ '3xl': {
214
+ fontFamily: string;
215
+ fontWeight: string;
216
+ fontSize: string;
217
+ lineHeight: string;
218
+ letterSpacing: string;
219
+ fontFeatureSettings: string;
220
+ };
221
+ '2xl': {
222
+ fontFamily: string;
223
+ fontWeight: string;
224
+ fontSize: string;
225
+ lineHeight: string;
226
+ letterSpacing: string;
227
+ fontFeatureSettings: string;
228
+ };
229
+ xl: {
230
+ fontFamily: string;
231
+ fontWeight: string;
232
+ fontSize: string;
233
+ lineHeight: string;
234
+ letterSpacing: string;
235
+ fontFeatureSettings: string;
236
+ };
237
+ lg: {
238
+ fontFamily: string;
239
+ fontWeight: string;
240
+ fontSize: string;
241
+ lineHeight: string;
242
+ letterSpacing: string;
243
+ fontFeatureSettings: string;
244
+ };
245
+ md: {
246
+ fontFamily: string;
247
+ fontWeight: string;
248
+ fontSize: string;
249
+ lineHeight: string;
250
+ letterSpacing: string;
251
+ fontFeatureSettings: string;
252
+ };
253
+ sm: {
254
+ fontFamily: string;
255
+ fontWeight: string;
256
+ fontSize: string;
257
+ lineHeight: string;
258
+ letterSpacing: string;
259
+ fontFeatureSettings: string;
260
+ };
261
+ xs: {
262
+ fontFamily: string;
263
+ fontWeight: string;
264
+ fontSize: string;
265
+ lineHeight: string;
266
+ letterSpacing: string;
267
+ fontFeatureSettings: string;
268
+ };
269
+ };
270
+ title: {
271
+ lg: {
272
+ fontFamily: string;
273
+ fontWeight: string;
274
+ fontSize: string;
275
+ lineHeight: string;
276
+ letterSpacing: string;
277
+ };
278
+ md: {
279
+ fontFamily: string;
280
+ fontWeight: string;
281
+ fontSize: string;
282
+ lineHeight: string;
283
+ letterSpacing: string;
284
+ };
285
+ sm: {
286
+ fontFamily: string;
287
+ fontWeight: string;
288
+ fontSize: string;
289
+ lineHeight: string;
290
+ letterSpacing: string;
291
+ };
292
+ xs: {
293
+ fontFamily: string;
294
+ fontWeight: string;
295
+ fontSize: string;
296
+ lineHeight: string;
297
+ letterSpacing: string;
298
+ };
299
+ '2xs': {
300
+ fontFamily: string;
301
+ fontWeight: string;
302
+ fontSize: string;
303
+ lineHeight: string;
304
+ letterSpacing: string;
305
+ };
306
+ '3xs': {
307
+ fontFamily: string;
308
+ fontWeight: string;
309
+ fontSize: string;
310
+ lineHeight: string;
311
+ letterSpacing: string;
312
+ };
313
+ };
314
+ body: {
315
+ xl: {
316
+ fontFamily: string;
317
+ fontWeight: string;
318
+ fontSize: string;
319
+ lineHeight: string;
320
+ letterSpacing: string;
321
+ };
322
+ lg: {
323
+ fontFamily: string;
324
+ fontWeight: string;
325
+ fontSize: string;
326
+ lineHeight: string;
327
+ letterSpacing: string;
328
+ };
329
+ md: {
330
+ fontFamily: string;
331
+ fontWeight: string;
332
+ fontSize: string;
333
+ lineHeight: string;
334
+ letterSpacing: string;
335
+ };
336
+ sm: {
337
+ fontFamily: string;
338
+ fontWeight: string;
339
+ fontSize: string;
340
+ lineHeight: string;
341
+ letterSpacing: string;
342
+ };
343
+ xs: {
344
+ fontFamily: string;
345
+ fontWeight: string;
346
+ fontSize: string;
347
+ lineHeight: string;
348
+ letterSpacing: string;
349
+ };
350
+ };
351
+ label: {
352
+ md: {
353
+ fontFamily: string;
354
+ fontWeight: string;
355
+ fontSize: string;
356
+ lineHeight: string;
357
+ letterSpacing: string;
358
+ };
359
+ sm: {
360
+ fontFamily: string;
361
+ fontWeight: string;
362
+ fontSize: string;
363
+ lineHeight: string;
364
+ letterSpacing: string;
365
+ };
366
+ };
367
+ button: {
368
+ md: {
369
+ fontFamily: string;
370
+ fontWeight: string;
371
+ fontSize: string;
372
+ lineHeight: string;
373
+ letterSpacing: string;
374
+ };
375
+ sm: {
376
+ fontFamily: string;
377
+ fontWeight: string;
378
+ fontSize: string;
379
+ lineHeight: string;
380
+ letterSpacing: string;
381
+ };
382
+ };
383
+ caption: {
384
+ md: {
385
+ fontFamily: string;
386
+ fontWeight: string;
387
+ fontSize: string;
388
+ lineHeight: string;
389
+ letterSpacing: string;
390
+ };
391
+ sm: {
392
+ fontFamily: string;
393
+ fontWeight: string;
394
+ fontSize: string;
395
+ lineHeight: string;
396
+ letterSpacing: string;
397
+ };
398
+ };
399
+ };
400
+ }) => {
401
+ neutral: {
402
+ background: string;
403
+ color: string;
404
+ };
405
+ error: {
406
+ background: string;
407
+ color: string;
408
+ };
409
+ };
410
+ export declare type ToastVariant = VariantProps<typeof getVariantStyles>;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import * as ToastPrimitive from '@radix-ui/react-toast';
3
+ import type { HTMLQdsProps } from '../../types';
4
+ import type { ToastVariant } from './toast-styles';
5
+ interface ToastOptions {
6
+ text: string;
7
+ variant?: ToastVariant;
8
+ }
9
+ declare type OmittedProps = 'children';
10
+ interface ToastProps extends Omit<HTMLQdsProps<'div'>, OmittedProps>, ToastOptions {
11
+ }
12
+ export declare function Toast(props: ToastProps & ToastPrimitive.ToastProps): JSX.Element;
13
+ export {};