@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okshaun/components",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "okshaun design system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -6,7 +6,7 @@ export const avatarRecipe = defineSlotRecipe({
6
6
  slots: ['root', 'image', 'fallback', 'presence', 'status'],
7
7
  staticCss: [
8
8
  {
9
- size: ['xs', 'sm', 'md', 'lx', 'xl', '2xl'],
9
+ size: ['xs', 'sm', 'md', 'lg', 'xl', '2xl'],
10
10
  shape: ['circle', 'square', 'hexagon'],
11
11
  },
12
12
  ],
@@ -46,6 +46,13 @@ export const badgeRecipe = defineSlotRecipe({
46
46
  p: '5',
47
47
  },
48
48
  },
49
+ xl: {
50
+ indicator: {
51
+ h: '12',
52
+ fontSize: '16',
53
+ p: '6',
54
+ },
55
+ },
49
56
  },
50
57
  // When standalone (no children), don't use absolute positioning
51
58
  standalone: {
@@ -169,6 +176,16 @@ export const badgeRecipe = defineSlotRecipe({
169
176
  },
170
177
  },
171
178
  },
179
+ {
180
+ dot: false,
181
+ size: 'xl',
182
+ css: {
183
+ indicator: {
184
+ minW: '28',
185
+ h: 'fit',
186
+ },
187
+ },
188
+ },
172
189
  ],
173
190
  defaultVariants: {
174
191
  size: 'md',
@@ -0,0 +1,11 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ export const breakpointIndicatorRecipe = defineRecipe({
4
+ className: 'breakpointIndicator',
5
+ jsx: ['BreakpointIndicator'],
6
+ base: {
7
+ display: 'inline-flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ },
11
+ });
@@ -55,6 +55,20 @@ const baseButtonStyles = {
55
55
  outlineColor: 'border.focused',
56
56
  },
57
57
  },
58
+ mainContent: {
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ width: 'fit',
62
+ height: 'fit',
63
+ },
64
+ slot: {
65
+ display: 'inline-flex',
66
+ alignItems: 'center',
67
+ transitionDuration: 'fast',
68
+ transitionProperty: 'fill',
69
+ transitionTimingFunction: 'default',
70
+ flex: '0 0 auto',
71
+ },
58
72
  icon: {
59
73
  aspectRatio: 'square',
60
74
  transitionDuration: 'fast',
@@ -77,6 +91,7 @@ const buttonVariants = {
77
91
  },
78
92
  },
79
93
  icon: iconDefaultStyles,
94
+ slot: iconDefaultStyles,
80
95
  },
81
96
  primary: {
82
97
  container: {
@@ -96,6 +111,13 @@ const buttonVariants = {
96
111
  fill: 'icon.decorative.inverse.subtle',
97
112
  },
98
113
  },
114
+ slot: {
115
+ ...iconInverseStyles,
116
+ fill: 'icon.decorative.inverse.subtle',
117
+ _groupDisabled: {
118
+ fill: 'icon.decorative.inverse.subtle',
119
+ },
120
+ },
99
121
  },
100
122
  ghost: {
101
123
  container: {
@@ -111,6 +133,7 @@ const buttonVariants = {
111
133
  },
112
134
  },
113
135
  icon: iconDefaultStyles,
136
+ slot: iconDefaultStyles,
114
137
  },
115
138
  subtle: {
116
139
  container: {
@@ -126,6 +149,7 @@ const buttonVariants = {
126
149
  },
127
150
  },
128
151
  icon: iconDefaultStyles,
152
+ slot: iconDefaultStyles,
129
153
  },
130
154
  hollow: {
131
155
  container: {
@@ -143,6 +167,7 @@ const buttonVariants = {
143
167
  },
144
168
  },
145
169
  icon: iconDefaultStyles,
170
+ slot: iconDefaultStyles,
146
171
  },
147
172
  danger: {
148
173
  container: {
@@ -161,6 +186,12 @@ const buttonVariants = {
161
186
  fill: 'icon.decorative.inverse',
162
187
  },
163
188
  },
189
+ slot: {
190
+ ...iconInverseStyles,
191
+ _groupDisabled: {
192
+ fill: 'icon.decorative.inverse',
193
+ },
194
+ },
164
195
  },
165
196
  selected: {
166
197
  container: {
@@ -184,6 +215,15 @@ const buttonVariants = {
184
215
  fill: 'icon.selected',
185
216
  },
186
217
  },
218
+ slot: {
219
+ fill: 'icon.selected',
220
+ mixBlendMode: { base: 'multiply', _dark: 'screen' },
221
+ _groupHover: { fill: 'icon.selected' },
222
+ _groupActive: { fill: 'icon.selected' },
223
+ _groupDisabled: {
224
+ fill: 'icon.selected',
225
+ },
226
+ },
187
227
  },
188
228
  selectedBold: {
189
229
  container: {
@@ -205,6 +245,15 @@ const buttonVariants = {
205
245
  fill: 'icon.inverse',
206
246
  },
207
247
  },
248
+ slot: {
249
+ fill: 'icon.inverse',
250
+ mixBlendMode: { base: 'screen', _dark: 'multiply' },
251
+ _groupHover: { fill: 'icon.inverse' },
252
+ _groupActive: { fill: 'icon.inverse' },
253
+ _groupDisabled: {
254
+ fill: 'icon.inverse',
255
+ },
256
+ },
208
257
  },
209
258
  selectedSubtle: {
210
259
  container: {
@@ -228,6 +277,15 @@ const buttonVariants = {
228
277
  fill: 'icon.selected',
229
278
  },
230
279
  },
280
+ slot: {
281
+ fill: 'icon.selected',
282
+ mixBlendMode: { base: 'multiply', _dark: 'screen' },
283
+ _groupHover: { fill: 'icon.selected' },
284
+ _groupActive: { fill: 'icon.selected' },
285
+ _groupDisabled: {
286
+ fill: 'icon.selected',
287
+ },
288
+ },
231
289
  },
232
290
  },
233
291
  };
@@ -239,6 +297,11 @@ const buttonSizes = {
239
297
  py: '1',
240
298
  px: '8',
241
299
  },
300
+ slot: {
301
+ w: '16',
302
+ h: '16',
303
+ px: '4',
304
+ },
242
305
  icon: {
243
306
  w: '22',
244
307
  h: '22',
@@ -250,6 +313,11 @@ const buttonSizes = {
250
313
  py: '3',
251
314
  px: '12',
252
315
  },
316
+ slot: {
317
+ w: '20',
318
+ h: '20',
319
+ px: '6',
320
+ },
253
321
  icon: {
254
322
  w: '24',
255
323
  h: '24',
@@ -261,6 +329,11 @@ const buttonSizes = {
261
329
  py: '7',
262
330
  px: '14',
263
331
  },
332
+ slot: {
333
+ w: '24',
334
+ h: '24',
335
+ px: '8',
336
+ },
264
337
  icon: {
265
338
  w: '24',
266
339
  h: '24',
@@ -272,6 +345,11 @@ const buttonSizes = {
272
345
  py: '9',
273
346
  px: '16',
274
347
  },
348
+ slot: {
349
+ w: '28',
350
+ h: '28',
351
+ px: '10',
352
+ },
275
353
  icon: {
276
354
  w: '28',
277
355
  h: '28',
@@ -282,7 +360,7 @@ const buttonSizes = {
282
360
  export const buttonRecipe = defineSlotRecipe({
283
361
  className: 'button',
284
362
  jsx: ['Button'],
285
- slots: ['container', 'icon'],
363
+ slots: ['container', 'mainContent', 'slot', 'icon'],
286
364
  base: baseButtonStyles,
287
365
  variants: {
288
366
  ...buttonVariants,
@@ -361,7 +439,7 @@ export const buttonRecipe = defineSlotRecipe({
361
439
  export const iconButtonRecipe = defineSlotRecipe({
362
440
  className: 'iconButton',
363
441
  jsx: ['IconButton'],
364
- slots: ['container', 'icon'],
442
+ slots: ['container', 'mainContent', 'slot', 'icon'],
365
443
  base: baseButtonStyles,
366
444
  variants: {
367
445
  ...buttonVariants,
@@ -371,6 +449,14 @@ export const iconButtonRecipe = defineSlotRecipe({
371
449
  fontSize: '14',
372
450
  p: '1',
373
451
  },
452
+ slot: {
453
+ w: '22',
454
+ h: '22',
455
+ },
456
+ mainContent: {
457
+ width: 'fit',
458
+ height: 'fit',
459
+ },
374
460
  icon: {
375
461
  w: '22',
376
462
  h: '22',
@@ -381,6 +467,14 @@ export const iconButtonRecipe = defineSlotRecipe({
381
467
  fontSize: '16',
382
468
  p: '3',
383
469
  },
470
+ slot: {
471
+ w: '24',
472
+ h: '24',
473
+ },
474
+ mainContent: {
475
+ width: 'fit',
476
+ height: 'fit',
477
+ },
384
478
  icon: {
385
479
  w: '24',
386
480
  h: '24',
@@ -391,6 +485,14 @@ export const iconButtonRecipe = defineSlotRecipe({
391
485
  fontSize: '16',
392
486
  p: '7',
393
487
  },
488
+ slot: {
489
+ w: '24',
490
+ h: '24',
491
+ },
492
+ mainContent: {
493
+ width: 'fit',
494
+ height: 'fit',
495
+ },
394
496
  icon: {
395
497
  w: '24',
396
498
  h: '24',
@@ -401,6 +503,14 @@ export const iconButtonRecipe = defineSlotRecipe({
401
503
  fontSize: '20',
402
504
  p: '9',
403
505
  },
506
+ slot: {
507
+ w: '28',
508
+ h: '28',
509
+ },
510
+ mainContent: {
511
+ width: 'fit',
512
+ height: 'fit',
513
+ },
404
514
  icon: {
405
515
  w: '28',
406
516
  h: '28',
@@ -3,22 +3,27 @@ import { defineSlotRecipe } from '@pandacss/dev';
3
3
  const chipBase = {
4
4
  container: {
5
5
  position: 'relative',
6
+ display: 'inline-flex',
7
+ alignItems: 'center',
8
+ gap: '1',
9
+ width: 'fit-content',
10
+ verticalAlign: 'middle',
11
+ },
12
+ body: {
6
13
  display: 'inline-flex',
7
14
  alignItems: 'center',
8
15
  appearance: 'none',
9
- width: 'fit',
16
+ border: 'none',
10
17
  borderRadius: '999',
11
18
  fontFamily: 'sans',
12
19
  lineHeight: 'default',
13
20
  fontWeight: 'medium',
14
21
  whiteSpace: 'nowrap',
15
- verticalAlign: 'middle',
16
22
  cursor: 'pointer',
17
23
  transitionDuration: 'fast',
18
- transitionProperty: 'background, color',
24
+ transitionProperty: 'background, color, border-color, box-shadow',
19
25
  transitionTimingFunction: 'default',
20
26
  userSelect: 'none',
21
- border: 'none',
22
27
  outlineWidth: '2',
23
28
  outlineStyle: 'solid',
24
29
  outlineColor: 'transparent',
@@ -64,6 +69,50 @@ const chipBase = {
64
69
  },
65
70
  },
66
71
  },
72
+ mainContent: {
73
+ display: 'inline-flex',
74
+ alignItems: 'center',
75
+ gap: 'inherit',
76
+ minW: 0,
77
+ },
78
+ slot: {
79
+ display: 'inline-flex',
80
+ alignItems: 'center',
81
+ justifyContent: 'center',
82
+ flexShrink: 0,
83
+ },
84
+ dismissButton: {
85
+ display: 'inline-flex',
86
+ alignItems: 'center',
87
+ justifyContent: 'center',
88
+ border: 'none',
89
+ borderRadius: 'full',
90
+ bg: 'transparent',
91
+ color: 'inherit',
92
+ cursor: 'pointer',
93
+ transitionDuration: 'fast',
94
+ transitionProperty: 'background, color',
95
+ transitionTimingFunction: 'default',
96
+ outlineWidth: '2',
97
+ outlineStyle: 'solid',
98
+ outlineColor: 'transparent',
99
+ _hover: {
100
+ bg: 'bg.neutral.hovered',
101
+ },
102
+ _active: {
103
+ bg: 'bg.neutral.pressed',
104
+ },
105
+ _focusVisible: {
106
+ outlineColor: 'border.focused',
107
+ },
108
+ _disabled: {
109
+ cursor: 'not-allowed',
110
+ color: 'text.disabled',
111
+ },
112
+ '[data-selected=true] &': {
113
+ color: 'text.inverse',
114
+ },
115
+ },
67
116
  chipIcon: {
68
117
  fill: 'icon.decorative',
69
118
  aspectRatio: 'square',
@@ -73,7 +122,6 @@ const chipBase = {
73
122
  _groupHover: { fill: 'icon.decorative.hovered' },
74
123
  _groupActive: { fill: 'icon.decorative.hovered' },
75
124
  _groupDisabled: { fill: 'icon.decorative' },
76
-
77
125
  '[data-selected=true] &': {
78
126
  fill: 'icon.decorative.inverse',
79
127
  },
@@ -86,55 +134,118 @@ const chipBase = {
86
134
  export const chipRecipe = defineSlotRecipe({
87
135
  className: 'chip',
88
136
  jsx: ['Chip'],
89
- slots: ['container', 'chipIcon'],
137
+ slots: [
138
+ 'container',
139
+ 'body',
140
+ 'mainContent',
141
+ 'dismissButton',
142
+ 'slot',
143
+ 'chipIcon',
144
+ ],
90
145
  base: chipBase,
91
146
  variants: {
92
147
  size: {
93
148
  sm: {
94
- container: {
149
+ body: {
95
150
  gap: '2',
96
151
  h: '20',
97
152
  px: '6',
98
153
  py: '0',
99
154
  fontSize: '14',
100
155
  },
156
+ mainContent: {
157
+ gap: '2',
158
+ },
159
+ slot: {
160
+ gap: '2',
161
+ },
101
162
  chipIcon: {
102
163
  w: '20',
103
164
  h: '20',
104
165
  },
166
+ dismissButton: {
167
+ w: '20',
168
+ h: '20',
169
+ },
105
170
  },
106
171
  md: {
107
- container: {
172
+ body: {
108
173
  gap: '4',
109
174
  h: '24',
110
175
  px: '8',
111
176
  py: '1',
112
177
  fontSize: '14',
113
178
  },
179
+ mainContent: {
180
+ gap: '4',
181
+ },
182
+ slot: {
183
+ gap: '4',
184
+ },
114
185
  chipIcon: {
115
186
  w: '20',
116
187
  h: '20',
117
188
  },
189
+ dismissButton: {
190
+ w: '24',
191
+ h: '24',
192
+ },
118
193
  },
119
194
  lg: {
120
- container: {
195
+ body: {
121
196
  gap: '4',
122
197
  h: '32',
123
198
  px: '10',
124
199
  py: '4',
125
200
  fontSize: '16',
126
201
  },
202
+ mainContent: {
203
+ gap: '4',
204
+ },
205
+ slot: {
206
+ gap: '4',
207
+ },
127
208
  chipIcon: {
128
209
  w: '24',
129
210
  h: '24',
130
211
  },
212
+ dismissButton: {
213
+ w: '32',
214
+ h: '32',
215
+ },
216
+ },
217
+ xl: {
218
+ body: {
219
+ gap: '4',
220
+ h: '40',
221
+ px: '12',
222
+ py: '5',
223
+ fontSize: '16',
224
+ },
225
+ mainContent: {
226
+ gap: '4',
227
+ },
228
+ slot: {
229
+ gap: '4',
230
+ },
231
+ chipIcon: {
232
+ w: '24',
233
+ h: '24',
234
+ },
235
+ dismissButton: {
236
+ w: '40',
237
+ h: '40',
238
+ },
131
239
  },
132
240
  },
133
241
  before: {
134
- true: { container: {} },
242
+ true: { body: {} },
135
243
  },
136
244
  after: {
137
- true: { container: {} },
245
+ true: { body: {} },
246
+ },
247
+ dismissable: {
248
+ true: { body: {} },
138
249
  },
139
250
  },
140
251
  compoundVariants: [
@@ -142,42 +253,56 @@ export const chipRecipe = defineSlotRecipe({
142
253
  size: 'sm',
143
254
  before: true,
144
255
  css: {
145
- container: { ps: '2' },
256
+ body: { ps: '2' },
146
257
  },
147
258
  },
148
259
  {
149
260
  size: 'sm',
150
261
  after: true,
151
262
  css: {
152
- container: { pe: '2' },
263
+ body: { pe: '2' },
153
264
  },
154
265
  },
155
266
  {
156
267
  size: 'md',
157
268
  before: true,
158
269
  css: {
159
- container: { ps: '2' },
270
+ body: { ps: '2' },
160
271
  },
161
272
  },
162
273
  {
163
274
  size: 'md',
164
275
  after: true,
165
276
  css: {
166
- container: { pe: '2' },
277
+ body: { pe: '2' },
167
278
  },
168
279
  },
169
280
  {
170
281
  size: 'lg',
171
282
  before: true,
172
283
  css: {
173
- container: { ps: '4' },
284
+ body: { ps: '4' },
174
285
  },
175
286
  },
176
287
  {
177
288
  size: 'lg',
178
289
  after: true,
179
290
  css: {
180
- container: { pe: '4' },
291
+ body: { pe: '4' },
292
+ },
293
+ },
294
+ {
295
+ size: 'xl',
296
+ before: true,
297
+ css: {
298
+ body: { ps: '4' },
299
+ },
300
+ },
301
+ {
302
+ size: 'xl',
303
+ after: true,
304
+ css: {
305
+ body: { pe: '4' },
181
306
  },
182
307
  },
183
308
  ],
@@ -64,6 +64,25 @@ const datePickerBase = {
64
64
  outlineColor: 'border.danger',
65
65
  },
66
66
  },
67
+ _invalid: {
68
+ bg: 'bg.danger',
69
+ borderColor: 'border.danger',
70
+ color: 'text.danger',
71
+ _hover: {
72
+ bg: 'bg.danger.hovered',
73
+ borderColor: 'border.danger',
74
+ },
75
+ _focusWithin: {
76
+ bg: 'bg.danger',
77
+ borderColor: 'border.danger',
78
+ outlineColor: 'border.danger',
79
+ },
80
+ _open: {
81
+ bg: 'bg.danger',
82
+ borderColor: 'border.danger',
83
+ outlineColor: 'border.danger',
84
+ },
85
+ },
67
86
  },
68
87
  segment: {
69
88
  display: 'inline-flex',
@@ -85,6 +104,9 @@ const datePickerBase = {
85
104
  _groupDisabled: {
86
105
  color: 'text.disabled',
87
106
  },
107
+ _invalid: {
108
+ color: 'text.danger',
109
+ },
88
110
  },
89
111
  separator: {
90
112
  color: 'text.placeholder',
@@ -1,13 +1,32 @@
1
1
  import { defineRecipe } from '@pandacss/dev';
2
2
 
3
- const iconBase = {
4
- w: '24',
5
- aspectRatio: 'square',
6
- fill: 'icon.decorative',
7
- };
3
+ import type { AllowedIconSizes } from '~/components/Icon';
4
+ import { numericSizes } from '~/styles/primitives';
5
+
6
+ const sizeVariants = Object.fromEntries(
7
+ Object.keys(numericSizes).map((key) => [key, { w: key }]),
8
+ ) as Record<AllowedIconSizes, { w: AllowedIconSizes }>;
8
9
 
9
10
  export const iconRecipe = defineRecipe({
10
11
  className: 'icon',
11
12
  jsx: ['Icon'],
12
- base: iconBase,
13
+ base: {
14
+ aspectRatio: 'square',
15
+ fill: 'icon.decorative',
16
+ flexShrink: 0,
17
+ // Default size. Does not affect variant class names, so it is safe here.
18
+ w: '24',
19
+ },
20
+ variants: {
21
+ size: {
22
+ ...sizeVariants,
23
+ sm: { w: '16' },
24
+ md: { w: '20' },
25
+ lg: { w: '24' },
26
+ xl: { w: '28' },
27
+ },
28
+ },
29
+ // No default size variant: a default here would be hard to override in
30
+ // other recipes.
31
+ defaultVariants: {},
13
32
  });
@@ -0,0 +1,53 @@
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
+
3
+ const kbdBase = {
4
+ container: {
5
+ display: 'inline-flex',
6
+ alignItems: 'center',
7
+ gap: '1',
8
+ verticalAlign: 'middle',
9
+ },
10
+ key: {
11
+ display: 'inline-flex',
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ minH: '6',
15
+ minW: '6',
16
+ px: '2',
17
+ borderWidth: '1',
18
+ borderStyle: 'solid',
19
+ borderColor: 'border.subtle',
20
+ borderRadius: '6',
21
+ bg: 'bg.neutral',
22
+ color: 'text',
23
+ fontFamily: 'mono',
24
+ fontSize: '12',
25
+ lineHeight: 'none',
26
+ fontWeight: 'medium',
27
+ letterSpacing: 'wide',
28
+ whiteSpace: 'nowrap',
29
+ boxShadow: 'sm',
30
+ },
31
+ };
32
+
33
+ export const kbdRecipe = defineSlotRecipe({
34
+ className: 'kbd',
35
+ jsx: ['Kbd'],
36
+ slots: ['container', 'key'],
37
+ base: kbdBase,
38
+ variants: {
39
+ symbol: {
40
+ true: {
41
+ key: {
42
+ minW: '7',
43
+ px: '2.5',
44
+ fontSize: '14',
45
+ letterSpacing: 'normal',
46
+ },
47
+ },
48
+ },
49
+ },
50
+ defaultVariants: {
51
+ symbol: false,
52
+ },
53
+ });