@atom-learning/components 1.2.3 → 1.5.0

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 (68) hide show
  1. package/dist/components/action-icon/ActionIcon.d.ts +2 -2
  2. package/dist/components/action-icon/ActionIcon.js +1 -1
  3. package/dist/components/calendar/Calendar.d.ts +19 -0
  4. package/dist/components/calendar/Calendar.js +1 -0
  5. package/dist/components/calendar/Day.d.ts +269 -0
  6. package/dist/components/calendar/Day.js +1 -0
  7. package/dist/components/calendar/constants.d.ts +2 -0
  8. package/dist/components/calendar/constants.js +1 -0
  9. package/dist/components/date-field/DateField.d.ts +17 -0
  10. package/dist/components/date-field/DateField.js +1 -0
  11. package/dist/components/date-field/index.d.ts +1 -0
  12. package/dist/components/date-input/DateInput.d.ts +17 -0
  13. package/dist/components/date-input/DateInput.js +1 -0
  14. package/dist/components/date-input/constants.d.ts +1 -0
  15. package/dist/components/date-input/constants.js +1 -0
  16. package/dist/components/date-input/index.d.ts +1 -0
  17. package/dist/components/date-input/use-date.d.ts +5 -0
  18. package/dist/components/date-input/use-date.js +1 -0
  19. package/dist/components/dialog/DialogContent.d.ts +1 -0
  20. package/dist/components/dialog/DialogContent.js +1 -1
  21. package/dist/components/form/Form.types.d.ts +2 -2
  22. package/dist/components/index.d.ts +6 -1
  23. package/dist/components/notification-badge/NotificationBadge.d.ts +535 -0
  24. package/dist/components/notification-badge/NotificationBadge.js +1 -0
  25. package/dist/components/notification-badge/index.d.ts +1 -0
  26. package/dist/components/popover/PopoverContent.d.ts +1 -0
  27. package/dist/components/popover/PopoverContent.js +1 -1
  28. package/dist/components/search-input/SearchInput.d.ts +3 -1
  29. package/dist/components/search-input/SearchInput.js +1 -1
  30. package/dist/components/slider/Slider.d.ts +276 -0
  31. package/dist/components/slider/Slider.js +1 -0
  32. package/dist/components/slider/SliderSteps.d.ts +13 -0
  33. package/dist/components/slider/SliderSteps.js +1 -0
  34. package/dist/components/slider/SliderValue.d.ts +9 -0
  35. package/dist/components/slider/SliderValue.js +1 -0
  36. package/dist/components/slider/index.d.ts +1 -0
  37. package/dist/components/slider-field/SliderField.d.ts +13 -0
  38. package/dist/components/slider-field/SliderField.js +1 -0
  39. package/dist/components/slider-field/index.d.ts +1 -0
  40. package/dist/components/table/Table.d.ts +1 -0
  41. package/dist/components/table/Table.js +1 -1
  42. package/dist/components/table/TableHeader.d.ts +7 -1
  43. package/dist/components/table/TableHeader.js +1 -1
  44. package/dist/components/table/TableHeaderCell.js +1 -1
  45. package/dist/components/table/TableRow.js +1 -1
  46. package/dist/components/tabs/TabTrigger.d.ts +5 -3
  47. package/dist/components/tabs/TabTrigger.js +1 -1
  48. package/dist/components/tabs/Tabs.d.ts +8 -268
  49. package/dist/components/tabs/Tabs.js +1 -1
  50. package/dist/components/tabs/TabsTriggerList.d.ts +274 -0
  51. package/dist/components/tabs/TabsTriggerList.js +1 -0
  52. package/dist/components/tabs/utils.d.ts +2 -0
  53. package/dist/components/tabs/utils.js +1 -0
  54. package/dist/components/text/Text.js +1 -1
  55. package/dist/docgen.json +1 -1
  56. package/dist/docs/DateField.mdx +20 -0
  57. package/dist/docs/DateInput.mdx +81 -0
  58. package/dist/docs/Dialog.mdx +16 -1
  59. package/dist/docs/NotificationBadge.mdx +33 -0
  60. package/dist/docs/RadioButton.mdx +1 -1
  61. package/dist/docs/SearchInput.mdx +2 -1
  62. package/dist/docs/Slider.mdx +117 -0
  63. package/dist/docs/SliderField.mdx +35 -0
  64. package/dist/docs/Table.mdx +14 -0
  65. package/dist/docs/Tabs.mdx +24 -1
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/package.json +7 -2
@@ -0,0 +1,535 @@
1
+ import React from 'react';
2
+ declare const StyledBadge: import("@stitches/react/types/styled-component").StyledComponent<import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
3
+ sm: string;
4
+ md: string;
5
+ lg: string;
6
+ xl: string;
7
+ reducedMotion: string;
8
+ allowMotion: string;
9
+ hover: string;
10
+ }, import("@stitches/react/types/css-util").CSS<{
11
+ sm: string;
12
+ md: string;
13
+ lg: string;
14
+ xl: string;
15
+ reducedMotion: string;
16
+ allowMotion: string;
17
+ hover: string;
18
+ }, {
19
+ colors: {
20
+ textForeground: any;
21
+ textSubtle: any;
22
+ textPlaceholder: any;
23
+ background: any;
24
+ backgroundAccent: any;
25
+ tonal50: any;
26
+ tonal100: any;
27
+ tonal200: any;
28
+ tonal300: any;
29
+ tonal400: any;
30
+ tonal500: any;
31
+ tonal600: any;
32
+ alpha100: any;
33
+ alpha150: any;
34
+ alpha200: any;
35
+ alpha250: any;
36
+ alpha600: any;
37
+ primaryLight: any;
38
+ primary: any;
39
+ primaryMid: any;
40
+ primaryDark: any;
41
+ secondary: any;
42
+ brandRed: any;
43
+ brandRedAccent: any;
44
+ brandGreen: any;
45
+ brandGreenAccent: any;
46
+ brandPurple: any;
47
+ brandPurpleAccent: any;
48
+ brandYellow: any;
49
+ brandYellowAccent: any;
50
+ successLight: any;
51
+ success: any;
52
+ successMid: any;
53
+ successDark: any;
54
+ dangerLight: any;
55
+ danger: any;
56
+ dangerMid: any;
57
+ dangerDark: any;
58
+ warningLight: any;
59
+ warning: any;
60
+ warningMid: any;
61
+ warningDark: any;
62
+ subjectEnglish: any;
63
+ subjectMaths: any;
64
+ subjectScience: any;
65
+ subjectVerbalReasoning: any;
66
+ subjectNonVerbalReasoning: any;
67
+ subjectCreativeWriting: any;
68
+ subjectExamSkills: any;
69
+ };
70
+ space: {
71
+ "0": any;
72
+ "1": any;
73
+ "2": any;
74
+ "3": any;
75
+ "4": any;
76
+ "5": any;
77
+ "6": any;
78
+ "7": any;
79
+ "8": any;
80
+ "9": any;
81
+ };
82
+ fontSizes: {
83
+ xs: any;
84
+ sm: any;
85
+ md: any;
86
+ lg: any;
87
+ xl: any;
88
+ "2xl": any;
89
+ "3xl": any;
90
+ "4xl": any;
91
+ };
92
+ fonts: {
93
+ sans: any;
94
+ mono: any;
95
+ display: any;
96
+ body: any;
97
+ };
98
+ sizes: {
99
+ "0": any;
100
+ "1": any;
101
+ "2": any;
102
+ "3": any;
103
+ "4": any;
104
+ "5": any;
105
+ "6": any;
106
+ "7": any;
107
+ "8": any;
108
+ };
109
+ radii: {
110
+ "0": any;
111
+ "1": any;
112
+ "2": any;
113
+ "3": any;
114
+ round: any;
115
+ };
116
+ shadows: {
117
+ "0": any;
118
+ "1": any;
119
+ "2": any;
120
+ "3": any;
121
+ };
122
+ }, import("@stitches/react/types/config").DefaultThemeMap, {
123
+ bg: (value: {
124
+ readonly [$$PropertyValue]: "background";
125
+ }) => {
126
+ background: {
127
+ readonly [$$PropertyValue]: "background";
128
+ };
129
+ };
130
+ inset: (value: string | number | {
131
+ readonly [$$ScaleValue]: "space";
132
+ }) => {
133
+ top: string | number | {
134
+ readonly [$$ScaleValue]: "space";
135
+ };
136
+ right: string | number | {
137
+ readonly [$$ScaleValue]: "space";
138
+ };
139
+ bottom: string | number | {
140
+ readonly [$$ScaleValue]: "space";
141
+ };
142
+ left: string | number | {
143
+ readonly [$$ScaleValue]: "space";
144
+ };
145
+ };
146
+ size: (value: string | number | {
147
+ readonly [$$ScaleValue]: "size";
148
+ }) => {
149
+ height: string | number | {
150
+ readonly [$$ScaleValue]: "size";
151
+ };
152
+ width: string | number | {
153
+ readonly [$$ScaleValue]: "size";
154
+ };
155
+ };
156
+ p: (value: string | number | {
157
+ readonly [$$ScaleValue]: "space";
158
+ }) => {
159
+ padding: string | number | {
160
+ readonly [$$ScaleValue]: "space";
161
+ };
162
+ };
163
+ pt: (value: string | number | {
164
+ readonly [$$ScaleValue]: "space";
165
+ }) => {
166
+ paddingTop: string | number | {
167
+ readonly [$$ScaleValue]: "space";
168
+ };
169
+ };
170
+ pr: (value: string | number | {
171
+ readonly [$$ScaleValue]: "space";
172
+ }) => {
173
+ paddingRight: string | number | {
174
+ readonly [$$ScaleValue]: "space";
175
+ };
176
+ };
177
+ pb: (value: string | number | {
178
+ readonly [$$ScaleValue]: "space";
179
+ }) => {
180
+ paddingBottom: string | number | {
181
+ readonly [$$ScaleValue]: "space";
182
+ };
183
+ };
184
+ pl: (value: string | number | {
185
+ readonly [$$ScaleValue]: "space";
186
+ }) => {
187
+ paddingLeft: string | number | {
188
+ readonly [$$ScaleValue]: "space";
189
+ };
190
+ };
191
+ px: (value: string | number | {
192
+ readonly [$$ScaleValue]: "space";
193
+ }) => {
194
+ paddingLeft: string | number | {
195
+ readonly [$$ScaleValue]: "space";
196
+ };
197
+ paddingRight: string | number | {
198
+ readonly [$$ScaleValue]: "space";
199
+ };
200
+ };
201
+ py: (value: string | number | {
202
+ readonly [$$ScaleValue]: "space";
203
+ }) => {
204
+ paddingTop: string | number | {
205
+ readonly [$$ScaleValue]: "space";
206
+ };
207
+ paddingBottom: string | number | {
208
+ readonly [$$ScaleValue]: "space";
209
+ };
210
+ };
211
+ m: (value: string | number | {
212
+ readonly [$$ScaleValue]: "space";
213
+ }) => {
214
+ margin: string | number | {
215
+ readonly [$$ScaleValue]: "space";
216
+ };
217
+ };
218
+ mt: (value: string | number | {
219
+ readonly [$$ScaleValue]: "space";
220
+ }) => {
221
+ marginTop: string | number | {
222
+ readonly [$$ScaleValue]: "space";
223
+ };
224
+ };
225
+ mr: (value: string | number | {
226
+ readonly [$$ScaleValue]: "space";
227
+ }) => {
228
+ marginRight: string | number | {
229
+ readonly [$$ScaleValue]: "space";
230
+ };
231
+ };
232
+ mb: (value: string | number | {
233
+ readonly [$$ScaleValue]: "space";
234
+ }) => {
235
+ marginBottom: string | number | {
236
+ readonly [$$ScaleValue]: "space";
237
+ };
238
+ };
239
+ ml: (value: string | number | {
240
+ readonly [$$ScaleValue]: "space";
241
+ }) => {
242
+ marginLeft: string | number | {
243
+ readonly [$$ScaleValue]: "space";
244
+ };
245
+ };
246
+ mx: (value: string | number | {
247
+ readonly [$$ScaleValue]: "space";
248
+ }) => {
249
+ marginLeft: string | number | {
250
+ readonly [$$ScaleValue]: "space";
251
+ };
252
+ marginRight: string | number | {
253
+ readonly [$$ScaleValue]: "space";
254
+ };
255
+ };
256
+ my: (value: string | number | {
257
+ readonly [$$ScaleValue]: "space";
258
+ }) => {
259
+ marginTop: string | number | {
260
+ readonly [$$ScaleValue]: "space";
261
+ };
262
+ marginBottom: string | number | {
263
+ readonly [$$ScaleValue]: "space";
264
+ };
265
+ };
266
+ }>>, {}, {
267
+ sm: string;
268
+ md: string;
269
+ lg: string;
270
+ xl: string;
271
+ reducedMotion: string;
272
+ allowMotion: string;
273
+ hover: string;
274
+ }, import("@stitches/react/types/css-util").CSS<{
275
+ sm: string;
276
+ md: string;
277
+ lg: string;
278
+ xl: string;
279
+ reducedMotion: string;
280
+ allowMotion: string;
281
+ hover: string;
282
+ }, {
283
+ colors: {
284
+ textForeground: any;
285
+ textSubtle: any;
286
+ textPlaceholder: any;
287
+ background: any;
288
+ backgroundAccent: any;
289
+ tonal50: any;
290
+ tonal100: any;
291
+ tonal200: any;
292
+ tonal300: any;
293
+ tonal400: any;
294
+ tonal500: any;
295
+ tonal600: any;
296
+ alpha100: any;
297
+ alpha150: any;
298
+ alpha200: any;
299
+ alpha250: any;
300
+ alpha600: any;
301
+ primaryLight: any;
302
+ primary: any;
303
+ primaryMid: any;
304
+ primaryDark: any;
305
+ secondary: any;
306
+ brandRed: any;
307
+ brandRedAccent: any;
308
+ brandGreen: any;
309
+ brandGreenAccent: any;
310
+ brandPurple: any;
311
+ brandPurpleAccent: any;
312
+ brandYellow: any;
313
+ brandYellowAccent: any;
314
+ successLight: any;
315
+ success: any;
316
+ successMid: any;
317
+ successDark: any;
318
+ dangerLight: any;
319
+ danger: any;
320
+ dangerMid: any;
321
+ dangerDark: any;
322
+ warningLight: any;
323
+ warning: any;
324
+ warningMid: any;
325
+ warningDark: any;
326
+ subjectEnglish: any;
327
+ subjectMaths: any;
328
+ subjectScience: any;
329
+ subjectVerbalReasoning: any;
330
+ subjectNonVerbalReasoning: any;
331
+ subjectCreativeWriting: any;
332
+ subjectExamSkills: any;
333
+ };
334
+ space: {
335
+ "0": any;
336
+ "1": any;
337
+ "2": any;
338
+ "3": any;
339
+ "4": any;
340
+ "5": any;
341
+ "6": any;
342
+ "7": any;
343
+ "8": any;
344
+ "9": any;
345
+ };
346
+ fontSizes: {
347
+ xs: any;
348
+ sm: any;
349
+ md: any;
350
+ lg: any;
351
+ xl: any;
352
+ "2xl": any;
353
+ "3xl": any;
354
+ "4xl": any;
355
+ };
356
+ fonts: {
357
+ sans: any;
358
+ mono: any;
359
+ display: any;
360
+ body: any;
361
+ };
362
+ sizes: {
363
+ "0": any;
364
+ "1": any;
365
+ "2": any;
366
+ "3": any;
367
+ "4": any;
368
+ "5": any;
369
+ "6": any;
370
+ "7": any;
371
+ "8": any;
372
+ };
373
+ radii: {
374
+ "0": any;
375
+ "1": any;
376
+ "2": any;
377
+ "3": any;
378
+ round: any;
379
+ };
380
+ shadows: {
381
+ "0": any;
382
+ "1": any;
383
+ "2": any;
384
+ "3": any;
385
+ };
386
+ }, import("@stitches/react/types/config").DefaultThemeMap, {
387
+ bg: (value: {
388
+ readonly [$$PropertyValue]: "background";
389
+ }) => {
390
+ background: {
391
+ readonly [$$PropertyValue]: "background";
392
+ };
393
+ };
394
+ inset: (value: string | number | {
395
+ readonly [$$ScaleValue]: "space";
396
+ }) => {
397
+ top: string | number | {
398
+ readonly [$$ScaleValue]: "space";
399
+ };
400
+ right: string | number | {
401
+ readonly [$$ScaleValue]: "space";
402
+ };
403
+ bottom: string | number | {
404
+ readonly [$$ScaleValue]: "space";
405
+ };
406
+ left: string | number | {
407
+ readonly [$$ScaleValue]: "space";
408
+ };
409
+ };
410
+ size: (value: string | number | {
411
+ readonly [$$ScaleValue]: "size";
412
+ }) => {
413
+ height: string | number | {
414
+ readonly [$$ScaleValue]: "size";
415
+ };
416
+ width: string | number | {
417
+ readonly [$$ScaleValue]: "size";
418
+ };
419
+ };
420
+ p: (value: string | number | {
421
+ readonly [$$ScaleValue]: "space";
422
+ }) => {
423
+ padding: string | number | {
424
+ readonly [$$ScaleValue]: "space";
425
+ };
426
+ };
427
+ pt: (value: string | number | {
428
+ readonly [$$ScaleValue]: "space";
429
+ }) => {
430
+ paddingTop: string | number | {
431
+ readonly [$$ScaleValue]: "space";
432
+ };
433
+ };
434
+ pr: (value: string | number | {
435
+ readonly [$$ScaleValue]: "space";
436
+ }) => {
437
+ paddingRight: string | number | {
438
+ readonly [$$ScaleValue]: "space";
439
+ };
440
+ };
441
+ pb: (value: string | number | {
442
+ readonly [$$ScaleValue]: "space";
443
+ }) => {
444
+ paddingBottom: string | number | {
445
+ readonly [$$ScaleValue]: "space";
446
+ };
447
+ };
448
+ pl: (value: string | number | {
449
+ readonly [$$ScaleValue]: "space";
450
+ }) => {
451
+ paddingLeft: string | number | {
452
+ readonly [$$ScaleValue]: "space";
453
+ };
454
+ };
455
+ px: (value: string | number | {
456
+ readonly [$$ScaleValue]: "space";
457
+ }) => {
458
+ paddingLeft: string | number | {
459
+ readonly [$$ScaleValue]: "space";
460
+ };
461
+ paddingRight: string | number | {
462
+ readonly [$$ScaleValue]: "space";
463
+ };
464
+ };
465
+ py: (value: string | number | {
466
+ readonly [$$ScaleValue]: "space";
467
+ }) => {
468
+ paddingTop: string | number | {
469
+ readonly [$$ScaleValue]: "space";
470
+ };
471
+ paddingBottom: string | number | {
472
+ readonly [$$ScaleValue]: "space";
473
+ };
474
+ };
475
+ m: (value: string | number | {
476
+ readonly [$$ScaleValue]: "space";
477
+ }) => {
478
+ margin: string | number | {
479
+ readonly [$$ScaleValue]: "space";
480
+ };
481
+ };
482
+ mt: (value: string | number | {
483
+ readonly [$$ScaleValue]: "space";
484
+ }) => {
485
+ marginTop: string | number | {
486
+ readonly [$$ScaleValue]: "space";
487
+ };
488
+ };
489
+ mr: (value: string | number | {
490
+ readonly [$$ScaleValue]: "space";
491
+ }) => {
492
+ marginRight: string | number | {
493
+ readonly [$$ScaleValue]: "space";
494
+ };
495
+ };
496
+ mb: (value: string | number | {
497
+ readonly [$$ScaleValue]: "space";
498
+ }) => {
499
+ marginBottom: string | number | {
500
+ readonly [$$ScaleValue]: "space";
501
+ };
502
+ };
503
+ ml: (value: string | number | {
504
+ readonly [$$ScaleValue]: "space";
505
+ }) => {
506
+ marginLeft: string | number | {
507
+ readonly [$$ScaleValue]: "space";
508
+ };
509
+ };
510
+ mx: (value: string | number | {
511
+ readonly [$$ScaleValue]: "space";
512
+ }) => {
513
+ marginLeft: string | number | {
514
+ readonly [$$ScaleValue]: "space";
515
+ };
516
+ marginRight: string | number | {
517
+ readonly [$$ScaleValue]: "space";
518
+ };
519
+ };
520
+ my: (value: string | number | {
521
+ readonly [$$ScaleValue]: "space";
522
+ }) => {
523
+ marginTop: string | number | {
524
+ readonly [$$ScaleValue]: "space";
525
+ };
526
+ marginBottom: string | number | {
527
+ readonly [$$ScaleValue]: "space";
528
+ };
529
+ };
530
+ }>>;
531
+ declare type NotificationBadgeProps = React.ComponentProps<typeof StyledBadge> & {
532
+ value: number | string;
533
+ };
534
+ export declare const NotificationBadge: React.FC<NotificationBadgeProps>;
535
+ export {};
@@ -0,0 +1 @@
1
+ import t from"react";import{Box as e}from"../box/Box.js";import{Flex as o}from"../flex/Flex.js";import{styled as r}from"../../stitches.js";const i=r(e,{position:"relative"}),n=r(o,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary"}),l=({value:e,children:o})=>t.createElement(i,null,!!e&&t.createElement(n,{role:"status"},e),o);export{l as NotificationBadge};
@@ -0,0 +1 @@
1
+ export { NotificationBadge } from './NotificationBadge';
@@ -269,6 +269,7 @@ declare const StyledContent: import("@stitches/react/types/styled-component").St
269
269
  }>>;
270
270
  declare type PopoverContentProps = React.ComponentProps<typeof StyledContent> & React.ComponentProps<typeof Content> & {
271
271
  closePopoverText?: string;
272
+ showCloseButton?: boolean;
272
273
  };
273
274
  export declare const PopoverContent: React.FC<PopoverContentProps>;
274
275
  export {};
@@ -1 +1 @@
1
- const i=["children","side","sideOffset","closePopoverText","size"];import{Close as t}from"@atom-learning/icons";import{Content as e,Arrow as o,Close as a}from"@radix-ui/react-popover";import{createElement as s}from"react";import{styled as r}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"polished";import{slideDownAndFade as n,slideLeftAndFade as m,slideUpAndFade as d,slideRightAndFade as p}from"../../utilities/style/keyframe-animations.js";import{ActionIcon as l}from"../action-icon/ActionIcon.js";import{Icon as c}from"../icon/Icon.js";const f=r(e,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative","@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:n},'&[data-side="right"]':{animationName:m},'&[data-side="bottom"]':{animationName:d},'&[data-side="left"]':{animationName:p}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),h=r(o,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),u=e=>{let{children:o,side:r="top",sideOffset:n=8,closePopoverText:m="Close popover",size:d="md"}=e,p=function(i,t){if(null==i)return{};var e,o,a={},s=Object.keys(i);for(o=0;o<s.length;o++)e=s[o],t.indexOf(e)>=0||(a[e]=i[e]);return a}(e,i);return s(f,Object.assign({size:d,side:r,sideOffset:n},p),s(l,{as:a,css:{position:"absolute",right:"$0",top:"$0"},label:m,size:"lg",theme:"neutral"},s(c,{is:t})),o,s(h,{width:16,height:8}))};export{u as PopoverContent};
1
+ const i=["children","side","sideOffset","closePopoverText","showCloseButton","size"];import{Close as t}from"@atom-learning/icons";import{Content as e,Arrow as o,Close as s}from"@radix-ui/react-popover";import{createElement as a}from"react";import{styled as n}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"polished";import{slideDownAndFade as r,slideLeftAndFade as m,slideUpAndFade as d,slideRightAndFade as l}from"../../utilities/style/keyframe-animations.js";import{ActionIcon as p}from"../action-icon/ActionIcon.js";import{Icon as c}from"../icon/Icon.js";const f=n(e,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative","@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:r},'&[data-side="right"]':{animationName:m},'&[data-side="bottom"]':{animationName:d},'&[data-side="left"]':{animationName:l}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),h=n(o,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),u=e=>{let{children:o,side:n="top",sideOffset:r=8,closePopoverText:m="Close popover",showCloseButton:d=!0,size:l="md"}=e,u=function(i,t){if(null==i)return{};var e,o,s={},a=Object.keys(i);for(o=0;o<a.length;o++)e=a[o],t.indexOf(e)>=0||(s[e]=i[e]);return s}(e,i);return a(f,Object.assign({size:l,side:n,sideOffset:r},u),d&&a(p,{as:s,css:{position:"absolute",right:"$0",top:"$0"},label:m,size:"lg",theme:"neutral"},a(c,{is:t})),o,a(h,{width:16,height:8}))};export{u as PopoverContent};
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react';
2
+ import { Input } from '../../components/input';
2
3
  import { CSS } from '../../stitches';
3
- import { Input } from '../input/Input';
4
4
  declare type SearchInputProps = React.ComponentProps<typeof Input> & {
5
5
  size: 'sm' | 'md';
6
6
  css?: CSS;
7
+ value?: string;
8
+ clearText?: string;
7
9
  };
8
10
  export declare const SearchInput: React.FC<SearchInputProps>;
9
11
  export {};
@@ -1 +1 @@
1
- const t=["size","css"];function o(){return(o=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t}).apply(this,arguments)}import{Search as r}from"@atom-learning/icons";import{createElement as s,Fragment as n}from"react";import{Box as e}from"../box/Box.js";import{Icon as i}from"../icon/Icon.js";import{Input as c}from"../input/Input.js";const p=p=>{let{size:a,css:l}=p,m=function(t,o){if(null==t)return{};var r,s,n={},e=Object.keys(t);for(s=0;s<e.length;s++)r=e[s],o.indexOf(r)>=0||(n[r]=t[r]);return n}(p,t);return s(e,{css:o({position:"relative"},l)},s(n,null,s(i,{is:r,css:{color:"$tonal300",pointerEvents:"none",position:"absolute",size:"sm"===a?"$1":20,top:"sm"===a?"$2":10,left:"sm"===a?"$2":10}}),s(c,Object.assign({size:a,css:{pl:"sm"===a?"$5":"$6"}},m,{type:"search"}))))};p.displayName="SearchInput";export{p as SearchInput};
1
+ const t=["size","css","value","clearText"];function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t}).apply(this,arguments)}import{Search as s,Close as o}from"@atom-learning/icons";import{useState as r,createElement as i}from"react";import{ActionIcon as n}from"../action-icon/ActionIcon.js";import{Box as a}from"../box/Box.js";import{Icon as c}from"../icon/Icon.js";import{Input as l}from"../input/Input.js";import{styled as p}from"../../stitches.js";var u;!function(t){t.SEARCH="SEARCH",t.CLEAR="CLEAR"}(u||(u={}));const m=p(c,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),h=p(l,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),f=l=>{let{size:p="md",css:f,value:b,clearText:v="Clear"}=l,C=function(t,e){if(null==t)return{};var s,o,r={},i=Object.keys(t);for(o=0;o<i.length;o++)s=i[o],e.indexOf(s)>=0||(r[s]=t[s]);return r}(l,t);const[g,A]=r(b||""),[E,R]=r(b?u.CLEAR:u.SEARCH),j=()=>{A(""),R(u.SEARCH)};return i(a,{css:e({position:"relative"},f)},i(h,Object.assign({size:p,type:"search"},C,{value:g,onChange:t=>{A(t.target.value),R(t.target.value?u.CLEAR:u.SEARCH)},css:{pr:"sm"===p?"$5":"$6"}})),E===u.SEARCH?i(m,{is:s,size:p,css:{size:"sm"==p?"$1":20}}):i(n,{label:v,theme:"neutral",size:"sm"==p?"md":"lg",css:{position:"absolute",top:0,right:0},onClick:j},i(c,{is:o})))};f.displayName="SearchInput";export{f as SearchInput};