@okshaun/components 0.5.8 → 1.0.1
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 +22 -26
- package/dist/.mcp.json +11 -0
- package/dist/index.d.ts +3 -1268
- package/dist/index.js +1231 -957
- package/dist/index.js.map +1 -1
- package/dist/okshaun-logo-white.svg +11 -0
- package/dist/okshaun-logo.svg +11 -0
- package/dist/preset-BzrKiUEH.js +8452 -0
- package/dist/preset-BzrKiUEH.js.map +1 -0
- package/dist/preset.js +3 -7234
- package/dist/preset.js.map +1 -1
- package/dist/specs/animation-styles.json +4 -0
- package/dist/specs/color-palette.json +98 -0
- package/dist/specs/conditions.json +1901 -0
- package/dist/specs/keyframes.json +137 -0
- package/dist/specs/layer-styles.json +23 -0
- package/dist/specs/patterns.json +475 -0
- package/dist/specs/recipes.json +907 -0
- package/dist/specs/semantic-tokens.json +2837 -0
- package/dist/specs/text-styles.json +149 -0
- package/dist/specs/tokens.json +2750 -0
- package/dist/sprite.svg +1 -1
- package/dist/sprite.symbol.html +14 -14
- package/dist/styles/global.css +148 -0
- package/dist/styles/recipes/avatar.css +185 -0
- package/dist/styles/recipes/badge.css +85 -0
- package/dist/styles/recipes/breadcrumbs.css +38 -0
- package/dist/styles/recipes/button.css +195 -0
- package/dist/styles/recipes/card.css +57 -0
- package/dist/styles/recipes/checkbox-input.css +12 -0
- package/dist/styles/recipes/checkbox.css +90 -0
- package/dist/styles/recipes/chip.css +137 -0
- package/dist/styles/recipes/code.css +12 -0
- package/dist/styles/recipes/divider.css +43 -0
- package/dist/styles/recipes/form-field.css +39 -0
- package/dist/styles/recipes/heading.css +40 -0
- package/dist/styles/recipes/icon-button.css +181 -0
- package/dist/styles/recipes/label.css +14 -0
- package/dist/styles/recipes/link.css +49 -0
- package/dist/styles/recipes/menu.css +141 -0
- package/dist/styles/recipes/modal.css +99 -0
- package/dist/styles/recipes/pre.css +16 -0
- package/dist/styles/recipes/radio-input.css +7 -0
- package/dist/styles/recipes/radio.css +82 -0
- package/dist/styles/recipes/select.css +103 -0
- package/dist/styles/recipes/spinner.css +36 -0
- package/dist/styles/recipes/tag.css +27 -0
- package/dist/styles/recipes/text.css +46 -0
- package/dist/styles/recipes/textarea.css +91 -0
- package/dist/styles/recipes/textinput.css +87 -0
- package/dist/styles/recipes/theme-switcher.css +53 -0
- package/dist/styles/recipes/toggle-input.css +12 -0
- package/dist/styles/recipes/toggle.css +125 -0
- package/dist/styles/recipes/tooltip.css +133 -0
- package/dist/styles/recipes.css +30 -0
- package/dist/styles/reset.css +1 -0
- package/dist/styles/tokens.css +1016 -0
- package/dist/styles/utilities.css +1694 -0
- package/dist/styles.css +7 -0
- package/dist/svgs/building.svg +1 -0
- package/dist/types/index.d.ts +21626 -0
- package/dist/types/preset.d.ts +19 -0
- package/package.json +37 -35
- package/src/recipes/avatar.ts +205 -0
- package/src/recipes/badge.ts +203 -0
- package/src/recipes/box.ts +13 -0
- package/src/recipes/breadcrumbs.ts +29 -0
- package/src/recipes/button.ts +319 -0
- package/src/recipes/card.ts +148 -0
- package/src/recipes/checkbox.ts +87 -0
- package/src/recipes/checkboxinput.ts +15 -0
- package/src/recipes/chip.ts +189 -0
- package/src/recipes/code.ts +35 -0
- package/src/recipes/divider.ts +41 -0
- package/src/recipes/formField.ts +60 -0
- package/src/recipes/index.ts +28 -0
- package/src/recipes/menu.ts +205 -0
- package/src/recipes/modal.ts +120 -0
- package/src/recipes/radio.ts +71 -0
- package/src/recipes/radioinput.ts +12 -0
- package/src/recipes/select.ts +142 -0
- package/src/recipes/spinner.ts +52 -0
- package/src/recipes/tag.ts +262 -0
- package/src/recipes/text.ts +193 -0
- package/src/recipes/textarea.ts +153 -0
- package/src/recipes/textinput.ts +100 -0
- package/src/recipes/themeSwitcher.ts +48 -0
- package/src/recipes/toggle.ts +116 -0
- package/src/recipes/toggleinput.ts +16 -0
- package/src/recipes/tooltip.ts +359 -0
- package/src/styles/index.css +1 -0
- package/src/styles/primitives/animations.ts +16 -0
- package/src/styles/primitives/aspectRatios.ts +22 -0
- package/src/styles/primitives/blurs.ts +25 -0
- package/src/styles/primitives/borderWidths.ts +10 -0
- package/src/styles/primitives/borders.ts +36 -0
- package/src/styles/primitives/colors.ts +228 -0
- package/src/styles/primitives/durations.ts +25 -0
- package/src/styles/primitives/easings.ts +19 -0
- package/src/styles/primitives/fontSizes.ts +16 -0
- package/src/styles/primitives/fontWeights.ts +9 -0
- package/src/styles/primitives/fonts.ts +18 -0
- package/src/styles/primitives/index.ts +46 -0
- package/src/styles/primitives/letterSpacings.ts +22 -0
- package/src/styles/primitives/lineHeights.ts +16 -0
- package/src/styles/primitives/radii.ts +14 -0
- package/src/styles/primitives/shadows.ts +73 -0
- package/src/styles/primitives/sizes.ts +86 -0
- package/src/styles/primitives/spacings.ts +7 -0
- package/src/styles/semantics/colors.ts +774 -0
- package/src/styles/semantics/index.ts +2 -0
- package/src/styles/semantics/shadows.ts +32 -0
- package/src/styles/utilities/breakpoints.ts +8 -0
- package/src/styles/utilities/conditions.ts +140 -0
- package/src/styles/utilities/containerSizes.ts +17 -0
- package/src/styles/utilities/filters.ts +12 -0
- package/src/styles/utilities/globalStyle.ts +93 -0
- package/src/styles/utilities/index.ts +9 -0
- package/src/styles/utilities/keyframes.ts +89 -0
- package/src/styles/utilities/layerStyles.ts +18 -0
- package/src/styles/utilities/textStyles.ts +135 -0
- package/src/styles/utilities/transitions.ts +92 -0
- package/src/utils/injectSprite.ts +36 -0
- package/src/utils/splitProps.ts +19 -0
- package/src/utils/spriteContent.ts +4 -0
- package/dist/panda.buildinfo.json +0 -448
- package/dist/preset.d.ts +0 -5
- package/dist/transitions-DUgH88VW.js +0 -1041
- package/dist/transitions-DUgH88VW.js.map +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
import {
|
|
3
|
+
fontSizes as fontSizeTokens,
|
|
4
|
+
fontWeights as fontWeightTokens,
|
|
5
|
+
} from '../styles/primitives';
|
|
6
|
+
|
|
7
|
+
const textBase = {
|
|
8
|
+
margin: '0',
|
|
9
|
+
lineHeight: 'default',
|
|
10
|
+
fontWeight: 'normal',
|
|
11
|
+
fontSize: '16',
|
|
12
|
+
color: 'text.subtlest',
|
|
13
|
+
maxWidth: 'prose',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type FontSizeKey = keyof typeof fontSizeTokens;
|
|
17
|
+
const fontSizes = (Object.keys(fontSizeTokens) as FontSizeKey[]).reduce(
|
|
18
|
+
(accumulator, currentKey) => {
|
|
19
|
+
accumulator[currentKey] = { fontSize: fontSizeTokens[currentKey].value };
|
|
20
|
+
return accumulator;
|
|
21
|
+
},
|
|
22
|
+
{} as Record<FontSizeKey, Record<'fontSize', string>>,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
type FontWeightKey = keyof typeof fontWeightTokens;
|
|
26
|
+
const fontWeights = (Object.keys(fontWeightTokens) as FontWeightKey[]).reduce(
|
|
27
|
+
(accumulator, currentKey) => {
|
|
28
|
+
accumulator[currentKey] = {
|
|
29
|
+
fontWeight: fontWeightTokens[currentKey].value,
|
|
30
|
+
};
|
|
31
|
+
return accumulator;
|
|
32
|
+
},
|
|
33
|
+
{} as Record<FontWeightKey, Record<'fontWeight', number>>,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const textVariants = {
|
|
37
|
+
family: {
|
|
38
|
+
heading: { fontFamily: 'heading' },
|
|
39
|
+
body: { fontFamily: 'body' },
|
|
40
|
+
sans: { fontFamily: 'sans' },
|
|
41
|
+
serif: { fontFamily: 'serif' },
|
|
42
|
+
mono: { fontFamily: 'mono' },
|
|
43
|
+
inherit: { fontFamily: 'inherit' },
|
|
44
|
+
},
|
|
45
|
+
bold: {
|
|
46
|
+
true: {
|
|
47
|
+
fontWeight: 'bold',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
italic: {
|
|
51
|
+
true: {
|
|
52
|
+
fontStyle: 'italic',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
underline: {
|
|
56
|
+
true: {
|
|
57
|
+
textDecoration: 'underline',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
truncate: {
|
|
61
|
+
true: {
|
|
62
|
+
width: 'full',
|
|
63
|
+
maxWidth: 'full',
|
|
64
|
+
textOverflow: 'ellipsis',
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
whiteSpace: 'nowrap',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
allcaps: {
|
|
70
|
+
true: {
|
|
71
|
+
textTransform: 'uppercase',
|
|
72
|
+
fontWeight: 'bold',
|
|
73
|
+
letterSpacing: 'widest',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
size: fontSizes,
|
|
77
|
+
weight: fontWeights,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const headingBase = {
|
|
81
|
+
fontFamily: 'heading',
|
|
82
|
+
fontWeight: 'black',
|
|
83
|
+
color: 'text.bold',
|
|
84
|
+
lineHeight: 'default',
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const headingVariants = {
|
|
88
|
+
level: {
|
|
89
|
+
h1: { textStyle: 'heading.lg' },
|
|
90
|
+
h2: { textStyle: 'heading.md' },
|
|
91
|
+
h3: { textStyle: 'heading.sm' },
|
|
92
|
+
h4: { textStyle: 'heading.xs' },
|
|
93
|
+
},
|
|
94
|
+
allcaps: {
|
|
95
|
+
true: {
|
|
96
|
+
textTransform: 'uppercase',
|
|
97
|
+
letterSpacing: 'widest',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const linkBase = {
|
|
103
|
+
display: 'inline-flex',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
fontWeight: 'medium',
|
|
106
|
+
gap: '1',
|
|
107
|
+
color: { base: 'blue.70', _dark: 'blue.40' },
|
|
108
|
+
backgroundImage: 'linear-gradient(90deg, transparent 0% 100%)',
|
|
109
|
+
backgroundSize: '100% 1px',
|
|
110
|
+
backgroundRepeat: 'no-repeat',
|
|
111
|
+
backgroundPositionY: '100%',
|
|
112
|
+
width: 'fit-content',
|
|
113
|
+
cursor: 'pointer',
|
|
114
|
+
textDecoration: 'none',
|
|
115
|
+
_hover: {
|
|
116
|
+
color: { base: 'blue.60', _dark: 'blue.40' },
|
|
117
|
+
backgroundColor: { base: 'blue.10', _dark: 'blue.100' },
|
|
118
|
+
backgroundImage: 'linear-gradient(90deg, currentColor 0% 100%)',
|
|
119
|
+
},
|
|
120
|
+
'p &': {
|
|
121
|
+
backgroundImage: 'linear-gradient(90deg, currentColor 0% 100%)',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const linkVariants = {
|
|
126
|
+
...textVariants,
|
|
127
|
+
_disabled: {
|
|
128
|
+
true: {
|
|
129
|
+
cursor: 'not-allowed',
|
|
130
|
+
color: 'text.disabled',
|
|
131
|
+
pointerEvents: 'none',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const labelBase = {
|
|
137
|
+
fontSize: '14',
|
|
138
|
+
fontWeight: 'normal',
|
|
139
|
+
lineHeight: 'tight',
|
|
140
|
+
cursor: 'default',
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
//Copied linkvarients, don't have styles defined for this yet
|
|
144
|
+
const labelVariants = {
|
|
145
|
+
...textVariants,
|
|
146
|
+
_disabled: {
|
|
147
|
+
true: {
|
|
148
|
+
cursor: 'not-allowed',
|
|
149
|
+
color: 'text.disabled',
|
|
150
|
+
pointerEvents: 'none',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const textRecipe = defineRecipe({
|
|
156
|
+
className: 'text',
|
|
157
|
+
jsx: ['Text'],
|
|
158
|
+
base: textBase,
|
|
159
|
+
variants: textVariants,
|
|
160
|
+
defaultVariants: {
|
|
161
|
+
family: 'inherit',
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
export const headingRecipe = defineRecipe({
|
|
166
|
+
className: 'heading',
|
|
167
|
+
jsx: ['Heading'],
|
|
168
|
+
base: headingBase,
|
|
169
|
+
variants: headingVariants,
|
|
170
|
+
defaultVariants: {
|
|
171
|
+
level: 'h2',
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const linkRecipe = defineRecipe({
|
|
176
|
+
className: 'link',
|
|
177
|
+
jsx: ['Link'],
|
|
178
|
+
base: linkBase,
|
|
179
|
+
variants: linkVariants,
|
|
180
|
+
defaultVariants: {
|
|
181
|
+
family: 'inherit',
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export const labelRecipe = defineRecipe({
|
|
186
|
+
className: 'label',
|
|
187
|
+
jsx: ['Label'],
|
|
188
|
+
base: labelBase,
|
|
189
|
+
variants: labelVariants,
|
|
190
|
+
defaultVariants: {
|
|
191
|
+
family: 'sans',
|
|
192
|
+
},
|
|
193
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const textareaVariants = {
|
|
4
|
+
size: {
|
|
5
|
+
md: {
|
|
6
|
+
py: '3',
|
|
7
|
+
px: '10',
|
|
8
|
+
fontSize: '16',
|
|
9
|
+
minHeight: '64',
|
|
10
|
+
},
|
|
11
|
+
sm: {
|
|
12
|
+
py: '0',
|
|
13
|
+
px: '8',
|
|
14
|
+
minHeight: '48',
|
|
15
|
+
fontSize: '14',
|
|
16
|
+
},
|
|
17
|
+
lg: {
|
|
18
|
+
py: '7',
|
|
19
|
+
px: '12',
|
|
20
|
+
fontSize: '16',
|
|
21
|
+
minHeight: '80',
|
|
22
|
+
},
|
|
23
|
+
xl: {
|
|
24
|
+
py: '9',
|
|
25
|
+
px: '16',
|
|
26
|
+
fontSize: '20',
|
|
27
|
+
minHeight: '96',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
autoSize: {
|
|
31
|
+
false: {
|
|
32
|
+
width: 'full',
|
|
33
|
+
},
|
|
34
|
+
true: {
|
|
35
|
+
width: 'fit-content',
|
|
36
|
+
fieldSizing: 'content',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
// stacked: {
|
|
40
|
+
// true: {
|
|
41
|
+
// gridTemplateRows: 'auto 1fr',
|
|
42
|
+
// alignItems: 'stretch',
|
|
43
|
+
// '&::after, & textarea': {
|
|
44
|
+
// gridArea: '2 / 1',
|
|
45
|
+
// },
|
|
46
|
+
// '& textarea': {
|
|
47
|
+
// background: { base: 'gray.10', _dark: 'gray.90' },
|
|
48
|
+
// borderColor: { base: 'gray.40', _dark: 'gray.100' },
|
|
49
|
+
// // _hover: {
|
|
50
|
+
// // borderColor: { base: 'gray.20', _dark: 'gray.30' },
|
|
51
|
+
// // },
|
|
52
|
+
// // _focus: {
|
|
53
|
+
// // borderColor: { base: 'gray.90', _dark: 'gray.10' },
|
|
54
|
+
// // },
|
|
55
|
+
// },
|
|
56
|
+
// },
|
|
57
|
+
// false: {
|
|
58
|
+
// gridTemplateColumns: 'auto 1fr',
|
|
59
|
+
// alignItems: 'center',
|
|
60
|
+
// '& textarea': {
|
|
61
|
+
// background: { base: 'gray.10', _dark: 'gray.90' },
|
|
62
|
+
// borderColor: { base: 'green.40', _dark: 'green.50' },
|
|
63
|
+
// // _hover: {
|
|
64
|
+
// // borderColor: { base: 'gray.20', _dark: 'gray.30' },
|
|
65
|
+
// // },
|
|
66
|
+
// // _focus: {
|
|
67
|
+
// // borderColor: { base: 'gray.90', _dark: 'gray.10' },
|
|
68
|
+
// // },
|
|
69
|
+
// },
|
|
70
|
+
// },
|
|
71
|
+
// },
|
|
72
|
+
// internalLabel: {
|
|
73
|
+
// false: {},
|
|
74
|
+
// true: {
|
|
75
|
+
// // _focusWithin: {
|
|
76
|
+
// // outlineWidth: 1,
|
|
77
|
+
// // outlineStyle: 'solid',
|
|
78
|
+
// // outlineColor: { base: 'gray.90', _dark: 'gray.10' },
|
|
79
|
+
// // // outlineOffset: 2,
|
|
80
|
+
// // ml: '-4',
|
|
81
|
+
// // },
|
|
82
|
+
// },
|
|
83
|
+
// },
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const textareaBase = {
|
|
87
|
+
display: 'inline-grid',
|
|
88
|
+
position: 'relative',
|
|
89
|
+
width: 'full',
|
|
90
|
+
verticalAlign: 'top',
|
|
91
|
+
borderWidth: '1',
|
|
92
|
+
borderStyle: 'solid',
|
|
93
|
+
borderColor: 'border.input',
|
|
94
|
+
borderRadius: '4',
|
|
95
|
+
outlineWidth: '2',
|
|
96
|
+
outlineOffset: '-1',
|
|
97
|
+
outlineStyle: 'solid',
|
|
98
|
+
outlineColor: 'transparent',
|
|
99
|
+
lineHeight: 'default',
|
|
100
|
+
fontFamily: 'body',
|
|
101
|
+
bg: 'bg.input',
|
|
102
|
+
color: 'text',
|
|
103
|
+
transitionDuration: 'fast',
|
|
104
|
+
transitionProperty: 'background, border-color, color, outline-color',
|
|
105
|
+
transitionTimingFunction: 'default',
|
|
106
|
+
_placeholder: {
|
|
107
|
+
color: 'text.placeholder',
|
|
108
|
+
},
|
|
109
|
+
// _hover: {
|
|
110
|
+
// bg: 'bg.input.hovered',
|
|
111
|
+
// },
|
|
112
|
+
_focus: {
|
|
113
|
+
bg: 'bg.input.pressed',
|
|
114
|
+
borderColor: 'border.focused',
|
|
115
|
+
outlineColor: 'border.focused',
|
|
116
|
+
},
|
|
117
|
+
_disabled: {
|
|
118
|
+
bg: 'bg.disabled',
|
|
119
|
+
borderColor: 'border.disabled',
|
|
120
|
+
color: 'text.disabled',
|
|
121
|
+
},
|
|
122
|
+
_error: {
|
|
123
|
+
display: 'inline-grid',
|
|
124
|
+
bg: 'bg.danger',
|
|
125
|
+
borderColor: 'border.danger',
|
|
126
|
+
color: 'text.danger',
|
|
127
|
+
_placeholder: {
|
|
128
|
+
color: 'text.danger/60',
|
|
129
|
+
},
|
|
130
|
+
_hover: {
|
|
131
|
+
bg: 'bg.danger.hovered',
|
|
132
|
+
borderColor: 'border.danger',
|
|
133
|
+
},
|
|
134
|
+
_focus: {
|
|
135
|
+
bg: 'bg.danger',
|
|
136
|
+
borderColor: 'border.danger',
|
|
137
|
+
outlineColor: 'border.danger',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const textareaRecipe = defineRecipe({
|
|
143
|
+
className: 'textarea',
|
|
144
|
+
jsx: ['Textarea'],
|
|
145
|
+
base: textareaBase,
|
|
146
|
+
variants: textareaVariants,
|
|
147
|
+
defaultVariants: {
|
|
148
|
+
size: 'md',
|
|
149
|
+
// stacked: true,
|
|
150
|
+
// internalLabel: false,
|
|
151
|
+
// autoGrow: false,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const textInputVariants = {
|
|
4
|
+
size: {
|
|
5
|
+
md: {
|
|
6
|
+
py: 3,
|
|
7
|
+
px: 10,
|
|
8
|
+
fontSize: '16',
|
|
9
|
+
},
|
|
10
|
+
sm: {
|
|
11
|
+
py: 0,
|
|
12
|
+
px: 8,
|
|
13
|
+
fontSize: '14',
|
|
14
|
+
},
|
|
15
|
+
lg: {
|
|
16
|
+
py: 7,
|
|
17
|
+
px: 12,
|
|
18
|
+
fontSize: '16',
|
|
19
|
+
},
|
|
20
|
+
xl: {
|
|
21
|
+
fontSize: '20',
|
|
22
|
+
py: '9',
|
|
23
|
+
px: '16',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
autoSize: {
|
|
27
|
+
false: {
|
|
28
|
+
width: 'full',
|
|
29
|
+
},
|
|
30
|
+
true: {
|
|
31
|
+
width: 'fit-content',
|
|
32
|
+
fieldSizing: 'content',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const textInputBase = {
|
|
38
|
+
display: 'inline-grid',
|
|
39
|
+
position: 'relative',
|
|
40
|
+
width: 'full',
|
|
41
|
+
borderWidth: '1',
|
|
42
|
+
borderStyle: 'solid',
|
|
43
|
+
borderColor: 'border.input',
|
|
44
|
+
borderRadius: '4',
|
|
45
|
+
outlineWidth: '2',
|
|
46
|
+
outlineOffset: '-1',
|
|
47
|
+
outlineStyle: 'solid',
|
|
48
|
+
outlineColor: 'transparent',
|
|
49
|
+
lineHeight: 'default',
|
|
50
|
+
fontFamily: 'body',
|
|
51
|
+
bg: 'bg.input',
|
|
52
|
+
color: 'text',
|
|
53
|
+
transitionDuration: 'fast',
|
|
54
|
+
transitionProperty: 'background, border-color, color, outline-color',
|
|
55
|
+
transitionTimingFunction: 'default',
|
|
56
|
+
_placeholder: {
|
|
57
|
+
color: 'text.placeholder',
|
|
58
|
+
},
|
|
59
|
+
// _hover: {
|
|
60
|
+
// bg: 'bg.input.hovered',
|
|
61
|
+
// },
|
|
62
|
+
_focus: {
|
|
63
|
+
bg: 'bg.input.pressed',
|
|
64
|
+
borderColor: 'border.focused',
|
|
65
|
+
outlineColor: 'border.focused',
|
|
66
|
+
},
|
|
67
|
+
_disabled: {
|
|
68
|
+
bg: 'bg.disabled',
|
|
69
|
+
borderColor: 'border.disabled',
|
|
70
|
+
color: 'text.disabled',
|
|
71
|
+
},
|
|
72
|
+
_error: {
|
|
73
|
+
display: 'inline-grid',
|
|
74
|
+
bg: 'bg.danger',
|
|
75
|
+
borderColor: 'border.danger',
|
|
76
|
+
color: 'text.danger',
|
|
77
|
+
_placeholder: {
|
|
78
|
+
color: 'text.danger/60',
|
|
79
|
+
},
|
|
80
|
+
_hover: {
|
|
81
|
+
bg: 'bg.danger.hovered',
|
|
82
|
+
borderColor: 'border.danger',
|
|
83
|
+
},
|
|
84
|
+
_focus: {
|
|
85
|
+
bg: 'bg.danger',
|
|
86
|
+
borderColor: 'border.danger',
|
|
87
|
+
outlineColor: 'border.danger',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const textinputRecipe = defineRecipe({
|
|
93
|
+
className: 'textinput',
|
|
94
|
+
jsx: ['TextInput'],
|
|
95
|
+
base: textInputBase,
|
|
96
|
+
variants: textInputVariants,
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
size: 'md',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
export const themeSwitcherRecipe = defineRecipe({
|
|
4
|
+
className: 'themeSwitcher',
|
|
5
|
+
jsx: ['ThemeSwitcher'],
|
|
6
|
+
base: {
|
|
7
|
+
position: 'relative',
|
|
8
|
+
borderWidth: '2',
|
|
9
|
+
borderStyle: 'solid',
|
|
10
|
+
borderColor: 'border',
|
|
11
|
+
bg: 'transparent',
|
|
12
|
+
color: 'transparent',
|
|
13
|
+
margin: '8',
|
|
14
|
+
borderRadius: '100',
|
|
15
|
+
cursor: 'pointer',
|
|
16
|
+
display: 'grid',
|
|
17
|
+
lineHeight: 'none',
|
|
18
|
+
width: '14',
|
|
19
|
+
height: '14',
|
|
20
|
+
minWidth: '14',
|
|
21
|
+
minHeight: '14',
|
|
22
|
+
flexShrink: 0,
|
|
23
|
+
aspectRatio: 'square',
|
|
24
|
+
transition: 'all',
|
|
25
|
+
'&:before': {
|
|
26
|
+
content: '""',
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
inset: '0',
|
|
29
|
+
opacity: 0,
|
|
30
|
+
display: 'block',
|
|
31
|
+
borderRadius: '100',
|
|
32
|
+
bg: 'bg.neutral.inverse.bold',
|
|
33
|
+
transition: 'all',
|
|
34
|
+
transitionTimingFunction: 'default',
|
|
35
|
+
transitionDuration: 'normal',
|
|
36
|
+
},
|
|
37
|
+
_hover: {
|
|
38
|
+
cursor: 'pointer',
|
|
39
|
+
bg: 'bg.neutral.inverse.bold',
|
|
40
|
+
borderColor: 'bg.neutral.bold',
|
|
41
|
+
'&:before': {
|
|
42
|
+
inset: '-8',
|
|
43
|
+
bg: 'bg.neutral.inverse.bold',
|
|
44
|
+
opacity: 0.25,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const toggleBase = {
|
|
4
|
+
container: {
|
|
5
|
+
position: 'relative',
|
|
6
|
+
w: '40',
|
|
7
|
+
h: '24',
|
|
8
|
+
cursor: 'pointer',
|
|
9
|
+
_disabled: {
|
|
10
|
+
opacity: 0.4,
|
|
11
|
+
pointerEvents: 'none',
|
|
12
|
+
cursor: 'none',
|
|
13
|
+
display: 'inline-grid',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
background: {
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
w: '40',
|
|
20
|
+
h: '24',
|
|
21
|
+
rounded: '24',
|
|
22
|
+
bg: 'surface',
|
|
23
|
+
transitionProperty: 'border-color, background-color',
|
|
24
|
+
transitionDuration: '200ms',
|
|
25
|
+
transitionTimingFunction: 'ease-in-out',
|
|
26
|
+
borderWidth: '2',
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
borderColor: 'border',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
input: {
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
opacity: 0,
|
|
34
|
+
w: '40',
|
|
35
|
+
h: '24',
|
|
36
|
+
rounded: '24',
|
|
37
|
+
m: 0,
|
|
38
|
+
p: 0,
|
|
39
|
+
border: 'none',
|
|
40
|
+
zIndex: 0,
|
|
41
|
+
cursor: 'inherit',
|
|
42
|
+
|
|
43
|
+
"& ~ [name='circle']": {
|
|
44
|
+
display: 'inline-grid',
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
opacity: 1,
|
|
47
|
+
transform: 'translateX(0)',
|
|
48
|
+
transitionProperty: 'transform, opacity',
|
|
49
|
+
transitionDuration: '200ms',
|
|
50
|
+
transitionTimingFunction: 'ease-in-out',
|
|
51
|
+
fill: 'icon.decorative/80',
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
"& ~ [name='circle-check']": {
|
|
55
|
+
display: 'inline-grid',
|
|
56
|
+
position: 'absolute',
|
|
57
|
+
opacity: 0,
|
|
58
|
+
transform: 'translateX(0)',
|
|
59
|
+
transitionProperty: 'transform, opacity',
|
|
60
|
+
transitionDuration: '200ms',
|
|
61
|
+
transitionTimingFunction: 'ease-in-out',
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
_checked: {
|
|
65
|
+
"& ~ [name='circle']": {
|
|
66
|
+
opacity: 0,
|
|
67
|
+
transform: 'translateX(10px)',
|
|
68
|
+
},
|
|
69
|
+
"& ~ [name='circle-check']": {
|
|
70
|
+
opacity: 1,
|
|
71
|
+
transform: 'translateX(16px)',
|
|
72
|
+
fill: 'icon.inverse',
|
|
73
|
+
},
|
|
74
|
+
"& ~ [name='toggle-bg']": {
|
|
75
|
+
bg: 'bg.neutral.inverse',
|
|
76
|
+
borderColor: 'bg.neutral.inverse',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
_error: {
|
|
80
|
+
"& ~ [name='toggle-bg']": {
|
|
81
|
+
borderColor: 'error.default',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
_focusVisible: {
|
|
86
|
+
appearance: 'none',
|
|
87
|
+
opacity: 1,
|
|
88
|
+
outlineColor: { base: 'gray.80', _dark: 'gray.10' },
|
|
89
|
+
outlineOffset: 1,
|
|
90
|
+
outlineWidth: 2,
|
|
91
|
+
outlineStyle: 'solid',
|
|
92
|
+
rounded: '24',
|
|
93
|
+
w: '40',
|
|
94
|
+
h: '24',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
indicator: {
|
|
99
|
+
display: 'none',
|
|
100
|
+
w: '24',
|
|
101
|
+
h: '24',
|
|
102
|
+
transitionProperty: 'border-color, background-color',
|
|
103
|
+
transitionDuration: '200ms',
|
|
104
|
+
transitionTimingFunction: 'ease-in-out',
|
|
105
|
+
"&:is([name='circle'])": {
|
|
106
|
+
fill: { base: 'gray.20', _dark: 'gray.40' },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const toggleRecipe = defineSlotRecipe({
|
|
112
|
+
className: 'toggle',
|
|
113
|
+
jsx: ['toggle'],
|
|
114
|
+
slots: ['container', 'input', 'indicator', 'background'],
|
|
115
|
+
base: toggleBase,
|
|
116
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const toggleInputBase = {
|
|
4
|
+
display: 'grid',
|
|
5
|
+
gap: '8',
|
|
6
|
+
gridTemplateColumns: '40px auto',
|
|
7
|
+
userSelect: 'none',
|
|
8
|
+
fontSize: '16',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const toggleInputRecipe = defineRecipe({
|
|
12
|
+
className: 'toggle-input',
|
|
13
|
+
jsx: ['ToggleInput'],
|
|
14
|
+
base: toggleInputBase,
|
|
15
|
+
variants: {},
|
|
16
|
+
});
|