@qasa/qds-ui 0.10.0-next.3 → 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.
@@ -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';
@@ -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
+ 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
@@ -5524,6 +5524,21 @@ interface TextareaProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$1>,
5524
5524
  }
5525
5525
  declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
5526
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
+
5527
5542
  interface UseBreakpointOptions {
5528
5543
  /**
5529
5544
  * If `true` the initial value will be `base` instead of the current breakpoint.
@@ -5623,4 +5638,4 @@ declare function useStableId(fixedId?: string | null): string;
5623
5638
  */
5624
5639
  declare const useSafeLayoutEffect: typeof useLayoutEffect;
5625
5640
 
5626
- 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, 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",
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
  }