@okshaun/components 3.0.0 → 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.
- package/dist/icon-metadata.json +359 -42
- package/dist/index.js +12890 -5844
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +523 -501
- package/dist/{preset-BAn5LBiW.js → preset-BOFHjPdQ.js} +1986 -2045
- package/dist/preset-BOFHjPdQ.js.map +1 -0
- package/dist/preset.js +1 -1
- package/dist/specs/conditions.json +75 -51
- package/dist/specs/keyframes.json +22 -0
- package/dist/specs/recipes.json +222 -106
- package/dist/specs/semantic-tokens.json +152 -44
- package/dist/specs/tokens.json +16 -36
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +445 -44
- package/dist/styles.css +11268 -13251
- package/dist/svgs/cheese.svg +1 -0
- package/dist/svgs/collapse-vertical.svg +1 -0
- package/dist/svgs/expand-vertical.svg +1 -0
- package/dist/svgs/magnet.svg +1 -0
- package/dist/svgs/to-date-backward.svg +1 -0
- package/dist/svgs/to-date-forward.svg +1 -0
- package/dist/types/index.d.ts +2815 -288
- package/package.json +4 -2
- package/src/recipes/autocomplete.ts +266 -0
- package/src/recipes/badge.ts +25 -54
- package/src/recipes/button.ts +155 -316
- package/src/recipes/calendar.ts +91 -0
- package/src/recipes/card.ts +4 -70
- package/src/recipes/chip.ts +212 -266
- package/src/recipes/dateMenus.ts +40 -0
- package/src/recipes/dateTimeMenus.ts +43 -0
- package/src/recipes/kbd.ts +42 -39
- package/src/recipes/list.ts +11 -85
- package/src/recipes/listDensity.ts +66 -0
- package/src/recipes/listItem.ts +27 -166
- package/src/recipes/listItemGroup.ts +16 -16
- package/src/recipes/menu.ts +17 -3
- package/src/recipes/modal.ts +65 -65
- package/src/recipes/radio.ts +6 -6
- package/src/recipes/recipes-slot.ts +7 -2
- package/src/recipes/segmentedFields.ts +192 -0
- package/src/recipes/segmentedInputs.ts +109 -0
- package/src/recipes/tag.ts +218 -210
- package/src/recipes/text.ts +37 -19
- package/src/recipes/textInput.ts +103 -155
- package/src/recipes/themeSwitcher.ts +3 -3
- package/src/recipes/timeMenus.ts +110 -0
- package/src/recipes/toggle.ts +3 -1
- package/src/styles/primitives/shadows.ts +26 -60
- package/src/styles/primitives/zIndex.ts +1 -0
- package/src/styles/semantics/colors.ts +43 -0
- package/src/styles/semantics/shadows.ts +4 -30
- package/src/styles/semantics/zIndex.ts +2 -0
- package/src/styles/utilities/conditions.ts +61 -51
- package/src/styles/utilities/dropShadows.ts +51 -0
- package/src/styles/utilities/filters.ts +22 -7
- package/src/styles/utilities/globalStyle.ts +5 -2
- package/src/styles/utilities/index.ts +3 -0
- package/src/styles/utilities/keyframes.ts +27 -4
- package/src/styles/utilities/recipeGlobalStyles.ts +22 -0
- package/src/styles/utilities/shadowDefinitions.ts +112 -0
- package/src/utils/dsChain.ts +113 -0
- package/src/utils/dsComponent.ts +44 -0
- package/src/utils/dsPart.ts +41 -0
- package/dist/preset-BAn5LBiW.js.map +0 -1
- package/src/recipes/datePicker.ts +0 -234
- package/src/recipes/timePicker.ts +0 -216
package/src/recipes/chip.ts
CHANGED
|
@@ -1,311 +1,257 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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',
|
|
11
17
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
appearance: 'none',
|
|
16
|
-
border: 'none',
|
|
17
|
-
borderRadius: '999',
|
|
18
|
-
fontFamily: 'sans',
|
|
19
|
-
lineHeight: 'default',
|
|
20
|
-
fontWeight: 'medium',
|
|
21
|
-
whiteSpace: 'nowrap',
|
|
22
|
-
cursor: 'pointer',
|
|
23
|
-
transitionDuration: 'fast',
|
|
24
|
-
transitionProperty: 'background, color, border-color, box-shadow',
|
|
25
|
-
transitionTimingFunction: 'default',
|
|
26
|
-
userSelect: 'none',
|
|
27
|
-
outlineWidth: '2',
|
|
28
|
-
outlineStyle: 'solid',
|
|
29
|
-
outlineColor: 'transparent',
|
|
30
|
-
bg: 'bg.neutral',
|
|
31
|
-
color: 'text',
|
|
32
|
-
_hover: {
|
|
33
|
-
bg: 'bg.neutral.hovered',
|
|
18
|
+
_hover: {
|
|
19
|
+
_icon: {
|
|
20
|
+
fill: 'icon',
|
|
34
21
|
},
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
},
|
|
23
|
+
_active: {
|
|
24
|
+
_icon: {
|
|
25
|
+
fill: 'icon',
|
|
37
26
|
},
|
|
38
|
-
|
|
39
|
-
|
|
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',
|
|
40
45
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
},
|
|
47
|
+
'&:has([data-selected=true]):is(:hover, [data-hover])': {
|
|
48
|
+
_icon: {
|
|
49
|
+
fill: 'icon.decorative.inverse.hovered',
|
|
44
50
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
},
|
|
52
|
+
'&:has([data-selected=true]):is(:active, [data-active])': {
|
|
53
|
+
_icon: {
|
|
54
|
+
fill: 'icon.decorative.inverse.hovered',
|
|
49
55
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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.
|
|
55
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',
|
|
56
114
|
bg: 'bg.disabled',
|
|
57
115
|
color: 'text.disabled',
|
|
58
|
-
|
|
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,
|
|
59
139
|
},
|
|
60
140
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
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.
|
|
64
172
|
_hover: {
|
|
65
|
-
bg: '
|
|
173
|
+
bg: 'transparent',
|
|
174
|
+
_icon: { fill: 'icon' },
|
|
66
175
|
},
|
|
67
176
|
_active: {
|
|
68
|
-
bg: '
|
|
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)',
|
|
69
186
|
},
|
|
70
187
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
},
|
|
116
|
-
chipIcon: {
|
|
117
|
-
fill: 'icon.decorative',
|
|
118
|
-
aspectRatio: 'square',
|
|
119
|
-
transitionDuration: 'fast',
|
|
120
|
-
transitionProperty: 'fill',
|
|
121
|
-
transitionTimingFunction: 'default',
|
|
122
|
-
_groupHover: { fill: 'icon.decorative.hovered' },
|
|
123
|
-
_groupActive: { fill: 'icon.decorative.hovered' },
|
|
124
|
-
_groupDisabled: { fill: 'icon.decorative' },
|
|
125
|
-
'[data-selected=true] &': {
|
|
126
|
-
fill: 'icon.decorative.inverse',
|
|
127
|
-
},
|
|
128
|
-
'.group:is(:hover, [data-hover])[data-selected=true] &': {
|
|
129
|
-
fill: 'icon.decorative.inverse.hovered',
|
|
188
|
+
slot: {
|
|
189
|
+
display: 'inline-flex',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
px: 'var(--slot-px)',
|
|
130
192
|
},
|
|
131
193
|
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const chipRecipe = defineSlotRecipe({
|
|
135
|
-
className: 'chip',
|
|
136
|
-
jsx: ['Chip'],
|
|
137
|
-
slots: [
|
|
138
|
-
'container',
|
|
139
|
-
'body',
|
|
140
|
-
'mainContent',
|
|
141
|
-
'dismissButton',
|
|
142
|
-
'slot',
|
|
143
|
-
'chipIcon',
|
|
144
|
-
],
|
|
145
|
-
base: chipBase,
|
|
146
194
|
variants: {
|
|
147
195
|
size: {
|
|
148
196
|
sm: {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
mainContent: {
|
|
157
|
-
gap: '2',
|
|
158
|
-
},
|
|
159
|
-
slot: {
|
|
160
|
-
gap: '2',
|
|
161
|
-
},
|
|
162
|
-
chipIcon: {
|
|
163
|
-
w: '20',
|
|
164
|
-
h: '20',
|
|
165
|
-
},
|
|
166
|
-
dismissButton: {
|
|
167
|
-
w: '20',
|
|
168
|
-
h: '20',
|
|
197
|
+
container: {
|
|
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)',
|
|
169
204
|
},
|
|
170
205
|
},
|
|
171
206
|
md: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
mainContent: {
|
|
180
|
-
gap: '4',
|
|
181
|
-
},
|
|
182
|
-
slot: {
|
|
183
|
-
gap: '4',
|
|
184
|
-
},
|
|
185
|
-
chipIcon: {
|
|
186
|
-
w: '20',
|
|
187
|
-
h: '20',
|
|
188
|
-
},
|
|
189
|
-
dismissButton: {
|
|
190
|
-
w: '24',
|
|
191
|
-
h: '24',
|
|
207
|
+
container: {
|
|
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)',
|
|
192
214
|
},
|
|
193
215
|
},
|
|
194
216
|
lg: {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
mainContent: {
|
|
203
|
-
gap: '4',
|
|
204
|
-
},
|
|
205
|
-
slot: {
|
|
206
|
-
gap: '4',
|
|
207
|
-
},
|
|
208
|
-
chipIcon: {
|
|
209
|
-
w: '24',
|
|
210
|
-
h: '24',
|
|
211
|
-
},
|
|
212
|
-
dismissButton: {
|
|
213
|
-
w: '32',
|
|
214
|
-
h: '32',
|
|
217
|
+
container: {
|
|
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)',
|
|
215
224
|
},
|
|
216
225
|
},
|
|
217
226
|
xl: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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',
|
|
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)',
|
|
238
234
|
},
|
|
239
235
|
},
|
|
240
236
|
},
|
|
241
237
|
before: {
|
|
242
|
-
true: {
|
|
238
|
+
true: {
|
|
239
|
+
mainContent: {
|
|
240
|
+
ps: 'var(--main-slot-side-padding)',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
243
|
},
|
|
244
244
|
after: {
|
|
245
|
-
true: {
|
|
245
|
+
true: {
|
|
246
|
+
mainContent: {
|
|
247
|
+
pe: 'var(--main-slot-side-padding)',
|
|
248
|
+
},
|
|
249
|
+
},
|
|
246
250
|
},
|
|
247
251
|
dismissable: {
|
|
248
|
-
true: {
|
|
252
|
+
true: {},
|
|
249
253
|
},
|
|
250
254
|
},
|
|
251
|
-
compoundVariants: [
|
|
252
|
-
{
|
|
253
|
-
size: 'sm',
|
|
254
|
-
before: true,
|
|
255
|
-
css: {
|
|
256
|
-
body: { ps: '2' },
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
size: 'sm',
|
|
261
|
-
after: true,
|
|
262
|
-
css: {
|
|
263
|
-
body: { pe: '2' },
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
size: 'md',
|
|
268
|
-
before: true,
|
|
269
|
-
css: {
|
|
270
|
-
body: { ps: '2' },
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
size: 'md',
|
|
275
|
-
after: true,
|
|
276
|
-
css: {
|
|
277
|
-
body: { pe: '2' },
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
size: 'lg',
|
|
282
|
-
before: true,
|
|
283
|
-
css: {
|
|
284
|
-
body: { ps: '4' },
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
size: 'lg',
|
|
289
|
-
after: true,
|
|
290
|
-
css: {
|
|
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' },
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
255
|
defaultVariants: {
|
|
310
256
|
size: 'md',
|
|
311
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
|
+
});
|
package/src/recipes/kbd.ts
CHANGED
|
@@ -1,53 +1,56 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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.
|
|
33
7
|
export const kbdRecipe = defineSlotRecipe({
|
|
34
8
|
className: 'kbd',
|
|
35
9
|
jsx: ['Kbd'],
|
|
36
|
-
slots: ['
|
|
37
|
-
base:
|
|
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
|
+
},
|
|
38
39
|
variants: {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
variant: {
|
|
41
|
+
default: {
|
|
42
|
+
key: {
|
|
43
|
+
fontSize: '10',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
symbol: {
|
|
41
47
|
key: {
|
|
42
|
-
|
|
43
|
-
px: '2.5',
|
|
44
|
-
fontSize: '14',
|
|
45
|
-
letterSpacing: 'normal',
|
|
48
|
+
fontSize: '12',
|
|
46
49
|
},
|
|
47
50
|
},
|
|
48
51
|
},
|
|
49
52
|
},
|
|
50
53
|
defaultVariants: {
|
|
51
|
-
|
|
54
|
+
variant: 'default',
|
|
52
55
|
},
|
|
53
56
|
});
|