@okshaun/components 3.0.0 → 4.1.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 (69) hide show
  1. package/dist/icon-metadata.json +359 -42
  2. package/dist/index.js +12890 -5844
  3. package/dist/index.js.map +1 -1
  4. package/dist/panda.buildinfo.json +523 -501
  5. package/dist/playroom-static.css +2 -2
  6. package/dist/{preset-BAn5LBiW.js → preset-CLoY9s9i.js} +2031 -2086
  7. package/dist/preset-CLoY9s9i.js.map +1 -0
  8. package/dist/preset.js +1 -1
  9. package/dist/specs/conditions.json +75 -51
  10. package/dist/specs/keyframes.json +22 -0
  11. package/dist/specs/recipes.json +222 -106
  12. package/dist/specs/semantic-tokens.json +194 -86
  13. package/dist/specs/tokens.json +16 -36
  14. package/dist/sprite.svg +1 -1
  15. package/dist/sprite.symbol.html +445 -44
  16. package/dist/styles.css +11441 -13424
  17. package/dist/svgs/cheese.svg +1 -0
  18. package/dist/svgs/collapse-vertical.svg +1 -0
  19. package/dist/svgs/expand-vertical.svg +1 -0
  20. package/dist/svgs/magnet.svg +1 -0
  21. package/dist/svgs/to-date-backward.svg +1 -0
  22. package/dist/svgs/to-date-forward.svg +1 -0
  23. package/dist/types/index.d.ts +2815 -288
  24. package/package.json +4 -2
  25. package/src/recipes/autocomplete.ts +266 -0
  26. package/src/recipes/badge.ts +25 -54
  27. package/src/recipes/button.ts +155 -316
  28. package/src/recipes/calendar.ts +91 -0
  29. package/src/recipes/card.ts +4 -70
  30. package/src/recipes/chip.ts +212 -266
  31. package/src/recipes/dateMenus.ts +40 -0
  32. package/src/recipes/dateTimeMenus.ts +43 -0
  33. package/src/recipes/formField.ts +1 -1
  34. package/src/recipes/kbd.ts +42 -39
  35. package/src/recipes/list.ts +11 -85
  36. package/src/recipes/listDensity.ts +66 -0
  37. package/src/recipes/listItem.ts +27 -166
  38. package/src/recipes/listItemGroup.ts +16 -16
  39. package/src/recipes/menu.ts +17 -3
  40. package/src/recipes/modal.ts +65 -65
  41. package/src/recipes/radio.ts +6 -6
  42. package/src/recipes/recipes-slot.ts +7 -2
  43. package/src/recipes/segmentedFields.ts +192 -0
  44. package/src/recipes/segmentedInputs.ts +109 -0
  45. package/src/recipes/tag.ts +218 -210
  46. package/src/recipes/text.ts +37 -19
  47. package/src/recipes/textInput.ts +103 -155
  48. package/src/recipes/themeSwitcher.ts +3 -3
  49. package/src/recipes/timeMenus.ts +110 -0
  50. package/src/recipes/toggle.ts +3 -1
  51. package/src/styles/primitives/shadows.ts +26 -60
  52. package/src/styles/primitives/zIndex.ts +1 -0
  53. package/src/styles/semantics/colors.ts +84 -37
  54. package/src/styles/semantics/shadows.ts +4 -30
  55. package/src/styles/semantics/zIndex.ts +2 -0
  56. package/src/styles/utilities/conditions.ts +61 -51
  57. package/src/styles/utilities/dropShadows.ts +51 -0
  58. package/src/styles/utilities/filters.ts +22 -7
  59. package/src/styles/utilities/globalStyle.ts +5 -2
  60. package/src/styles/utilities/index.ts +3 -0
  61. package/src/styles/utilities/keyframes.ts +27 -4
  62. package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
  63. package/src/styles/utilities/shadowDefinitions.ts +112 -0
  64. package/src/utils/dsChain.ts +113 -0
  65. package/src/utils/dsComponent.ts +44 -0
  66. package/src/utils/dsPart.ts +41 -0
  67. package/dist/preset-BAn5LBiW.js.map +0 -1
  68. package/src/recipes/datePicker.ts +0 -234
  69. package/src/recipes/timePicker.ts +0 -216
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okshaun/components",
3
- "version": "3.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "okshaun design system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -60,7 +60,8 @@
60
60
  "@fontsource/ibm-plex-mono": "^5.1.0",
61
61
  "@fontsource/ibm-plex-sans": "^5.1.0",
62
62
  "react": "^19.0.0",
63
- "react-dom": "^19.0.0"
63
+ "react-dom": "^19.0.0",
64
+ "@tanstack/react-form": "^1.0.0"
64
65
  },
65
66
  "peerDependenciesMeta": {
66
67
  "@fontsource-variable/piazzolla": {
@@ -93,6 +94,7 @@
93
94
  "@storybook/react": "^8.6.17",
94
95
  "@storybook/react-vite": "^8.6.17",
95
96
  "@storybook/test": "^8.6.17",
97
+ "@tanstack/react-form": "^1.33.5",
96
98
  "@types/node": "^22.15.30",
97
99
  "@types/react": "19.0.8",
98
100
  "@types/react-dom": "19.0.3",
@@ -0,0 +1,266 @@
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
+
3
+ import { globalBaseStyles } from '~/styles/utilities';
4
+
5
+ const validationStyles = {
6
+ danger: {
7
+ borderColor: 'border.danger',
8
+ outlineColor: 'border.danger',
9
+ },
10
+ success: {
11
+ borderColor: 'border.success',
12
+ outlineColor: 'border.success',
13
+ },
14
+ };
15
+
16
+ const autocompleteBase = {
17
+ root: {
18
+ ...globalBaseStyles,
19
+ '--control-py': 'token(sizes.3)',
20
+ '--control-px': 'token(sizes.10)',
21
+ '--control-fs': 'token(sizes.16)',
22
+ '--control-min-height': 'token(sizes.32)',
23
+ '--value-gap': 'token(sizes.4)',
24
+ '--input-min-width': 'token(sizes.80)',
25
+ '--loading-size': 'token(sizes.20)',
26
+ position: 'relative',
27
+ display: 'inline-flex',
28
+ flexDirection: 'column',
29
+ width: 'full',
30
+ minWidth: '0',
31
+ maxWidth: 'full',
32
+ fontFamily: 'sans',
33
+ lineHeight: 'default',
34
+ _disabled: {
35
+ opacity: 0.4,
36
+ cursor: 'not-allowed',
37
+ },
38
+ _groupDisabled: {
39
+ opacity: 1,
40
+ },
41
+ },
42
+ control: {
43
+ position: 'relative',
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ width: 'full',
47
+ minWidth: '0',
48
+ minHeight: 'var(--control-min-height)',
49
+ py: 'var(--control-py)',
50
+ ps: 'var(--control-px)',
51
+ pe: 'var(--control-px)',
52
+ bg: 'surface',
53
+ color: 'text',
54
+ borderWidth: '1',
55
+ borderStyle: 'solid',
56
+ borderColor: 'border.input',
57
+ borderRadius: '4',
58
+ outlineWidth: '1',
59
+ outlineStyle: 'solid',
60
+ outlineColor: 'transparent',
61
+ cursor: 'text',
62
+ transitionDuration: 'fast',
63
+ transitionProperty: 'background, border-color, outline-color',
64
+ transitionTimingFunction: 'default',
65
+ _focusWithin: {
66
+ borderColor: 'border.focused',
67
+ outlineColor: 'border.focused',
68
+ },
69
+ _open: {
70
+ borderColor: 'border.focused',
71
+ outlineColor: 'border.focused',
72
+ },
73
+ _error: validationStyles.danger,
74
+ _invalid: validationStyles.danger,
75
+ _valid: validationStyles.success,
76
+ _disabled: {
77
+ bg: 'bg.disabled',
78
+ borderColor: 'border.disabled',
79
+ color: 'text.disabled',
80
+ cursor: 'not-allowed',
81
+ pointerEvents: 'none',
82
+ _focusWithin: {
83
+ borderColor: 'border.disabled',
84
+ outlineColor: 'transparent',
85
+ },
86
+ },
87
+ },
88
+ valueContainer: {
89
+ display: 'flex',
90
+ alignItems: 'center',
91
+ alignContent: 'center',
92
+ flex: '1',
93
+ flexWrap: 'wrap',
94
+ minWidth: '0',
95
+ gap: 'var(--value-gap)',
96
+ },
97
+ input: {
98
+ flexGrow: '1',
99
+ flexShrink: '0',
100
+ flexBasis: 'var(--input-min-width)',
101
+ minWidth: 'var(--input-min-width)',
102
+ maxWidth: 'full',
103
+ p: '0',
104
+ marginBlock: '-3',
105
+ bg: 'transparent',
106
+ color: 'text',
107
+ fontFamily: 'sans',
108
+ fontSize: 'var(--control-fs)',
109
+ lineHeight: 'default',
110
+ border: 'none',
111
+ outline: 'none',
112
+ _placeholder: {
113
+ color: 'text.placeholder',
114
+ },
115
+ _disabled: {
116
+ color: 'text.disabled',
117
+ cursor: 'not-allowed',
118
+ },
119
+ },
120
+ token: {
121
+ minWidth: '0',
122
+ maxWidth: 'full',
123
+ flex: '0 1 auto',
124
+ _new: {
125
+ bg: 'transparent',
126
+ outlineWidth: '1',
127
+ outlineStyle: 'dashed',
128
+ outlineColor: 'border.warning',
129
+ },
130
+ },
131
+ overflowIndicator: {
132
+ display: 'inline-flex',
133
+ alignItems: 'center',
134
+ flexShrink: '0',
135
+ minHeight: 'var(--loading-size)',
136
+ px: '6',
137
+ bg: 'bg.neutral',
138
+ color: 'text.subtle',
139
+ borderRadius: '999',
140
+ fontSize: '14',
141
+ fontWeight: 'medium',
142
+ lineHeight: 'default',
143
+ whiteSpace: 'nowrap',
144
+ },
145
+ loadingIndicator: {
146
+ display: 'inline-flex',
147
+ alignItems: 'center',
148
+ alignSelf: 'center',
149
+ flexShrink: '0',
150
+ ms: 'var(--control-py)',
151
+ width: 'var(--loading-size)',
152
+ height: 'var(--loading-size)',
153
+ _icon: {
154
+ width: 'var(--loading-size)',
155
+ height: 'var(--loading-size)',
156
+ },
157
+ },
158
+ listbox: {
159
+ ...globalBaseStyles,
160
+ width: 'full',
161
+ maxHeight: '192',
162
+ overflowY: 'auto',
163
+ bg: 'surface',
164
+ borderRadius: '4',
165
+ boxShadow: 'overlay',
166
+ outline: 'none',
167
+ },
168
+ status: {
169
+ display: 'flex',
170
+ alignItems: 'center',
171
+ width: 'full',
172
+ minHeight: '40',
173
+ px: '12',
174
+ py: '8',
175
+ color: 'text.subtle',
176
+ fontSize: '14',
177
+ lineHeight: 'default',
178
+ },
179
+ liveRegion: {
180
+ srOnly: true,
181
+ },
182
+ };
183
+
184
+ const autocompleteVariants = {
185
+ layer: {
186
+ elevated: {
187
+ listbox: {
188
+ zIndex: 'elevated',
189
+ },
190
+ },
191
+ modalFloating: {
192
+ listbox: {
193
+ zIndex: 'modalFloating',
194
+ },
195
+ },
196
+ },
197
+ size: {
198
+ sm: {
199
+ root: {
200
+ '--control-py': 'token(sizes.0)',
201
+ '--control-px': 'token(sizes.8)',
202
+ '--control-fs': 'token(sizes.14)',
203
+ '--control-min-height': 'token(sizes.24)',
204
+ '--value-gap': 'token(sizes.3)',
205
+ '--input-min-width': 'token(sizes.64)',
206
+ '--loading-size': 'token(sizes.16)',
207
+ },
208
+ },
209
+ md: {
210
+ root: {
211
+ '--control-py': 'token(sizes.3)',
212
+ '--control-px': 'token(sizes.10)',
213
+ '--control-fs': 'token(sizes.16)',
214
+ '--control-min-height': 'token(sizes.32)',
215
+ '--value-gap': 'token(sizes.4)',
216
+ '--input-min-width': 'token(sizes.80)',
217
+ '--loading-size': 'token(sizes.20)',
218
+ },
219
+ },
220
+ lg: {
221
+ root: {
222
+ '--control-py': 'token(sizes.7)',
223
+ '--control-px': 'token(sizes.12)',
224
+ '--control-fs': 'token(sizes.16)',
225
+ '--control-min-height': 'token(sizes.40)',
226
+ '--value-gap': 'token(sizes.5)',
227
+ '--input-min-width': 'token(sizes.96)',
228
+ '--loading-size': 'token(sizes.20)',
229
+ },
230
+ },
231
+ xl: {
232
+ root: {
233
+ '--control-py': 'token(sizes.9)',
234
+ '--control-px': 'token(sizes.16)',
235
+ '--control-fs': 'token(sizes.20)',
236
+ '--control-min-height': 'token(sizes.48)',
237
+ '--value-gap': 'token(sizes.6)',
238
+ '--input-min-width': 'token(sizes.112)',
239
+ '--loading-size': 'token(sizes.24)',
240
+ },
241
+ },
242
+ },
243
+ };
244
+
245
+ export const autocompleteRecipe = defineSlotRecipe({
246
+ className: 'autocomplete',
247
+ jsx: ['Autocomplete'],
248
+ slots: [
249
+ 'root',
250
+ 'control',
251
+ 'valueContainer',
252
+ 'input',
253
+ 'token',
254
+ 'overflowIndicator',
255
+ 'loadingIndicator',
256
+ 'listbox',
257
+ 'status',
258
+ 'liveRegion',
259
+ ],
260
+ base: autocompleteBase,
261
+ variants: autocompleteVariants,
262
+ defaultVariants: {
263
+ size: 'md',
264
+ layer: 'elevated',
265
+ },
266
+ });
@@ -1,54 +1,69 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
+ // Ported from the Cetec design system: slots, sizing scale and behaviour.
4
+ // okshaun's semantic tokens carry the colours.
5
+
6
+ import { globalBaseStyles } from '~/styles/utilities';
7
+
3
8
  export const badgeRecipe = defineSlotRecipe({
4
9
  className: 'badge',
5
10
  jsx: ['Badge'],
6
11
  slots: ['root', 'indicator'],
7
12
  base: {
8
13
  root: {
14
+ ...globalBaseStyles,
15
+ '--indicator-min-width': 'token(sizes.16)',
9
16
  display: 'inline-flex',
10
17
  position: 'relative',
11
18
  verticalAlign: 'middle',
19
+ w: 'fit',
20
+ h: 'fit',
21
+ flex: '0',
12
22
  },
13
23
  indicator: {
14
24
  display: 'inline-flex',
15
25
  alignItems: 'center',
16
26
  justifyContent: 'center',
27
+ h: 'fit',
17
28
  borderRadius: '999',
18
29
  fontWeight: 'medium',
19
30
  fontFamily: 'sans',
20
31
  lineHeight: 'none',
21
32
  whiteSpace: 'nowrap',
22
33
  userSelect: 'none',
23
- zIndex: 'raised',
34
+ zIndex: '1',
24
35
  },
25
36
  },
26
37
  variants: {
27
38
  size: {
28
39
  sm: {
29
40
  indicator: {
30
- h: '6',
41
+ '--indicator-min-width': 'token(sizes.16)',
42
+ minH: '6',
31
43
  fontSize: '10',
32
44
  p: '3',
33
45
  },
34
46
  },
35
47
  md: {
36
48
  indicator: {
37
- h: '8',
49
+ '--indicator-min-width': 'token(sizes.20)',
50
+ minH: '8',
38
51
  fontSize: '12',
39
52
  p: '4',
40
53
  },
41
54
  },
42
55
  lg: {
43
56
  indicator: {
44
- h: '10',
57
+ '--indicator-min-width': 'token(sizes.24)',
58
+ minH: '10',
45
59
  fontSize: '14',
46
60
  p: '5',
47
61
  },
48
62
  },
49
63
  xl: {
50
64
  indicator: {
51
- h: '12',
65
+ '--indicator-min-width': 'token(sizes.28)',
66
+ minH: '12',
52
67
  fontSize: '16',
53
68
  p: '6',
54
69
  },
@@ -63,6 +78,7 @@ export const badgeRecipe = defineSlotRecipe({
63
78
  indicator: {
64
79
  position: 'static',
65
80
  transform: 'none',
81
+ h: 'fit',
66
82
  },
67
83
  },
68
84
  false: {
@@ -76,19 +92,17 @@ export const badgeRecipe = defineSlotRecipe({
76
92
  top: '0',
77
93
  right: '0',
78
94
  transform: 'translate(50%, -50%)',
95
+ h: 'fit',
79
96
  },
80
97
  },
81
98
  },
82
99
  // Dot mode: smaller, no text
83
100
  dot: {
84
- true: {
85
- indicator: {
86
- // Dot mode styles handled by base + size variants
87
- },
88
- },
101
+ true: {},
89
102
  false: {
90
103
  indicator: {
91
- // Count mode - compound variants handle sizing
104
+ h: 'fit',
105
+ minW: 'var(--indicator-min-width)',
92
106
  },
93
107
  },
94
108
  },
@@ -144,49 +158,6 @@ export const badgeRecipe = defineSlotRecipe({
144
158
  },
145
159
  },
146
160
  },
147
- compoundVariants: [
148
- // Count mode sizes (smaller than count mode)
149
- {
150
- dot: false,
151
- size: 'sm',
152
- css: {
153
- indicator: {
154
- minW: '16',
155
- h: 'fit',
156
- },
157
- },
158
- },
159
- {
160
- dot: false,
161
- size: 'md',
162
- css: {
163
- indicator: {
164
- minW: '20',
165
- h: 'fit',
166
- },
167
- },
168
- },
169
- {
170
- dot: false,
171
- size: 'lg',
172
- css: {
173
- indicator: {
174
- minW: '24',
175
- h: 'fit',
176
- },
177
- },
178
- },
179
- {
180
- dot: false,
181
- size: 'xl',
182
- css: {
183
- indicator: {
184
- minW: '28',
185
- h: 'fit',
186
- },
187
- },
188
- },
189
- ],
190
161
  defaultVariants: {
191
162
  size: 'md',
192
163
  variant: 'danger',