@okshaun/components 4.1.5 → 5.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/README.md +1 -1
- package/dist/icon-metadata.json +134 -0
- package/dist/index.js +16208 -10749
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +754 -530
- package/dist/{preset-jXQwQ5KL.js → preset-B6fsdoKY.js} +2338 -317
- package/dist/preset-B6fsdoKY.js.map +1 -0
- package/dist/preset.js +1 -1
- package/dist/specs/keyframes.json +66 -0
- package/dist/specs/recipes.json +394 -26
- package/dist/specs/tokens.json +15 -0
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +248 -2
- package/dist/styles.css +3971 -789
- package/dist/svgs/barcode-reader-off.svg +1 -0
- package/dist/svgs/circle-dashed.svg +1 -0
- package/dist/svgs/drawer-left-hide.svg +1 -0
- package/dist/svgs/drawer-left-show.svg +1 -0
- package/dist/svgs/drawer-right-hide.svg +1 -0
- package/dist/svgs/drawer-right-show.svg +1 -0
- package/dist/svgs/not-equal.svg +1 -0
- package/dist/svgs/square-dashed.svg +1 -0
- package/dist/types/index.d.ts +2989 -115
- package/package.json +9 -12
- package/src/recipes/alert.ts +80 -0
- package/src/recipes/autocomplete.ts +2 -2
- package/src/recipes/avatar.ts +13 -6
- package/src/recipes/button.ts +41 -30
- package/src/recipes/checkbox.ts +3 -0
- package/src/recipes/chip.ts +16 -0
- package/src/recipes/code.ts +40 -23
- package/src/recipes/codeBlock.ts +277 -0
- package/src/recipes/drawer.ts +150 -0
- package/src/recipes/filterField.ts +138 -0
- package/src/recipes/filterMenu.ts +71 -0
- package/src/recipes/filterToken.ts +189 -0
- package/src/recipes/inlineNote.ts +49 -0
- package/src/recipes/keyFact.ts +111 -0
- package/src/recipes/listItem.ts +25 -0
- package/src/recipes/menu.ts +41 -2
- package/src/recipes/pageBanner.ts +110 -0
- package/src/recipes/peekBar.ts +35 -0
- package/src/recipes/popover.ts +206 -0
- package/src/recipes/printPreview.ts +101 -0
- package/src/recipes/recipes-regular.ts +1 -1
- package/src/recipes/recipes-slot.ts +14 -0
- package/src/recipes/segmentedFields.ts +11 -5
- package/src/recipes/select.ts +204 -63
- package/src/recipes/spinner.ts +1 -1
- package/src/recipes/tabs.ts +161 -0
- package/src/recipes/tag.ts +13 -2
- package/src/recipes/timeMenus.ts +1 -1
- package/src/recipes/toast.ts +116 -0
- package/src/recipes/toggle.ts +3 -3
- package/src/styles/primitives/fontSizes.ts +1 -0
- package/src/styles/primitives/radii.ts +2 -0
- package/src/styles/utilities/keyframes.ts +38 -0
- package/src/utils/compoundComponent.ts +29 -0
- package/dist/preset-jXQwQ5KL.js.map +0 -1
package/src/recipes/select.ts
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
3
|
const selectBase = {
|
|
4
|
-
|
|
4
|
+
root: {
|
|
5
|
+
'--icon-size': 'token(sizes.24)',
|
|
6
|
+
'--icon-margin': 'token(sizes.3)',
|
|
7
|
+
'--input-icon-padding': 'token(sizes.10)',
|
|
8
|
+
display: 'inline-flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
position: 'relative',
|
|
11
|
+
minWidth: '0',
|
|
12
|
+
maxW: 'full',
|
|
13
|
+
width: 'fit',
|
|
14
|
+
},
|
|
5
15
|
trigger: {
|
|
6
|
-
|
|
16
|
+
position: 'relative',
|
|
17
|
+
display: 'inline-flex',
|
|
7
18
|
alignItems: 'center',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
width: 'fit',
|
|
20
|
+
minWidth: '0',
|
|
21
|
+
maxWidth: 'full',
|
|
22
|
+
pe: 'var(--input-icon-padding)',
|
|
11
23
|
borderWidth: '1',
|
|
12
24
|
borderStyle: 'solid',
|
|
13
25
|
borderColor: 'border.input',
|
|
14
26
|
borderRadius: '4',
|
|
27
|
+
outlineWidth: '2',
|
|
28
|
+
outlineOffset: '-1',
|
|
29
|
+
outlineStyle: 'solid',
|
|
30
|
+
outlineColor: 'transparent',
|
|
15
31
|
bg: 'bg.input',
|
|
16
32
|
color: 'text',
|
|
17
|
-
fontFamily: '
|
|
33
|
+
fontFamily: 'sans',
|
|
34
|
+
lineHeight: 'default',
|
|
18
35
|
cursor: 'pointer',
|
|
19
|
-
|
|
36
|
+
overflow: 'hidden',
|
|
20
37
|
transitionDuration: 'fast',
|
|
21
|
-
transitionProperty: 'background, border-color,
|
|
38
|
+
transitionProperty: 'background, border-color, outline-color',
|
|
22
39
|
transitionTimingFunction: 'default',
|
|
23
40
|
_hover: {
|
|
24
41
|
bg: 'bg.input.hovered',
|
|
25
42
|
},
|
|
26
|
-
|
|
43
|
+
_focusVisible: {
|
|
44
|
+
bg: 'bg.input.pressed',
|
|
45
|
+
borderColor: 'border.focused',
|
|
46
|
+
outlineColor: 'border.focused',
|
|
47
|
+
},
|
|
48
|
+
_open: {
|
|
49
|
+
bg: 'bg.input.pressed',
|
|
27
50
|
borderColor: 'border.focused',
|
|
28
|
-
outlineWidth: '2',
|
|
29
|
-
outlineOffset: '-1',
|
|
30
|
-
outlineStyle: 'solid',
|
|
31
51
|
outlineColor: 'border.focused',
|
|
32
52
|
},
|
|
33
53
|
_disabled: {
|
|
@@ -35,103 +55,215 @@ const selectBase = {
|
|
|
35
55
|
borderColor: 'border.disabled',
|
|
36
56
|
color: 'text.disabled',
|
|
37
57
|
cursor: 'not-allowed',
|
|
38
|
-
|
|
58
|
+
pointerEvents: 'none',
|
|
39
59
|
},
|
|
40
60
|
_error: {
|
|
41
|
-
bg: 'bg.danger',
|
|
42
61
|
borderColor: 'border.danger',
|
|
43
62
|
_hover: {
|
|
44
|
-
|
|
63
|
+
borderColor: 'border.danger',
|
|
45
64
|
},
|
|
46
|
-
|
|
65
|
+
_focusVisible: {
|
|
66
|
+
borderColor: 'border.danger',
|
|
67
|
+
outlineColor: 'border.danger',
|
|
68
|
+
},
|
|
69
|
+
_open: {
|
|
47
70
|
borderColor: 'border.danger',
|
|
48
71
|
outlineColor: 'border.danger',
|
|
49
72
|
},
|
|
50
73
|
},
|
|
51
74
|
},
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
content: {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
minWidth: '0',
|
|
79
|
+
width: 'full',
|
|
80
|
+
flex: '1',
|
|
81
|
+
ps: 'var(--select-px)',
|
|
82
|
+
},
|
|
83
|
+
before: {
|
|
84
|
+
display: 'inline-flex',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
flex: '0 0 auto',
|
|
87
|
+
alignSelf: 'center',
|
|
88
|
+
px: 'var(--select-slot-px)',
|
|
89
|
+
fill: 'icon.decorative',
|
|
90
|
+
pointerEvents: 'none',
|
|
91
|
+
},
|
|
54
92
|
value: {
|
|
55
93
|
flex: 1,
|
|
94
|
+
minWidth: '0',
|
|
56
95
|
textAlign: 'left',
|
|
57
96
|
truncate: true,
|
|
58
97
|
color: 'text',
|
|
59
|
-
_placeholder: {
|
|
60
|
-
color: 'text.subtlest',
|
|
61
|
-
},
|
|
62
98
|
},
|
|
63
|
-
|
|
64
|
-
// Placeholder styling (when no value selected)
|
|
65
99
|
placeholder: {
|
|
66
|
-
color: 'text.subtlest',
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
chips: {
|
|
70
100
|
flex: 1,
|
|
71
101
|
minWidth: '0',
|
|
102
|
+
textAlign: 'left',
|
|
103
|
+
truncate: true,
|
|
104
|
+
color: 'text.placeholder',
|
|
105
|
+
},
|
|
106
|
+
chips: {
|
|
107
|
+
display: 'flex',
|
|
72
108
|
alignItems: 'center',
|
|
73
|
-
|
|
109
|
+
gap: '4',
|
|
110
|
+
minWidth: '0',
|
|
111
|
+
width: 'full',
|
|
112
|
+
flex: '1',
|
|
113
|
+
overflowX: 'auto',
|
|
114
|
+
overflowY: 'hidden',
|
|
115
|
+
scrollbarWidth: 'thin',
|
|
74
116
|
},
|
|
75
|
-
|
|
76
|
-
// The chevron/arrow icon
|
|
77
117
|
icon: {
|
|
78
|
-
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
top: '50%',
|
|
120
|
+
right: '1',
|
|
121
|
+
display: 'inline-flex',
|
|
79
122
|
alignItems: 'center',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
justifyContent: 'center',
|
|
124
|
+
width: 'var(--icon-size)',
|
|
125
|
+
height: 'var(--icon-size)',
|
|
126
|
+
marginInline: 'var(--icon-margin)',
|
|
127
|
+
transform: 'translateY(-50%)',
|
|
128
|
+
bg: 'bg.input',
|
|
129
|
+
fill: 'icon.decorative',
|
|
130
|
+
pointerEvents: 'none',
|
|
131
|
+
transitionDuration: 'fast',
|
|
132
|
+
transitionProperty: 'all',
|
|
84
133
|
transitionTimingFunction: 'default',
|
|
85
|
-
|
|
86
|
-
|
|
134
|
+
_icon: {
|
|
135
|
+
width: 'var(--icon-size)',
|
|
136
|
+
height: 'var(--icon-size)',
|
|
137
|
+
transitionDuration: 'fast',
|
|
138
|
+
transitionProperty: 'all',
|
|
139
|
+
transitionTimingFunction: 'default',
|
|
140
|
+
},
|
|
141
|
+
_peerHover: {
|
|
142
|
+
bg: 'bg.input.hovered',
|
|
143
|
+
},
|
|
144
|
+
_open: {
|
|
145
|
+
'& > svg': {
|
|
146
|
+
transform: 'rotate(-180deg)',
|
|
147
|
+
transformOrigin: 'center',
|
|
148
|
+
},
|
|
87
149
|
},
|
|
88
150
|
},
|
|
89
151
|
};
|
|
90
152
|
|
|
91
153
|
const selectVariants = {
|
|
92
154
|
size: {
|
|
155
|
+
sm: {
|
|
156
|
+
root: {
|
|
157
|
+
'--icon-size': 'token(sizes.22)',
|
|
158
|
+
'--icon-margin': 'token(sizes.2)',
|
|
159
|
+
'--input-icon-padding': '[26px]',
|
|
160
|
+
'--select-px': 'token(sizes.8)',
|
|
161
|
+
'--select-slot-px': 'token(sizes.4)',
|
|
162
|
+
},
|
|
163
|
+
content: {
|
|
164
|
+
py: '0',
|
|
165
|
+
fontSize: '14',
|
|
166
|
+
},
|
|
167
|
+
chips: {
|
|
168
|
+
gap: '3',
|
|
169
|
+
py: '2',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
93
172
|
md: {
|
|
94
|
-
|
|
173
|
+
root: {
|
|
174
|
+
'--icon-size': 'token(sizes.24)',
|
|
175
|
+
'--icon-margin': 'token(sizes.3)',
|
|
176
|
+
'--input-icon-padding': '[31px]',
|
|
177
|
+
'--select-px': 'token(sizes.10)',
|
|
178
|
+
'--select-slot-px': 'token(sizes.6)',
|
|
179
|
+
},
|
|
180
|
+
content: {
|
|
95
181
|
py: '3',
|
|
96
|
-
px: '12',
|
|
97
182
|
fontSize: '16',
|
|
98
183
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
184
|
+
chips: {
|
|
185
|
+
gap: '4',
|
|
186
|
+
py: '5',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
lg: {
|
|
190
|
+
root: {
|
|
191
|
+
'--icon-size': 'token(sizes.24)',
|
|
192
|
+
'--icon-margin': 'token(sizes.5)',
|
|
193
|
+
'--input-icon-padding': '[34px]',
|
|
194
|
+
'--select-px': 'token(sizes.12)',
|
|
195
|
+
'--select-slot-px': 'token(sizes.8)',
|
|
196
|
+
},
|
|
197
|
+
content: {
|
|
198
|
+
py: '7',
|
|
199
|
+
fontSize: '16',
|
|
200
|
+
},
|
|
201
|
+
chips: {
|
|
202
|
+
gap: '5',
|
|
203
|
+
py: '0',
|
|
102
204
|
},
|
|
103
205
|
},
|
|
104
206
|
xl: {
|
|
105
|
-
|
|
207
|
+
root: {
|
|
208
|
+
'--icon-size': 'token(sizes.28)',
|
|
209
|
+
'--icon-margin': 'token(sizes.7)',
|
|
210
|
+
'--input-icon-padding': '[42px]',
|
|
211
|
+
'--select-px': 'token(sizes.16)',
|
|
212
|
+
'--select-slot-px': 'token(sizes.10)',
|
|
213
|
+
},
|
|
214
|
+
content: {
|
|
106
215
|
py: '9',
|
|
107
|
-
px: '16',
|
|
108
216
|
fontSize: '20',
|
|
109
217
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
218
|
+
chips: {
|
|
219
|
+
gap: '6',
|
|
220
|
+
py: '2',
|
|
113
221
|
},
|
|
114
222
|
},
|
|
115
|
-
|
|
223
|
+
},
|
|
224
|
+
before: {
|
|
225
|
+
true: {
|
|
226
|
+
content: {
|
|
227
|
+
ps: '0',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
multiple: {
|
|
232
|
+
true: {
|
|
116
233
|
trigger: {
|
|
117
|
-
|
|
118
|
-
px: '14',
|
|
119
|
-
fontSize: '16',
|
|
234
|
+
alignItems: 'flex-start',
|
|
120
235
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
h: '24',
|
|
236
|
+
content: {
|
|
237
|
+
alignItems: 'flex-start',
|
|
124
238
|
},
|
|
125
239
|
},
|
|
126
|
-
|
|
240
|
+
},
|
|
241
|
+
autoSize: {
|
|
242
|
+
true: {
|
|
127
243
|
trigger: {
|
|
128
|
-
|
|
129
|
-
px: '8',
|
|
130
|
-
fontSize: '14',
|
|
244
|
+
height: 'auto',
|
|
131
245
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
246
|
+
value: {
|
|
247
|
+
whiteSpace: 'normal',
|
|
248
|
+
textWrap: 'wrap',
|
|
249
|
+
overflow: 'visible',
|
|
250
|
+
textOverflow: 'clip',
|
|
251
|
+
},
|
|
252
|
+
placeholder: {
|
|
253
|
+
whiteSpace: 'normal',
|
|
254
|
+
textWrap: 'wrap',
|
|
255
|
+
overflow: 'visible',
|
|
256
|
+
textOverflow: 'clip',
|
|
257
|
+
},
|
|
258
|
+
chips: {
|
|
259
|
+
flexWrap: 'wrap',
|
|
260
|
+
overflowX: 'visible',
|
|
261
|
+
overflowY: 'visible',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
false: {
|
|
265
|
+
chips: {
|
|
266
|
+
flexWrap: 'nowrap',
|
|
135
267
|
},
|
|
136
268
|
},
|
|
137
269
|
},
|
|
@@ -139,8 +271,17 @@ const selectVariants = {
|
|
|
139
271
|
|
|
140
272
|
export const selectRecipe = defineSlotRecipe({
|
|
141
273
|
className: 'select',
|
|
142
|
-
jsx: ['Select'
|
|
143
|
-
slots: [
|
|
274
|
+
jsx: ['Select'],
|
|
275
|
+
slots: [
|
|
276
|
+
'root',
|
|
277
|
+
'trigger',
|
|
278
|
+
'content',
|
|
279
|
+
'value',
|
|
280
|
+
'placeholder',
|
|
281
|
+
'chips',
|
|
282
|
+
'before',
|
|
283
|
+
'icon',
|
|
284
|
+
],
|
|
144
285
|
base: selectBase,
|
|
145
286
|
variants: selectVariants,
|
|
146
287
|
defaultVariants: {
|
package/src/recipes/spinner.ts
CHANGED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
export const tabsRecipe = defineSlotRecipe({
|
|
6
|
+
className: 'tabs',
|
|
7
|
+
jsx: ['Tabs'],
|
|
8
|
+
slots: ['root', 'strip', 'list', 'tab', 'badge', 'overflow', 'menu', 'panel'],
|
|
9
|
+
base: {
|
|
10
|
+
root: {
|
|
11
|
+
...globalBaseStyles,
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
minWidth: '0',
|
|
15
|
+
width: 'full',
|
|
16
|
+
},
|
|
17
|
+
strip: {
|
|
18
|
+
...globalBaseStyles,
|
|
19
|
+
position: 'relative',
|
|
20
|
+
minWidth: '0',
|
|
21
|
+
width: 'full',
|
|
22
|
+
},
|
|
23
|
+
list: {
|
|
24
|
+
...globalBaseStyles,
|
|
25
|
+
position: 'relative',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
alignItems: 'stretch',
|
|
28
|
+
flexWrap: 'nowrap',
|
|
29
|
+
// Figma `Tabs` tablist: 8px between tabs, with each tab carrying 6px of
|
|
30
|
+
// its own inline padding so the underline hugs the label.
|
|
31
|
+
gap: '8',
|
|
32
|
+
minWidth: '0',
|
|
33
|
+
width: 'full',
|
|
34
|
+
// The 1px rule the strip sits on. Each tab's 2px underline overlaps it.
|
|
35
|
+
borderBottomWidth: '1',
|
|
36
|
+
borderBottomStyle: 'solid',
|
|
37
|
+
borderBottomColor: 'border',
|
|
38
|
+
},
|
|
39
|
+
tab: {
|
|
40
|
+
...globalBaseStyles,
|
|
41
|
+
position: 'relative',
|
|
42
|
+
display: 'inline-flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
gap: '6',
|
|
46
|
+
flexShrink: '0',
|
|
47
|
+
whiteSpace: 'nowrap',
|
|
48
|
+
appearance: 'none',
|
|
49
|
+
bg: 'transparent',
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
px: '6',
|
|
52
|
+
// 8px above and below the 22px line box, plus the 2px underline, makes
|
|
53
|
+
// the 40px tab in Figma `_TabsTab`. The 20px badge sits inside the line
|
|
54
|
+
// box, so showing it never changes the tab's height.
|
|
55
|
+
py: '8',
|
|
56
|
+
fontSize: '14',
|
|
57
|
+
lineHeight: 'default',
|
|
58
|
+
color: 'text.subtlest',
|
|
59
|
+
borderWidth: '0',
|
|
60
|
+
borderBottomWidth: '2',
|
|
61
|
+
borderBottomStyle: 'solid',
|
|
62
|
+
borderBottomColor: 'transparent',
|
|
63
|
+
// Pull the 2px underline on top of the list's 1px rule.
|
|
64
|
+
marginBottom: '-1',
|
|
65
|
+
transitionProperty: 'color, border-color',
|
|
66
|
+
transitionDuration: 'fast',
|
|
67
|
+
transitionTimingFunction: 'default',
|
|
68
|
+
_hover: {
|
|
69
|
+
color: 'text',
|
|
70
|
+
borderBottomColor: 'border',
|
|
71
|
+
},
|
|
72
|
+
_selected: {
|
|
73
|
+
color: 'text',
|
|
74
|
+
borderBottomColor: 'border.bold',
|
|
75
|
+
// The selected underline does not react to hover.
|
|
76
|
+
_hover: {
|
|
77
|
+
borderBottomColor: 'border.bold',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
_focusVisible: {
|
|
81
|
+
outlineWidth: '2',
|
|
82
|
+
outlineStyle: 'solid',
|
|
83
|
+
outlineColor: 'border.focused',
|
|
84
|
+
outlineOffset: '-2',
|
|
85
|
+
},
|
|
86
|
+
_disabled: {
|
|
87
|
+
color: 'text.disabled',
|
|
88
|
+
cursor: 'not-allowed',
|
|
89
|
+
_hover: {
|
|
90
|
+
color: 'text.disabled',
|
|
91
|
+
borderBottomColor: 'transparent',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
_motionReduce: {
|
|
95
|
+
transitionDuration: 'fastest',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
badge: {
|
|
99
|
+
display: 'inline-flex',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
flexShrink: '0',
|
|
102
|
+
// Keep the badge from adding a line box of its own to the tab.
|
|
103
|
+
lineHeight: 'none',
|
|
104
|
+
},
|
|
105
|
+
overflow: {
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
insetInlineEnd: '0',
|
|
108
|
+
top: '0',
|
|
109
|
+
bottom: '0',
|
|
110
|
+
display: 'inline-flex',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
flexShrink: '0',
|
|
113
|
+
},
|
|
114
|
+
menu: {
|
|
115
|
+
minWidth: '160',
|
|
116
|
+
},
|
|
117
|
+
panel: {
|
|
118
|
+
...globalBaseStyles,
|
|
119
|
+
color: 'text',
|
|
120
|
+
fontSize: '14',
|
|
121
|
+
minWidth: '0',
|
|
122
|
+
_focusVisible: {
|
|
123
|
+
outlineWidth: '2',
|
|
124
|
+
outlineStyle: 'solid',
|
|
125
|
+
outlineColor: 'border.focused',
|
|
126
|
+
outlineOffset: '2',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
variants: {
|
|
131
|
+
hasOverflow: {
|
|
132
|
+
false: {
|
|
133
|
+
overflow: {
|
|
134
|
+
visibility: 'hidden',
|
|
135
|
+
pointerEvents: 'none',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
true: {
|
|
139
|
+
overflow: {
|
|
140
|
+
visibility: 'visible',
|
|
141
|
+
pointerEvents: 'auto',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
/** Keeps an overflowed tab measurable while removing it from the strip. */
|
|
146
|
+
overflowed: {
|
|
147
|
+
true: {
|
|
148
|
+
tab: {
|
|
149
|
+
position: 'absolute',
|
|
150
|
+
visibility: 'hidden',
|
|
151
|
+
pointerEvents: 'none',
|
|
152
|
+
insetInlineStart: '0',
|
|
153
|
+
top: '0',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
defaultVariants: {
|
|
159
|
+
hasOverflow: false,
|
|
160
|
+
},
|
|
161
|
+
});
|
package/src/recipes/tag.ts
CHANGED
|
@@ -12,13 +12,23 @@ export const tagRecipe = defineRecipe({
|
|
|
12
12
|
gap: '1',
|
|
13
13
|
px: '4',
|
|
14
14
|
w: 'fit',
|
|
15
|
-
h: '20',
|
|
16
|
-
fontSize: '14',
|
|
17
15
|
fontWeight: 'medium',
|
|
18
16
|
lineHeight: 'tight',
|
|
19
17
|
whiteSpace: 'nowrap',
|
|
20
18
|
},
|
|
21
19
|
variants: {
|
|
20
|
+
// Both sizes set every property they change, so a conditional value such
|
|
21
|
+
// as { base: 'sm', md: 'md' } switches back at the breakpoint.
|
|
22
|
+
size: {
|
|
23
|
+
sm: {
|
|
24
|
+
h: '16',
|
|
25
|
+
fontSize: '12',
|
|
26
|
+
},
|
|
27
|
+
md: {
|
|
28
|
+
h: '20',
|
|
29
|
+
fontSize: '14',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
22
32
|
// Each hue publishes both colour pairs; `variant` picks one. This replaces
|
|
23
33
|
// 24 compoundVariants, which Panda emitted no CSS for at all: the variant
|
|
24
34
|
// bodies were empty, so every Tag rendered as the uncoloured base. Doing it
|
|
@@ -261,6 +271,7 @@ export const tagRecipe = defineRecipe({
|
|
|
261
271
|
},
|
|
262
272
|
},
|
|
263
273
|
defaultVariants: {
|
|
274
|
+
size: 'md',
|
|
264
275
|
variant: 'default',
|
|
265
276
|
hue: 'gray',
|
|
266
277
|
},
|
package/src/recipes/timeMenus.ts
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
const toastBase = {
|
|
6
|
+
/**
|
|
7
|
+
* Fixed, bottom-right stack rendered once by `ToastViewport`. The viewport
|
|
8
|
+
* itself is click-through so it never covers the page; each toast re-enables
|
|
9
|
+
* pointer events for its own box.
|
|
10
|
+
*/
|
|
11
|
+
viewport: {
|
|
12
|
+
position: 'fixed',
|
|
13
|
+
left: { base: '24', xs: 'auto' },
|
|
14
|
+
right: '24',
|
|
15
|
+
bottom: '24',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
alignItems: 'flex-end',
|
|
19
|
+
gap: '12',
|
|
20
|
+
maxW: 'full',
|
|
21
|
+
pointerEvents: 'none',
|
|
22
|
+
zIndex: 'tooltip',
|
|
23
|
+
},
|
|
24
|
+
root: {
|
|
25
|
+
...globalBaseStyles,
|
|
26
|
+
display: 'flex',
|
|
27
|
+
alignItems: 'flex-start',
|
|
28
|
+
gap: '8',
|
|
29
|
+
w: 'full',
|
|
30
|
+
minW: { base: '0', xs: 'xs' },
|
|
31
|
+
maxW: 'sm',
|
|
32
|
+
p: '12',
|
|
33
|
+
borderRadius: '8',
|
|
34
|
+
bg: 'surface.overlay',
|
|
35
|
+
boxShadow: 'overlay',
|
|
36
|
+
border: 'default',
|
|
37
|
+
pointerEvents: 'auto',
|
|
38
|
+
animationName: 'toastSlideIn',
|
|
39
|
+
animationDuration: 'fast',
|
|
40
|
+
animationTimingFunction: 'out',
|
|
41
|
+
animationFillMode: 'forwards',
|
|
42
|
+
'&[data-state="closing"]': {
|
|
43
|
+
animationName: 'toastSlideOut',
|
|
44
|
+
},
|
|
45
|
+
_motionReduce: {
|
|
46
|
+
animationName: 'none',
|
|
47
|
+
opacity: '1',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
display: 'flex',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
flex: 'none',
|
|
54
|
+
minH: '18',
|
|
55
|
+
},
|
|
56
|
+
content: {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column',
|
|
59
|
+
gap: '4',
|
|
60
|
+
flex: '1',
|
|
61
|
+
minW: '0',
|
|
62
|
+
},
|
|
63
|
+
message: {
|
|
64
|
+
maxW: 'full',
|
|
65
|
+
},
|
|
66
|
+
actions: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
flexWrap: 'wrap',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
gap: '8',
|
|
71
|
+
mt: '4',
|
|
72
|
+
},
|
|
73
|
+
dismiss: {
|
|
74
|
+
flex: 'none',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const toastVariants = {
|
|
79
|
+
/** Semantic tone. Drives the leading border accent and the tone icon. */
|
|
80
|
+
tone: {
|
|
81
|
+
info: {
|
|
82
|
+
root: { borderLeft: 'info', borderLeftWidth: '4' },
|
|
83
|
+
},
|
|
84
|
+
success: {
|
|
85
|
+
root: { borderLeft: 'success', borderLeftWidth: '4' },
|
|
86
|
+
},
|
|
87
|
+
warning: {
|
|
88
|
+
root: { borderLeft: 'warning', borderLeftWidth: '4' },
|
|
89
|
+
},
|
|
90
|
+
danger: {
|
|
91
|
+
root: { borderLeft: 'danger', borderLeftWidth: '4' },
|
|
92
|
+
},
|
|
93
|
+
neutral: {
|
|
94
|
+
root: { borderLeft: 'default', borderLeftWidth: '4' },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const toastRecipe = defineSlotRecipe({
|
|
100
|
+
className: 'toast',
|
|
101
|
+
jsx: ['Toast', 'ToastViewport'],
|
|
102
|
+
slots: [
|
|
103
|
+
'viewport',
|
|
104
|
+
'root',
|
|
105
|
+
'icon',
|
|
106
|
+
'content',
|
|
107
|
+
'message',
|
|
108
|
+
'actions',
|
|
109
|
+
'dismiss',
|
|
110
|
+
],
|
|
111
|
+
base: toastBase,
|
|
112
|
+
variants: toastVariants,
|
|
113
|
+
defaultVariants: {
|
|
114
|
+
tone: 'neutral',
|
|
115
|
+
},
|
|
116
|
+
});
|
package/src/recipes/toggle.ts
CHANGED
|
@@ -10,11 +10,11 @@ export const toggleRecipe = defineSlotRecipe({
|
|
|
10
10
|
w: '32',
|
|
11
11
|
h: '20',
|
|
12
12
|
my: '2',
|
|
13
|
-
rounded: '
|
|
13
|
+
rounded: '999',
|
|
14
14
|
bg: 'surface',
|
|
15
15
|
cursor: 'pointer',
|
|
16
16
|
transitionProperty: 'border-color, background-color',
|
|
17
|
-
transitionDuration: '
|
|
17
|
+
transitionDuration: 'normal',
|
|
18
18
|
transitionTimingFunction: 'ease-in-out',
|
|
19
19
|
borderWidth: '2',
|
|
20
20
|
borderStyle: 'solid',
|
|
@@ -33,7 +33,7 @@ export const toggleRecipe = defineSlotRecipe({
|
|
|
33
33
|
outlineOffset: '1',
|
|
34
34
|
outlineWidth: '2',
|
|
35
35
|
outlineStyle: 'solid',
|
|
36
|
-
rounded: '
|
|
36
|
+
rounded: '999',
|
|
37
37
|
w: '32',
|
|
38
38
|
h: '20',
|
|
39
39
|
},
|