@okshaun/components 2.0.2 → 4.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 (78) hide show
  1. package/dist/icon-metadata.json +385 -41
  2. package/dist/index.js +13414 -5259
  3. package/dist/index.js.map +1 -1
  4. package/dist/panda.buildinfo.json +1245 -263
  5. package/dist/{preset-DAmO4B54.js → preset-BOFHjPdQ.js} +2265 -1727
  6. package/dist/preset-BOFHjPdQ.js.map +1 -0
  7. package/dist/preset.js +1 -1
  8. package/dist/specs/conditions.json +75 -51
  9. package/dist/specs/keyframes.json +33 -0
  10. package/dist/specs/recipes.json +359 -103
  11. package/dist/specs/semantic-tokens.json +152 -44
  12. package/dist/specs/tokens.json +21 -36
  13. package/dist/sprite.svg +1 -1
  14. package/dist/sprite.symbol.html +499 -43
  15. package/dist/styles.css +18229 -7568
  16. package/dist/svgs/barcode-off.svg +1 -0
  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/spinner.svg +1 -0
  22. package/dist/svgs/to-date-backward.svg +1 -0
  23. package/dist/svgs/to-date-forward.svg +1 -0
  24. package/dist/types/index.d.ts +2804 -296
  25. package/package.json +4 -2
  26. package/src/recipes/autocomplete.ts +266 -0
  27. package/src/recipes/avatar.ts +1 -1
  28. package/src/recipes/badge.ts +31 -43
  29. package/src/recipes/breakpointIndicator.ts +11 -0
  30. package/src/recipes/button.ts +172 -223
  31. package/src/recipes/calendar.ts +91 -0
  32. package/src/recipes/card.ts +4 -70
  33. package/src/recipes/chip.ts +213 -142
  34. package/src/recipes/dateMenus.ts +40 -0
  35. package/src/recipes/dateTimeMenus.ts +43 -0
  36. package/src/recipes/icon.ts +25 -6
  37. package/src/recipes/kbd.ts +56 -0
  38. package/src/recipes/list.ts +17 -1
  39. package/src/recipes/listDensity.ts +66 -0
  40. package/src/recipes/listItem.ts +29 -161
  41. package/src/recipes/listItemGroup.ts +17 -39
  42. package/src/recipes/menu.ts +17 -3
  43. package/src/recipes/modal.ts +70 -39
  44. package/src/recipes/radio.ts +6 -6
  45. package/src/recipes/recipes-regular.ts +2 -0
  46. package/src/recipes/recipes-slot.ts +8 -2
  47. package/src/recipes/segmentedFields.ts +192 -0
  48. package/src/recipes/segmentedInputs.ts +109 -0
  49. package/src/recipes/select.ts +8 -1
  50. package/src/recipes/skeleton.ts +72 -0
  51. package/src/recipes/spinner.ts +27 -24
  52. package/src/recipes/tag.ts +218 -210
  53. package/src/recipes/text.ts +37 -19
  54. package/src/recipes/textInput.ts +106 -117
  55. package/src/recipes/themeSwitcher.ts +3 -3
  56. package/src/recipes/timeMenus.ts +110 -0
  57. package/src/recipes/toggle.ts +3 -1
  58. package/src/styles/primitives/animations.ts +3 -0
  59. package/src/styles/primitives/shadows.ts +26 -60
  60. package/src/styles/primitives/zIndex.ts +1 -0
  61. package/src/styles/semantics/colors.ts +43 -0
  62. package/src/styles/semantics/shadows.ts +4 -30
  63. package/src/styles/semantics/zIndex.ts +2 -0
  64. package/src/styles/utilities/conditions.ts +61 -51
  65. package/src/styles/utilities/dropShadows.ts +51 -0
  66. package/src/styles/utilities/filters.ts +22 -7
  67. package/src/styles/utilities/globalStyle.ts +5 -2
  68. package/src/styles/utilities/index.ts +3 -0
  69. package/src/styles/utilities/keyframes.ts +31 -4
  70. package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
  71. package/src/styles/utilities/shadowDefinitions.ts +112 -0
  72. package/src/utils/dsChain.ts +113 -0
  73. package/src/utils/dsComponent.ts +44 -0
  74. package/src/utils/dsPart.ts +41 -0
  75. package/src/utils/mergeAriaDescribedBy.ts +7 -0
  76. package/dist/preset-DAmO4B54.js.map +0 -1
  77. package/src/recipes/datePicker.ts +0 -212
  78. package/src/recipes/timePicker.ts +0 -199
@@ -3,6 +3,7 @@ import { defineRecipe } from '@pandacss/dev';
3
3
  const interactiveHoverStyles = {
4
4
  cursor: 'pointer',
5
5
  transition: 'all',
6
+ textDecoration: 'none',
6
7
  _hover: {
7
8
  bg: 'surface',
8
9
  boxShadow: 'elevated',
@@ -14,10 +15,6 @@ const interactiveHoverStyles = {
14
15
  outlineColor: 'border.focused',
15
16
  borderColor: 'border.focused',
16
17
  },
17
- _disabled: {
18
- opacity: '0.4',
19
- cursor: 'not-allowed',
20
- },
21
18
  };
22
19
 
23
20
  export const cardRecipe = defineRecipe({
@@ -73,79 +70,16 @@ export const cardRecipe = defineRecipe({
73
70
  },
74
71
  interactive: {
75
72
  true: {
76
- cursor: 'pointer',
77
- },
78
- false: {
79
- cursor: 'default',
80
- },
81
- },
82
- },
83
- compoundVariants: [
84
- // Default + interactive
85
- {
86
- variant: 'default',
87
- interactive: true,
88
- css: {
89
- ...interactiveHoverStyles,
90
- _disabled: {
91
- _hover: {
92
- boxShadow: 'raised',
93
- },
94
- },
95
- },
96
- },
97
- // Flat + interactive
98
- {
99
- variant: 'flat',
100
- interactive: true,
101
- css: {
102
73
  ...interactiveHoverStyles,
74
+ cursor: 'pointer',
103
75
  _disabled: {
104
76
  _hover: {
105
- boxShadow: 'none',
106
- },
107
- },
108
- },
109
- },
110
- // Sunken + interactive
111
- {
112
- variant: 'sunken',
113
- interactive: true,
114
- css: {
115
- ...interactiveHoverStyles,
116
- _disabled: {
117
- _hover: {
118
- boxShadow: 'none',
119
- },
120
- },
121
- },
122
- },
123
- // Ghost + interactive
124
- {
125
- variant: 'ghost',
126
- interactive: true,
127
- css: {
128
- ...interactiveHoverStyles,
129
- _disabled: {
130
- _hover: {
131
- boxShadow: 'none',
132
- },
133
- },
134
- },
135
- },
136
- // Overlay + interactive
137
- {
138
- variant: 'overlay',
139
- interactive: true,
140
- css: {
141
- _disabled: {
142
- _hover: {
143
- boxShadow: 'raised',
77
+ boxShadow: 'initial',
144
78
  },
145
79
  },
146
80
  },
147
81
  },
148
- ],
82
+ },
149
83
  defaultVariants: {
150
84
  variant: 'default',
151
85
  },
@@ -1,186 +1,257 @@
1
1
  import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
- const chipBase = {
4
- container: {
5
- position: 'relative',
6
- display: 'inline-flex',
7
- alignItems: 'center',
8
- appearance: 'none',
9
- width: 'fit',
10
- borderRadius: '999',
11
- fontFamily: 'sans',
12
- lineHeight: 'default',
13
- fontWeight: 'medium',
14
- whiteSpace: 'nowrap',
15
- verticalAlign: 'middle',
16
- cursor: 'pointer',
17
- transitionDuration: 'fast',
18
- transitionProperty: 'background, color',
19
- transitionTimingFunction: 'default',
20
- userSelect: 'none',
21
- border: 'none',
22
- outlineWidth: '2',
23
- outlineStyle: 'solid',
24
- outlineColor: 'transparent',
25
- bg: 'bg.neutral',
26
- color: 'text',
27
- _hover: {
28
- bg: 'bg.neutral.hovered',
3
+ import { globalBaseStyles } from '~/styles/utilities';
4
+
5
+ // Ported from the Cetec design system: slots, sizing scale, the
6
+ // custom-property mechanism and interaction behaviour. okshaun's semantic
7
+ // tokens carry the colours.
8
+
9
+ const buttonStyles = {
10
+ appearance: 'none',
11
+ cursor: 'pointer',
12
+ transitionDuration: 'fast',
13
+ transitionProperty: 'background, color',
14
+ transitionTimingFunction: 'default',
15
+ _icon: {
16
+ fill: 'icon.decorative',
17
+ },
18
+ _hover: {
19
+ _icon: {
20
+ fill: 'icon',
29
21
  },
30
- _active: {
31
- bg: 'bg.neutral.pressed',
22
+ },
23
+ _active: {
24
+ _icon: {
25
+ fill: 'icon',
32
26
  },
33
- _focusVisible: {
34
- outlineColor: 'border.focused',
27
+ },
28
+ _focusVisible: {
29
+ outlineColor: 'border.focused',
30
+ },
31
+ _disabled: {
32
+ cursor: 'not-allowed',
33
+ },
34
+ '&:has([data-disabled=true])': {
35
+ cursor: 'not-allowed',
36
+ },
37
+ '&:has([data-deleted=true])': {
38
+ textDecoration: 'line-through',
39
+ opacity: '[0.6]',
40
+ },
41
+ '&:has([data-selected=true])': {
42
+ bg: 'bg.neutral.boldest',
43
+ _icon: {
44
+ fill: 'icon.decorative.inverse',
35
45
  },
36
- _loading: {
37
- cursor: 'wait',
38
- animation: 'pulse',
46
+ },
47
+ '&:has([data-selected=true]):is(:hover, [data-hover])': {
48
+ _icon: {
49
+ fill: 'icon.decorative.inverse.hovered',
39
50
  },
40
- _deleted: {
41
- textDecoration: 'line-through',
42
- cursor: 'not-allowed',
43
- opacity: '[0.6]',
51
+ },
52
+ '&:has([data-selected=true]):is(:active, [data-active])': {
53
+ _icon: {
54
+ fill: 'icon.decorative.inverse.hovered',
44
55
  },
45
- _disabled: {
46
- cursor: 'not-allowed',
47
- bg: 'bg.disabled',
48
- color: 'text.disabled',
49
- borderColor: 'border.disabled',
56
+ },
57
+ };
58
+
59
+ export const chipRecipe = defineSlotRecipe({
60
+ className: 'chip',
61
+ jsx: ['Chip'],
62
+ slots: ['container', 'body', 'mainContent', 'dismissButton', 'slot'],
63
+ base: {
64
+ container: {
65
+ ...globalBaseStyles,
66
+ '--chip-h': 'token(sizes.24)',
67
+ '--main-px': 'token(sizes.8)',
68
+ '--main-fs': 'token(sizes.14)',
69
+ '--main-slot-side-padding': 'token(sizes.4)',
70
+ '--slot-size': 'token(sizes.20)',
71
+ '--slot-px': 'token(sizes.2)',
72
+ position: 'relative',
73
+ display: 'inline-flex',
74
+ alignItems: 'center',
75
+ width: 'fit',
76
+ height: 'var(--chip-h)',
77
+ borderRadius: '999',
78
+ fontFamily: 'sans',
79
+ lineHeight: 'default',
80
+ fontWeight: 'medium',
81
+ whiteSpace: 'nowrap',
82
+ verticalAlign: 'middle',
83
+ transitionDuration: 'fast',
84
+ transitionProperty: 'all',
85
+ transitionTimingFunction: 'default',
86
+ userSelect: 'none',
87
+ bg: 'bg.neutral',
88
+ // Deviation from Cetec: hover and active live here, not on the body.
89
+ // okshaun's bg.neutral tokens are semi-transparent, so a body-painted
90
+ // hover would composite over this base rather than replace it, and it
91
+ // would leave the dismiss area of a dismissable chip unhighlighted.
92
+ // Cetec's opaque equivalents do not have this problem.
50
93
  _hover: {
94
+ bg: 'bg.neutral.hovered',
95
+ },
96
+ _active: {
97
+ bg: 'bg.neutral.pressed',
98
+ },
99
+ _loading: {
100
+ animation: 'pulse',
101
+ },
102
+ '&:has([data-selected=true])': {
103
+ bg: 'bg.neutral.boldest',
104
+ color: 'text.inverse',
105
+ _hover: {
106
+ bg: 'bg.neutral.bold.hovered',
107
+ },
108
+ _active: {
109
+ bg: 'bg.neutral.bold.pressed',
110
+ },
111
+ },
112
+ '&:has([data-disabled=true])': {
113
+ cursor: 'not-allowed',
51
114
  bg: 'bg.disabled',
52
115
  color: 'text.disabled',
53
- borderColor: 'border.disabled',
116
+ opacity: '[0.3]',
117
+ _hover: {
118
+ bg: 'bg.disabled',
119
+ },
120
+ },
121
+ },
122
+ body: {
123
+ ...globalBaseStyles,
124
+ position: 'relative',
125
+ display: 'inline-flex',
126
+ alignItems: 'center',
127
+ minW: '0',
128
+ height: 'var(--chip-h)',
129
+ flexShrink: '0',
130
+ bg: 'transparent',
131
+ border: 'none',
132
+ borderRadius: '999',
133
+ outlineWidth: '2',
134
+ outlineStyle: 'solid',
135
+ outlineColor: 'transparent',
136
+ outlineOffset: 'calc(token(sizes.2) * -1)',
137
+ 'button&': {
138
+ ...buttonStyles,
139
+ },
140
+ },
141
+ mainContent: {
142
+ display: 'inline-flex',
143
+ alignItems: 'center',
144
+ minW: '0',
145
+ px: 'var(--main-px)',
146
+ fontSize: 'var(--main-fs)',
147
+ color: 'text',
148
+ '[data-selected=true] > &': {
149
+ color: 'text.inverse',
54
150
  },
55
151
  },
56
- _selected: {
57
- bg: 'bg.neutral.boldest',
58
- color: 'text.inverse',
152
+ dismissButton: {
153
+ ...globalBaseStyles,
154
+ position: 'relative',
155
+ display: 'inline-flex',
156
+ alignItems: 'center',
157
+ justifyContent: 'center',
158
+ minW: '0',
159
+ flexShrink: '0',
160
+ bg: 'transparent',
161
+ border: 'none',
162
+ borderRadius: '999',
163
+ outlineWidth: '2',
164
+ outlineStyle: 'solid',
165
+ outlineColor: 'transparent',
166
+ outlineOffset: 'calc(token(sizes.2) * -1)',
167
+ aspectRatio: 'square',
168
+ ...buttonStyles,
169
+ // Deviation from Cetec: no hover background here. okshaun's bg.neutral
170
+ // tokens are semi-transparent, so painting hovered over the pill
171
+ // composites to roughly 26% rather than the 14% the token specifies.
59
172
  _hover: {
60
- bg: 'bg.neutral.bold.hovered',
173
+ bg: 'transparent',
174
+ _icon: { fill: 'icon' },
61
175
  },
62
176
  _active: {
63
- bg: 'bg.neutral.bold.pressed',
177
+ bg: 'transparent',
178
+ _icon: { fill: 'icon' },
179
+ },
180
+ w: 'calc(var(--slot-size) + (var(--slot-px) * 2))',
181
+ h: 'calc(var(--slot-size) + (var(--slot-px) * 2))',
182
+ _icon: {
183
+ fill: 'icon.decorative',
184
+ width: 'var(--slot-size)',
185
+ height: 'var(--slot-size)',
64
186
  },
65
187
  },
66
- },
67
- chipIcon: {
68
- fill: 'icon.decorative',
69
- aspectRatio: 'square',
70
- transitionDuration: 'fast',
71
- transitionProperty: 'fill',
72
- transitionTimingFunction: 'default',
73
- _groupHover: { fill: 'icon.decorative.hovered' },
74
- _groupActive: { fill: 'icon.decorative.hovered' },
75
- _groupDisabled: { fill: 'icon.decorative' },
76
-
77
- '[data-selected=true] &': {
78
- fill: 'icon.decorative.inverse',
79
- },
80
- '.group:is(:hover, [data-hover])[data-selected=true] &': {
81
- fill: 'icon.decorative.inverse.hovered',
188
+ slot: {
189
+ display: 'inline-flex',
190
+ alignItems: 'center',
191
+ px: 'var(--slot-px)',
82
192
  },
83
193
  },
84
- };
85
-
86
- export const chipRecipe = defineSlotRecipe({
87
- className: 'chip',
88
- jsx: ['Chip'],
89
- slots: ['container', 'chipIcon'],
90
- base: chipBase,
91
194
  variants: {
92
195
  size: {
93
196
  sm: {
94
197
  container: {
95
- gap: '2',
96
- h: '20',
97
- px: '6',
98
- py: '0',
99
- fontSize: '14',
100
- },
101
- chipIcon: {
102
- w: '20',
103
- h: '20',
198
+ '--chip-h': 'token(sizes.18)',
199
+ '--main-px': 'token(sizes.6)',
200
+ '--main-fs': 'token(sizes.12)',
201
+ '--main-slot-side-padding': 'token(sizes.4)',
202
+ '--slot-size': 'token(sizes.16)',
203
+ '--slot-px': 'token(sizes.1)',
104
204
  },
105
205
  },
106
206
  md: {
107
207
  container: {
108
- gap: '4',
109
- h: '24',
110
- px: '8',
111
- py: '1',
112
- fontSize: '14',
113
- },
114
- chipIcon: {
115
- w: '20',
116
- h: '20',
208
+ '--chip-h': 'token(sizes.24)',
209
+ '--main-px': 'token(sizes.8)',
210
+ '--main-fs': 'token(sizes.14)',
211
+ '--main-slot-side-padding': 'token(sizes.4)',
212
+ '--slot-size': 'token(sizes.20)',
213
+ '--slot-px': 'token(sizes.2)',
117
214
  },
118
215
  },
119
216
  lg: {
120
217
  container: {
121
- gap: '4',
122
- h: '32',
123
- px: '10',
124
- py: '4',
125
- fontSize: '16',
218
+ '--chip-h': 'token(sizes.28)',
219
+ '--main-px': 'token(sizes.10)',
220
+ '--main-fs': 'token(sizes.16)',
221
+ '--main-slot-side-padding': 'token(sizes.4)',
222
+ '--slot-size': 'token(sizes.24)',
223
+ '--slot-px': 'token(sizes.2)',
126
224
  },
127
- chipIcon: {
128
- w: '24',
129
- h: '24',
225
+ },
226
+ xl: {
227
+ container: {
228
+ '--chip-h': 'token(sizes.32)',
229
+ '--main-px': 'token(sizes.12)',
230
+ '--main-fs': 'token(sizes.20)',
231
+ '--main-slot-side-padding': 'token(sizes.4)',
232
+ '--slot-size': 'token(sizes.28)',
233
+ '--slot-px': 'token(sizes.2)',
130
234
  },
131
235
  },
132
236
  },
133
237
  before: {
134
- true: { container: {} },
135
- },
136
- after: {
137
- true: { container: {} },
138
- },
139
- },
140
- compoundVariants: [
141
- {
142
- size: 'sm',
143
- before: true,
144
- css: {
145
- container: { ps: '2' },
146
- },
147
- },
148
- {
149
- size: 'sm',
150
- after: true,
151
- css: {
152
- container: { pe: '2' },
153
- },
154
- },
155
- {
156
- size: 'md',
157
- before: true,
158
- css: {
159
- container: { ps: '2' },
160
- },
161
- },
162
- {
163
- size: 'md',
164
- after: true,
165
- css: {
166
- container: { pe: '2' },
238
+ true: {
239
+ mainContent: {
240
+ ps: 'var(--main-slot-side-padding)',
241
+ },
167
242
  },
168
243
  },
169
- {
170
- size: 'lg',
171
- before: true,
172
- css: {
173
- container: { ps: '4' },
244
+ after: {
245
+ true: {
246
+ mainContent: {
247
+ pe: 'var(--main-slot-side-padding)',
248
+ },
174
249
  },
175
250
  },
176
- {
177
- size: 'lg',
178
- after: true,
179
- css: {
180
- container: { pe: '4' },
181
- },
251
+ dismissable: {
252
+ true: {},
182
253
  },
183
- ],
254
+ },
184
255
  defaultVariants: {
185
256
  size: 'md',
186
257
  },
@@ -0,0 +1,40 @@
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
+
3
+ // Content-only slots shared by DateMenu (single Calendar) and DateRangeMenu
4
+ // (two Calendars + a middle divider + a Cancel/Apply footer for the pending
5
+ // selection). The popover chrome itself (bg/radius/shadow) comes from
6
+ // `<Menu>`, not from a slot here, so it isn't duplicated.
7
+ const dateMenusBase = {
8
+ // Row wrapper for DateRangeMenu's two Calendar instances.
9
+ calendars: {
10
+ display: 'flex',
11
+ alignItems: 'stretch',
12
+ },
13
+
14
+ // Vertical rule between the two calendars.
15
+ calendarsDivider: {
16
+ width: '1',
17
+ alignSelf: 'stretch',
18
+ bg: 'border',
19
+ },
20
+
21
+ // Right-aligned Cancel/Apply pair for the pending range selection.
22
+ footer: {
23
+ display: 'flex',
24
+ justifyContent: 'flex-end',
25
+ alignItems: 'center',
26
+ gap: '8',
27
+ borderTopWidth: '1',
28
+ borderTopStyle: 'solid',
29
+ borderColor: 'border',
30
+ px: '16',
31
+ py: '8',
32
+ },
33
+ };
34
+
35
+ export const dateMenusRecipe = defineSlotRecipe({
36
+ className: 'dateMenus',
37
+ jsx: ['DateMenus', 'DateMenu', 'DateRangeMenu'],
38
+ slots: ['calendars', 'calendarsDivider', 'footer'],
39
+ base: dateMenusBase,
40
+ });
@@ -0,0 +1,43 @@
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
+
3
+ // Content-only slots for DateTimeMenu: a single Calendar + a 4px divider +
4
+ // the same scrollable time columns TimeMenu/TimeRangeMenu use (imported
5
+ // directly from `timeMenus` in the component — the column look lives in one
6
+ // place). The popover chrome itself (bg/radius/shadow) comes from `<Menu>`,
7
+ // not from a slot here. One fixed layout, not range-variant, per the Figma spec.
8
+ const dateTimeMenusBase = {
9
+ // Row holding the Calendar + divider + time columns, above the footer.
10
+ content: {
11
+ display: 'flex',
12
+ alignItems: 'stretch',
13
+ },
14
+
15
+ // 4px-wide vertical divider between the Calendar and the time columns.
16
+ divider: {
17
+ width: '4',
18
+ alignSelf: 'stretch',
19
+ bg: 'border',
20
+ },
21
+
22
+ // Right-aligned Cancel/Apply pair — always present per the Figma spec,
23
+ // even though DateTimeMenu isn't itself a range variant.
24
+ footer: {
25
+ display: 'flex',
26
+ justifyContent: 'flex-end',
27
+ alignItems: 'center',
28
+ w: 'full',
29
+ gap: '8',
30
+ borderTopWidth: '1',
31
+ borderTopStyle: 'solid',
32
+ borderColor: 'border',
33
+ px: '16',
34
+ py: '8',
35
+ },
36
+ };
37
+
38
+ export const dateTimeMenusRecipe = defineSlotRecipe({
39
+ className: 'dateTimeMenus',
40
+ jsx: ['DateTimeMenus', 'DateTimeMenu'],
41
+ slots: ['content', 'divider', 'footer'],
42
+ base: dateTimeMenusBase,
43
+ });
@@ -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,56 @@
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
+
3
+ // Ported from the Cetec design system: slot names, sizing and type treatment.
4
+ // Two Cetec properties are dropped rather than faked: `cornerShape` is a Cetec
5
+ // utility okshaun does not register, and `fontVariant` drives Recursive's
6
+ // variable-font axes, which IBM Plex Mono does not expose.
7
+ export const kbdRecipe = defineSlotRecipe({
8
+ className: 'kbd',
9
+ jsx: ['Kbd'],
10
+ slots: ['kbdGroup', 'key'],
11
+ base: {
12
+ kbdGroup: {
13
+ display: 'inline-flex',
14
+ alignItems: 'center',
15
+ gap: '2',
16
+ verticalAlign: 'middle',
17
+ },
18
+ key: {
19
+ display: 'inline-flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ gap: '1',
23
+ h: '16',
24
+ w: 'fit',
25
+ minW: '16',
26
+ rounded: '6',
27
+ bg: 'bg.neutral',
28
+ px: '4',
29
+ fontFamily: 'mono',
30
+ lineHeight: 'tight',
31
+ fontWeight: 'bold',
32
+ textTransform: 'uppercase',
33
+ color: 'text.subtle',
34
+ userSelect: 'none',
35
+ pointerEvents: 'none',
36
+ fontSize: '10',
37
+ },
38
+ },
39
+ variants: {
40
+ variant: {
41
+ default: {
42
+ key: {
43
+ fontSize: '10',
44
+ },
45
+ },
46
+ symbol: {
47
+ key: {
48
+ fontSize: '12',
49
+ },
50
+ },
51
+ },
52
+ },
53
+ defaultVariants: {
54
+ variant: 'default',
55
+ },
56
+ });