cetec-design-system 0.0.25 → 0.0.27
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 +223 -35
- package/dist/cetec-design-system.es.js +21 -21
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +8 -0
- package/dist/components/CheckboxInput/index.d.ts +1 -0
- package/dist/components/RadioInput/RadioInput.d.ts +9 -0
- package/dist/components/RadioInput/index.d.ts +1 -0
- package/dist/components/Toggle/Toggle.d.ts +8 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/components/ToggleInput/ToggleInput.d.ts +8 -0
- package/dist/components/ToggleInput/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/recipes/checkbox.ts +1 -1
- package/src/recipes/index.ts +3 -0
- package/src/recipes/radioinput.ts +14 -0
- package/src/recipes/toggle.ts +115 -0
- package/src/recipes/toggleinput.ts +17 -0
- package/src/utils/splitProps.ts +12 -5
package/README.md
CHANGED
|
@@ -1,50 +1,238 @@
|
|
|
1
|
-
|
|
1
|
+
>[!IMPORTANT]
|
|
2
|
+
>Currently a work in progress and may not be accurate.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# Cetec-ERP Design System
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Contains components and styles for the Cetec-ERP application and marketing website.
|
|
6
7
|
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
8
|
+
- [Overview](#overview)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Usage](#usage)
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Overview
|
|
13
|
+
Components are bundled in /dist/cetec-design-system.es.js
|
|
14
|
+
Type definitions are in src/components/
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
## Installation
|
|
17
|
+
## Usage
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
Copy the panda config from the repo (below) and change the paths to the imports to point to path of the package in node modules.
|
|
20
|
+
Set up the 'include' option to contain the paths in which you want panda to look when building styled-system and styles.css.
|
|
21
|
+
```
|
|
22
|
+
import {
|
|
23
|
+
defineConfig,
|
|
24
|
+
defineTokens,
|
|
25
|
+
defineSemanticTokens,
|
|
26
|
+
} from '@pandacss/dev';
|
|
27
|
+
import pandaBasePreset from '@pandacss/preset-base';
|
|
28
|
+
|
|
29
|
+
import * as tokens from 'node_modules/cetec-design-system/src/styles/tokens';
|
|
30
|
+
import * as semanticTokens from 'node_modules/cetec-design-system/src/styles/semanticTokens';
|
|
31
|
+
import { globalCss } from 'node_modules/cetec-design-system/src/styles/globalStyle';
|
|
32
|
+
import { conditions } from 'node_modules/cetec-design-system/src/styles/conditions';
|
|
33
|
+
import {
|
|
34
|
+
buttonRecipe,
|
|
35
|
+
iconButtonRecipe,
|
|
36
|
+
inputRecipe,
|
|
37
|
+
textareaRecipe,
|
|
38
|
+
headingRecipe,
|
|
39
|
+
linkRecipe,
|
|
40
|
+
labelRecipe,
|
|
41
|
+
textRecipe,
|
|
42
|
+
checkBoxRecipe,
|
|
43
|
+
spinnerRecipe,
|
|
44
|
+
dividerRecipe,
|
|
45
|
+
preRecipe,
|
|
46
|
+
codeRecipe,
|
|
47
|
+
boxRecipe,
|
|
48
|
+
radioRecipe,
|
|
49
|
+
textinputRecipe,
|
|
50
|
+
} from 'node_modules/cetec-design-system/src/recipes';
|
|
51
|
+
import { benefitsRecipe } from "./src/recipes";
|
|
52
|
+
|
|
53
|
+
// https://panda-css.com/docs/concepts/extend#removing-something-from-the-base-presets
|
|
54
|
+
// omit default patterns here
|
|
55
|
+
const { box, divider, ...pandaBasePresetPatterns } = pandaBasePreset.patterns;
|
|
56
|
+
const pandaBasePresetConditions = pandaBasePreset.conditions;
|
|
57
|
+
const pandaBasePresetUtilities = pandaBasePreset.utilities;
|
|
58
|
+
const pandaBasePresetGlobalCss = pandaBasePreset.globalCss;
|
|
59
|
+
|
|
60
|
+
// using pandas methods to define type-safe tokens
|
|
61
|
+
const theme = {
|
|
62
|
+
tokens: defineTokens({
|
|
63
|
+
aspectRatios: tokens.aspectRatios,
|
|
64
|
+
borders: tokens.borders,
|
|
65
|
+
shadows: tokens.shadows,
|
|
66
|
+
easings: tokens.easings,
|
|
67
|
+
durations: tokens.durations,
|
|
68
|
+
letterSpacings: tokens.letterSpacings,
|
|
69
|
+
lineHeights: tokens.lineHeights,
|
|
70
|
+
blurs: tokens.blurs,
|
|
71
|
+
animations: tokens.animations,
|
|
72
|
+
colors: tokens.colors,
|
|
73
|
+
fonts: tokens.fonts,
|
|
74
|
+
fontSizes: tokens.fontSizes,
|
|
75
|
+
fontWeights: tokens.fontWeights,
|
|
76
|
+
sizes: tokens.sizes,
|
|
77
|
+
numericSizes: tokens.numericSizes,
|
|
78
|
+
spacing: tokens.sizes,
|
|
79
|
+
radii: tokens.radii,
|
|
80
|
+
keyframes: tokens.keyframes,
|
|
81
|
+
containerSizes: tokens.containerSizes,
|
|
82
|
+
breakpoints: tokens.breakpoints,
|
|
83
|
+
}),
|
|
84
|
+
semanticTokens: defineSemanticTokens({
|
|
85
|
+
colors: semanticTokens.colors,
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default defineConfig({
|
|
90
|
+
presets: ['@pandacss/dev/presets'],
|
|
91
|
+
eject: true,
|
|
92
|
+
gitignore: true,
|
|
93
|
+
jsxFramework: 'react',
|
|
94
|
+
jsxStyleProps: 'all',
|
|
95
|
+
jsxFactory: 'styled',
|
|
96
|
+
watch: true,
|
|
97
|
+
include: ["./src/pages/index.astro", "./src/components/**/*{ts, tsx, js, jsx, astro}"],
|
|
98
|
+
preflight: true,
|
|
99
|
+
exclude: [],
|
|
100
|
+
strictTokens: true,
|
|
101
|
+
importMap: '@styled-system',
|
|
102
|
+
outdir: 'styled-system',
|
|
15
103
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
104
|
+
theme: {
|
|
105
|
+
containerSizes: tokens.containerSizes,
|
|
106
|
+
keyframes: tokens.keyframes,
|
|
107
|
+
tokens: {
|
|
108
|
+
aspectRatios: theme.tokens.aspectRatios,
|
|
109
|
+
borders: theme.tokens.borders,
|
|
110
|
+
shadows: theme.tokens.shadows,
|
|
111
|
+
easings: theme.tokens.easings,
|
|
112
|
+
durations: theme.tokens.durations,
|
|
113
|
+
letterSpacings: theme.tokens.letterSpacings,
|
|
114
|
+
lineHeights: theme.tokens.lineHeights,
|
|
115
|
+
blurs: theme.tokens.blurs,
|
|
116
|
+
animations: theme.tokens.animations,
|
|
117
|
+
colors: theme.tokens.colors,
|
|
118
|
+
fonts: theme.tokens.fonts,
|
|
119
|
+
fontSizes: theme.tokens.fontSizes,
|
|
120
|
+
fontWeights: theme.tokens.fontWeights,
|
|
121
|
+
sizes: theme.tokens.sizes,
|
|
122
|
+
numericSizes: theme.tokens.numericSizes,
|
|
123
|
+
spacing: theme.tokens.sizes,
|
|
124
|
+
radii: theme.tokens.radii,
|
|
125
|
+
},
|
|
126
|
+
semanticTokens: {
|
|
127
|
+
colors: theme.semanticTokens.colors,
|
|
128
|
+
},
|
|
129
|
+
extend: {
|
|
130
|
+
breakpoints: theme.tokens.breakpoints,
|
|
131
|
+
textStyles: tokens.textStyles,
|
|
132
|
+
recipes: {
|
|
133
|
+
benefits: benefitsRecipe,
|
|
134
|
+
text: textRecipe,
|
|
135
|
+
heading: headingRecipe,
|
|
136
|
+
link: linkRecipe,
|
|
137
|
+
label: labelRecipe,
|
|
138
|
+
button: buttonRecipe,
|
|
139
|
+
iconButton: iconButtonRecipe,
|
|
140
|
+
input: inputRecipe,
|
|
141
|
+
textinput: textinputRecipe,
|
|
142
|
+
textarea: textareaRecipe,
|
|
143
|
+
code: codeRecipe,
|
|
144
|
+
pre: preRecipe,
|
|
145
|
+
spinner: spinnerRecipe,
|
|
146
|
+
divider: dividerRecipe,
|
|
147
|
+
box: boxRecipe,
|
|
148
|
+
},
|
|
149
|
+
slotRecipes: {
|
|
150
|
+
checkbox: checkBoxRecipe,
|
|
151
|
+
radio: radioRecipe,
|
|
152
|
+
},
|
|
23
153
|
},
|
|
24
154
|
},
|
|
25
|
-
})
|
|
26
|
-
```
|
|
27
155
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
156
|
+
utilities: {
|
|
157
|
+
...pandaBasePresetUtilities,
|
|
158
|
+
},
|
|
31
159
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
160
|
+
patterns: {
|
|
161
|
+
icon: {
|
|
162
|
+
properties: {
|
|
163
|
+
size: {
|
|
164
|
+
type: 'enum',
|
|
165
|
+
value: Object.keys(tokens.sizes),
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
transform(props) {
|
|
169
|
+
const { size, ...rest } = props;
|
|
170
|
+
return {
|
|
171
|
+
width: size,
|
|
172
|
+
height: size,
|
|
173
|
+
...rest,
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
extend: {
|
|
178
|
+
...pandaBasePresetPatterns,
|
|
179
|
+
container: {
|
|
180
|
+
transform(props) {
|
|
181
|
+
return Object.assign(
|
|
182
|
+
{
|
|
183
|
+
position: 'relative',
|
|
184
|
+
width: '100%',
|
|
185
|
+
maxWidth: '7xl',
|
|
186
|
+
mx: 'auto',
|
|
187
|
+
px: { base: '24', md: '20', sm: '16' },
|
|
188
|
+
},
|
|
189
|
+
props,
|
|
190
|
+
);
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
35
195
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
196
|
+
globalCss: {
|
|
197
|
+
...pandaBasePresetGlobalCss,
|
|
198
|
+
...globalCss,
|
|
199
|
+
html: {
|
|
200
|
+
'--global-font-heading': 'fonts.heading',
|
|
201
|
+
'--global-font-body': 'fonts.body',
|
|
202
|
+
'--global-font-mono': 'fonts.mono',
|
|
203
|
+
},
|
|
42
204
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
...
|
|
47
|
-
|
|
205
|
+
conditions: {
|
|
206
|
+
...pandaBasePresetConditions,
|
|
207
|
+
// Core conditions pulled from panda preset-base package
|
|
208
|
+
...conditions,
|
|
209
|
+
|
|
210
|
+
// Themes moved to conditions.tx
|
|
211
|
+
|
|
212
|
+
// States
|
|
213
|
+
indeterminate:
|
|
214
|
+
'&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])',
|
|
215
|
+
hidden: '&:is([hidden])',
|
|
216
|
+
current: '&:is([data-current])',
|
|
217
|
+
today: '&:is([data-today])',
|
|
218
|
+
collapsed:
|
|
219
|
+
'&:is([aria-collapsed=true], [data-collapsed], [data-state="collapsed"])',
|
|
220
|
+
|
|
221
|
+
// Containers
|
|
222
|
+
containerSmall: '@container (max-width: 560px)',
|
|
223
|
+
containerMedium: '@container (min-width: 561px) and (max-width: 999px)',
|
|
224
|
+
containerLarge: '@container (min-width: 1000px)',
|
|
48
225
|
},
|
|
49
|
-
})
|
|
226
|
+
});
|
|
227
|
+
```
|
|
228
|
+
At the root of your project you'll want to:
|
|
229
|
+
- Import styles.css from the styled-system folder generated from panda codegen, usually at the root of the project: ./styled-system/styles.css
|
|
230
|
+
- Import Icons from the cetec-design-system like so: import * as iconsimport Header from "../components/Header.astro"; - maybe you don't need to do this anymore?
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
import { ThemeProvider, Text, Spinner, Button, Icon } from "cetec-design-system";
|
|
235
|
+
import "@styled-system/styles.css";
|
|
236
|
+
import * as icons from 'cetec-design-system/icons';
|
|
237
|
+
from 'cetec-design-system/icons';
|
|
50
238
|
```
|
|
@@ -139,7 +139,7 @@ function zt(e) {
|
|
|
139
139
|
}
|
|
140
140
|
return { mergeCss: b(r), assignCss: o };
|
|
141
141
|
}
|
|
142
|
-
var Lt = /([A-Z])/g, At = /^ms-/,
|
|
142
|
+
var Lt = /([A-Z])/g, At = /^ms-/, Nt = b((e) => e.startsWith("--") ? e : e.replace(Lt, "-$1").replace(At, "-ms-").toLowerCase()), Dt = ["min", "max", "clamp", "calc"], Xt = new RegExp(`^(${Dt.join("|")})\\(.*\\)`), Yt = (e) => typeof e == "string" && Xt.test(e), Kt = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%", Gt = `(?:${Kt.split(",").join("|")})`, Ht = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${Gt}$`), qt = (e) => typeof e == "string" && Ht.test(e), $t = (e) => typeof e == "string" && /^var\(--.+\)$/.test(e), ae = {
|
|
143
143
|
map: Et,
|
|
144
144
|
isCssFunction: Yt,
|
|
145
145
|
isCssVar: $t,
|
|
@@ -180,29 +180,29 @@ const Qt = /^_/, er = /&|@/;
|
|
|
180
180
|
function Ae(e) {
|
|
181
181
|
return e.map((t) => Le.has(t) ? t.replace(Qt, "") : er.test(t) ? `[${re(t.trim())}]` : t);
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Ne(e) {
|
|
184
184
|
return e.sort((t, r) => {
|
|
185
185
|
const o = ge(t), n = ge(r);
|
|
186
186
|
return o && !n ? 1 : !o && n ? -1 : 0;
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
const tr = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle",
|
|
189
|
+
const tr = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle", De = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map();
|
|
190
190
|
tr.split(",").forEach((e) => {
|
|
191
191
|
const [t, r] = e.split(":"), [o, ...n] = r.split("/");
|
|
192
|
-
|
|
192
|
+
De.set(t, o), n.length && n.forEach((a) => {
|
|
193
193
|
Xe.set(a === "1" ? o : a, t);
|
|
194
194
|
});
|
|
195
195
|
});
|
|
196
196
|
const ue = (e) => Xe.get(e) || e, Ye = {
|
|
197
197
|
conditions: {
|
|
198
|
-
shift:
|
|
198
|
+
shift: Ne,
|
|
199
199
|
finalize: Ae,
|
|
200
200
|
breakpoints: { keys: ["base", "xs", "sm", "md", "lg", "xl", "2xl"] }
|
|
201
201
|
},
|
|
202
202
|
utility: {
|
|
203
203
|
transform: (e, t) => {
|
|
204
204
|
const r = ue(e);
|
|
205
|
-
return { className: `${
|
|
205
|
+
return { className: `${De.get(r) || Nt(r)}_${re(t)}` };
|
|
206
206
|
},
|
|
207
207
|
hasShorthand: !0,
|
|
208
208
|
toHash: (e, t) => t(e.join(":")),
|
|
@@ -284,7 +284,7 @@ const _ = (e, t, r) => {
|
|
|
284
284
|
recipeFn: (a, i = !0) => {
|
|
285
285
|
const d = je({
|
|
286
286
|
conditions: {
|
|
287
|
-
shift:
|
|
287
|
+
shift: Ne,
|
|
288
288
|
finalize: Ae,
|
|
289
289
|
breakpoints: { keys: ["base", "xs", "sm", "md", "lg", "xl", "2xl"] }
|
|
290
290
|
},
|
|
@@ -482,7 +482,7 @@ const _ = (e, t, r) => {
|
|
|
482
482
|
return g(e, _e);
|
|
483
483
|
},
|
|
484
484
|
getVariantProps: A.getVariantProps
|
|
485
|
-
}),
|
|
485
|
+
}), N = /* @__PURE__ */ _("label", {
|
|
486
486
|
family: "body"
|
|
487
487
|
}, []), $e = {
|
|
488
488
|
textStyle: [
|
|
@@ -541,10 +541,10 @@ const _ = (e, t, r) => {
|
|
|
541
541
|
_disabled: [
|
|
542
542
|
"true"
|
|
543
543
|
]
|
|
544
|
-
}, ke = Object.keys($e), sr = /* @__PURE__ */ Object.assign(b(
|
|
544
|
+
}, ke = Object.keys($e), sr = /* @__PURE__ */ Object.assign(b(N.recipeFn), {
|
|
545
545
|
__recipe__: !0,
|
|
546
546
|
__name__: "label",
|
|
547
|
-
__getCompoundVariantCss__:
|
|
547
|
+
__getCompoundVariantCss__: N.__getCompoundVariantCss__,
|
|
548
548
|
raw: (e) => e,
|
|
549
549
|
variantKeys: ke,
|
|
550
550
|
variantMap: $e,
|
|
@@ -554,8 +554,8 @@ const _ = (e, t, r) => {
|
|
|
554
554
|
splitVariantProps(e) {
|
|
555
555
|
return g(e, ke);
|
|
556
556
|
},
|
|
557
|
-
getVariantProps:
|
|
558
|
-
}),
|
|
557
|
+
getVariantProps: N.getVariantProps
|
|
558
|
+
}), D = /* @__PURE__ */ _("button", {
|
|
559
559
|
variant: "standard",
|
|
560
560
|
size: "medium"
|
|
561
561
|
}, []), Ue = {
|
|
@@ -572,10 +572,10 @@ const _ = (e, t, r) => {
|
|
|
572
572
|
"large",
|
|
573
573
|
"small"
|
|
574
574
|
]
|
|
575
|
-
}, ye = Object.keys(Ue), lr = /* @__PURE__ */ Object.assign(b(
|
|
575
|
+
}, ye = Object.keys(Ue), lr = /* @__PURE__ */ Object.assign(b(D.recipeFn), {
|
|
576
576
|
__recipe__: !0,
|
|
577
577
|
__name__: "button",
|
|
578
|
-
__getCompoundVariantCss__:
|
|
578
|
+
__getCompoundVariantCss__: D.__getCompoundVariantCss__,
|
|
579
579
|
raw: (e) => e,
|
|
580
580
|
variantKeys: ye,
|
|
581
581
|
variantMap: Ue,
|
|
@@ -585,7 +585,7 @@ const _ = (e, t, r) => {
|
|
|
585
585
|
splitVariantProps(e) {
|
|
586
586
|
return g(e, ye);
|
|
587
587
|
},
|
|
588
|
-
getVariantProps:
|
|
588
|
+
getVariantProps: D.getVariantProps
|
|
589
589
|
}), X = /* @__PURE__ */ _("icon-button", {
|
|
590
590
|
variant: "standard",
|
|
591
591
|
size: "medium"
|
|
@@ -879,11 +879,11 @@ const Me = {
|
|
|
879
879
|
};
|
|
880
880
|
},
|
|
881
881
|
defaultValues: { gap: "10px" }
|
|
882
|
-
},
|
|
882
|
+
}, Nr = (e = {}) => {
|
|
883
883
|
const t = ie(Me, e);
|
|
884
884
|
return Me.transform(t, ae);
|
|
885
|
-
},
|
|
886
|
-
const [o, n] = g(t, ["justify", "gap"]), a =
|
|
885
|
+
}, Dr = /* @__PURE__ */ te(function(t, r) {
|
|
886
|
+
const [o, n] = g(t, ["justify", "gap"]), a = Nr(o), i = { ref: r, ...a, ...n };
|
|
887
887
|
return M(st.div, i);
|
|
888
888
|
}), Ee = {
|
|
889
889
|
transform(e, { map: t, isCssUnit: r }) {
|
|
@@ -907,8 +907,8 @@ const Me = {
|
|
|
907
907
|
const [o, n] = g(t, ["gap", "columnGap", "rowGap", "columns", "minChildWidth"]), a = Xr(o), i = { ref: r, ...a, ...n };
|
|
908
908
|
return M(st.div, i);
|
|
909
909
|
}), k = (e) => {
|
|
910
|
-
const [t, r] = Wr(e), { css: o, ...n } = t;
|
|
911
|
-
return [
|
|
910
|
+
const [t, r] = Wr(e), { css: o, ...n } = t, a = T(o, n), i = r.className || "", s = h(i, a), { className: d, ...c } = r;
|
|
911
|
+
return [s, c];
|
|
912
912
|
}, y = ({ as: e = "div", ...t }) => {
|
|
913
913
|
const [r, o] = k(t), n = h(hr({}), r);
|
|
914
914
|
return M(e, {
|
|
@@ -957,7 +957,7 @@ const Me = {
|
|
|
957
957
|
loading: e = !1,
|
|
958
958
|
children: t
|
|
959
959
|
}) => /* @__PURE__ */ E(wt, { children: [
|
|
960
|
-
/* @__PURE__ */ p(
|
|
960
|
+
/* @__PURE__ */ p(Dr, { gap: "4", opacity: e ? 0 : 1, children: t }),
|
|
961
961
|
e && /* @__PURE__ */ p(
|
|
962
962
|
Yr,
|
|
963
963
|
{
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
export type CheckBoxInputProps = BoxProps & {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
children?: string | ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const CheckBoxInput: FC<CheckBoxInputProps>;
|
|
8
|
+
export default CheckBoxInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckBoxInput, type CheckBoxInputProps } from './CheckboxInput';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RadioInputVariantProps } from '../../../styled-system/recipes';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
import { FC, ReactNode } from 'react';
|
|
4
|
+
export type RadioInputProps = BoxProps & RadioInputVariantProps & {
|
|
5
|
+
error?: boolean;
|
|
6
|
+
children?: string | ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const RadioInput: FC<RadioInputProps>;
|
|
9
|
+
export default RadioInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioInput, type RadioInputProps } from './RadioInput';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BoxProps } from '../Box';
|
|
2
|
+
import { ToggleVariantProps } from '../../../styled-system/recipes';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
export type ToggleProps = Omit<BoxProps, keyof ToggleVariantProps> & ToggleVariantProps & {
|
|
5
|
+
error?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const Toggle: React.FC<ToggleProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toggle, type ToggleProps } from './Toggle';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
import { ToggleInputVariantProps } from '../../../styled-system/recipes';
|
|
4
|
+
export type ToggleInputProps = BoxProps & ToggleInputVariantProps & {
|
|
5
|
+
error?: boolean;
|
|
6
|
+
children?: string | ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const ToggleInput: FC<ToggleInputProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ToggleInput, type ToggleInputProps } from './ToggleInput';
|
package/package.json
CHANGED
package/src/recipes/checkbox.ts
CHANGED
package/src/recipes/index.ts
CHANGED
|
@@ -8,5 +8,8 @@ export { dividerRecipe } from "./divider"
|
|
|
8
8
|
export { preRecipe, codeRecipe } from "./code"
|
|
9
9
|
export { boxRecipe } from './box';
|
|
10
10
|
export { radioRecipe } from './radio';
|
|
11
|
+
export { toggleRecipe } from './toggle';
|
|
11
12
|
export { textinputRecipe } from './textinput';
|
|
13
|
+
export { radioInputRecipe } from './radioinput';
|
|
14
|
+
export { toggleInputRecipe } from './toggleinput';
|
|
12
15
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
2
|
+
|
|
3
|
+
const radioInputBase = {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const radioInputRecipe = defineRecipe({
|
|
8
|
+
className: 'radio-input',
|
|
9
|
+
jsx: ["RadioInput"],
|
|
10
|
+
base: radioInputBase,
|
|
11
|
+
variants: {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
})
|
|
@@ -0,0 +1,115 @@
|
|
|
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: { base: 'slate.0', _dark: 'slate.90' },
|
|
23
|
+
transitionProperty: 'border-color, background-color',
|
|
24
|
+
transitionDuration: '200ms',
|
|
25
|
+
transitionTimingFunction: 'ease-in-out',
|
|
26
|
+
borderWidth: '2',
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
borderColor: { base: 'slate.20', _dark: 'slate.40' },
|
|
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
|
+
},
|
|
52
|
+
|
|
53
|
+
"& ~ [name='circle-check']": {
|
|
54
|
+
display: 'inline-grid',
|
|
55
|
+
position: 'absolute',
|
|
56
|
+
filter: { base: 'invert(100%)', _dark: 'invert(0%)' },
|
|
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
|
+
},
|
|
73
|
+
"& ~ [name='toggle-bg']":{
|
|
74
|
+
bg: { base: 'slate.90', _dark: 'slate.0' },
|
|
75
|
+
borderColor: { base: 'slate.90 !important', _dark: 'slate.0 !important' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
_error:{
|
|
79
|
+
"& ~ [name='toggle-bg']":{
|
|
80
|
+
borderColor: 'error.default',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
_focusVisible: {
|
|
85
|
+
appearance: 'none',
|
|
86
|
+
opacity: 1,
|
|
87
|
+
outlineColor: { base: 'slate.80', _dark: 'slate.5' },
|
|
88
|
+
outlineOffset: 1,
|
|
89
|
+
outlineWidth: 2,
|
|
90
|
+
outlineStyle: 'solid',
|
|
91
|
+
rounded: '24',
|
|
92
|
+
w: '40',
|
|
93
|
+
h: '24',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
indicator: {
|
|
98
|
+
display: 'none',
|
|
99
|
+
w: '24',
|
|
100
|
+
h: '24',
|
|
101
|
+
transitionProperty: 'border-color, background-color',
|
|
102
|
+
transitionDuration: '200ms',
|
|
103
|
+
transitionTimingFunction: 'ease-in-out',
|
|
104
|
+
"&:is([name='circle'])": {
|
|
105
|
+
fill: { base: 'slate.20', _dark: 'slate.40' },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const toggleRecipe = defineSlotRecipe({
|
|
111
|
+
className: 'toggle',
|
|
112
|
+
jsx: ['toggle'],
|
|
113
|
+
slots: ['container', 'input', 'indicator', 'background'],
|
|
114
|
+
base: toggleBase,
|
|
115
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
2
|
+
|
|
3
|
+
const toggleInputBase = {
|
|
4
|
+
display: 'grid',
|
|
5
|
+
gap: '8',
|
|
6
|
+
gridTemplateColumns: '40px auto',
|
|
7
|
+
userSelect: 'none',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const toggleInputRecipe = defineRecipe({
|
|
11
|
+
className: 'toggle-input',
|
|
12
|
+
jsx: ["ToggleInput"],
|
|
13
|
+
base: toggleInputBase,
|
|
14
|
+
variants: {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
})
|
package/src/utils/splitProps.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { splitCssProps } from '@styled-system/jsx';
|
|
2
|
-
import { css } from '@styled-system/css';
|
|
2
|
+
import { css, cx } from '@styled-system/css';
|
|
3
3
|
|
|
4
4
|
export const splitProps = (
|
|
5
|
-
props: Record<string, any
|
|
5
|
+
props: Record<string, any>,
|
|
6
6
|
): [string, Record<string, any>] => {
|
|
7
7
|
const [cssProps, otherProps] = splitCssProps(props);
|
|
8
8
|
const { css: cssProp, ...styleProps } = cssProps;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
const generatedClassName: string = css(cssProp, styleProps);
|
|
11
|
+
const existingClassName = otherProps.className || '';
|
|
12
|
+
|
|
13
|
+
const mergedClassName = cx(existingClassName, generatedClassName);
|
|
14
|
+
|
|
15
|
+
const { className, ...remainingProps } = otherProps;
|
|
16
|
+
|
|
17
|
+
return [mergedClassName, remainingProps];
|
|
18
|
+
};
|