@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/textInput.ts
CHANGED
|
@@ -1,36 +1,62 @@
|
|
|
1
1
|
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
+
import { globalBaseStyles } from '~/styles/utilities';
|
|
4
|
+
|
|
5
|
+
// Ported from the Cetec design system: slots, the custom-property sizing
|
|
6
|
+
// mechanism and interaction behaviour. The recipe's before/after variants are
|
|
7
|
+
// internal; TextInput's public before/after/iconBefore/iconAfter props are
|
|
8
|
+
// unchanged.
|
|
9
|
+
|
|
3
10
|
const textInputBase = {
|
|
4
11
|
container: {
|
|
12
|
+
...globalBaseStyles,
|
|
13
|
+
'--input-py': 'token(sizes.3)',
|
|
14
|
+
'--input-px': 'token(sizes.10)',
|
|
15
|
+
'--input-slot-side-padding': 'token(sizes.0)',
|
|
16
|
+
'--input-fs': 'token(sizes.16)',
|
|
17
|
+
'--slot-size': 'token(sizes.20)',
|
|
18
|
+
'--slot-px': 'token(sizes.6)',
|
|
5
19
|
position: 'relative',
|
|
6
20
|
display: 'flex',
|
|
7
21
|
alignItems: 'center',
|
|
8
22
|
width: 'full',
|
|
9
23
|
bg: 'surface',
|
|
10
|
-
borderWidth: '
|
|
24
|
+
borderWidth: '1',
|
|
11
25
|
borderStyle: 'solid',
|
|
12
26
|
borderColor: 'border.input',
|
|
13
|
-
borderRadius: '
|
|
14
|
-
outlineWidth: '
|
|
27
|
+
borderRadius: '4',
|
|
28
|
+
outlineWidth: '1',
|
|
15
29
|
outlineStyle: 'solid',
|
|
16
30
|
outlineColor: 'transparent',
|
|
17
|
-
|
|
18
|
-
lineHeight: 'none',
|
|
19
|
-
_focusWithin: {
|
|
31
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
20
32
|
outlineColor: 'border.focused',
|
|
21
33
|
borderColor: 'border.focused',
|
|
22
34
|
},
|
|
23
35
|
_error: {
|
|
24
36
|
borderColor: 'border.danger',
|
|
25
|
-
|
|
37
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
26
38
|
borderColor: 'border.danger',
|
|
27
39
|
outlineColor: 'border.danger',
|
|
28
40
|
},
|
|
29
41
|
},
|
|
42
|
+
_invalid: {
|
|
43
|
+
borderColor: 'border.danger',
|
|
44
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
45
|
+
borderColor: 'border.danger',
|
|
46
|
+
outlineColor: 'border.danger',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
_valid: {
|
|
50
|
+
borderColor: 'border.success',
|
|
51
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
52
|
+
borderColor: 'border.success',
|
|
53
|
+
outlineColor: 'border.success',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
30
56
|
_disabled: {
|
|
31
|
-
opacity:
|
|
57
|
+
opacity: 0.4,
|
|
32
58
|
cursor: 'not-allowed',
|
|
33
|
-
|
|
59
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
34
60
|
outlineColor: 'transparent',
|
|
35
61
|
borderColor: 'border.input',
|
|
36
62
|
},
|
|
@@ -39,126 +65,110 @@ const textInputBase = {
|
|
|
39
65
|
opacity: 1, // let FormField handle disabled state opacity
|
|
40
66
|
},
|
|
41
67
|
},
|
|
68
|
+
input: {
|
|
69
|
+
width: 'full',
|
|
70
|
+
bg: 'surface',
|
|
71
|
+
py: 'var(--input-py)',
|
|
72
|
+
px: 'var(--input-px)',
|
|
73
|
+
fontSize: 'var(--input-fs)',
|
|
74
|
+
borderRadius: '3',
|
|
75
|
+
color: 'text',
|
|
76
|
+
lineHeight: 'default',
|
|
77
|
+
fontFamily: 'sans',
|
|
78
|
+
border: 'none',
|
|
79
|
+
outline: 'none',
|
|
80
|
+
_placeholder: {
|
|
81
|
+
color: 'text.placeholder',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
42
84
|
slot: {
|
|
43
85
|
display: 'inline-flex',
|
|
44
86
|
alignItems: 'center',
|
|
45
87
|
transitionDuration: 'fast',
|
|
46
88
|
transitionProperty: 'all',
|
|
47
89
|
transitionTimingFunction: 'default',
|
|
48
|
-
flex: '0 0
|
|
49
|
-
|
|
90
|
+
flex: '0 0 var(--slot-size)',
|
|
91
|
+
px: 'var(--slot-px)',
|
|
92
|
+
fill: 'icon.decorative',
|
|
50
93
|
pointerEvents: 'none',
|
|
51
94
|
zIndex: 1,
|
|
52
95
|
},
|
|
53
96
|
buttonSlot: {
|
|
54
97
|
display: 'inline-flex',
|
|
55
98
|
alignItems: 'center',
|
|
56
|
-
flex: '0 0
|
|
99
|
+
flex: '0 0 var(--slot-size)',
|
|
57
100
|
px: '0',
|
|
58
101
|
zIndex: 1,
|
|
59
102
|
m: '-1',
|
|
60
103
|
},
|
|
61
|
-
input: {
|
|
62
|
-
width: 'full',
|
|
63
|
-
bg: 'surface',
|
|
64
|
-
color: 'text',
|
|
65
|
-
lineHeight: 'default',
|
|
66
|
-
fontFamily: 'sans',
|
|
67
|
-
border: 'none',
|
|
68
|
-
outline: 'none',
|
|
69
|
-
_placeholder: {
|
|
70
|
-
color: 'text.placeholder',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
icon: {
|
|
74
|
-
position: 'absolute',
|
|
75
|
-
top: '50%',
|
|
76
|
-
transform: 'translateY(-50%)',
|
|
77
|
-
fill: 'icon.decorative.subtle',
|
|
78
|
-
mixBlendMode: { base: 'multiply', _dark: 'screen' },
|
|
79
|
-
pointerEvents: 'none',
|
|
80
|
-
zIndex: 1,
|
|
81
|
-
},
|
|
82
104
|
};
|
|
83
105
|
|
|
84
106
|
const textInputVariants = {
|
|
85
107
|
size: {
|
|
86
108
|
sm: {
|
|
87
|
-
|
|
88
|
-
py: '0',
|
|
89
|
-
px: '
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
h: '16',
|
|
95
|
-
px: '4',
|
|
96
|
-
},
|
|
97
|
-
icon: {
|
|
98
|
-
mx: '2',
|
|
99
|
-
w: '{sizes.22}',
|
|
109
|
+
container: {
|
|
110
|
+
'--input-py': 'token(sizes.0)',
|
|
111
|
+
'--input-px': 'token(sizes.8)',
|
|
112
|
+
'--input-slot-side-padding': 'token(sizes.0)',
|
|
113
|
+
'--input-fs': 'token(sizes.14)',
|
|
114
|
+
'--slot-size': 'token(sizes.16)',
|
|
115
|
+
'--slot-px': 'token(sizes.4)',
|
|
100
116
|
},
|
|
101
117
|
},
|
|
102
118
|
md: {
|
|
103
|
-
|
|
104
|
-
py: '3',
|
|
105
|
-
px: '
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
h: '20',
|
|
111
|
-
px: '6',
|
|
112
|
-
},
|
|
113
|
-
icon: {
|
|
114
|
-
mx: '3',
|
|
115
|
-
w: '{sizes.24}',
|
|
119
|
+
container: {
|
|
120
|
+
'--input-py': 'token(sizes.3)',
|
|
121
|
+
'--input-px': 'token(sizes.10)',
|
|
122
|
+
'--input-slot-side-padding': 'token(sizes.0)',
|
|
123
|
+
'--input-fs': 'token(sizes.16)',
|
|
124
|
+
'--slot-size': 'token(sizes.20)',
|
|
125
|
+
'--slot-px': 'token(sizes.6)',
|
|
116
126
|
},
|
|
117
127
|
},
|
|
118
128
|
lg: {
|
|
119
|
-
|
|
120
|
-
py: '7',
|
|
121
|
-
px: '
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
h: '24',
|
|
127
|
-
px: '8',
|
|
128
|
-
},
|
|
129
|
-
icon: {
|
|
130
|
-
mx: '5',
|
|
131
|
-
w: '{sizes.24}',
|
|
129
|
+
container: {
|
|
130
|
+
'--input-py': 'token(sizes.7)',
|
|
131
|
+
'--input-px': 'token(sizes.12)',
|
|
132
|
+
'--input-slot-side-padding': 'token(sizes.0)',
|
|
133
|
+
'--input-fs': 'token(sizes.16)',
|
|
134
|
+
'--slot-size': 'token(sizes.24)',
|
|
135
|
+
'--slot-px': 'token(sizes.8)',
|
|
132
136
|
},
|
|
133
137
|
},
|
|
134
138
|
xl: {
|
|
135
|
-
|
|
136
|
-
py: '9',
|
|
137
|
-
px: '
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
h: '28',
|
|
143
|
-
px: '10',
|
|
144
|
-
},
|
|
145
|
-
icon: {
|
|
146
|
-
mx: '7',
|
|
147
|
-
w: '{sizes.28}',
|
|
139
|
+
container: {
|
|
140
|
+
'--input-py': 'token(sizes.9)',
|
|
141
|
+
'--input-px': 'token(sizes.16)',
|
|
142
|
+
'--input-slot-side-padding': 'token(sizes.0)',
|
|
143
|
+
'--input-fs': 'token(sizes.20)',
|
|
144
|
+
'--slot-size': 'token(sizes.28)',
|
|
145
|
+
'--slot-px': 'token(sizes.10)',
|
|
148
146
|
},
|
|
149
147
|
},
|
|
150
148
|
},
|
|
151
|
-
|
|
149
|
+
before: {
|
|
152
150
|
true: {
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
input: {
|
|
152
|
+
ps: '0',
|
|
153
|
+
},
|
|
154
|
+
buttonSlot: {
|
|
155
|
+
'& button': {
|
|
156
|
+
borderTopRightRadius: '0',
|
|
157
|
+
borderBottomRightRadius: '0',
|
|
158
|
+
},
|
|
155
159
|
},
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
|
-
|
|
162
|
+
after: {
|
|
159
163
|
true: {
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
input: {
|
|
165
|
+
pe: '0',
|
|
166
|
+
},
|
|
167
|
+
buttonSlot: {
|
|
168
|
+
'& button': {
|
|
169
|
+
borderTopLeftRadius: '0',
|
|
170
|
+
borderBottomLeftRadius: '0',
|
|
171
|
+
},
|
|
162
172
|
},
|
|
163
173
|
},
|
|
164
174
|
},
|
|
@@ -172,74 +182,12 @@ const textInputVariants = {
|
|
|
172
182
|
},
|
|
173
183
|
};
|
|
174
184
|
|
|
175
|
-
const textInputCompoundVariants: NonNullable<
|
|
176
|
-
Parameters<typeof defineSlotRecipe>[0]['compoundVariants']
|
|
177
|
-
> = [
|
|
178
|
-
{
|
|
179
|
-
size: 'sm',
|
|
180
|
-
iconBefore: true,
|
|
181
|
-
css: {
|
|
182
|
-
input: { ps: '[calc({sizes.24} + {sizes.2})]' },
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
size: 'sm',
|
|
187
|
-
iconAfter: true,
|
|
188
|
-
css: {
|
|
189
|
-
input: { pe: '[calc({sizes.24} + {sizes.2})]' },
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
size: 'md',
|
|
194
|
-
iconBefore: true,
|
|
195
|
-
css: {
|
|
196
|
-
input: { ps: '[calc({sizes.24} + {sizes.7})]' },
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
size: 'md',
|
|
201
|
-
iconAfter: true,
|
|
202
|
-
css: {
|
|
203
|
-
input: { pe: '[calc({sizes.24} + {sizes.7})]' },
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
size: 'lg',
|
|
208
|
-
iconBefore: true,
|
|
209
|
-
css: {
|
|
210
|
-
input: { ps: '[calc({sizes.24} + {sizes.10})]' },
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
size: 'lg',
|
|
215
|
-
iconAfter: true,
|
|
216
|
-
css: {
|
|
217
|
-
input: { pe: '[calc({sizes.24} + {sizes.10})]' },
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
size: 'xl',
|
|
222
|
-
iconBefore: true,
|
|
223
|
-
css: {
|
|
224
|
-
input: { ps: '[calc({sizes.32} + {sizes.10})]' },
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
size: 'xl',
|
|
229
|
-
iconAfter: true,
|
|
230
|
-
css: {
|
|
231
|
-
input: { pe: '[calc({sizes.32} + {sizes.10})]' },
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
];
|
|
235
|
-
|
|
236
185
|
export const textInputRecipe = defineSlotRecipe({
|
|
237
186
|
className: 'textInput',
|
|
238
|
-
jsx: ['TextInput'
|
|
239
|
-
slots: ['container', 'input', 'slot', 'buttonSlot', '
|
|
187
|
+
jsx: ['TextInput'],
|
|
188
|
+
slots: ['container', 'input', 'slot', 'buttonSlot', 'before', 'after'],
|
|
240
189
|
base: textInputBase,
|
|
241
190
|
variants: textInputVariants,
|
|
242
|
-
compoundVariants: textInputCompoundVariants,
|
|
243
191
|
defaultVariants: {
|
|
244
192
|
size: 'md',
|
|
245
193
|
},
|
|
@@ -29,18 +29,18 @@ export const themeSwitcherRecipe = defineRecipe({
|
|
|
29
29
|
opacity: 'revert-layer',
|
|
30
30
|
display: 'block',
|
|
31
31
|
borderRadius: '100',
|
|
32
|
-
bg: 'bg.neutral.inverse
|
|
32
|
+
bg: 'bg.neutral.inverse',
|
|
33
33
|
transition: 'all',
|
|
34
34
|
transitionTimingFunction: 'default',
|
|
35
35
|
transitionDuration: 'normal',
|
|
36
36
|
},
|
|
37
37
|
_hover: {
|
|
38
38
|
cursor: 'pointer',
|
|
39
|
-
bg: 'bg.neutral.inverse
|
|
39
|
+
bg: 'bg.neutral.inverse',
|
|
40
40
|
borderColor: 'bg.neutral.bold',
|
|
41
41
|
'&:before': {
|
|
42
42
|
inset: '-8',
|
|
43
|
-
bg: 'bg.neutral.inverse
|
|
43
|
+
bg: 'bg.neutral.inverse',
|
|
44
44
|
opacity: '[0.25]',
|
|
45
45
|
},
|
|
46
46
|
},
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
// Content-only slots for TimeMenu/TimeRangeMenu's scrollable HR/MIN[/AM-PM]
|
|
4
|
+
// column picker — the popover chrome itself (bg/radius/shadow) comes from
|
|
5
|
+
// `<Menu>`, not from a slot here, so it isn't duplicated. Reused directly by
|
|
6
|
+
// DateTimeMenu for its own time columns (see `dateTimeMenus.ts`) so the
|
|
7
|
+
// column look only lives in one place. Structure/sizing preserves the
|
|
8
|
+
// established picker column treatment (maxHeight, border separators instead
|
|
9
|
+
// of a standalone divider element, hidden scrollbar).
|
|
10
|
+
const timeMenusBase = {
|
|
11
|
+
// Row of columns (HR | MIN | AM-PM), doubled with its own divider for range.
|
|
12
|
+
// minH: '0' overrides the flexbox default of min-height:auto on a flex
|
|
13
|
+
// item, which otherwise floors this box at its content's natural height
|
|
14
|
+
// and defeats stretching it down to match a shorter sibling (DateTimeMenu's
|
|
15
|
+
// Calendar) — see the `column` slot below for the full explanation.
|
|
16
|
+
columns: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'stretch',
|
|
19
|
+
minH: '0',
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
// A single scrollable HR/MIN/AM-PM column. `maxHeight` (not `h: 'full'`)
|
|
23
|
+
// matters here — Menu's own internal wrapper chain (levelsViewport >
|
|
24
|
+
// levelsTrack > level > list) doesn't propagate a concrete height down to
|
|
25
|
+
// this element, so `h: 'full'` resolves to "as tall as my content" and
|
|
26
|
+
// `overflowY: auto` never actually engages; an explicit cap makes the
|
|
27
|
+
// column bound itself regardless of what any ancestor does. `200` keeps
|
|
28
|
+
// the existing picker column cap exactly.
|
|
29
|
+
column: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
flex: '1',
|
|
33
|
+
minW: '56',
|
|
34
|
+
// minH: '0' is the load-bearing part, not maxHeight — a flex item's
|
|
35
|
+
// default min-height:auto floors it at its content's natural height no
|
|
36
|
+
// matter what cross-axis stretch or maxHeight say, which silently
|
|
37
|
+
// defeats overflowY:auto (nothing to scroll if the box just grows to
|
|
38
|
+
// fit everything). Zeroing it lets maxHeight (standalone) or the
|
|
39
|
+
// stretch variant's parent-driven height (DateTimeMenu) actually apply.
|
|
40
|
+
minH: '0',
|
|
41
|
+
maxHeight: '200',
|
|
42
|
+
overflowY: 'auto',
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
borderRightWidth: '1',
|
|
45
|
+
borderRightStyle: 'solid',
|
|
46
|
+
borderColor: 'border',
|
|
47
|
+
_last: {
|
|
48
|
+
borderRight: 'none',
|
|
49
|
+
},
|
|
50
|
+
// Hide the scrollbar visually but keep it functional — matches legacy.
|
|
51
|
+
'&::-webkit-scrollbar': {
|
|
52
|
+
display: 'none',
|
|
53
|
+
},
|
|
54
|
+
scrollbarWidth: 'none',
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// "HR" / "MIN" / "AM/PM" column label.
|
|
58
|
+
columnHeader: {
|
|
59
|
+
position: 'sticky',
|
|
60
|
+
top: '0',
|
|
61
|
+
textAlign: 'center',
|
|
62
|
+
fontSize: '12',
|
|
63
|
+
fontWeight: 'semibold',
|
|
64
|
+
color: 'text.subtlest',
|
|
65
|
+
bg: 'surface',
|
|
66
|
+
py: '4',
|
|
67
|
+
borderBottomWidth: '1',
|
|
68
|
+
borderBottomStyle: 'solid',
|
|
69
|
+
borderColor: 'border',
|
|
70
|
+
zIndex: '1',
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// Right-aligned Cancel/Apply pair — TimeRangeMenu only (TimeMenu commits
|
|
74
|
+
// immediately per value, same as DateMenu's non-range case).
|
|
75
|
+
footer: {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
justifyContent: 'flex-end',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
gap: '8',
|
|
80
|
+
borderTopWidth: '1',
|
|
81
|
+
borderTopStyle: 'solid',
|
|
82
|
+
borderColor: 'border',
|
|
83
|
+
px: '16',
|
|
84
|
+
py: '8',
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const timeMenusVariants = {
|
|
89
|
+
// DateTimeMenu pairs the columns with a Calendar sibling inside a
|
|
90
|
+
// stretch-aligned flex row, so the columns can size to match the
|
|
91
|
+
// Calendar's real rendered height instead of the standalone 200px cap —
|
|
92
|
+
// without this, the columns clip well short of the taller Calendar next to
|
|
93
|
+
// them. TimeMenu/TimeRangeMenu have no such sibling to stretch against, so
|
|
94
|
+
// they keep the fixed cap as their own default.
|
|
95
|
+
stretch: {
|
|
96
|
+
true: {
|
|
97
|
+
column: {
|
|
98
|
+
maxHeight: 'none',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const timeMenusRecipe = defineSlotRecipe({
|
|
105
|
+
className: 'timeMenus',
|
|
106
|
+
jsx: ['TimeMenus', 'TimeMenu', 'TimeRangeMenu'],
|
|
107
|
+
slots: ['columns', 'column', 'columnHeader', 'footer'],
|
|
108
|
+
base: timeMenusBase,
|
|
109
|
+
variants: timeMenusVariants,
|
|
110
|
+
});
|
package/src/recipes/toggle.ts
CHANGED
|
@@ -75,7 +75,9 @@ export const toggleRecipe = defineSlotRecipe({
|
|
|
75
75
|
"&:is([name='circle-check'])": {
|
|
76
76
|
display: 'inline-grid',
|
|
77
77
|
position: 'absolute',
|
|
78
|
-
|
|
78
|
+
// Hidden until checked. This read `inherit`, which took the parent's
|
|
79
|
+
// opacity of 1 and left the check mark visible on an off toggle.
|
|
80
|
+
opacity: '[0]',
|
|
79
81
|
transform: '[translateX(0)]',
|
|
80
82
|
fill: 'icon.inverse',
|
|
81
83
|
'input:checked ~ &': {
|
|
@@ -1,64 +1,30 @@
|
|
|
1
1
|
import { defineTokens } from '@pandacss/dev';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
getBoxShadowPrimitive,
|
|
5
|
+
getDarkBoxShadowPrimitive,
|
|
6
|
+
} from '../utilities/shadowDefinitions';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generated from the shared layer definitions in `utilities/shadowDefinitions`,
|
|
10
|
+
* so boxShadow and dropShadow cannot drift apart.
|
|
11
|
+
*
|
|
12
|
+
* Each elevation still needs a light and a dark primitive. These are declared on
|
|
13
|
+
* `:root`, and a custom property that references another resolves in the scope
|
|
14
|
+
* where it is defined, so a single primitive pointing at a mode-aware colour
|
|
15
|
+
* would stay light inside a locally dark subtree. The switch happens on the
|
|
16
|
+
* semantic token in `styles/semantics/shadows.ts` instead.
|
|
17
|
+
*/
|
|
3
18
|
export const shadows = defineTokens.shadows({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
raisedDark: {
|
|
17
|
-
value:
|
|
18
|
-
'{sizes.0} {sizes.1} {sizes.1} {colors.shadow.raised.1.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.raised.2.dark}',
|
|
19
|
-
},
|
|
20
|
-
raisedDarkUp: {
|
|
21
|
-
value:
|
|
22
|
-
'{sizes.0} [-1] {sizes.1} {colors.shadow.raised.1.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.raised.2.dark}',
|
|
23
|
-
},
|
|
24
|
-
elevatedLight: {
|
|
25
|
-
value:
|
|
26
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.elevated.1.light}, {sizes.0} {sizes.4} {sizes.7} {colors.shadow.elevated.2.light}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.elevated.3.light}',
|
|
27
|
-
},
|
|
28
|
-
elevatedLightUp: {
|
|
29
|
-
value:
|
|
30
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.elevated.1.light}, {sizes.0} [-4] {sizes.7} {colors.shadow.elevated.2.light}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.elevated.3.light}',
|
|
31
|
-
},
|
|
32
|
-
elevatedDark: {
|
|
33
|
-
value:
|
|
34
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.elevated.1.dark}, {sizes.0} {sizes.4} {sizes.7} {colors.shadow.elevated.2.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.elevated.3.dark}',
|
|
35
|
-
},
|
|
36
|
-
elevatedDarkUp: {
|
|
37
|
-
value:
|
|
38
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.elevated.1.dark}, {sizes.0} [-4] {sizes.7} {colors.shadow.elevated.2.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.elevated.3.dark}',
|
|
39
|
-
},
|
|
40
|
-
overlayLight: {
|
|
41
|
-
value:
|
|
42
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.overlay.1.light}, {sizes.0} {sizes.8} {sizes.12} {colors.shadow.overlay.2.light}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overlay.3.light}',
|
|
43
|
-
},
|
|
44
|
-
overlayLightUp: {
|
|
45
|
-
value:
|
|
46
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.overlay.1.light}, {sizes.0} [-8] {sizes.12} {colors.shadow.overlay.2.light}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overlay.3.light}',
|
|
47
|
-
},
|
|
48
|
-
overlayDark: {
|
|
49
|
-
value:
|
|
50
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.overlay.1.dark}, {sizes.0} {sizes.8} {sizes.12} {colors.shadow.overlay.2.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overlay.3.dark}',
|
|
51
|
-
},
|
|
52
|
-
overlayDarkUp: {
|
|
53
|
-
value:
|
|
54
|
-
'{sizes.0} {sizes.0} {sizes.0} {colors.shadow.overlay.1.dark}, {sizes.0} [-8] {sizes.12} {colors.shadow.overlay.2.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overlay.3.dark}',
|
|
55
|
-
},
|
|
56
|
-
overflowLight: {
|
|
57
|
-
value:
|
|
58
|
-
'{sizes.0} {sizes.0} {sizes.8} {colors.shadow.overflow.1.light}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overflow.2.light}',
|
|
59
|
-
},
|
|
60
|
-
overflowDark: {
|
|
61
|
-
value:
|
|
62
|
-
'{sizes.0} {sizes.0} {sizes.12} {colors.shadow.overflow.1.dark}, {sizes.0} {sizes.0} {sizes.1} {colors.shadow.overflow.2.dark}',
|
|
63
|
-
},
|
|
19
|
+
zeroLight: { value: getBoxShadowPrimitive('zero', 'light') },
|
|
20
|
+
zeroDark: { value: getBoxShadowPrimitive('zero', 'dark') },
|
|
21
|
+
raisedLight: { value: getBoxShadowPrimitive('raised', 'light') },
|
|
22
|
+
raisedDark: { value: getBoxShadowPrimitive('raised', 'dark') },
|
|
23
|
+
elevatedLight: { value: getBoxShadowPrimitive('elevated', 'light') },
|
|
24
|
+
elevatedDark: { value: getBoxShadowPrimitive('elevated', 'dark') },
|
|
25
|
+
overlayLight: { value: getBoxShadowPrimitive('overlay', 'light') },
|
|
26
|
+
overlayDark: { value: getBoxShadowPrimitive('overlay', 'dark') },
|
|
27
|
+
overflowLight: { value: getBoxShadowPrimitive('overflow', 'light') },
|
|
28
|
+
// Dark mode is the one place where the geometry differs, not just the colour.
|
|
29
|
+
overflowDark: { value: getDarkBoxShadowPrimitive('overflow') },
|
|
64
30
|
});
|
|
@@ -586,6 +586,49 @@ export const colors = defineSemanticTokens.colors({
|
|
|
586
586
|
DEFAULT: { value: { base: '{colors.blue.50}', _dark: '{colors.blue.40}' } },
|
|
587
587
|
pressed: { value: { base: '{colors.blue.60}', _dark: '{colors.blue.50}' } },
|
|
588
588
|
},
|
|
589
|
+
// Shadow layer colors. These were primitives holding explicit `.light` and
|
|
590
|
+
// `.dark` leaves, which forced every shadow to exist twice. As semantic
|
|
591
|
+
// tokens they resolve per mode on their own, so one geometry serves both.
|
|
592
|
+
shadow: {
|
|
593
|
+
raised: {
|
|
594
|
+
1: {
|
|
595
|
+
value: { base: 'rgba(30, 31, 33, 0.25)', _dark: 'rgba(1, 4, 4, 0.5)' },
|
|
596
|
+
},
|
|
597
|
+
2: {
|
|
598
|
+
value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
elevated: {
|
|
602
|
+
1: {
|
|
603
|
+
value: { base: 'rgba(0, 0, 0, 0)', _dark: 'rgba(95, 95, 95, 0.06)' },
|
|
604
|
+
},
|
|
605
|
+
2: {
|
|
606
|
+
value: { base: 'rgba(30, 31, 33, 0.2)', _dark: 'rgba(1, 4, 4, 0.43)' },
|
|
607
|
+
},
|
|
608
|
+
3: {
|
|
609
|
+
value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
overlay: {
|
|
613
|
+
1: {
|
|
614
|
+
value: { base: 'rgba(0, 0, 0, 0)', _dark: 'rgba(189, 189, 189, 0.12)' },
|
|
615
|
+
},
|
|
616
|
+
2: {
|
|
617
|
+
value: { base: 'rgba(30, 31, 33, 0.15)', _dark: 'rgba(1, 4, 4, 0.36)' },
|
|
618
|
+
},
|
|
619
|
+
3: {
|
|
620
|
+
value: { base: 'rgba(30, 31, 33, 0.31)', _dark: 'rgba(1, 4, 4, 0.5)' },
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
overflow: {
|
|
624
|
+
1: {
|
|
625
|
+
value: { base: 'rgba(30, 31, 33, 0.16)', _dark: 'rgba(1, 4, 4, 0.56)' },
|
|
626
|
+
},
|
|
627
|
+
2: {
|
|
628
|
+
value: { base: 'rgba(30, 31, 33, 0.12)', _dark: 'rgba(1, 4, 4, 0.5)' },
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
},
|
|
589
632
|
surface: {
|
|
590
633
|
DEFAULT: {
|
|
591
634
|
value: { base: '{colors.neutral.0}', _dark: '{colors.darkNeutral.10}' },
|
|
@@ -1,41 +1,15 @@
|
|
|
1
1
|
import { defineSemanticTokens } from '@pandacss/dev';
|
|
2
2
|
|
|
3
3
|
export const shadows = defineSemanticTokens.shadows({
|
|
4
|
-
zero: {
|
|
5
|
-
value: { base: '{shadows.zeroShadow}', _dark: '{shadows.zeroShadow}' },
|
|
6
|
-
},
|
|
4
|
+
zero: { value: { base: '{shadows.zeroLight}', _dark: '{shadows.zeroDark}' } },
|
|
7
5
|
raised: {
|
|
8
|
-
|
|
9
|
-
value: { base: '{shadows.raisedLight}', _dark: '{shadows.raisedDark}' },
|
|
10
|
-
},
|
|
11
|
-
up: {
|
|
12
|
-
value: {
|
|
13
|
-
base: '{shadows.raisedLightUp}',
|
|
14
|
-
_dark: '{shadows.raisedDarkUp}',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
6
|
+
value: { base: '{shadows.raisedLight}', _dark: '{shadows.raisedDark}' },
|
|
17
7
|
},
|
|
18
8
|
elevated: {
|
|
19
|
-
|
|
20
|
-
value: {
|
|
21
|
-
base: '{shadows.elevatedLight}',
|
|
22
|
-
_dark: '{shadows.elevatedDark}',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
up: {
|
|
26
|
-
value: {
|
|
27
|
-
base: '{shadows.elevatedLightUp}',
|
|
28
|
-
_dark: '{shadows.elevatedDarkUp}',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
9
|
+
value: { base: '{shadows.elevatedLight}', _dark: '{shadows.elevatedDark}' },
|
|
31
10
|
},
|
|
32
11
|
overlay: {
|
|
33
|
-
|
|
34
|
-
value: { base: '{shadows.overlayLight}', _dark: '{shadows.overlayDark}' },
|
|
35
|
-
},
|
|
36
|
-
dark: {
|
|
37
|
-
value: { base: '{shadows.overlayDark}', _dark: '{shadows.overlayLight}' },
|
|
38
|
-
},
|
|
12
|
+
value: { base: '{shadows.overlayLight}', _dark: '{shadows.overlayDark}' },
|
|
39
13
|
},
|
|
40
14
|
overflow: {
|
|
41
15
|
value: { base: '{shadows.overflowLight}', _dark: '{shadows.overflowDark}' },
|