@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.
- package/dist/icon-metadata.json +385 -41
- package/dist/index.js +13414 -5259
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +1245 -263
- package/dist/{preset-DAmO4B54.js → preset-BOFHjPdQ.js} +2265 -1727
- 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 +33 -0
- package/dist/specs/recipes.json +359 -103
- package/dist/specs/semantic-tokens.json +152 -44
- package/dist/specs/tokens.json +21 -36
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +499 -43
- package/dist/styles.css +18229 -7568
- package/dist/svgs/barcode-off.svg +1 -0
- 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/spinner.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 +2804 -296
- package/package.json +4 -2
- package/src/recipes/autocomplete.ts +266 -0
- package/src/recipes/avatar.ts +1 -1
- package/src/recipes/badge.ts +31 -43
- package/src/recipes/breakpointIndicator.ts +11 -0
- package/src/recipes/button.ts +172 -223
- package/src/recipes/calendar.ts +91 -0
- package/src/recipes/card.ts +4 -70
- package/src/recipes/chip.ts +213 -142
- package/src/recipes/dateMenus.ts +40 -0
- package/src/recipes/dateTimeMenus.ts +43 -0
- package/src/recipes/icon.ts +25 -6
- package/src/recipes/kbd.ts +56 -0
- package/src/recipes/list.ts +17 -1
- package/src/recipes/listDensity.ts +66 -0
- package/src/recipes/listItem.ts +29 -161
- package/src/recipes/listItemGroup.ts +17 -39
- package/src/recipes/menu.ts +17 -3
- package/src/recipes/modal.ts +70 -39
- package/src/recipes/radio.ts +6 -6
- package/src/recipes/recipes-regular.ts +2 -0
- package/src/recipes/recipes-slot.ts +8 -2
- package/src/recipes/segmentedFields.ts +192 -0
- package/src/recipes/segmentedInputs.ts +109 -0
- package/src/recipes/select.ts +8 -1
- package/src/recipes/skeleton.ts +72 -0
- package/src/recipes/spinner.ts +27 -24
- package/src/recipes/tag.ts +218 -210
- package/src/recipes/text.ts +37 -19
- package/src/recipes/textInput.ts +106 -117
- 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/animations.ts +3 -0
- 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 +31 -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/src/utils/mergeAriaDescribedBy.ts +7 -0
- package/dist/preset-DAmO4B54.js.map +0 -1
- package/src/recipes/datePicker.ts +0 -212
- package/src/recipes/timePicker.ts +0 -199
package/src/recipes/textInput.ts
CHANGED
|
@@ -1,34 +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',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
6
22
|
width: 'full',
|
|
7
23
|
bg: 'surface',
|
|
8
|
-
borderWidth: '
|
|
24
|
+
borderWidth: '1',
|
|
9
25
|
borderStyle: 'solid',
|
|
10
26
|
borderColor: 'border.input',
|
|
11
|
-
borderRadius: '
|
|
12
|
-
outlineWidth: '
|
|
27
|
+
borderRadius: '4',
|
|
28
|
+
outlineWidth: '1',
|
|
13
29
|
outlineStyle: 'solid',
|
|
14
30
|
outlineColor: 'transparent',
|
|
15
|
-
|
|
16
|
-
lineHeight: 'none',
|
|
17
|
-
_focusWithin: {
|
|
31
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
18
32
|
outlineColor: 'border.focused',
|
|
19
33
|
borderColor: 'border.focused',
|
|
20
34
|
},
|
|
21
35
|
_error: {
|
|
22
36
|
borderColor: 'border.danger',
|
|
23
|
-
|
|
37
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
24
38
|
borderColor: 'border.danger',
|
|
25
39
|
outlineColor: 'border.danger',
|
|
26
40
|
},
|
|
27
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
|
+
},
|
|
28
56
|
_disabled: {
|
|
29
|
-
opacity:
|
|
57
|
+
opacity: 0.4,
|
|
30
58
|
cursor: 'not-allowed',
|
|
31
|
-
|
|
59
|
+
'&:focus-within:not(:has(button:focus))': {
|
|
32
60
|
outlineColor: 'transparent',
|
|
33
61
|
borderColor: 'border.input',
|
|
34
62
|
},
|
|
@@ -40,6 +68,10 @@ const textInputBase = {
|
|
|
40
68
|
input: {
|
|
41
69
|
width: 'full',
|
|
42
70
|
bg: 'surface',
|
|
71
|
+
py: 'var(--input-py)',
|
|
72
|
+
px: 'var(--input-px)',
|
|
73
|
+
fontSize: 'var(--input-fs)',
|
|
74
|
+
borderRadius: '3',
|
|
43
75
|
color: 'text',
|
|
44
76
|
lineHeight: 'default',
|
|
45
77
|
fontFamily: 'sans',
|
|
@@ -49,75 +81,94 @@ const textInputBase = {
|
|
|
49
81
|
color: 'text.placeholder',
|
|
50
82
|
},
|
|
51
83
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
84
|
+
slot: {
|
|
85
|
+
display: 'inline-flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
transitionDuration: 'fast',
|
|
88
|
+
transitionProperty: 'all',
|
|
89
|
+
transitionTimingFunction: 'default',
|
|
90
|
+
flex: '0 0 var(--slot-size)',
|
|
91
|
+
px: 'var(--slot-px)',
|
|
92
|
+
fill: 'icon.decorative',
|
|
58
93
|
pointerEvents: 'none',
|
|
59
94
|
zIndex: 1,
|
|
60
95
|
},
|
|
96
|
+
buttonSlot: {
|
|
97
|
+
display: 'inline-flex',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
flex: '0 0 var(--slot-size)',
|
|
100
|
+
px: '0',
|
|
101
|
+
zIndex: 1,
|
|
102
|
+
m: '-1',
|
|
103
|
+
},
|
|
61
104
|
};
|
|
62
105
|
|
|
63
106
|
const textInputVariants = {
|
|
64
107
|
size: {
|
|
65
108
|
sm: {
|
|
66
|
-
|
|
67
|
-
py: '0',
|
|
68
|
-
px: '
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
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)',
|
|
74
116
|
},
|
|
75
117
|
},
|
|
76
118
|
md: {
|
|
77
|
-
|
|
78
|
-
py: '3',
|
|
79
|
-
px: '
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
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)',
|
|
85
126
|
},
|
|
86
127
|
},
|
|
87
128
|
lg: {
|
|
88
|
-
|
|
89
|
-
py: '7',
|
|
90
|
-
px: '
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
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)',
|
|
96
136
|
},
|
|
97
137
|
},
|
|
98
138
|
xl: {
|
|
99
|
-
|
|
100
|
-
py: '9',
|
|
101
|
-
px: '
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
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)',
|
|
107
146
|
},
|
|
108
147
|
},
|
|
109
148
|
},
|
|
110
|
-
|
|
149
|
+
before: {
|
|
111
150
|
true: {
|
|
112
|
-
|
|
113
|
-
|
|
151
|
+
input: {
|
|
152
|
+
ps: '0',
|
|
153
|
+
},
|
|
154
|
+
buttonSlot: {
|
|
155
|
+
'& button': {
|
|
156
|
+
borderTopRightRadius: '0',
|
|
157
|
+
borderBottomRightRadius: '0',
|
|
158
|
+
},
|
|
114
159
|
},
|
|
115
160
|
},
|
|
116
161
|
},
|
|
117
|
-
|
|
162
|
+
after: {
|
|
118
163
|
true: {
|
|
119
|
-
|
|
120
|
-
|
|
164
|
+
input: {
|
|
165
|
+
pe: '0',
|
|
166
|
+
},
|
|
167
|
+
buttonSlot: {
|
|
168
|
+
'& button': {
|
|
169
|
+
borderTopLeftRadius: '0',
|
|
170
|
+
borderBottomLeftRadius: '0',
|
|
171
|
+
},
|
|
121
172
|
},
|
|
122
173
|
},
|
|
123
174
|
},
|
|
@@ -131,74 +182,12 @@ const textInputVariants = {
|
|
|
131
182
|
},
|
|
132
183
|
};
|
|
133
184
|
|
|
134
|
-
const textInputCompoundVariants: NonNullable<
|
|
135
|
-
Parameters<typeof defineSlotRecipe>[0]['compoundVariants']
|
|
136
|
-
> = [
|
|
137
|
-
{
|
|
138
|
-
size: 'sm',
|
|
139
|
-
iconBefore: true,
|
|
140
|
-
css: {
|
|
141
|
-
input: { ps: '[calc({sizes.24} + {sizes.2})]' },
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
size: 'sm',
|
|
146
|
-
iconAfter: true,
|
|
147
|
-
css: {
|
|
148
|
-
input: { pe: '[calc({sizes.24} + {sizes.2})]' },
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
size: 'md',
|
|
153
|
-
iconBefore: true,
|
|
154
|
-
css: {
|
|
155
|
-
input: { ps: '[calc({sizes.24} + {sizes.7})]' },
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
size: 'md',
|
|
160
|
-
iconAfter: true,
|
|
161
|
-
css: {
|
|
162
|
-
input: { pe: '[calc({sizes.24} + {sizes.7})]' },
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
size: 'lg',
|
|
167
|
-
iconBefore: true,
|
|
168
|
-
css: {
|
|
169
|
-
input: { ps: '[calc({sizes.24} + {sizes.10})]' },
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
size: 'lg',
|
|
174
|
-
iconAfter: true,
|
|
175
|
-
css: {
|
|
176
|
-
input: { pe: '[calc({sizes.24} + {sizes.10})]' },
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
size: 'xl',
|
|
181
|
-
iconBefore: true,
|
|
182
|
-
css: {
|
|
183
|
-
input: { ps: '[calc({sizes.32} + {sizes.10})]' },
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
size: 'xl',
|
|
188
|
-
iconAfter: true,
|
|
189
|
-
css: {
|
|
190
|
-
input: { pe: '[calc({sizes.32} + {sizes.10})]' },
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
];
|
|
194
|
-
|
|
195
185
|
export const textInputRecipe = defineSlotRecipe({
|
|
196
186
|
className: 'textInput',
|
|
197
|
-
jsx: ['TextInput'
|
|
198
|
-
slots: ['container', 'input', '
|
|
187
|
+
jsx: ['TextInput'],
|
|
188
|
+
slots: ['container', 'input', 'slot', 'buttonSlot', 'before', 'after'],
|
|
199
189
|
base: textInputBase,
|
|
200
190
|
variants: textInputVariants,
|
|
201
|
-
compoundVariants: textInputCompoundVariants,
|
|
202
191
|
defaultVariants: {
|
|
203
192
|
size: 'md',
|
|
204
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}' },
|
|
@@ -6,6 +6,7 @@ import { defineSemanticTokens } from '@pandacss/dev';
|
|
|
6
6
|
* elevated → shadows.elevated (menus, dropdowns)
|
|
7
7
|
* overlay → shadows.overlay / surface.overlay (modal backdrop)
|
|
8
8
|
* modal → (modal container, above backdrop)
|
|
9
|
+
* modalFloating → (floating content inside a modal)
|
|
9
10
|
* tooltip → (always on top)
|
|
10
11
|
*/
|
|
11
12
|
export const zIndex = defineSemanticTokens.zIndex({
|
|
@@ -14,5 +15,6 @@ export const zIndex = defineSemanticTokens.zIndex({
|
|
|
14
15
|
elevated: { value: '{zIndex.1000}' },
|
|
15
16
|
overlay: { value: '{zIndex.1100}' },
|
|
16
17
|
modal: { value: '{zIndex.1101}' },
|
|
18
|
+
modalFloating: { value: '{zIndex.1102}' },
|
|
17
19
|
tooltip: { value: '{zIndex.1200}' },
|
|
18
20
|
});
|