cetec-design-system 0.0.4 → 0.0.6

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/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "cetec-design-system",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
+ "imports": {
6
+ "~/*": "./src/*",
7
+ "@styled-system/*": "./styled-system/*"
8
+ },
5
9
  "files": [
6
10
  "./styled-system/*",
7
11
  "./src/index.ts",
8
12
  "./src/storybook/*",
9
13
  "./src/utils/*",
10
14
  "./public/*",
11
- "./src/components/*"
15
+ "./src/components/*",
16
+ "./src/styles/*",
17
+ "./src/recipes/*"
12
18
  ],
13
19
  "scripts": {
14
20
  "cssgen": "npx panda cssgen 'src/**/*.css'",
@@ -0,0 +1,16 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const boxBase = {
4
+ };
5
+
6
+ const boxVariants = {
7
+ };
8
+
9
+ export const boxRecipe = defineRecipe({
10
+ className: 'box',
11
+ jsx: ['Box'],
12
+ base: boxBase,
13
+ variants: boxVariants,
14
+ defaultVariants: {
15
+ },
16
+ });
@@ -0,0 +1,220 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const buttonBase = {
4
+ position: 'relative',
5
+ appearance: 'none',
6
+ minWidth: '0',
7
+ transitionDuration: 'fast',
8
+ transitionProperty: 'background, border-color, color, box-shadow',
9
+ transitionTimingFunction: 'default',
10
+ userSelect: 'none',
11
+ verticalAlign: 'middle',
12
+ display: 'flex',
13
+ alignItems: 'center',
14
+ gap: '4',
15
+ fontFamily: 'body',
16
+ fontSize: '16',
17
+ fontWeight: 'medium',
18
+ lineHeight: 'default',
19
+ borderWidth: '1',
20
+ borderStyle: 'solid',
21
+ borderColor: 'transparent',
22
+ borderRadius: '4',
23
+ outlineWidth: '2',
24
+ outlineStyle: 'solid',
25
+ outlineColor: 'transparent',
26
+ outlineOffset: '1',
27
+ textDecoration: 'none',
28
+ whiteSpace: 'nowrap',
29
+ cursor: 'pointer',
30
+ _disabled: {
31
+ opacity: 0.4,
32
+ cursor: 'not-allowed',
33
+ },
34
+ _focusVisible: {
35
+ outlineColor: { base: 'slate.80', _dark: 'slate.5' },
36
+ },
37
+ '& svg': {
38
+ fill: 'current',
39
+ },
40
+ };
41
+
42
+ const buttonVariants = {
43
+ variant: {
44
+ primary: {
45
+ bg: { base: 'slate.90', _dark: 'slate.5' },
46
+ color: { base: 'slate.0', _dark: 'slate.90' },
47
+ _hover: {
48
+ bg: { base: 'slate.70', _dark: 'slate.10' },
49
+ },
50
+ _active: {
51
+ bg: { base: 'slate.100', _dark: 'slate.20' },
52
+ },
53
+ _disabled: {
54
+ _hover: {
55
+ bg: { base: 'slate.90', _dark: 'slate.5' },
56
+ },
57
+ },
58
+ _selected: {
59
+ bg: { base: 'slate.5', _dark: 'slate.90' },
60
+ color: { base: 'slate.90', _dark: 'slate.0' },
61
+ },
62
+ },
63
+ standard: {
64
+ bg: { base: 'slate.5', _dark: 'slate.70' },
65
+ color: { base: 'slate.90', _dark: 'slate.0' },
66
+ _hover: {
67
+ bg: { base: 'slate.10', _dark: 'slate.60' },
68
+ },
69
+ _active: {
70
+ bg: { base: 'slate.20', _dark: 'slate.80' },
71
+ },
72
+ _disabled: {
73
+ _hover: {
74
+ bg: { base: 'slate.5', _dark: 'slate.70' },
75
+ },
76
+ },
77
+ _selected: {
78
+ bg: { base: 'slate.90', _dark: 'slate.5' },
79
+ color: { base: 'slate.0', _dark: 'slate.90' },
80
+ },
81
+ },
82
+ hollow: {
83
+ bg: 'transparent',
84
+ borderColor: { base: 'slate.30', _dark: 'slate.60' },
85
+ color: { base: 'slate.90', _dark: 'slate.0' },
86
+ _hover: {
87
+ bg: { base: 'slate.10', _dark: 'slate.60' },
88
+ borderColor: { base: 'slate.10', _dark: 'slate.60' },
89
+ },
90
+ _active: {
91
+ bg: { base: 'slate.20', _dark: 'slate.80' },
92
+ borderColor: { base: 'slate.20', _dark: 'slate.80' },
93
+ },
94
+ _disabled: {
95
+ _hover: {
96
+ bg: 'transparent',
97
+ },
98
+ },
99
+ _selected: {
100
+ bg: { base: 'slate.90', _dark: 'slate.5' },
101
+ color: { base: 'slate.0', _dark: 'slate.90' },
102
+ borderColor: 'transparent',
103
+ },
104
+ },
105
+ ghost: {
106
+ bg: 'transparent',
107
+ color: { base: 'slate.90', _dark: 'slate.0' },
108
+ _hover: {
109
+ bg: { base: 'slate.10', _dark: 'slate.60' },
110
+ },
111
+ _active: {
112
+ bg: { base: 'slate.20', _dark: 'slate.70' },
113
+ },
114
+ _disabled: {
115
+ _hover: {
116
+ bg: 'transparent',
117
+ },
118
+ },
119
+ _selected: {
120
+ bg: { base: 'slate.90', _dark: 'slate.5' },
121
+ color: { base: 'slate.0', _dark: 'slate.90' },
122
+ },
123
+ },
124
+ cta: {
125
+ bg: { base: 'gold.20', _dark: 'gold.30' },
126
+ color: 'slate.90',
127
+ _hover: {
128
+ bg: { base: 'gold.10', _dark: 'gold.20' },
129
+ },
130
+ _active: {
131
+ bg: { base: 'gold.30', _dark: 'gold.40' },
132
+ },
133
+ _disabled: {
134
+ _hover: {
135
+ bg: { base: 'gold.20', _dark: 'gold.30' },
136
+ },
137
+ },
138
+ },
139
+ danger: {
140
+ bg: 'red.50',
141
+ color: 'slate.0',
142
+ _hover: {
143
+ bg: 'red.40',
144
+ },
145
+ _active: {
146
+ bg: 'red.60',
147
+ },
148
+ _disabled: {
149
+ _hover: {
150
+ bg: 'red.50',
151
+ },
152
+ },
153
+ },
154
+ },
155
+ };
156
+
157
+ export const buttonRecipe = defineRecipe({
158
+ className: 'button',
159
+ jsx: ['Button'],
160
+ base: buttonBase,
161
+ variants: {
162
+ ...buttonVariants,
163
+ size: {
164
+ medium: {
165
+ fontSize: '16',
166
+ py: '3',
167
+ px: '10',
168
+ },
169
+ large: {
170
+ fontSize: '16',
171
+ py: '7',
172
+ px: '12',
173
+ },
174
+ small: {
175
+ fontSize: '14',
176
+ py: '0',
177
+ px: '8',
178
+ '& svg': {
179
+ mt: '-1',
180
+ mb: '-1',
181
+ },
182
+ },
183
+ },
184
+ },
185
+ defaultVariants: {
186
+ variant: 'standard',
187
+ size: 'medium',
188
+ },
189
+ });
190
+
191
+ export const iconButtonRecipe = defineRecipe({
192
+ className: 'icon-button',
193
+ jsx: ['IconButton'],
194
+ base: buttonBase,
195
+ variants: {
196
+ ...buttonVariants,
197
+ size: {
198
+ medium: {
199
+ fontSize: '16',
200
+ p: '3',
201
+ },
202
+ large: {
203
+ fontSize: '16',
204
+ p: '7',
205
+ },
206
+ small: {
207
+ fontSize: '14',
208
+ p: '0',
209
+ '& svg': {
210
+ mt: '-1',
211
+ mb: '-1',
212
+ },
213
+ },
214
+ },
215
+ },
216
+ defaultVariants: {
217
+ variant: 'standard',
218
+ size: 'medium',
219
+ },
220
+ });
@@ -0,0 +1,88 @@
1
+ import { defineSlotRecipe } from "@pandacss/dev";
2
+
3
+ export const checkBoxRecipe = defineSlotRecipe({
4
+ className: "checkbox",
5
+ jsx: ['CheckBox'],
6
+ slots: ["container", "input", "indicator"],
7
+ base: {
8
+ container: {
9
+ position: "relative",
10
+ display: "inline-grid",
11
+ gridTemplateColumns: "auto 1fr",
12
+ gap: 4,
13
+ alignItems: "start",
14
+ cursor: "pointer",
15
+ userSelect: "none",
16
+ },
17
+ input: {
18
+ position: "absolute",
19
+ opacity: 0,
20
+ width: "full",
21
+ height: "full",
22
+ margin: "0",
23
+ padding: "0",
24
+ zIndex: 1,
25
+ cursor: "inherit",
26
+ "& ~ [name='checkbox']": {
27
+ display: "inline-grid",
28
+ },
29
+ _checked: {
30
+ "& ~ [name='checkbox-checked']": {
31
+ display: "inline-grid",
32
+ fill: { base: "slate.90", _dark: "slate.0" },
33
+ },
34
+ "& ~ [name='checkbox']": {
35
+ display: "none",
36
+ },
37
+ },
38
+ _indeterminate: {
39
+ "& ~ [name='checkbox-indeterminate']": {
40
+ display: "inline-grid",
41
+ fill: { base: "slate.90", _dark: "slate.0" },
42
+ _disabled: {
43
+ },
44
+ },
45
+ "& ~ [name='checkbox']": {
46
+ display: "none",
47
+ },
48
+ },
49
+ _disabled: {
50
+ "& ~ svg": {
51
+ opacity: 0.4,
52
+ pointerEvents: 'none',
53
+ cursor: 'none',
54
+ },
55
+ display: "inline-grid",
56
+ },
57
+ _error: {
58
+ display: "inline-grid",
59
+ "& ~ svg": {
60
+ fill: "red.50",
61
+ }
62
+ },
63
+ _focusVisible: {
64
+ "& ~ svg": {
65
+ outlineColor: { base: 'slate.80', _dark: 'slate.5' },
66
+ outlineOffset: -3,
67
+ borderRadius: 5,
68
+ outlineWidth: 1,
69
+ outlineStyle: 'solid',
70
+ },
71
+ },
72
+ },
73
+ indicator: {
74
+ placeContent: "center",
75
+ display: 'none',
76
+ width: 24,
77
+ height: 24,
78
+ "&:is([name='checkbox'])": {
79
+ display: "inline-grid",
80
+ fill: "slate.20",
81
+ },
82
+ },
83
+ },
84
+ variants: {
85
+ },
86
+ defaultVariants: {
87
+ },
88
+ });
@@ -0,0 +1,37 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const codeBase = {
4
+ bg: 'slate.80',
5
+ position: "relative",
6
+ overflow: "auto",
7
+ p: "4",
8
+ whiteSpace: "pre",
9
+ fontSize: "14",
10
+ };
11
+
12
+ const preBase = {
13
+ borderRadius: "8",
14
+ overflow: "hidden",
15
+ borderWidth: "0",
16
+ borderColor: "slate.60",
17
+ bg: "slate.80",
18
+ color: "slate.5",
19
+ px: "16",
20
+ py: "8",
21
+ my: "8",
22
+ whiteSpace: "pre",
23
+ };
24
+
25
+ export const codeRecipe = defineRecipe({
26
+ className: 'code',
27
+ jsx:['Code'],
28
+ base: codeBase,
29
+ });
30
+
31
+ export const preRecipe = defineRecipe({
32
+ className: 'pre',
33
+ jsx: ['Pre'],
34
+ base: preBase,
35
+ });
36
+
37
+
@@ -0,0 +1,40 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const dividerBase = {
4
+ '--divider-weight': 'sizes.1',
5
+ borderStyle: 'solid',
6
+ color: { base: 'slate.20', _dark: 'slate.80' },
7
+ borderColor: 'current',
8
+ minWidth: '1',
9
+ minHeight: '1',
10
+ };
11
+
12
+ const dividerVariants = {
13
+ direction: {
14
+ horizontal: {
15
+ width: 'full',
16
+ borderTopWidth: 'var(--divider-weight)',
17
+ },
18
+ vertical: {
19
+ height: 'full',
20
+ borderLeftWidth: 'var(--divider-weight)',
21
+ },
22
+ },
23
+ weight: {
24
+ thin: { '--divider-weight': 'sizes.1' },
25
+ medium: { '--divider-weight': 'sizes.2' },
26
+ thick: { '--divider-weight': 'sizes.4' },
27
+ thicker: { '--divider-weight': 'sizes.6' },
28
+ },
29
+ };
30
+
31
+ export const dividerRecipe = defineRecipe({
32
+ className: 'divider',
33
+ jsx: ['Divider'],
34
+ base: dividerBase,
35
+ variants: dividerVariants,
36
+ defaultVariants: {
37
+ direction: 'horizontal',
38
+ weight: 'thin',
39
+ },
40
+ });
@@ -0,0 +1,10 @@
1
+ export { buttonRecipe, iconButtonRecipe } from './button';
2
+ export { inputRecipe } from './input';
3
+ export { textareaRecipe } from './textarea';
4
+ export { textRecipe, headingRecipe, linkRecipe, labelRecipe } from './text';
5
+ export { checkBoxRecipe } from "./checkbox"
6
+ export { spinnerRecipe } from "./spinner"
7
+ export { dividerRecipe } from "./divider"
8
+ export { preRecipe, codeRecipe } from "./code"
9
+ export { boxRecipe } from './box';
10
+ export { radioRecipe } from './radio';
@@ -0,0 +1,56 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+ const inputBase = {
3
+ position: 'relative',
4
+ display: 'inline-grid',
5
+ verticalAlign: 'top',
6
+ alignItems: 'center',
7
+ padding: '0',
8
+ fontFamily: 'body',
9
+ fontSize: '16',
10
+ fontWeight: 'normal',
11
+ lineHeight: 'normal',
12
+ color: { base: 'slate.90', _osDark: 'slate.5' },
13
+ borderRadius: '8',
14
+ '& input': {
15
+ width: 'auto',
16
+ minWidth: '16',
17
+ maxWidth: 'full',
18
+ font: 'inherit',
19
+ py: '4',
20
+ px: '8',
21
+ m: '0',
22
+ resize: 'none',
23
+ appearance: 'none',
24
+ borderWidth: '1',
25
+ borderStyle: 'solid',
26
+ borderRadius: '4',
27
+ borderColor: 'transparent',
28
+ background: { base: 'slate.0', _osDark: 'slate.90' },
29
+ },
30
+ gridTemplateColumns: 'auto 1fr',
31
+ };
32
+
33
+ const inputVariants = {
34
+ variant: {
35
+ stacked: {
36
+ gridTemplateRows: 'auto 1fr',
37
+ alignItems: 'stretch',
38
+ '& input': {
39
+ gridArea: '2 / 1',
40
+ background: { base: 'slate.0', _osDark: 'slate.90' },
41
+ borderColor: { base: 'slate.40', _osDark: 'slate.50' },
42
+ },
43
+ },
44
+ internalLabel: {},
45
+ },
46
+ };
47
+
48
+ export const inputRecipe = defineRecipe({
49
+ className: 'input',
50
+ jsx: ['Input'],
51
+ base: inputBase,
52
+ variants: inputVariants,
53
+ defaultVariants: {
54
+ variant: 'stacked',
55
+ },
56
+ });
@@ -0,0 +1,71 @@
1
+ import { defineSlotRecipe } from "@pandacss/dev";
2
+
3
+ export const radioRecipe = defineSlotRecipe({
4
+ className: "radio",
5
+ jsx: ['Radio'],
6
+ slots: ["container", "input", "indicator"],
7
+ base: {
8
+ container: {
9
+ position: "relative",
10
+ display: "inline-grid",
11
+ gridTemplateColumns: "auto 1fr",
12
+ gap: 4,
13
+ alignItems: "start",
14
+ cursor: "pointer",
15
+ userSelect: "none",
16
+ },
17
+ input: {
18
+ position: "absolute",
19
+ opacity: 0 ,
20
+ width: "full",
21
+ height: "full",
22
+ margin: "0",
23
+ padding: "0",
24
+ zIndex: 1,
25
+ cursor: "inherit",
26
+ "& ~ [name='radio']": {
27
+ display: "inline-grid",
28
+ },
29
+ _checked: {
30
+ "& ~ [name='radio-checked']": {
31
+ display: "inline-grid",
32
+ fill: { base: "slate.90", _dark: "slate.0" },
33
+ },
34
+ "& ~ [name='radio']": {
35
+ display: "none",
36
+ },
37
+ },
38
+ _disabled: {
39
+ "& ~ svg": {
40
+ opacity: 0.4,
41
+ pointerEvents: 'none',
42
+ cursor: 'none',
43
+ },
44
+ display: "inline-grid",
45
+ },
46
+ _error: {
47
+ display: "inline-grid",
48
+ "& ~ svg": {
49
+ fill: "red.50",
50
+ }
51
+ },
52
+ _focusVisible: {
53
+ "& ~ [name='radio-focus']": {
54
+ display: 'inline-grid',
55
+ position: 'absolute',
56
+ fill: { base: 'slate.90', _dark: 'slate.1' },
57
+ },
58
+ },
59
+ },
60
+ indicator: {
61
+ placeContent: "center",
62
+ display: 'none',
63
+ width: 24,
64
+ height: 24,
65
+ "&:is([name='radio'])": {
66
+ display: "inline-grid",
67
+ fill: "slate.20",
68
+ },
69
+ },
70
+ },
71
+ })
@@ -0,0 +1,42 @@
1
+ import { defineRecipe } from '@pandacss/dev';
2
+
3
+ const spinnerBase = {
4
+ aspectRatio: 'square',
5
+ rounded: '100',
6
+ borderWidth: '3',
7
+ borderStyle: 'solid',
8
+ borderColor: 'transparent',
9
+ borderTopColor: 'slate.90',
10
+ borderBottomColor: 'slate.90',
11
+ animation: 'spin',
12
+ filter: 'invert(1)',
13
+ mixBlendMode: 'difference',
14
+ isolation: 'isolate',
15
+ };
16
+
17
+ const spinnerVariants = {
18
+ size: {
19
+ medium: {
20
+ height: '24',
21
+ minHeight: '24',
22
+ },
23
+ small: {
24
+ height: '16',
25
+ minHeight: '16',
26
+ },
27
+ large: {
28
+ height: '32',
29
+ minHeight: '32',
30
+ },
31
+ }
32
+ };
33
+
34
+ export const spinnerRecipe = defineRecipe({
35
+ className: 'spinner',
36
+ jsx:['Spinner'],
37
+ base: spinnerBase,
38
+ variants: spinnerVariants,
39
+ defaultVariants: {
40
+ size: 'medium',
41
+ },
42
+ });