@okshaun/components 2.0.2 → 3.0.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 (40) hide show
  1. package/dist/icon-metadata.json +27 -0
  2. package/dist/index.js +2567 -1458
  3. package/dist/index.js.map +1 -1
  4. package/dist/panda.buildinfo.json +1008 -48
  5. package/dist/{preset-DAmO4B54.js → preset-BAn5LBiW.js} +738 -141
  6. package/dist/preset-BAn5LBiW.js.map +1 -0
  7. package/dist/preset.js +1 -1
  8. package/dist/specs/keyframes.json +11 -0
  9. package/dist/specs/recipes.json +153 -13
  10. package/dist/specs/tokens.json +5 -0
  11. package/dist/sprite.svg +1 -1
  12. package/dist/sprite.symbol.html +57 -2
  13. package/dist/styles.css +14752 -2108
  14. package/dist/svgs/barcode-off.svg +1 -0
  15. package/dist/svgs/spinner.svg +1 -0
  16. package/dist/types/index.d.ts +171 -190
  17. package/package.json +1 -1
  18. package/src/recipes/avatar.ts +1 -1
  19. package/src/recipes/badge.ts +17 -0
  20. package/src/recipes/breakpointIndicator.ts +11 -0
  21. package/src/recipes/button.ts +112 -2
  22. package/src/recipes/chip.ts +142 -17
  23. package/src/recipes/datePicker.ts +22 -0
  24. package/src/recipes/icon.ts +25 -6
  25. package/src/recipes/kbd.ts +53 -0
  26. package/src/recipes/list.ts +91 -1
  27. package/src/recipes/listItem.ts +43 -36
  28. package/src/recipes/listItemGroup.ts +8 -30
  29. package/src/recipes/modal.ts +36 -5
  30. package/src/recipes/recipes-regular.ts +2 -0
  31. package/src/recipes/recipes-slot.ts +1 -0
  32. package/src/recipes/select.ts +8 -1
  33. package/src/recipes/skeleton.ts +72 -0
  34. package/src/recipes/spinner.ts +27 -24
  35. package/src/recipes/textInput.ts +42 -1
  36. package/src/recipes/timePicker.ts +17 -0
  37. package/src/styles/primitives/animations.ts +3 -0
  38. package/src/styles/utilities/keyframes.ts +4 -0
  39. package/src/utils/mergeAriaDescribedBy.ts +7 -0
  40. package/dist/preset-DAmO4B54.js.map +0 -1
@@ -1,5 +1,86 @@
1
1
  import { defineRecipe } from '@pandacss/dev';
2
2
 
3
+ export const listDensity = {
4
+ compact: {
5
+ groupLabel: {
6
+ px: '10',
7
+ pt: '8',
8
+ pb: '2',
9
+ fontSize: '12',
10
+ },
11
+ divider: {
12
+ my: '4',
13
+ mx: '10',
14
+ },
15
+ row: {
16
+ py: '3',
17
+ px: '10',
18
+ },
19
+ icon: {
20
+ w: '24',
21
+ h: '24',
22
+ },
23
+ beforeSlot: {
24
+ mr: '3',
25
+ },
26
+ afterSlot: {
27
+ ml: '3',
28
+ },
29
+ },
30
+ comfortable: {
31
+ groupLabel: {
32
+ px: '12',
33
+ pt: '12',
34
+ pb: '4',
35
+ fontSize: '14',
36
+ },
37
+ divider: {
38
+ my: '6',
39
+ mx: '12',
40
+ },
41
+ row: {
42
+ py: '7',
43
+ px: '12',
44
+ },
45
+ icon: {
46
+ w: '24',
47
+ h: '24',
48
+ },
49
+ beforeSlot: {
50
+ mr: '3',
51
+ },
52
+ afterSlot: {
53
+ ml: '3',
54
+ },
55
+ },
56
+ spacious: {
57
+ groupLabel: {
58
+ px: '16',
59
+ pt: '16',
60
+ pb: '6',
61
+ fontSize: '16',
62
+ },
63
+ divider: {
64
+ my: '8',
65
+ mx: '16',
66
+ },
67
+ row: {
68
+ py: '9',
69
+ px: '16',
70
+ },
71
+ icon: {
72
+ w: '28',
73
+ h: '28',
74
+ },
75
+ beforeSlot: {
76
+ mr: '4',
77
+ },
78
+ afterSlot: {
79
+ ml: '4',
80
+ },
81
+ },
82
+ } as const;
83
+
3
84
  export const listRecipe = defineRecipe({
4
85
  className: 'list',
5
86
  jsx: ['List'],
@@ -10,5 +91,14 @@ export const listRecipe = defineRecipe({
10
91
  justifyContent: 'start',
11
92
  gap: '0',
12
93
  },
13
- variants: {},
94
+ variants: {
95
+ density: {
96
+ compact: {},
97
+ comfortable: {},
98
+ spacious: {},
99
+ },
100
+ },
101
+ defaultVariants: {
102
+ density: 'compact',
103
+ },
14
104
  });
@@ -1,10 +1,14 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
+ import { listDensity } from './list';
4
+
3
5
  export const listItemRecipe = defineSlotRecipe({
4
6
  className: 'listItem',
5
7
  jsx: ['ListItem'],
6
8
  slots: [
7
9
  'wrapper',
10
+ 'beforeSlot',
11
+ 'afterSlot',
8
12
  'icon',
9
13
  'itemMain',
10
14
  'itemLabel',
@@ -43,12 +47,27 @@ export const listItemRecipe = defineSlotRecipe({
43
47
  '&[data-active="true"]': {
44
48
  bg: 'bg.neutral.hovered',
45
49
  },
50
+ '&[data-disabled="true"]': {
51
+ opacity: '0.4',
52
+ cursor: 'not-allowed',
53
+ pointerEvents: 'none',
54
+ },
46
55
  _disabled: {
47
56
  opacity: '0.4',
48
57
  cursor: 'not-allowed',
49
58
  pointerEvents: 'none',
50
59
  },
51
60
  },
61
+ beforeSlot: {
62
+ display: 'flex',
63
+ alignItems: 'center',
64
+ flexShrink: '0',
65
+ },
66
+ afterSlot: {
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ flexShrink: '0',
70
+ },
52
71
  divider: {
53
72
  width: 'full',
54
73
  },
@@ -124,10 +143,7 @@ export const listItemRecipe = defineSlotRecipe({
124
143
  },
125
144
  density: {
126
145
  compact: {
127
- wrapper: {
128
- py: '3',
129
- px: '10',
130
- },
146
+ wrapper: listDensity.compact.row,
131
147
  itemLabel: {
132
148
  textStyle: 'sans.md',
133
149
  color: 'text',
@@ -136,20 +152,13 @@ export const listItemRecipe = defineSlotRecipe({
136
152
  textStyle: 'sans.xs',
137
153
  lineHeight: 'tight',
138
154
  },
139
- icon: {
140
- w: '24',
141
- h: '24',
142
- },
143
- divider: {
144
- py: '3',
145
- px: '10',
146
- },
155
+ icon: listDensity.compact.icon,
156
+ beforeSlot: listDensity.compact.beforeSlot,
157
+ afterSlot: listDensity.compact.afterSlot,
158
+ divider: listDensity.compact.divider,
147
159
  },
148
160
  comfortable: {
149
- wrapper: {
150
- py: '7',
151
- px: '12',
152
- },
161
+ wrapper: listDensity.comfortable.row,
153
162
  itemLabel: {
154
163
  textStyle: 'sans.md',
155
164
  color: 'text',
@@ -158,20 +167,13 @@ export const listItemRecipe = defineSlotRecipe({
158
167
  textStyle: 'sans.xs',
159
168
  lineHeight: 'tight',
160
169
  },
161
- icon: {
162
- w: '24',
163
- h: '24',
164
- },
165
- divider: {
166
- py: '7',
167
- px: '12',
168
- },
170
+ icon: listDensity.comfortable.icon,
171
+ beforeSlot: listDensity.comfortable.beforeSlot,
172
+ afterSlot: listDensity.comfortable.afterSlot,
173
+ divider: listDensity.comfortable.divider,
169
174
  },
170
175
  spacious: {
171
- wrapper: {
172
- py: '9',
173
- px: '16',
174
- },
176
+ wrapper: listDensity.spacious.row,
175
177
  itemLabel: {
176
178
  textStyle: 'sans.lg',
177
179
  color: 'text',
@@ -180,14 +182,10 @@ export const listItemRecipe = defineSlotRecipe({
180
182
  textStyle: 'sans.sm',
181
183
  lineHeight: 'tight',
182
184
  },
183
- icon: {
184
- w: '28',
185
- h: '28',
186
- },
187
- divider: {
188
- py: '9',
189
- px: '16',
190
- },
185
+ icon: listDensity.spacious.icon,
186
+ beforeSlot: listDensity.spacious.beforeSlot,
187
+ afterSlot: listDensity.spacious.afterSlot,
188
+ divider: listDensity.spacious.divider,
191
189
  },
192
190
  },
193
191
  selected: {
@@ -227,6 +225,7 @@ export const listItemRecipe = defineSlotRecipe({
227
225
  wrapper: {
228
226
  ps: '5',
229
227
  },
228
+ beforeSlot: listDensity.compact.beforeSlot,
230
229
  },
231
230
  },
232
231
  {
@@ -236,6 +235,7 @@ export const listItemRecipe = defineSlotRecipe({
236
235
  wrapper: {
237
236
  pe: '5',
238
237
  },
238
+ afterSlot: listDensity.compact.afterSlot,
239
239
  },
240
240
  },
241
241
  {
@@ -245,6 +245,7 @@ export const listItemRecipe = defineSlotRecipe({
245
245
  wrapper: {
246
246
  ps: '5',
247
247
  },
248
+ beforeSlot: listDensity.compact.beforeSlot,
248
249
  },
249
250
  },
250
251
  {
@@ -254,6 +255,7 @@ export const listItemRecipe = defineSlotRecipe({
254
255
  wrapper: {
255
256
  ps: '7',
256
257
  },
258
+ beforeSlot: listDensity.comfortable.beforeSlot,
257
259
  },
258
260
  },
259
261
  {
@@ -263,6 +265,7 @@ export const listItemRecipe = defineSlotRecipe({
263
265
  wrapper: {
264
266
  pe: '7',
265
267
  },
268
+ afterSlot: listDensity.comfortable.afterSlot,
266
269
  },
267
270
  },
268
271
  {
@@ -272,6 +275,7 @@ export const listItemRecipe = defineSlotRecipe({
272
275
  wrapper: {
273
276
  ps: '7',
274
277
  },
278
+ beforeSlot: listDensity.comfortable.beforeSlot,
275
279
  },
276
280
  },
277
281
  {
@@ -281,6 +285,7 @@ export const listItemRecipe = defineSlotRecipe({
281
285
  wrapper: {
282
286
  ps: '9',
283
287
  },
288
+ beforeSlot: listDensity.spacious.beforeSlot,
284
289
  },
285
290
  },
286
291
  {
@@ -290,6 +295,7 @@ export const listItemRecipe = defineSlotRecipe({
290
295
  wrapper: {
291
296
  pe: '9',
292
297
  },
298
+ afterSlot: listDensity.spacious.afterSlot,
293
299
  },
294
300
  },
295
301
  {
@@ -299,6 +305,7 @@ export const listItemRecipe = defineSlotRecipe({
299
305
  wrapper: {
300
306
  ps: '9',
301
307
  },
308
+ beforeSlot: listDensity.spacious.beforeSlot,
302
309
  },
303
310
  },
304
311
  ],
@@ -1,5 +1,7 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
+ import { listDensity } from './list';
4
+
3
5
  export const listItemGroupRecipe = defineSlotRecipe({
4
6
  className: 'listItemGroup',
5
7
  jsx: ['ListItemGroup'],
@@ -19,40 +21,16 @@ export const listItemGroupRecipe = defineSlotRecipe({
19
21
  variants: {
20
22
  density: {
21
23
  compact: {
22
- groupLabel: {
23
- px: '10',
24
- pt: '8',
25
- pb: '2',
26
- fontSize: '12',
27
- },
28
- divider: {
29
- my: '4',
30
- mx: '10',
31
- },
24
+ groupLabel: listDensity.compact.groupLabel,
25
+ divider: listDensity.compact.divider,
32
26
  },
33
27
  comfortable: {
34
- groupLabel: {
35
- px: '12',
36
- pt: '12',
37
- pb: '4',
38
- fontSize: '14',
39
- },
40
- divider: {
41
- my: '6',
42
- mx: '12',
43
- },
28
+ groupLabel: listDensity.comfortable.groupLabel,
29
+ divider: listDensity.comfortable.divider,
44
30
  },
45
31
  spacious: {
46
- groupLabel: {
47
- px: '16',
48
- pt: '16',
49
- pb: '6',
50
- fontSize: '16',
51
- },
52
- divider: {
53
- my: '8',
54
- mx: '16',
55
- },
32
+ groupLabel: listDensity.spacious.groupLabel,
33
+ divider: listDensity.spacious.divider,
56
34
  },
57
35
  },
58
36
  },
@@ -1,6 +1,17 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
3
  const modalBase = {
4
+ positionWrapper: {
5
+ position: 'fixed',
6
+ inset: '0',
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ overflowY: 'auto',
11
+ pointerEvents: 'none',
12
+ padding: '16',
13
+ zIndex: '1101',
14
+ },
4
15
  overlay: {
5
16
  position: 'fixed',
6
17
  inset: '0',
@@ -15,9 +26,7 @@ const modalBase = {
15
26
  },
16
27
  },
17
28
  container: {
18
- position: 'fixed',
19
- top: '50%',
20
- left: '50%',
29
+ position: 'relative',
21
30
  display: 'flex',
22
31
  flexDirection: 'column',
23
32
  width: 'full',
@@ -26,10 +35,10 @@ const modalBase = {
26
35
  borderRadius: '12',
27
36
  boxShadow: 'overlay',
28
37
  outline: 'none',
29
- zIndex: '1101',
38
+ pointerEvents: 'auto',
30
39
  // Initial state matches animation start
31
40
  opacity: '0',
32
- transform: '[translate(-50%, -50%) scale(0.95) translateY(-10px)]',
41
+ transform: '[scale(0.95) translateY(-10px)]',
33
42
  // Animation handled via data-state
34
43
  animation: 'modalScaleIn 150ms ease-out forwards',
35
44
  '&[data-state="closing"]': {
@@ -74,6 +83,26 @@ const modalBase = {
74
83
  };
75
84
 
76
85
  const modalVariants = {
86
+ position: {
87
+ centered: {
88
+ positionWrapper: {
89
+ alignItems: 'center',
90
+ justifyContent: 'center',
91
+ },
92
+ },
93
+ top: {
94
+ positionWrapper: {
95
+ alignItems: 'flex-start',
96
+ justifyContent: 'center',
97
+ },
98
+ },
99
+ bottom: {
100
+ positionWrapper: {
101
+ alignItems: 'flex-end',
102
+ justifyContent: 'center',
103
+ },
104
+ },
105
+ },
77
106
  size: {
78
107
  sm: {
79
108
  container: {
@@ -136,6 +165,7 @@ export const modalRecipe = defineSlotRecipe({
136
165
  className: 'modal',
137
166
  jsx: ['Modal', 'ModalHeader', 'ModalBody', 'ModalFooter'],
138
167
  slots: [
168
+ 'positionWrapper',
139
169
  'overlay',
140
170
  'container',
141
171
  'header',
@@ -147,6 +177,7 @@ export const modalRecipe = defineSlotRecipe({
147
177
  base: modalBase,
148
178
  variants: modalVariants,
149
179
  defaultVariants: {
180
+ position: 'centered',
150
181
  variant: 'default',
151
182
  size: 'md',
152
183
  },
@@ -1,4 +1,5 @@
1
1
  export { boxRecipe } from './box';
2
+ export { breakpointIndicatorRecipe } from './breakpointIndicator';
2
3
  export { cardRecipe } from './card';
3
4
  export { checkboxInputRecipe } from './checkboxInput';
4
5
  export { codeRecipe, preRecipe } from './code';
@@ -7,6 +8,7 @@ export { highlightTextRecipe } from './highlightText';
7
8
  export { iconRecipe } from './icon';
8
9
  export { listRecipe } from './list';
9
10
  export { radioInputRecipe } from './radioInput';
11
+ export { skeletonRecipe } from './skeleton';
10
12
  export { tagRecipe } from './tag';
11
13
  export { headingRecipe, labelRecipe, linkRecipe, textRecipe } from './text';
12
14
  export { textareaRecipe } from './textarea';
@@ -6,6 +6,7 @@ export { checkboxRecipe } from './checkbox';
6
6
  export { chipRecipe } from './chip';
7
7
  export { datePickerRecipe } from './datePicker';
8
8
  export { formFieldRecipe } from './formField';
9
+ export { kbdRecipe } from './kbd';
9
10
  export { listItemRecipe } from './listItem';
10
11
  export { listItemGroupRecipe } from './listItemGroup';
11
12
  export { menuRecipe } from './menu';
@@ -66,6 +66,13 @@ const selectBase = {
66
66
  color: 'text.subtlest',
67
67
  },
68
68
 
69
+ chips: {
70
+ flex: 1,
71
+ minWidth: '0',
72
+ alignItems: 'center',
73
+ color: 'text',
74
+ },
75
+
69
76
  // The chevron/arrow icon
70
77
  icon: {
71
78
  display: 'flex',
@@ -133,7 +140,7 @@ const selectVariants = {
133
140
  export const selectRecipe = defineSlotRecipe({
134
141
  className: 'select',
135
142
  jsx: ['Select', 'SelectTrigger'],
136
- slots: ['trigger', 'value', 'placeholder', 'icon'],
143
+ slots: ['trigger', 'value', 'placeholder', 'chips', 'icon'],
137
144
  base: selectBase,
138
145
  variants: selectVariants,
139
146
  defaultVariants: {
@@ -0,0 +1,72 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const skeletonBase = {
4
+ position: 'relative',
5
+ display: 'inline-flex',
6
+ overflow: 'hidden',
7
+ verticalAlign: 'middle',
8
+ pointerEvents: 'none',
9
+ userSelect: 'none',
10
+ color: 'transparent',
11
+ bg: 'bg.neutral',
12
+ '&::after': {
13
+ content: '""',
14
+ position: 'absolute',
15
+ inset: '0',
16
+ transform: 'translateX(-100%)',
17
+ bg: 'bg.neutral.hovered',
18
+ opacity: '0.45',
19
+ pointerEvents: 'none',
20
+ },
21
+ '@media (prefers-reduced-motion: reduce)': {
22
+ animation: 'none',
23
+ '&::after': {
24
+ animation: 'none',
25
+ },
26
+ },
27
+ };
28
+
29
+ export const skeletonRecipe = defineRecipe({
30
+ className: 'skeleton',
31
+ jsx: ['Skeleton'],
32
+ base: skeletonBase,
33
+ variants: {
34
+ variant: {
35
+ text: {
36
+ h: '4',
37
+ w: 'full',
38
+ borderRadius: 'full',
39
+ },
40
+ circular: {
41
+ borderRadius: 'full',
42
+ aspectRatio: 'square',
43
+ },
44
+ rounded: {
45
+ borderRadius: '8',
46
+ },
47
+ rectangular: {
48
+ borderRadius: '2',
49
+ },
50
+ },
51
+ animation: {
52
+ pulse: {
53
+ animation: 'pulse',
54
+ },
55
+ wave: {
56
+ '&::after': {
57
+ animation: 'skeletonWave',
58
+ },
59
+ },
60
+ false: {
61
+ animation: 'none',
62
+ '&::after': {
63
+ display: 'none',
64
+ },
65
+ },
66
+ },
67
+ },
68
+ defaultVariants: {
69
+ variant: 'text',
70
+ animation: 'pulse',
71
+ },
72
+ });
@@ -1,53 +1,59 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
3
  const spinnerBase = {
4
- spinnerDiv: {
4
+ container: {
5
+ position: 'relative',
6
+ display: 'grid',
7
+ placeContent: 'center',
8
+ zIndex: '100',
9
+ w: 'fit',
10
+ h: 'fit',
11
+ flex: '0',
12
+ },
13
+ spinnerSvg: {
5
14
  aspectRatio: 'square',
6
- rounded: '100',
7
- borderWidth: '3',
8
- borderStyle: 'solid',
9
- borderColor: 'transparent',
10
- borderTopColor: 'icon',
11
- borderBottomColor: 'icon',
12
15
  animation: 'spin',
16
+ fill: 'icon',
13
17
  isolation: 'isolate',
18
+ flex: '0',
14
19
  },
15
20
  };
16
21
 
17
22
  const spinnerVariants = {
18
23
  size: {
19
24
  xs: {
20
- spinnerDiv: {
21
- height: '16',
25
+ spinnerSvg: {
26
+ h: '16',
27
+ w: '16',
22
28
  minHeight: '16',
23
- borderWidth: '2',
24
29
  },
25
30
  },
26
31
  sm: {
27
- spinnerDiv: {
28
- height: '20',
32
+ spinnerSvg: {
33
+ h: '20',
34
+ w: '20',
29
35
  minHeight: '20',
30
- borderWidth: '2',
31
36
  },
32
37
  },
33
38
  md: {
34
- spinnerDiv: {
35
- height: '24',
39
+ spinnerSvg: {
40
+ h: '24',
41
+ w: '24',
36
42
  minHeight: '24',
37
43
  },
38
44
  },
39
45
  lg: {
40
- spinnerDiv: {
41
- height: '32',
46
+ spinnerSvg: {
47
+ h: '32',
48
+ w: '32',
42
49
  minHeight: '32',
43
50
  },
44
51
  },
45
52
  },
46
53
  inverse: {
47
54
  true: {
48
- spinnerDiv: {
49
- borderTopColor: 'icon.inverse',
50
- borderBottomColor: 'icon.inverse',
55
+ spinnerSvg: {
56
+ fill: 'icon.inverse',
51
57
  },
52
58
  },
53
59
  },
@@ -56,11 +62,8 @@ const spinnerVariants = {
56
62
  container: {
57
63
  position: 'absolute',
58
64
  inset: '0',
59
- display: 'grid',
60
- placeContent: 'center',
61
65
  width: 'full',
62
66
  height: 'full',
63
- zIndex: '100',
64
67
  },
65
68
  },
66
69
  },
@@ -69,7 +72,7 @@ const spinnerVariants = {
69
72
  export const spinnerRecipe = defineSlotRecipe({
70
73
  className: 'spinner',
71
74
  jsx: ['Spinner'],
72
- slots: ['container', 'spinnerDiv'],
75
+ slots: ['container', 'spinnerSvg'],
73
76
  base: spinnerBase,
74
77
  variants: spinnerVariants,
75
78
  defaultVariants: {