@qasa/qds-ui 0.10.0-next.2 → 0.10.0-next.4
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/cjs/index.js +1322 -1328
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/index.d.ts +2 -0
- package/dist/cjs/types/components/toast/index.d.ts +1 -0
- package/dist/cjs/types/components/toast/toast-provider.d.ts +4 -0
- package/dist/cjs/types/components/toast/toast-store.d.ts +44 -0
- package/dist/cjs/types/components/toast/toast-styles.d.ts +410 -0
- package/dist/cjs/types/components/toast/toast.d.ts +13 -0
- package/dist/esm/index.js +1323 -1328
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/index.d.ts +2 -0
- package/dist/esm/types/components/toast/index.d.ts +1 -0
- package/dist/esm/types/components/toast/toast-provider.d.ts +4 -0
- package/dist/esm/types/components/toast/toast-store.d.ts +44 -0
- package/dist/esm/types/components/toast/toast-styles.d.ts +410 -0
- package/dist/esm/types/components/toast/toast.d.ts +13 -0
- package/dist/index.d.ts +133 -1
- package/package.json +4 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './avatar';
|
|
2
2
|
export * from './button';
|
|
3
3
|
export * from './divider';
|
|
4
|
+
export * from './dropdown-menu';
|
|
4
5
|
export * from './heading';
|
|
5
6
|
export * from './hint-box';
|
|
6
7
|
export * from './icon';
|
|
@@ -16,3 +17,4 @@ export * from './select';
|
|
|
16
17
|
export * from './spacer';
|
|
17
18
|
export * from './stack';
|
|
18
19
|
export * from './textarea';
|
|
20
|
+
export * from './toast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { toast } from './toast-store';
|
|
@@ -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
|
+
negative: {
|
|
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 {};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ElementType, ComponentPropsWithoutRef, ReactNode, SVGAttributes, useLay
|
|
|
4
4
|
import { Options } from '@emotion/cache';
|
|
5
5
|
import * as _emotion_react from '@emotion/react';
|
|
6
6
|
import { CSSObject } from '@emotion/react';
|
|
7
|
+
import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
|
|
7
8
|
import * as _emotion_styled from '@emotion/styled';
|
|
8
9
|
import { LucideIcon } from 'lucide-react';
|
|
9
10
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
@@ -2430,6 +2431,122 @@ interface DividerProps extends HTMLQdsProps<'span'>, DividerOptions {
|
|
|
2430
2431
|
}
|
|
2431
2432
|
declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
|
|
2432
2433
|
|
|
2434
|
+
declare type PrimitiveContentProps = DropdownPrimitive.MenuContentProps;
|
|
2435
|
+
interface DropdownMenuContentOptions {
|
|
2436
|
+
/**
|
|
2437
|
+
* Event handler called when focus moves to the trigger after closing.
|
|
2438
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
2439
|
+
*/
|
|
2440
|
+
onCloseAutofocus?: PrimitiveContentProps['onCloseAutoFocus'];
|
|
2441
|
+
/**
|
|
2442
|
+
* Event handler called when the escape key is down.
|
|
2443
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
2444
|
+
*/
|
|
2445
|
+
onEscapeKeyDown?: PrimitiveContentProps['onEscapeKeyDown'];
|
|
2446
|
+
/**
|
|
2447
|
+
* Event handler called when a pointer event occurs outside the bounds of the component.
|
|
2448
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
2449
|
+
*/
|
|
2450
|
+
onPointerDownOutside?: PrimitiveContentProps['onPointerDownOutside'];
|
|
2451
|
+
/**
|
|
2452
|
+
* Event handler called when focus moves outside the bounds of the component.
|
|
2453
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
2454
|
+
*/
|
|
2455
|
+
onFocusOutside?: PrimitiveContentProps['onFocusOutside'];
|
|
2456
|
+
/**
|
|
2457
|
+
* Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component.
|
|
2458
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
2459
|
+
*/
|
|
2460
|
+
onInteractOutside?: PrimitiveContentProps['onInteractOutside'];
|
|
2461
|
+
/**
|
|
2462
|
+
* The preferred side of the trigger to render against when open.
|
|
2463
|
+
* Will be reversed when collisions occur and `avoidCollisions` is enabled.
|
|
2464
|
+
*
|
|
2465
|
+
* @default "bottom"
|
|
2466
|
+
*/
|
|
2467
|
+
side?: PrimitiveContentProps['side'];
|
|
2468
|
+
/**
|
|
2469
|
+
* The distance in pixels from the trigger.
|
|
2470
|
+
*
|
|
2471
|
+
* @default 8
|
|
2472
|
+
*/
|
|
2473
|
+
sideOffset?: PrimitiveContentProps['sideOffset'];
|
|
2474
|
+
/**
|
|
2475
|
+
* The preferred alignment against the trigger. May change when collisions occur.
|
|
2476
|
+
*
|
|
2477
|
+
* @default "center"
|
|
2478
|
+
*/
|
|
2479
|
+
align?: PrimitiveContentProps['align'];
|
|
2480
|
+
/**
|
|
2481
|
+
* The element used as the collision boundary.
|
|
2482
|
+
* By default this is the viewport, though you can provide additional element(s) to be included in this check.
|
|
2483
|
+
*
|
|
2484
|
+
* @default []
|
|
2485
|
+
*/
|
|
2486
|
+
collisionBoundary?: PrimitiveContentProps['collisionBoundary'];
|
|
2487
|
+
/**
|
|
2488
|
+
* Whether to hide the content when the trigger becomes fully occluded.
|
|
2489
|
+
*
|
|
2490
|
+
* @default false
|
|
2491
|
+
*/
|
|
2492
|
+
hideWhenDetached?: PrimitiveContentProps['hideWhenDetached'];
|
|
2493
|
+
}
|
|
2494
|
+
interface DropdownMenuContentProps extends HTMLQdsProps<'div'>, DropdownMenuContentOptions {
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
declare type DropdownMenuDividerProps = HTMLQdsProps<'div'>;
|
|
2498
|
+
|
|
2499
|
+
interface DropdownMenuItemOptions {
|
|
2500
|
+
/**
|
|
2501
|
+
* If `true`, the item will be disabled
|
|
2502
|
+
*/
|
|
2503
|
+
isDisabled?: boolean;
|
|
2504
|
+
/**
|
|
2505
|
+
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
2506
|
+
* Calling `event.preventDefault` in this handler will prevent the dropdown from closing when selecting that item.
|
|
2507
|
+
*/
|
|
2508
|
+
onSelect?: (event: Event) => void;
|
|
2509
|
+
/**
|
|
2510
|
+
* Optional text used for typeahead purposes.
|
|
2511
|
+
* By default the typeahead behavior will use the `.textContent` of the item.
|
|
2512
|
+
* Use this when the content is complex, or you have non-textual content inside.
|
|
2513
|
+
*/
|
|
2514
|
+
textValue?: string;
|
|
2515
|
+
/**
|
|
2516
|
+
* Optional icon to display on the left side of the item content.
|
|
2517
|
+
*/
|
|
2518
|
+
icon?: ElementType<IconProps>;
|
|
2519
|
+
}
|
|
2520
|
+
interface DropdownMenuItemProps extends Omit<DropdownPrimitive.DropdownMenuItemProps, 'asChild' | keyof DropdownMenuItemOptions>, DropdownMenuItemOptions {
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
declare type DropdownTriggerComponent = ForwardRefComponent<'button'>;
|
|
2524
|
+
declare type DropdownMenuTriggerProps = PropsOf<DropdownTriggerComponent>;
|
|
2525
|
+
|
|
2526
|
+
interface DropdownMenuRootProps {
|
|
2527
|
+
children: ReactNode;
|
|
2528
|
+
/**
|
|
2529
|
+
* If `true` the dropdown menu will be open
|
|
2530
|
+
*/
|
|
2531
|
+
isOpen?: boolean;
|
|
2532
|
+
/**
|
|
2533
|
+
* The open state of the submenu when it is initially rendered.
|
|
2534
|
+
* Use when you do not need to control its open state.
|
|
2535
|
+
*/
|
|
2536
|
+
defaultOpen?: boolean;
|
|
2537
|
+
/**
|
|
2538
|
+
* Callback invoked open state changes
|
|
2539
|
+
*/
|
|
2540
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
2541
|
+
}
|
|
2542
|
+
declare function DropdownMenuRoot(props: DropdownMenuRootProps): JSX.Element;
|
|
2543
|
+
declare const DropdownMenu: typeof DropdownMenuRoot & {
|
|
2544
|
+
Trigger: ForwardRefComponent<"button", {}>;
|
|
2545
|
+
Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
2546
|
+
Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
2547
|
+
Divider: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof react.HTMLAttributes<HTMLDivElement>> & react.RefAttributes<HTMLDivElement>>;
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2433
2550
|
declare const getSizeStyles$4: (theme: {
|
|
2434
2551
|
mediaQueries: {
|
|
2435
2552
|
readonly smUp: "@media(min-width: 480px)";
|
|
@@ -5407,6 +5524,21 @@ interface TextareaProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$1>,
|
|
|
5407
5524
|
}
|
|
5408
5525
|
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
5409
5526
|
|
|
5527
|
+
declare type Id = number | string;
|
|
5528
|
+
interface ToastOptions {
|
|
5529
|
+
/**
|
|
5530
|
+
* Unique identifier for the toast (can be used for removing it prematurely). If a toast with this
|
|
5531
|
+
* identifier already exists it will be removed before the new toast is added.
|
|
5532
|
+
* @default a random unique id will be set and returned
|
|
5533
|
+
*/
|
|
5534
|
+
id?: Id;
|
|
5535
|
+
}
|
|
5536
|
+
declare const toast: ((text: string, options?: ToastOptions) => Id) & {
|
|
5537
|
+
error: (text: string, options?: ToastOptions) => Id;
|
|
5538
|
+
remove: (id: Id) => void;
|
|
5539
|
+
removeAll: () => void;
|
|
5540
|
+
};
|
|
5541
|
+
|
|
5410
5542
|
interface UseBreakpointOptions {
|
|
5411
5543
|
/**
|
|
5412
5544
|
* If `true` the initial value will be `base` instead of the current breakpoint.
|
|
@@ -5506,4 +5638,4 @@ declare function useStableId(fixedId?: string | null): string;
|
|
|
5506
5638
|
*/
|
|
5507
5639
|
declare const useSafeLayoutEffect: typeof useLayoutEffect;
|
|
5508
5640
|
|
|
5509
|
-
export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, ImageIcon, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
|
|
5641
|
+
export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, DropdownMenu, DropdownMenuContentProps, DropdownMenuDividerProps, DropdownMenuItemProps, DropdownMenuRootProps, DropdownMenuTriggerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, ImageIcon, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, toast, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qasa/qds-ui",
|
|
3
|
-
"version": "0.10.0-next.
|
|
3
|
+
"version": "0.10.0-next.4",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"eslint-plugin-import": "^2.26.0",
|
|
71
71
|
"eslint-plugin-prettier": "^4.2.1",
|
|
72
72
|
"eslint-plugin-testing-library": "^5.7.0",
|
|
73
|
+
"framer-motion": "^11.0.3",
|
|
73
74
|
"husky": "^8.0.1",
|
|
74
75
|
"jest": "^29.1.1",
|
|
75
76
|
"jest-axe": "^6.0.0",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"peerDependencies": {
|
|
98
99
|
"@emotion/react": ">= 11.0.0",
|
|
99
100
|
"@emotion/styled": ">= 11.0.0",
|
|
101
|
+
"framer-motion": ">=11.0.3",
|
|
100
102
|
"react": ">=17.0.0",
|
|
101
103
|
"react-dom": ">=17.0.0"
|
|
102
104
|
},
|
|
@@ -105,6 +107,7 @@
|
|
|
105
107
|
},
|
|
106
108
|
"dependencies": {
|
|
107
109
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
110
|
+
"@radix-ui/react-toast": "^1.1.5",
|
|
108
111
|
"@radix-ui/react-dropdown-menu": "^2.0.6"
|
|
109
112
|
}
|
|
110
113
|
}
|