@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
@@ -18,239 +18,247 @@ export const tagRecipe = defineRecipe({
18
18
  whiteSpace: 'nowrap',
19
19
  },
20
20
  variants: {
21
- variant: {
22
- default: {},
23
- bold: {},
24
- },
21
+ // Each hue publishes both colour pairs; `variant` picks one. This replaces
22
+ // 24 compoundVariants, which Panda emitted no CSS for at all: the variant
23
+ // bodies were empty, so every Tag rendered as the uncoloured base. Doing it
24
+ // through custom properties also makes `hue` and `variant` responsive.
25
25
  hue: {
26
- gray: {},
27
- red: {},
28
- orange: {},
29
- yellow: {},
30
- lime: {},
31
- green: {},
32
- teal: {},
33
- blue: {},
34
- indigo: {},
35
- purple: {},
36
- magenta: {},
37
- tan: {},
38
- },
39
- iconBefore: {
40
- true: {
41
- gap: '1',
42
- pl: '1',
43
- },
44
- false: {},
45
- },
46
- iconAfter: {
47
- true: {
48
- gap: '1',
49
- pr: '1',
50
- },
51
- false: {},
52
- },
53
- hasIcon: {
54
- true: {},
55
- false: {
56
- px: '4',
57
- },
58
- },
59
- },
60
- compoundVariants: [
61
- {
62
- hue: 'gray',
63
- variant: 'default',
64
- css: {
65
- color: 'text.subtle',
66
- bg: 'bg.neutral',
67
- },
68
- },
69
- {
70
- hue: 'gray',
71
- variant: 'bold',
72
- css: {
73
- color: 'text.inverse',
74
- bg: 'bg.neutral.boldest',
75
- },
76
- },
77
- {
78
- hue: 'red',
79
- variant: 'default',
80
- css: {
81
- color: { base: 'red.70', _dark: 'red.20' },
82
- bg: { base: 'red.20', _dark: 'red.100' },
83
- },
84
- },
85
- {
86
- hue: 'red',
87
- variant: 'bold',
88
- css: {
89
- color: { base: 'red.10', _dark: 'red.100' },
90
- bg: { base: 'red.60', _dark: 'red.40' },
91
- },
92
- },
93
- {
94
- hue: 'orange',
95
- variant: 'default',
96
- css: {
97
- color: { base: 'orange.70', _dark: 'orange.20' },
98
- bg: { base: 'orange.20', _dark: 'orange.100' },
99
- },
100
- },
101
- {
102
- hue: 'orange',
103
- variant: 'bold',
104
- css: {
105
- color: { base: 'orange.10', _dark: 'orange.100' },
106
- bg: { base: 'orange.60', _dark: 'orange.50' },
26
+ gray: {
27
+ '--tag-fg': 'token(colors.text.subtle)',
28
+ '--tag-bg': 'token(colors.bg.neutral)',
29
+ '--tag-fg-bold': 'token(colors.text.inverse)',
30
+ '--tag-bg-bold': 'token(colors.bg.neutral.boldest)',
107
31
  },
108
- },
109
- {
110
- hue: 'yellow',
111
- variant: 'default',
112
- css: {
113
- color: { base: 'yellow.80', _dark: 'yellow.50' },
114
- bg: { base: 'yellow.20', _dark: 'yellow.90' },
32
+ red: {
33
+ '--tag-fg': {
34
+ base: 'token(colors.red.70)',
35
+ _dark: 'token(colors.red.20)',
36
+ },
37
+ '--tag-bg': {
38
+ base: 'token(colors.red.20)',
39
+ _dark: 'token(colors.red.100)',
40
+ },
41
+ '--tag-fg-bold': {
42
+ base: 'token(colors.red.10)',
43
+ _dark: 'token(colors.red.100)',
44
+ },
45
+ '--tag-bg-bold': {
46
+ base: 'token(colors.red.60)',
47
+ _dark: 'token(colors.red.40)',
48
+ },
115
49
  },
116
- },
117
- {
118
- hue: 'yellow',
119
- variant: 'bold',
120
- css: {
121
- color: { base: 'yellow.100', _dark: 'yellow.100' },
122
- bg: { base: 'yellow.40', _dark: 'yellow.60' },
50
+ orange: {
51
+ '--tag-fg': {
52
+ base: 'token(colors.orange.70)',
53
+ _dark: 'token(colors.orange.20)',
54
+ },
55
+ '--tag-bg': {
56
+ base: 'token(colors.orange.20)',
57
+ _dark: 'token(colors.orange.100)',
58
+ },
59
+ '--tag-fg-bold': {
60
+ base: 'token(colors.orange.10)',
61
+ _dark: 'token(colors.orange.100)',
62
+ },
63
+ '--tag-bg-bold': {
64
+ base: 'token(colors.orange.60)',
65
+ _dark: 'token(colors.orange.50)',
66
+ },
123
67
  },
124
- },
125
- {
126
- hue: 'lime',
127
- variant: 'default',
128
- css: {
129
- color: { base: 'lime.70', _dark: 'lime.20' },
130
- bg: { base: 'lime.20', _dark: 'lime.90' },
68
+ yellow: {
69
+ '--tag-fg': {
70
+ base: 'token(colors.yellow.80)',
71
+ _dark: 'token(colors.yellow.50)',
72
+ },
73
+ '--tag-bg': {
74
+ base: 'token(colors.yellow.20)',
75
+ _dark: 'token(colors.yellow.90)',
76
+ },
77
+ '--tag-fg-bold': {
78
+ base: 'token(colors.yellow.100)',
79
+ _dark: 'token(colors.yellow.100)',
80
+ },
81
+ '--tag-bg-bold': {
82
+ base: 'token(colors.yellow.40)',
83
+ _dark: 'token(colors.yellow.60)',
84
+ },
131
85
  },
132
- },
133
- {
134
- hue: 'lime',
135
- variant: 'bold',
136
- css: {
137
- color: { base: 'lime.10', _dark: 'lime.100' },
138
- bg: { base: 'lime.60', _dark: 'lime.40' },
86
+ lime: {
87
+ '--tag-fg': {
88
+ base: 'token(colors.lime.70)',
89
+ _dark: 'token(colors.lime.20)',
90
+ },
91
+ '--tag-bg': {
92
+ base: 'token(colors.lime.20)',
93
+ _dark: 'token(colors.lime.90)',
94
+ },
95
+ '--tag-fg-bold': {
96
+ base: 'token(colors.lime.10)',
97
+ _dark: 'token(colors.lime.100)',
98
+ },
99
+ '--tag-bg-bold': {
100
+ base: 'token(colors.lime.60)',
101
+ _dark: 'token(colors.lime.40)',
102
+ },
139
103
  },
140
- },
141
- {
142
- hue: 'green',
143
- variant: 'default',
144
- css: {
145
- color: { base: 'green.70', _dark: 'green.20' },
146
- bg: { base: 'green.20', _dark: 'green.90' },
104
+ green: {
105
+ '--tag-fg': {
106
+ base: 'token(colors.green.70)',
107
+ _dark: 'token(colors.green.20)',
108
+ },
109
+ '--tag-bg': {
110
+ base: 'token(colors.green.20)',
111
+ _dark: 'token(colors.green.90)',
112
+ },
113
+ '--tag-fg-bold': {
114
+ base: 'token(colors.gray.10)',
115
+ _dark: 'token(colors.green.100)',
116
+ },
117
+ '--tag-bg-bold': {
118
+ base: 'token(colors.green.70)',
119
+ _dark: 'token(colors.green.40)',
120
+ },
147
121
  },
148
- },
149
- {
150
- hue: 'green',
151
- variant: 'bold',
152
- css: {
153
- color: { base: 'gray.10', _dark: 'green.100' },
154
- bg: { base: 'green.70', _dark: 'green.40' },
122
+ teal: {
123
+ '--tag-fg': {
124
+ base: 'token(colors.teal.80)',
125
+ _dark: 'token(colors.teal.20)',
126
+ },
127
+ '--tag-bg': {
128
+ base: 'token(colors.teal.20)',
129
+ _dark: 'token(colors.teal.90)',
130
+ },
131
+ '--tag-fg-bold': {
132
+ base: 'token(colors.teal.10)',
133
+ _dark: 'token(colors.teal.100)',
134
+ },
135
+ '--tag-bg-bold': {
136
+ base: 'token(colors.teal.60)',
137
+ _dark: 'token(colors.teal.50)',
138
+ },
155
139
  },
156
- },
157
- {
158
- hue: 'teal',
159
- variant: 'default',
160
- css: {
161
- color: { base: 'teal.80', _dark: 'teal.20' },
162
- bg: { base: 'teal.20', _dark: 'teal.90' },
140
+ blue: {
141
+ '--tag-fg': {
142
+ base: 'token(colors.blue.70)',
143
+ _dark: 'token(colors.blue.20)',
144
+ },
145
+ '--tag-bg': {
146
+ base: 'token(colors.blue.20)',
147
+ _dark: 'token(colors.blue.90)',
148
+ },
149
+ '--tag-fg-bold': {
150
+ base: 'token(colors.blue.10)',
151
+ _dark: 'token(colors.blue.10)',
152
+ },
153
+ '--tag-bg-bold': {
154
+ base: 'token(colors.blue.50)',
155
+ _dark: 'token(colors.blue.70)',
156
+ },
163
157
  },
164
- },
165
- {
166
- hue: 'teal',
167
- variant: 'bold',
168
- css: {
169
- color: { base: 'teal.10', _dark: 'teal.100' },
170
- bg: { base: 'teal.60', _dark: 'teal.50' },
158
+ indigo: {
159
+ '--tag-fg': {
160
+ base: 'token(colors.indigo.70)',
161
+ _dark: 'token(colors.indigo.20)',
162
+ },
163
+ '--tag-bg': {
164
+ base: 'token(colors.indigo.20)',
165
+ _dark: 'token(colors.indigo.90)',
166
+ },
167
+ '--tag-fg-bold': {
168
+ base: 'token(colors.indigo.10)',
169
+ _dark: 'token(colors.indigo.10)',
170
+ },
171
+ '--tag-bg-bold': {
172
+ base: 'token(colors.indigo.60)',
173
+ _dark: 'token(colors.indigo.70)',
174
+ },
171
175
  },
172
- },
173
- {
174
- hue: 'blue',
175
- variant: 'default',
176
- css: {
177
- color: { base: 'blue.70', _dark: 'blue.20' },
178
- bg: { base: 'blue.20', _dark: 'blue.90' },
179
- },
180
- },
181
- {
182
- hue: 'blue',
183
- variant: 'bold',
184
- css: {
185
- color: { base: 'blue.10', _dark: 'blue.10' },
186
- bg: { base: 'blue.50', _dark: 'blue.70' },
176
+ purple: {
177
+ '--tag-fg': {
178
+ base: 'token(colors.purple.70)',
179
+ _dark: 'token(colors.purple.20)',
180
+ },
181
+ '--tag-bg': {
182
+ base: 'token(colors.purple.20)',
183
+ _dark: 'token(colors.purple.90)',
184
+ },
185
+ '--tag-fg-bold': {
186
+ base: 'token(colors.purple.10)',
187
+ _dark: 'token(colors.purple.10)',
188
+ },
189
+ '--tag-bg-bold': {
190
+ base: 'token(colors.purple.60)',
191
+ _dark: 'token(colors.purple.80)',
192
+ },
187
193
  },
188
- },
189
- {
190
- hue: 'indigo',
191
- variant: 'default',
192
- css: {
193
- color: { base: 'indigo.70', _dark: 'indigo.20' },
194
- bg: { base: 'indigo.20', _dark: 'indigo.90' },
194
+ magenta: {
195
+ '--tag-fg': {
196
+ base: 'token(colors.magenta.80)',
197
+ _dark: 'token(colors.magenta.20)',
198
+ },
199
+ '--tag-bg': {
200
+ base: 'token(colors.magenta.20)',
201
+ _dark: 'token(colors.magenta.90)',
202
+ },
203
+ '--tag-fg-bold': {
204
+ base: 'token(colors.magenta.10)',
205
+ _dark: 'token(colors.magenta.10)',
206
+ },
207
+ '--tag-bg-bold': {
208
+ base: 'token(colors.magenta.70)',
209
+ _dark: 'token(colors.magenta.70)',
210
+ },
195
211
  },
196
- },
197
- {
198
- hue: 'indigo',
199
- variant: 'bold',
200
- css: {
201
- color: { base: 'indigo.10', _dark: 'indigo.10' },
202
- bg: { base: 'indigo.60', _dark: 'indigo.70' },
212
+ tan: {
213
+ '--tag-fg': {
214
+ base: 'token(colors.tan.70)',
215
+ _dark: 'token(colors.tan.20)',
216
+ },
217
+ '--tag-bg': {
218
+ base: 'token(colors.tan.20)',
219
+ _dark: 'token(colors.tan.80)',
220
+ },
221
+ '--tag-fg-bold': {
222
+ base: 'token(colors.gray.10)',
223
+ _dark: 'token(colors.tan.90)',
224
+ },
225
+ '--tag-bg-bold': {
226
+ base: 'token(colors.tan.60)',
227
+ _dark: 'token(colors.tan.40)',
228
+ },
203
229
  },
204
230
  },
205
- {
206
- hue: 'purple',
207
- variant: 'default',
208
- css: {
209
- color: { base: 'purple.70', _dark: 'purple.20' },
210
- bg: { base: 'purple.20', _dark: 'purple.90' },
231
+ variant: {
232
+ default: {
233
+ color: 'var(--tag-fg)',
234
+ bg: 'var(--tag-bg)',
211
235
  },
212
- },
213
- {
214
- hue: 'purple',
215
- variant: 'bold',
216
- css: {
217
- color: { base: 'purple.10', _dark: 'purple.10' },
218
- bg: { base: 'purple.60', _dark: 'purple.80' },
236
+ bold: {
237
+ color: 'var(--tag-fg-bold)',
238
+ bg: 'var(--tag-bg-bold)',
219
239
  },
220
240
  },
221
- {
222
- hue: 'magenta',
223
- variant: 'default',
224
- css: {
225
- color: { base: 'magenta.80', _dark: 'magenta.20' },
226
- bg: { base: 'magenta.20', _dark: 'magenta.90' },
227
- },
228
- },
229
- {
230
- hue: 'magenta',
231
- variant: 'bold',
232
- css: {
233
- color: { base: 'magenta.10', _dark: 'magenta.10' },
234
- bg: { base: 'magenta.70', _dark: 'magenta.70' },
241
+ iconBefore: {
242
+ true: {
243
+ gap: '1',
244
+ pl: '1',
235
245
  },
246
+ false: {},
236
247
  },
237
- {
238
- hue: 'tan',
239
- variant: 'default',
240
- css: {
241
- color: { base: 'tan.70', _dark: 'tan.20' },
242
- bg: { base: 'tan.20', _dark: 'tan.80' },
248
+ iconAfter: {
249
+ true: {
250
+ gap: '1',
251
+ pr: '1',
243
252
  },
253
+ false: {},
244
254
  },
245
- {
246
- hue: 'tan',
247
- variant: 'bold',
248
- css: {
249
- color: { base: 'gray.10', _dark: 'tan.90' },
250
- bg: { base: 'tan.60', _dark: 'tan.40' },
255
+ hasIcon: {
256
+ true: {},
257
+ false: {
258
+ px: '4',
251
259
  },
252
260
  },
253
- ],
261
+ },
254
262
  defaultVariants: {
255
263
  variant: 'default',
256
264
  hue: 'gray',
@@ -56,6 +56,18 @@ const textVariants = {
56
56
  underline: {
57
57
  true: {
58
58
  textDecoration: 'underline',
59
+ textDecorationThickness: '[0.0625em]',
60
+ textUnderlineOffset: '[0.15625em]',
61
+ textDecorationSkipInk: 'all',
62
+ },
63
+ },
64
+ dashedUnderline: {
65
+ true: {
66
+ textDecoration: 'underline',
67
+ textDecorationStyle: 'dashed',
68
+ textDecorationThickness: '[0.0625em]',
69
+ textUnderlineOffset: '[0.15625em]',
70
+ textDecorationSkipInk: 'all',
59
71
  },
60
72
  },
61
73
  truncate: {
@@ -106,41 +118,47 @@ const linkBase = {
106
118
  fontWeight: 'medium',
107
119
  gap: '1',
108
120
  color: 'link',
109
- textDecoration: 'none',
110
- backgroundImage: 'linear-gradient(90deg, transparent 0% 100%)',
111
- backgroundSize: '100% {sizes.1}',
112
- backgroundRepeat: 'no-repeat',
113
- backgroundPositionY: '100%',
121
+ // A real text-decoration replaces the former linear-gradient background,
122
+ // so the underline follows descenders and respects skip-ink.
123
+ textDecoration: 'underline',
124
+ textDecorationThickness: '[0.0625em]',
125
+ textUnderlineOffset: '[0.15625em]',
126
+ textDecorationSkipInk: 'all',
127
+ textDecorationColor: '[color-mix(in srgb, currentColor 30%, transparent)]',
114
128
  outlineWidth: '2',
115
129
  outlineStyle: 'solid',
116
130
  outlineColor: 'transparent',
117
131
  outlineOffset: '1',
118
132
  width: 'fit-content',
119
133
  cursor: 'pointer',
134
+ transitionProperty: 'all',
135
+ transitionDuration: 'fast',
136
+ transitionTimingFunction: 'default',
120
137
  _hover: {
121
- color: 'link',
122
- backgroundImage: 'linear-gradient(90deg, currentColor 0% 100%)',
138
+ color: 'link.pressed',
139
+ textDecorationColor: 'current',
140
+ textDecorationThickness: '[0.125em]',
123
141
  },
124
142
  _focusVisible: {
125
143
  borderRadius: '{sizes.4}',
126
144
  outlineColor: 'border.focused',
127
145
  },
128
- 'p &': {
129
- backgroundImage: 'linear-gradient(90deg, currentColor 0% 100%)',
130
- },
131
- };
132
-
133
- const linkVariants = {
134
- ...textVariants,
146
+ // Link never passed a `_disabled` variant to the recipe, so the disabled
147
+ // styles below never rendered. As a base condition they match the real
148
+ // disabled state, including the aria-disabled Link already sets.
149
+ //
150
+ // Deliberately no colour change. globalStyle already fades anything disabled
151
+ // to 0.4 opacity, and text.disabled is itself a 29% alpha: together they
152
+ // render the label at roughly 1.2:1 against the page, which is invisible.
153
+ // The opacity alone carries the state, as it does in the Cetec DS.
135
154
  _disabled: {
136
- true: {
137
- cursor: 'not-allowed',
138
- color: 'text.disabled',
139
- pointerEvents: 'none',
140
- },
155
+ cursor: 'not-allowed',
156
+ pointerEvents: 'none',
141
157
  },
142
158
  };
143
159
 
160
+ const linkVariants = { ...textVariants };
161
+
144
162
  const labelBase = {
145
163
  fontSize: '{sizes.16}',
146
164
  fontWeight: 'normal',