@pandacss/studio 0.8.0 → 0.10.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/studio.js +49 -47
- package/dist/studio.mjs +49 -47
- package/package.json +15 -15
- package/styled-system/css/conditions.mjs +5 -116
- package/styled-system/css/css.mjs +19 -379
- package/styled-system/css/index.d.ts +2 -1
- package/styled-system/css/index.mjs +1 -0
- package/styled-system/css/sva.d.ts +4 -0
- package/styled-system/css/sva.mjs +20 -0
- package/styled-system/helpers.mjs +59 -21
- package/styled-system/jsx/aspect-ratio.mjs +1 -1
- package/styled-system/jsx/box.mjs +1 -1
- package/styled-system/jsx/center.mjs +1 -1
- package/styled-system/jsx/circle.mjs +1 -1
- package/styled-system/jsx/container.mjs +1 -1
- package/styled-system/jsx/divider.mjs +1 -1
- package/styled-system/jsx/factory.mjs +2 -2
- package/styled-system/jsx/flex.mjs +1 -1
- package/styled-system/jsx/float.mjs +1 -1
- package/styled-system/jsx/grid-item.mjs +1 -1
- package/styled-system/jsx/grid.mjs +1 -1
- package/styled-system/jsx/hstack.mjs +1 -1
- package/styled-system/jsx/is-valid-prop.mjs +8 -1018
- package/styled-system/jsx/link-box.mjs +1 -1
- package/styled-system/jsx/link-overlay.mjs +1 -1
- package/styled-system/jsx/spacer.mjs +1 -1
- package/styled-system/jsx/square.mjs +1 -1
- package/styled-system/jsx/stack.mjs +1 -1
- package/styled-system/jsx/styled-link.mjs +1 -1
- package/styled-system/jsx/vstack.mjs +1 -1
- package/styled-system/jsx/wrap.mjs +1 -1
- package/styled-system/tokens/index.css +1 -1
- package/styled-system/tokens/index.mjs +1 -1
- package/styled-system/types/global.d.ts +3 -2
- package/styled-system/types/pattern.d.ts +8 -1
- package/styled-system/types/prop-type.d.ts +5 -0
- package/styled-system/types/recipe.d.ts +66 -4
- package/styled-system/types/style-props.d.ts +3 -72
- package/styled-system/types/system-types.d.ts +3 -4
|
@@ -1,126 +1,15 @@
|
|
|
1
1
|
import { withoutSpace } from '../helpers.mjs'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
'_hover'
|
|
5
|
-
|
|
6
|
-
'_focusWithin',
|
|
7
|
-
'_focusVisible',
|
|
8
|
-
'_disabled',
|
|
9
|
-
'_active',
|
|
10
|
-
'_visited',
|
|
11
|
-
'_target',
|
|
12
|
-
'_readOnly',
|
|
13
|
-
'_readWrite',
|
|
14
|
-
'_empty',
|
|
15
|
-
'_checked',
|
|
16
|
-
'_enabled',
|
|
17
|
-
'_expanded',
|
|
18
|
-
'_highlighted',
|
|
19
|
-
'_before',
|
|
20
|
-
'_after',
|
|
21
|
-
'_firstLetter',
|
|
22
|
-
'_firstLine',
|
|
23
|
-
'_marker',
|
|
24
|
-
'_selection',
|
|
25
|
-
'_file',
|
|
26
|
-
'_backdrop',
|
|
27
|
-
'_first',
|
|
28
|
-
'_last',
|
|
29
|
-
'_only',
|
|
30
|
-
'_even',
|
|
31
|
-
'_odd',
|
|
32
|
-
'_firstOfType',
|
|
33
|
-
'_lastOfType',
|
|
34
|
-
'_onlyOfType',
|
|
35
|
-
'_peerFocus',
|
|
36
|
-
'_peerHover',
|
|
37
|
-
'_peerActive',
|
|
38
|
-
'_peerFocusWithin',
|
|
39
|
-
'_peerFocusVisible',
|
|
40
|
-
'_peerDisabled',
|
|
41
|
-
'_peerChecked',
|
|
42
|
-
'_peerInvalid',
|
|
43
|
-
'_peerExpanded',
|
|
44
|
-
'_peerPlaceholderShown',
|
|
45
|
-
'_groupFocus',
|
|
46
|
-
'_groupHover',
|
|
47
|
-
'_groupActive',
|
|
48
|
-
'_groupFocusWithin',
|
|
49
|
-
'_groupFocusVisible',
|
|
50
|
-
'_groupDisabled',
|
|
51
|
-
'_groupChecked',
|
|
52
|
-
'_groupExpanded',
|
|
53
|
-
'_groupInvalid',
|
|
54
|
-
'_indeterminate',
|
|
55
|
-
'_required',
|
|
56
|
-
'_valid',
|
|
57
|
-
'_invalid',
|
|
58
|
-
'_autofill',
|
|
59
|
-
'_inRange',
|
|
60
|
-
'_outOfRange',
|
|
61
|
-
'_placeholder',
|
|
62
|
-
'_placeholderShown',
|
|
63
|
-
'_pressed',
|
|
64
|
-
'_selected',
|
|
65
|
-
'_default',
|
|
66
|
-
'_optional',
|
|
67
|
-
'_open',
|
|
68
|
-
'_fullscreen',
|
|
69
|
-
'_loading',
|
|
70
|
-
'_currentPage',
|
|
71
|
-
'_currentStep',
|
|
72
|
-
'_motionReduce',
|
|
73
|
-
'_motionSafe',
|
|
74
|
-
'_print',
|
|
75
|
-
'_landscape',
|
|
76
|
-
'_portrait',
|
|
77
|
-
'_dark',
|
|
78
|
-
'_light',
|
|
79
|
-
'_osDark',
|
|
80
|
-
'_osLight',
|
|
81
|
-
'_highContrast',
|
|
82
|
-
'_lessContrast',
|
|
83
|
-
'_moreContrast',
|
|
84
|
-
'_ltr',
|
|
85
|
-
'_rtl',
|
|
86
|
-
'_scrollbar',
|
|
87
|
-
'_scrollbarThumb',
|
|
88
|
-
'_scrollbarTrack',
|
|
89
|
-
'_horizontal',
|
|
90
|
-
'_vertical',
|
|
91
|
-
'sm',
|
|
92
|
-
'smOnly',
|
|
93
|
-
'smDown',
|
|
94
|
-
'md',
|
|
95
|
-
'mdOnly',
|
|
96
|
-
'mdDown',
|
|
97
|
-
'lg',
|
|
98
|
-
'lgOnly',
|
|
99
|
-
'lgDown',
|
|
100
|
-
'xl',
|
|
101
|
-
'xlOnly',
|
|
102
|
-
'xlDown',
|
|
103
|
-
'2xl',
|
|
104
|
-
'2xlOnly',
|
|
105
|
-
'smToMd',
|
|
106
|
-
'smToLg',
|
|
107
|
-
'smToXl',
|
|
108
|
-
'smTo2xl',
|
|
109
|
-
'mdToLg',
|
|
110
|
-
'mdToXl',
|
|
111
|
-
'mdTo2xl',
|
|
112
|
-
'lgToXl',
|
|
113
|
-
'lgTo2xl',
|
|
114
|
-
'xlTo2xl',
|
|
115
|
-
'base',
|
|
116
|
-
])
|
|
3
|
+
const conditionsStr =
|
|
4
|
+
'_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base'
|
|
5
|
+
const conditions = new Set(conditionsStr.split(','))
|
|
117
6
|
|
|
118
7
|
export function isCondition(value) {
|
|
119
8
|
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
120
9
|
}
|
|
121
10
|
|
|
122
11
|
const underscoreRegex = /^_/
|
|
123
|
-
const
|
|
12
|
+
const conditionsSelectorRegex = /&|@/
|
|
124
13
|
|
|
125
14
|
export function finalizeConditions(paths) {
|
|
126
15
|
return paths.map((path) => {
|
|
@@ -128,7 +17,7 @@ export function finalizeConditions(paths) {
|
|
|
128
17
|
return path.replace(underscoreRegex, '')
|
|
129
18
|
}
|
|
130
19
|
|
|
131
|
-
if (
|
|
20
|
+
if (conditionsSelectorRegex.test(path)) {
|
|
132
21
|
return `[${withoutSpace(path.trim())}]`
|
|
133
22
|
}
|
|
134
23
|
|
|
@@ -1,394 +1,34 @@
|
|
|
1
1
|
import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs'
|
|
2
2
|
import { sortConditions, finalizeConditions } from './conditions.mjs'
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
aspectRatio:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
top: 'top',
|
|
16
|
-
left: 'left',
|
|
17
|
-
insetInline: 'inset-x',
|
|
18
|
-
insetBlock: 'inset-y',
|
|
19
|
-
inset: 'inset',
|
|
20
|
-
insetBlockEnd: 'inset-b',
|
|
21
|
-
insetBlockStart: 'inset-t',
|
|
22
|
-
insetInlineEnd: 'end',
|
|
23
|
-
insetInlineStart: 'start',
|
|
24
|
-
right: 'right',
|
|
25
|
-
bottom: 'bottom',
|
|
26
|
-
insetX: 'inset-x',
|
|
27
|
-
insetY: 'inset-y',
|
|
28
|
-
float: 'float',
|
|
29
|
-
visibility: 'vis',
|
|
30
|
-
display: 'd',
|
|
31
|
-
hideFrom: 'hide',
|
|
32
|
-
hideBelow: 'show',
|
|
33
|
-
flexBasis: 'basis',
|
|
34
|
-
flex: 'flex',
|
|
35
|
-
flexDirection: 'flex',
|
|
36
|
-
flexGrow: 'grow',
|
|
37
|
-
flexShrink: 'shrink',
|
|
38
|
-
gridTemplateColumns: 'grid-cols',
|
|
39
|
-
gridTemplateRows: 'grid-rows',
|
|
40
|
-
gridColumn: 'col-span',
|
|
41
|
-
gridRow: 'row-span',
|
|
42
|
-
gridColumnStart: 'col-start',
|
|
43
|
-
gridColumnEnd: 'col-end',
|
|
44
|
-
gridAutoFlow: 'grid-flow',
|
|
45
|
-
gridAutoColumns: 'auto-cols',
|
|
46
|
-
gridAutoRows: 'auto-rows',
|
|
47
|
-
gap: 'gap',
|
|
48
|
-
gridGap: 'gap',
|
|
49
|
-
gridRowGap: 'gap-x',
|
|
50
|
-
gridColumnGap: 'gap-y',
|
|
51
|
-
rowGap: 'gap-x',
|
|
52
|
-
columnGap: 'gap-y',
|
|
53
|
-
justifyContent: 'justify',
|
|
54
|
-
alignContent: 'content',
|
|
55
|
-
alignItems: 'items',
|
|
56
|
-
alignSelf: 'self',
|
|
57
|
-
padding: 'p',
|
|
58
|
-
paddingLeft: 'pl',
|
|
59
|
-
paddingRight: 'pr',
|
|
60
|
-
paddingTop: 'pt',
|
|
61
|
-
paddingBottom: 'pb',
|
|
62
|
-
paddingBlock: 'py',
|
|
63
|
-
paddingBlockEnd: 'pb',
|
|
64
|
-
paddingBlockStart: 'pt',
|
|
65
|
-
paddingInline: 'px',
|
|
66
|
-
paddingInlineEnd: 'pe',
|
|
67
|
-
paddingInlineStart: 'ps',
|
|
68
|
-
marginLeft: 'ml',
|
|
69
|
-
marginRight: 'mr',
|
|
70
|
-
marginTop: 'mt',
|
|
71
|
-
marginBottom: 'mb',
|
|
72
|
-
margin: 'm',
|
|
73
|
-
marginBlock: 'my',
|
|
74
|
-
marginBlockEnd: 'mb',
|
|
75
|
-
marginBlockStart: 'mt',
|
|
76
|
-
marginInline: 'mx',
|
|
77
|
-
marginInlineEnd: 'me',
|
|
78
|
-
marginInlineStart: 'ms',
|
|
79
|
-
outlineWidth: 'ring',
|
|
80
|
-
outlineColor: 'ring',
|
|
81
|
-
outline: 'ring',
|
|
82
|
-
outlineOffset: 'ring',
|
|
83
|
-
divideX: 'divide-x',
|
|
84
|
-
divideY: 'divide-y',
|
|
85
|
-
divideColor: 'divide',
|
|
86
|
-
divideStyle: 'divide',
|
|
87
|
-
width: 'w',
|
|
88
|
-
inlineSize: 'w',
|
|
89
|
-
minWidth: 'min-w',
|
|
90
|
-
minInlineSize: 'min-w',
|
|
91
|
-
maxWidth: 'max-w',
|
|
92
|
-
maxInlineSize: 'max-w',
|
|
93
|
-
height: 'h',
|
|
94
|
-
blockSize: 'h',
|
|
95
|
-
minHeight: 'min-h',
|
|
96
|
-
minBlockSize: 'min-h',
|
|
97
|
-
maxHeight: 'max-h',
|
|
98
|
-
maxBlockSize: 'max-b',
|
|
99
|
-
color: 'text',
|
|
100
|
-
fontFamily: 'font',
|
|
101
|
-
fontSize: 'fs',
|
|
102
|
-
fontWeight: 'font',
|
|
103
|
-
fontSmoothing: 'smoothing',
|
|
104
|
-
fontVariantNumeric: 'numeric',
|
|
105
|
-
letterSpacing: 'tracking',
|
|
106
|
-
lineHeight: 'leading',
|
|
107
|
-
textAlign: 'text',
|
|
108
|
-
textDecoration: 'text-decor',
|
|
109
|
-
textDecorationColor: 'text-decor',
|
|
110
|
-
textEmphasisColor: 'text-emphasis',
|
|
111
|
-
textDecorationStyle: 'decoration',
|
|
112
|
-
textDecorationThickness: 'decoration',
|
|
113
|
-
textUnderlineOffset: 'underline-offset',
|
|
114
|
-
textTransform: 'text',
|
|
115
|
-
textIndent: 'indent',
|
|
116
|
-
textShadow: 'text-shadow',
|
|
117
|
-
textOverflow: 'text',
|
|
118
|
-
verticalAlign: 'align',
|
|
119
|
-
wordBreak: 'break',
|
|
120
|
-
textWrap: 'text',
|
|
121
|
-
truncate: 'truncate',
|
|
122
|
-
lineClamp: 'clamp',
|
|
123
|
-
listStyleType: 'list',
|
|
124
|
-
listStylePosition: 'list',
|
|
125
|
-
listStyleImage: 'list-img',
|
|
126
|
-
backgroundPosition: 'bg',
|
|
127
|
-
backgroundPositionX: 'bg-x',
|
|
128
|
-
backgroundPositionY: 'bg-y',
|
|
129
|
-
backgroundAttachment: 'bg',
|
|
130
|
-
backgroundClip: 'bg-clip',
|
|
131
|
-
background: 'bg',
|
|
132
|
-
backgroundColor: 'bg',
|
|
133
|
-
backgroundOrigin: 'bg-origin',
|
|
134
|
-
backgroundImage: 'bg-img',
|
|
135
|
-
backgroundRepeat: 'bg-repeat',
|
|
136
|
-
backgroundBlendMode: 'bg-blend',
|
|
137
|
-
backgroundSize: 'bg',
|
|
138
|
-
backgroundGradient: 'bg-gradient',
|
|
139
|
-
textGradient: 'text-gradient',
|
|
140
|
-
gradientFrom: 'from',
|
|
141
|
-
gradientTo: 'to',
|
|
142
|
-
gradientVia: 'via',
|
|
143
|
-
borderRadius: 'rounded',
|
|
144
|
-
borderTopLeftRadius: 'rounded-tl',
|
|
145
|
-
borderTopRightRadius: 'rounded-tr',
|
|
146
|
-
borderBottomRightRadius: 'rounded-br',
|
|
147
|
-
borderBottomLeftRadius: 'rounded-bl',
|
|
148
|
-
borderTopRadius: 'rounded-t',
|
|
149
|
-
borderRightRadius: 'rounded-r',
|
|
150
|
-
borderBottomRadius: 'rounded-b',
|
|
151
|
-
borderLeftRadius: 'rounded-l',
|
|
152
|
-
borderStartStartRadius: 'rounded-ss',
|
|
153
|
-
borderStartEndRadius: 'rounded-se',
|
|
154
|
-
borderStartRadius: 'rounded-s',
|
|
155
|
-
borderEndStartRadius: 'rounded-es',
|
|
156
|
-
borderEndEndRadius: 'rounded-ee',
|
|
157
|
-
borderEndRadius: 'rounded-e',
|
|
158
|
-
border: 'border',
|
|
159
|
-
borderColor: 'border',
|
|
160
|
-
borderInline: 'border-x',
|
|
161
|
-
borderInlineWidth: 'border-x',
|
|
162
|
-
borderInlineColor: 'border-x',
|
|
163
|
-
borderBlock: 'border-y',
|
|
164
|
-
borderBlockWidth: 'border-y',
|
|
165
|
-
borderBlockColor: 'border-y',
|
|
166
|
-
borderLeft: 'border-l',
|
|
167
|
-
borderLeftColor: 'border-l',
|
|
168
|
-
borderInlineStart: 'border-s',
|
|
169
|
-
borderInlineStartColor: 'border-s',
|
|
170
|
-
borderRight: 'border-r',
|
|
171
|
-
borderRightColor: 'border-r',
|
|
172
|
-
borderInlineEnd: 'border-e',
|
|
173
|
-
borderInlineEndColor: 'border-e',
|
|
174
|
-
borderTop: 'border-t',
|
|
175
|
-
borderTopColor: 'border-t',
|
|
176
|
-
borderBottom: 'border-b',
|
|
177
|
-
borderBottomColor: 'border-b',
|
|
178
|
-
borderBlockEnd: 'border-be',
|
|
179
|
-
borderBlockEndColor: 'border-be',
|
|
180
|
-
borderBlockStart: 'border-bs',
|
|
181
|
-
borderBlockStartColor: 'border-bs',
|
|
182
|
-
boxShadow: 'shadow',
|
|
183
|
-
boxShadowColor: 'shadow',
|
|
184
|
-
mixBlendMode: 'mix-blend',
|
|
185
|
-
filter: 'filter',
|
|
186
|
-
brightness: 'brightness',
|
|
187
|
-
contrast: 'contrast',
|
|
188
|
-
grayscale: 'grayscale',
|
|
189
|
-
hueRotate: 'hue-rotate',
|
|
190
|
-
invert: 'invert',
|
|
191
|
-
saturate: 'saturate',
|
|
192
|
-
sepia: 'sepia',
|
|
193
|
-
dropShadow: 'drop-shadow',
|
|
194
|
-
blur: 'blur',
|
|
195
|
-
backdropFilter: 'backdrop',
|
|
196
|
-
backdropBlur: 'backdrop-blur',
|
|
197
|
-
backdropBrightness: 'backdrop-brightness',
|
|
198
|
-
backdropContrast: 'backdrop-contrast',
|
|
199
|
-
backdropGrayscale: 'backdrop-grayscale',
|
|
200
|
-
backdropHueRotate: 'backdrop-hue-rotate',
|
|
201
|
-
backdropInvert: 'backdrop-invert',
|
|
202
|
-
backdropOpacity: 'backdrop-opacity',
|
|
203
|
-
backdropSaturate: 'backdrop-saturate',
|
|
204
|
-
backdropSepia: 'backdrop-sepia',
|
|
205
|
-
borderCollapse: 'border',
|
|
206
|
-
borderSpacing: 'border-spacing',
|
|
207
|
-
borderSpacingX: 'border-spacing-x',
|
|
208
|
-
borderSpacingY: 'border-spacing-y',
|
|
209
|
-
tableLayout: 'table',
|
|
210
|
-
transitionTimingFunction: 'ease',
|
|
211
|
-
transitionDelay: 'delay',
|
|
212
|
-
transitionDuration: 'duration',
|
|
213
|
-
transitionProperty: 'transition-prop',
|
|
214
|
-
transition: 'transition',
|
|
215
|
-
animation: 'animation',
|
|
216
|
-
animationDelay: 'animation-delay',
|
|
217
|
-
transformOrigin: 'origin',
|
|
218
|
-
scale: 'scale',
|
|
219
|
-
scaleX: 'scale-x',
|
|
220
|
-
scaleY: 'scale-y',
|
|
221
|
-
translate: 'translate',
|
|
222
|
-
translateX: 'translate-x',
|
|
223
|
-
translateY: 'translate-y',
|
|
224
|
-
accentColor: 'accent',
|
|
225
|
-
caretColor: 'caret',
|
|
226
|
-
scrollBehavior: 'scroll',
|
|
227
|
-
scrollbar: 'scrollbar',
|
|
228
|
-
scrollMargin: 'scroll-m',
|
|
229
|
-
scrollMarginX: 'scroll-mx',
|
|
230
|
-
scrollMarginY: 'scroll-my',
|
|
231
|
-
scrollMarginLeft: 'scroll-ml',
|
|
232
|
-
scrollMarginRight: 'scroll-mr',
|
|
233
|
-
scrollMarginTop: 'scroll-mt',
|
|
234
|
-
scrollMarginBottom: 'scroll-mb',
|
|
235
|
-
scrollMarginBlock: 'scroll-my',
|
|
236
|
-
scrollMarginBlockEnd: 'scroll-mb',
|
|
237
|
-
scrollMarginBlockStart: 'scroll-mt',
|
|
238
|
-
scrollMarginInline: 'scroll-mx',
|
|
239
|
-
scrollMarginInlineEnd: 'scroll-me',
|
|
240
|
-
scrollMarginInlineStart: 'scroll-ms',
|
|
241
|
-
scrollPadding: 'scroll-p',
|
|
242
|
-
scrollPaddingBlock: 'scroll-pb',
|
|
243
|
-
scrollPaddingBlockStart: 'scroll-pt',
|
|
244
|
-
scrollPaddingBlockEnd: 'scroll-pb',
|
|
245
|
-
scrollPaddingInline: 'scroll-px',
|
|
246
|
-
scrollPaddingInlineEnd: 'scroll-pe',
|
|
247
|
-
scrollPaddingInlineStart: 'scroll-ps',
|
|
248
|
-
scrollPaddingX: 'scroll-px',
|
|
249
|
-
scrollPaddingY: 'scroll-py',
|
|
250
|
-
scrollPaddingLeft: 'scroll-pl',
|
|
251
|
-
scrollPaddingRight: 'scroll-pr',
|
|
252
|
-
scrollPaddingTop: 'scroll-pt',
|
|
253
|
-
scrollPaddingBottom: 'scroll-pb',
|
|
254
|
-
scrollSnapAlign: 'snap',
|
|
255
|
-
scrollSnapStop: 'snap',
|
|
256
|
-
scrollSnapType: 'snap',
|
|
257
|
-
scrollSnapStrictness: 'strictness',
|
|
258
|
-
scrollSnapMargin: 'snap-m',
|
|
259
|
-
scrollSnapMarginTop: 'snap-mt',
|
|
260
|
-
scrollSnapMarginBottom: 'snap-mb',
|
|
261
|
-
scrollSnapMarginLeft: 'snap-ml',
|
|
262
|
-
scrollSnapMarginRight: 'snap-mr',
|
|
263
|
-
touchAction: 'touch',
|
|
264
|
-
userSelect: 'select',
|
|
265
|
-
fill: 'fill',
|
|
266
|
-
stroke: 'stroke',
|
|
267
|
-
srOnly: 'sr',
|
|
268
|
-
debug: 'debug',
|
|
269
|
-
appearance: 'appearance',
|
|
270
|
-
backfaceVisibility: 'backface',
|
|
271
|
-
clipPath: 'clip-path',
|
|
272
|
-
hyphens: 'hyphens',
|
|
273
|
-
mask: 'mask',
|
|
274
|
-
maskImage: 'mask-image',
|
|
275
|
-
maskSize: 'mask-size',
|
|
276
|
-
textSizeAdjust: 'text-size-adjust',
|
|
277
|
-
textStyle: 'textStyle',
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
const shorthands = {
|
|
281
|
-
pos: 'position',
|
|
282
|
-
insetEnd: 'insetInlineEnd',
|
|
283
|
-
end: 'insetInlineEnd',
|
|
284
|
-
insetStart: 'insetInlineStart',
|
|
285
|
-
start: 'insetInlineStart',
|
|
286
|
-
flexDir: 'flexDirection',
|
|
287
|
-
p: 'padding',
|
|
288
|
-
pl: 'paddingLeft',
|
|
289
|
-
pr: 'paddingRight',
|
|
290
|
-
pt: 'paddingTop',
|
|
291
|
-
pb: 'paddingBottom',
|
|
292
|
-
py: 'paddingBlock',
|
|
293
|
-
paddingY: 'paddingBlock',
|
|
294
|
-
paddingX: 'paddingInline',
|
|
295
|
-
px: 'paddingInline',
|
|
296
|
-
pe: 'paddingInlineEnd',
|
|
297
|
-
paddingEnd: 'paddingInlineEnd',
|
|
298
|
-
ps: 'paddingInlineStart',
|
|
299
|
-
paddingStart: 'paddingInlineStart',
|
|
300
|
-
ml: 'marginLeft',
|
|
301
|
-
mr: 'marginRight',
|
|
302
|
-
mt: 'marginTop',
|
|
303
|
-
mb: 'marginBottom',
|
|
304
|
-
m: 'margin',
|
|
305
|
-
my: 'marginBlock',
|
|
306
|
-
marginY: 'marginBlock',
|
|
307
|
-
mx: 'marginInline',
|
|
308
|
-
marginX: 'marginInline',
|
|
309
|
-
me: 'marginInlineEnd',
|
|
310
|
-
marginEnd: 'marginInlineEnd',
|
|
311
|
-
ms: 'marginInlineStart',
|
|
312
|
-
marginStart: 'marginInlineStart',
|
|
313
|
-
ringWidth: 'outlineWidth',
|
|
314
|
-
ringColor: 'outlineColor',
|
|
315
|
-
ring: 'outline',
|
|
316
|
-
ringOffset: 'outlineOffset',
|
|
317
|
-
w: 'width',
|
|
318
|
-
minW: 'minWidth',
|
|
319
|
-
maxW: 'maxWidth',
|
|
320
|
-
h: 'height',
|
|
321
|
-
minH: 'minHeight',
|
|
322
|
-
maxH: 'maxHeight',
|
|
323
|
-
bgPosition: 'backgroundPosition',
|
|
324
|
-
bgPositionX: 'backgroundPositionX',
|
|
325
|
-
bgPositionY: 'backgroundPositionY',
|
|
326
|
-
bgAttachment: 'backgroundAttachment',
|
|
327
|
-
bgClip: 'backgroundClip',
|
|
328
|
-
bg: 'background',
|
|
329
|
-
bgColor: 'backgroundColor',
|
|
330
|
-
bgOrigin: 'backgroundOrigin',
|
|
331
|
-
bgImage: 'backgroundImage',
|
|
332
|
-
bgRepeat: 'backgroundRepeat',
|
|
333
|
-
bgBlendMode: 'backgroundBlendMode',
|
|
334
|
-
bgSize: 'backgroundSize',
|
|
335
|
-
bgGradient: 'backgroundGradient',
|
|
336
|
-
rounded: 'borderRadius',
|
|
337
|
-
roundedTopLeft: 'borderTopLeftRadius',
|
|
338
|
-
roundedTopRight: 'borderTopRightRadius',
|
|
339
|
-
roundedBottomRight: 'borderBottomRightRadius',
|
|
340
|
-
roundedBottomLeft: 'borderBottomLeftRadius',
|
|
341
|
-
roundedTop: 'borderTopRadius',
|
|
342
|
-
roundedRight: 'borderRightRadius',
|
|
343
|
-
roundedBottom: 'borderBottomRadius',
|
|
344
|
-
roundedLeft: 'borderLeftRadius',
|
|
345
|
-
roundedStartStart: 'borderStartStartRadius',
|
|
346
|
-
roundedStartEnd: 'borderStartEndRadius',
|
|
347
|
-
roundedStart: 'borderStartRadius',
|
|
348
|
-
roundedEndStart: 'borderEndStartRadius',
|
|
349
|
-
roundedEndEnd: 'borderEndEndRadius',
|
|
350
|
-
roundedEnd: 'borderEndRadius',
|
|
351
|
-
borderX: 'borderInline',
|
|
352
|
-
borderXWidth: 'borderInlineWidth',
|
|
353
|
-
borderXColor: 'borderInlineColor',
|
|
354
|
-
borderY: 'borderBlock',
|
|
355
|
-
borderYWidth: 'borderBlockWidth',
|
|
356
|
-
borderYColor: 'borderBlockColor',
|
|
357
|
-
borderStart: 'borderInlineStart',
|
|
358
|
-
borderStartColor: 'borderInlineStartColor',
|
|
359
|
-
borderEnd: 'borderInlineEnd',
|
|
360
|
-
borderEndColor: 'borderInlineEndColor',
|
|
361
|
-
shadow: 'boxShadow',
|
|
362
|
-
shadowColor: 'boxShadowColor',
|
|
363
|
-
x: 'translateX',
|
|
364
|
-
y: 'translateY',
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
const breakpointKeys = ['base', 'sm', 'md', 'lg', 'xl', '2xl']
|
|
368
|
-
|
|
369
|
-
const hasShorthand = true
|
|
4
|
+
const utilities =
|
|
5
|
+
'aspectRatio:aspect,boxDecorationBreak:decoration,zIndex:z,boxSizing:box,objectPosition:object,objectFit:object,overscrollBehavior:overscroll,overscrollBehaviorX:overscroll-x,overscrollBehaviorY:overscroll-y,position:pos/1,top:top,left:left,insetInline:inset-x,insetBlock:inset-y,inset:inset,insetBlockEnd:inset-b,insetBlockStart:inset-t,insetInlineEnd:end/1,insetInlineStart:start/1,right:right,bottom:bottom,insetX:inset-x,insetY:inset-y,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:basis,flex:flex,flexDirection:flex/flexDir,flexGrow:grow,flexShrink:shrink,gridTemplateColumns:grid-cols,gridTemplateRows:grid-rows,gridColumn:col-span,gridRow:row-span,gridColumnStart:col-start,gridColumnEnd:col-end,gridAutoFlow:grid-flow,gridAutoColumns:auto-cols,gridAutoRows:auto-rows,gap:gap,gridGap:gap,gridRowGap:gap-x,gridColumnGap:gap-y,rowGap:gap-x,columnGap:gap-y,justifyContent:justify,alignContent:content,alignItems:items,alignSelf:self,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/paddingY,paddingBlockEnd:pb,paddingBlockStart:pt,paddingInline:px/1,paddingInlineEnd:pe/paddingEnd,paddingInlineStart:ps/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/marginY,marginBlockEnd:mb,marginBlockStart:mt,marginInline:mx/marginX,marginInlineEnd:me/marginEnd,marginInlineStart:ms/marginStart,outlineWidth:ring/ringWidth,outlineColor:ring/ringColor,outline:ring/1,outlineOffset:ring/ringOffset,divideX:divide-x,divideY:divide-y,divideColor:divide,divideStyle:divide,width:w/1,inlineSize:w,minWidth:min-w/minW,minInlineSize:min-w,maxWidth:max-w/maxW,maxInlineSize:max-w,height:h/1,blockSize:h,minHeight:min-h/minH,minBlockSize:min-h,maxHeight:max-h/maxH,maxBlockSize:max-b,color:text,fontFamily:font,fontSize:fs,fontWeight:font,fontSmoothing:smoothing,fontVariantNumeric:numeric,letterSpacing:tracking,lineHeight:leading,textAlign:text,textDecoration:text-decor,textDecorationColor:text-decor,textEmphasisColor:text-emphasis,textDecorationStyle:decoration,textDecorationThickness:decoration,textUnderlineOffset:underline-offset,textTransform:text,textIndent:indent,textShadow:text-shadow,textOverflow:text,verticalAlign:align,wordBreak:break,textWrap:text,truncate:truncate,lineClamp:clamp,listStyleType:list,listStylePosition:list,listStyleImage:list-img,backgroundPosition:bg/bgPosition,backgroundPositionX:bg-x/bgPositionX,backgroundPositionY:bg-y/bgPositionY,backgroundAttachment:bg/bgAttachment,backgroundClip:bg-clip/bgClip,background:bg/1,backgroundColor:bg/bgColor,backgroundOrigin:bg-origin/bgOrigin,backgroundImage:bg-img/bgImage,backgroundRepeat:bg-repeat/bgRepeat,backgroundBlendMode:bg-blend/bgBlendMode,backgroundSize:bg/bgSize,backgroundGradient:bg-gradient/bgGradient,textGradient:text-gradient,gradientFrom:from,gradientTo:to,gradientVia:via,borderRadius:rounded/1,borderTopLeftRadius:rounded-tl/roundedTopLeft,borderTopRightRadius:rounded-tr/roundedTopRight,borderBottomRightRadius:rounded-br/roundedBottomRight,borderBottomLeftRadius:rounded-bl/roundedBottomLeft,borderTopRadius:rounded-t/roundedTop,borderRightRadius:rounded-r/roundedRight,borderBottomRadius:rounded-b/roundedBottom,borderLeftRadius:rounded-l/roundedLeft,borderStartStartRadius:rounded-ss/roundedStartStart,borderStartEndRadius:rounded-se/roundedStartEnd,borderStartRadius:rounded-s/roundedStart,borderEndStartRadius:rounded-es/roundedEndStart,borderEndEndRadius:rounded-ee/roundedEndEnd,borderEndRadius:rounded-e/roundedEnd,border:border,borderColor:border,borderInline:border-x/borderX,borderInlineWidth:border-x/borderXWidth,borderInlineColor:border-x/borderXColor,borderBlock:border-y/borderY,borderBlockWidth:border-y/borderYWidth,borderBlockColor:border-y/borderYColor,borderLeft:border-l,borderLeftColor:border-l,borderInlineStart:border-s/borderStart,borderInlineStartWidth:border-s/borderStartWidth,borderInlineStartColor:border-s/borderStartColor,borderRight:border-r,borderRightColor:border-r,borderInlineEnd:border-e/borderEnd,borderInlineEndWidth:border-e/borderEndWidth,borderInlineEndColor:border-e/borderEndColor,borderTop:border-t,borderTopColor:border-t,borderBottom:border-b,borderBottomColor:border-b,borderBlockEnd:border-be,borderBlockEndColor:border-be,borderBlockStart:border-bs,borderBlockStartColor:border-bs,boxShadow:shadow/1,boxShadowColor:shadow/shadowColor,mixBlendMode:mix-blend,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:backdrop,backdropBlur:backdrop-blur,backdropBrightness:backdrop-brightness,backdropContrast:backdrop-contrast,backdropGrayscale:backdrop-grayscale,backdropHueRotate:backdrop-hue-rotate,backdropInvert:backdrop-invert,backdropOpacity:backdrop-opacity,backdropSaturate:backdrop-saturate,backdropSepia:backdrop-sepia,borderCollapse:border,borderSpacing:border-spacing,borderSpacingX:border-spacing-x,borderSpacingY:border-spacing-y,tableLayout:table,transitionTimingFunction:ease,transitionDelay:delay,transitionDuration:duration,transitionProperty:transition-prop,transition:transition,animation:animation,animationDelay:animation-delay,transformOrigin:origin,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,accentColor:accent,caretColor:caret,scrollBehavior:scroll,scrollbar:scrollbar,scrollMargin:scroll-m,scrollMarginX:scroll-mx,scrollMarginY:scroll-my,scrollMarginLeft:scroll-ml,scrollMarginRight:scroll-mr,scrollMarginTop:scroll-mt,scrollMarginBottom:scroll-mb,scrollMarginBlock:scroll-my,scrollMarginBlockEnd:scroll-mb,scrollMarginBlockStart:scroll-mt,scrollMarginInline:scroll-mx,scrollMarginInlineEnd:scroll-me,scrollMarginInlineStart:scroll-ms,scrollPadding:scroll-p,scrollPaddingBlock:scroll-pb,scrollPaddingBlockStart:scroll-pt,scrollPaddingBlockEnd:scroll-pb,scrollPaddingInline:scroll-px,scrollPaddingInlineEnd:scroll-pe,scrollPaddingInlineStart:scroll-ps,scrollPaddingX:scroll-px,scrollPaddingY:scroll-py,scrollPaddingLeft:scroll-pl,scrollPaddingRight:scroll-pr,scrollPaddingTop:scroll-pt,scrollPaddingBottom:scroll-pb,scrollSnapAlign:snap,scrollSnapStop:snap,scrollSnapType:snap,scrollSnapStrictness:strictness,scrollSnapMargin:snap-m,scrollSnapMarginTop:snap-mt,scrollSnapMarginBottom:snap-mb,scrollSnapMarginLeft:snap-ml,scrollSnapMarginRight:snap-mr,touchAction:touch,userSelect:select,fill:fill,stroke:stroke,srOnly:sr,debug:debug,appearance:appearance,backfaceVisibility:backface,clipPath:clip-path,hyphens:hyphens,mask:mask,maskImage:mask-image,maskSize:mask-size,textSizeAdjust:text-size-adjust,textStyle:textStyle'
|
|
6
|
+
|
|
7
|
+
const classMap = {}
|
|
8
|
+
const shorthands = {}
|
|
9
|
+
utilities.split(',').forEach((utility) => {
|
|
10
|
+
const [prop, meta] = utility.split(':')
|
|
11
|
+
const [className, shorthand] = meta.split('/')
|
|
12
|
+
classMap[prop] = className
|
|
13
|
+
if (shorthand) shorthands[shorthand === '1' ? className : shorthand] = prop
|
|
14
|
+
})
|
|
370
15
|
|
|
371
16
|
const resolveShorthand = (prop) => shorthands[prop] || prop
|
|
372
17
|
|
|
373
|
-
function transform(prop, value) {
|
|
374
|
-
const key = resolveShorthand(prop)
|
|
375
|
-
const propKey = classNameMap[key] || hypenateProperty(key)
|
|
376
|
-
const className = `${propKey}_${withoutSpace(value)}`
|
|
377
|
-
return { className }
|
|
378
|
-
}
|
|
379
|
-
|
|
380
18
|
const context = {
|
|
381
|
-
hash: false,
|
|
382
19
|
conditions: {
|
|
383
20
|
shift: sortConditions,
|
|
384
21
|
finalize: finalizeConditions,
|
|
385
|
-
breakpoints: { keys:
|
|
22
|
+
breakpoints: { keys: ['base', 'sm', 'md', 'lg', 'xl', '2xl'] },
|
|
386
23
|
},
|
|
387
24
|
utility: {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
25
|
+
transform: (prop, value) => {
|
|
26
|
+
const key = resolveShorthand(prop)
|
|
27
|
+
const propKey = classMap[key] || hypenateProperty(key)
|
|
28
|
+
return { className: `${propKey}_${withoutSpace(value)}` }
|
|
29
|
+
},
|
|
30
|
+
hasShorthand: true,
|
|
31
|
+
resolveShorthand: resolveShorthand,
|
|
392
32
|
},
|
|
393
33
|
}
|
|
394
34
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getSlotRecipes } from '../helpers.mjs'
|
|
2
|
+
import { cva } from './cva.mjs'
|
|
3
|
+
|
|
4
|
+
export function sva(config) {
|
|
5
|
+
const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
|
|
6
|
+
|
|
7
|
+
function svaFn(props) {
|
|
8
|
+
const result = slots.map(([slot, cvaFn]) => [slot, cvaFn(props)])
|
|
9
|
+
return Object.fromEntries(result)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const [, firstCva] = slots[0]
|
|
13
|
+
|
|
14
|
+
return Object.assign(svaFn, {
|
|
15
|
+
__cva__: false,
|
|
16
|
+
variantMap: firstCva.variantMap,
|
|
17
|
+
variantKeys: firstCva.variantKeys,
|
|
18
|
+
splitVariantProps: firstCva.splitVariantProps,
|
|
19
|
+
})
|
|
20
|
+
}
|