@cieloazul310/digital-go-pandacss-preset 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +20 -0
  2. package/README.md +30 -0
  3. package/dist/index.d.mts +8 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.js +3022 -0
  6. package/dist/index.mjs +2989 -0
  7. package/eslint.config.mjs +6 -0
  8. package/package.json +60 -0
  9. package/src/anatomy.ts +41 -0
  10. package/src/index.ts +32 -0
  11. package/src/recipes/accordion.ts +128 -0
  12. package/src/recipes/breadcrumb.ts +64 -0
  13. package/src/recipes/button.ts +192 -0
  14. package/src/recipes/checkbox.ts +297 -0
  15. package/src/recipes/disclosure.ts +98 -0
  16. package/src/recipes/divider.ts +21 -0
  17. package/src/recipes/drawer.ts +126 -0
  18. package/src/recipes/error-text.ts +16 -0
  19. package/src/recipes/hamburger-menu-button.ts +45 -0
  20. package/src/recipes/index.ts +71 -0
  21. package/src/recipes/input-text.ts +76 -0
  22. package/src/recipes/input.ts +81 -0
  23. package/src/recipes/label.ts +32 -0
  24. package/src/recipes/legend.ts +44 -0
  25. package/src/recipes/link.ts +66 -0
  26. package/src/recipes/list.ts +11 -0
  27. package/src/recipes/menu-item.ts +99 -0
  28. package/src/recipes/menu-list.ts +67 -0
  29. package/src/recipes/menu.ts +101 -0
  30. package/src/recipes/notification-banner.ts +246 -0
  31. package/src/recipes/ordered-list.ts +23 -0
  32. package/src/recipes/radio-group.ts +74 -0
  33. package/src/recipes/radio.ts +227 -0
  34. package/src/recipes/requirement-badge.ts +29 -0
  35. package/src/recipes/resource-list.ts +122 -0
  36. package/src/recipes/select-box.ts +81 -0
  37. package/src/recipes/select.ts +117 -0
  38. package/src/recipes/support-text.ts +16 -0
  39. package/src/recipes/table.ts +146 -0
  40. package/src/recipes/tabs.ts +90 -0
  41. package/src/recipes/textarea.ts +63 -0
  42. package/src/recipes/tree-view.ts +89 -0
  43. package/src/recipes/unordered-list.ts +19 -0
  44. package/src/recipes/utility-link.ts +56 -0
  45. package/tsconfig.json +4 -0
  46. package/tsup.config.ts +9 -0
@@ -0,0 +1,246 @@
1
+ /**
2
+ * source:
3
+ * https://github.com/digital-go-jp/design-system-example-components/tree/main/src/components/NotificationBanner
4
+ * inspired by Park UI
5
+ * https://park-ui.com/react/docs/components/alert
6
+ */
7
+ import { defineSlotRecipe } from "@pandacss/dev";
8
+ import { notificationBannerAnatomy } from "../anatomy";
9
+
10
+ export default defineSlotRecipe({
11
+ className: "notification-banner",
12
+ slots: notificationBannerAnatomy.keys(),
13
+ base: {
14
+ root: {
15
+ /**
16
+ * [--icon-size:calc(24/16*1rem)] desktop:[--icon-size:calc(36/16*1rem)]
17
+ */
18
+ "--icon-size": {
19
+ base: "calc(24 / 16 * 1rem)",
20
+ md: "calc(36 / 16 * 1rem)",
21
+ },
22
+ "--icon-scale": {
23
+ base: 24 / 36,
24
+ md: 1,
25
+ },
26
+ /**
27
+ * p-4 desktop:p-6 border-current
28
+ */
29
+ p: { base: 4, md: 6 },
30
+ borderColor: "currentcolor",
31
+ /**
32
+ * grid grid-cols-[var(--icon-size)_1fr_minmax(0,auto)]
33
+ * gap-x-3 desktop:gap-x-6 gap-y-4
34
+ */
35
+ display: "grid",
36
+ gridTemplateColumns: "var(--icon-size) 1fr minmax(0, auto)",
37
+ columnGap: { base: 3, md: 6 },
38
+ rowGap: 4,
39
+ },
40
+ header: {
41
+ /**
42
+ * grid grid-cols-subgrid col-start-2 -col-end-1 place-items-start
43
+ [&>*:last-child]:-col-end-1
44
+ */
45
+ display: "grid",
46
+ gridTemplateColumns: "subgrid",
47
+ gridColumnStart: 2,
48
+ gridColumnEnd: -1,
49
+ placeItems: "start",
50
+ "& > *:last-child": {
51
+ gridColumnEnd: -1,
52
+ },
53
+ },
54
+ icon: {
55
+ /**
56
+ * mt-[calc(2/16*1rem)] desktop:mt-0
57
+ */
58
+ mt: { base: "calc(2 / 16 * 1rem)", md: 0 },
59
+ /**
60
+ * h-auto max-w-full
61
+ */
62
+ height: "auto",
63
+ maxWidth: "full",
64
+ /**
65
+ * icon element
66
+ * instead of icon component
67
+ */
68
+ _before: {
69
+ content: '""',
70
+ display: "block",
71
+ bg: "currentColor",
72
+ width: "36px",
73
+ height: "36px",
74
+ transformOrigin: "left center",
75
+ transform: "scale(var(--icon-scale))",
76
+ },
77
+ },
78
+ close: {
79
+ /**
80
+ * inline-flex items-center gap-0.5
81
+ * -mt-2 -mr-3 desktop:mt-0 desktop:mr-0 desktop:px-2 desktop:py-0.5
82
+ */
83
+ display: "inline-flex",
84
+ alignItems: "center",
85
+ gap: 0.5,
86
+ mt: { base: -2, md: 0 },
87
+ mr: { base: -3, md: 0 },
88
+ px: { base: 0, md: 2 },
89
+ py: { base: 0, md: 0.5 },
90
+ /**
91
+ * text-solid-gray-900
92
+ */
93
+ color: "solid-gray.900",
94
+ /**
95
+ * border border-transparent hover:border-solid-gray-900 rounded-8 focus-visible:border-transparent
96
+ */
97
+ borderWidth: "1px",
98
+ borderColor: {
99
+ base: "transparent",
100
+ _hover: "solid-gray.900",
101
+ _focusVisible: "transparent",
102
+ },
103
+ rounded: 8,
104
+ /**
105
+ * focus-visible:outline focus-visible:outline-4 focus-visible:outline-black focus-visible:outline-offset-[calc(2/16*1rem)]
106
+ * focus-visible:ring-[calc(2/16*1rem)] focus-visible:ring-yellow-300 focus-visible:bg-yellow-300
107
+ *
108
+ */
109
+ _focusVisible: {
110
+ outlineStyle: "solid",
111
+ outlineWidth: "4px",
112
+ outlineColor: "black",
113
+ outlineOffset: "calc(2 / 16 * 1rem)",
114
+ focusRing: "calc(2 / 16 * 1rem)",
115
+ },
116
+ },
117
+ heading: {
118
+ /**
119
+ * text-solid-gray-900 col-start-1 desktop:mt-0.5
120
+ * text-std-17B-170 desktop:text-std-20B-160
121
+ *
122
+ * @todo
123
+ * std-20B-160 doesn't exist and replace it to std-20B-150
124
+ */
125
+ textStyle: { base: "std-17B-170", md: "std-20B-150" },
126
+ color: "solid-gray.900",
127
+ gridColumnStart: 1,
128
+ mt: { base: "auto", md: 0.5 },
129
+ },
130
+ body: {
131
+ /**
132
+ * col-start-1 -col-end-1 desktop:col-start-2 text-std-16N-170 text-solid-gray-800
133
+ */
134
+ gridColumnStart: { base: 1, md: 2 },
135
+ gridColumnEnd: -1,
136
+ textStyle: "std-16N-170",
137
+ color: "solid-gray.800",
138
+ },
139
+ },
140
+ variants: {
141
+ type: {
142
+ success: {
143
+ root: {
144
+ /**
145
+ * text-success-2 [--color-chip-color:currentColor]
146
+ */
147
+ color: "success.2",
148
+ "--color-chip-color": "currentColor",
149
+ },
150
+ icon: {
151
+ _before: {
152
+ clipPath:
153
+ "path('M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM14.4 27L5.4 18L7.938 15.462L14.4 21.906L28.062 8.244L30.6 10.8L14.4 27Z')",
154
+ },
155
+ },
156
+ },
157
+ error: {
158
+ root: {
159
+ /**
160
+ * text-error-1 [--color-chip-color:currentColor]
161
+ */
162
+ color: "error.1",
163
+ "--color-chip-color": "currentColor",
164
+ },
165
+ icon: {
166
+ _before: {
167
+ clipPath:
168
+ "path('M24.2525 33H11.7475L3 24.2525V11.7475L11.7475 3H24.2525L33 11.7475V24.2525L24.2525 33Z')",
169
+ },
170
+ },
171
+ },
172
+ warning: {
173
+ root: {
174
+ /**
175
+ * text-warning-yellow-2 [--color-chip-color:theme(colors.yellow.400)]
176
+ */
177
+ color: "warning.yellow.2",
178
+ "--color-chip-color": "{colors.yellow.400}",
179
+ },
180
+ icon: {
181
+ _before: {
182
+ clipPath:
183
+ "path('M0 34.0909H36L18 3L0 34.0909ZM19.6364 29.1818H16.3636V25.9091H19.6364V29.1818ZM19.6364 22.6364H16.3636V16.0909H19.6364V22.6364Z')",
184
+ },
185
+ },
186
+ },
187
+ info1: {
188
+ root: {
189
+ /**
190
+ * text-blue-900 [--color-chip-color:currentColor]
191
+ */
192
+ color: "blue.900",
193
+ "--color-chip-color": "currentColor",
194
+ },
195
+ icon: {
196
+ _before: {
197
+ clipPath:
198
+ "path('M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM19.8 27H16.2V16.2H19.8V27ZM19.8 12.6H16.2V9H19.8V12.6Z')",
199
+ },
200
+ },
201
+ },
202
+ info2: {
203
+ root: {
204
+ /**
205
+ * text-solid-gray-536 [--color-chip-color:currentColor]
206
+ */
207
+ color: "solid-gray.536",
208
+ "--color-chip-color": "currentColor",
209
+ },
210
+ icon: {
211
+ _before: {
212
+ clipPath:
213
+ "path('M18 0C8.064 0 0 8.064 0 18C0 27.936 8.064 36 18 36C27.936 36 36 27.936 36 18C36 8.064 27.936 0 18 0ZM19.8 27H16.2V16.2H19.8V27ZM19.8 12.6H16.2V9H19.8V12.6Z')",
214
+ },
215
+ },
216
+ },
217
+ },
218
+ bannerStyle: {
219
+ standard: {
220
+ root: {
221
+ /**
222
+ * border-[3px] rounded-12
223
+ */
224
+ borderWidth: "3px",
225
+ rounded: 12,
226
+ },
227
+ },
228
+ "color-chip": {
229
+ root: {
230
+ /**
231
+ * border-2 !pl-6 desktop:!pl-10
232
+ * shadow-[inset_8px_0_0_0_var(--color-chip-color)]
233
+ * desktop:shadow-[inset_16px_0_0_0_var(--color-chip-color)]
234
+ */
235
+ borderWidth: "2px",
236
+ pl: { base: 6, md: 10 },
237
+ shadow: "inset 16px 0 0 0 var(--color-chip-color)",
238
+ },
239
+ },
240
+ },
241
+ },
242
+ defaultVariants: {
243
+ type: "info1",
244
+ bannerStyle: "standard",
245
+ },
246
+ });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * source:
3
+ * https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Ol/Ol.tsx
4
+ */
5
+ import { defineRecipe } from "@pandacss/dev";
6
+
7
+ export default defineRecipe({
8
+ className: "ordered-list",
9
+ base: {
10
+ /**
11
+ * pl-8 list-[revert]
12
+ */
13
+ pl: 8,
14
+ listStyle: "revert",
15
+ /**
16
+ * [&_:where(ol,ul)]:mt-1 [&_:where(ol,ul)]:-mb-1
17
+ */
18
+ "&:where(ol,ul)": {
19
+ mt: 1,
20
+ mb: -1,
21
+ },
22
+ },
23
+ });
@@ -0,0 +1,74 @@
1
+ /**
2
+ * source:
3
+ * https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Radio/Radio.tsx
4
+ */
5
+ import { defineSlotRecipe } from "@pandacss/dev";
6
+ import { anatomy as radioGroupAnatomy } from "@ark-ui/anatomy/radio-group";
7
+ import radio from "./radio";
8
+
9
+ export default defineSlotRecipe({
10
+ className: "radio-group",
11
+ slots: radioGroupAnatomy.keys(),
12
+ base: {
13
+ root: {
14
+ display: "flex",
15
+ _vertical: {
16
+ flexDirection: "column",
17
+ gap: 0,
18
+ },
19
+ _horizonal: {
20
+ flexDirection: "row",
21
+ gap: 4,
22
+ },
23
+ },
24
+ item: {
25
+ ...radio.base?.item,
26
+ },
27
+ itemControl: {
28
+ ...radio.base?.itemControl,
29
+ },
30
+ itemText: {
31
+ ...radio.base?.itemText,
32
+ },
33
+ },
34
+ variants: {
35
+ size: {
36
+ sm: {
37
+ item: {
38
+ ...radio.variants?.size?.sm?.item,
39
+ },
40
+ itemControl: {
41
+ ...radio.variants?.size?.sm?.itemControl,
42
+ },
43
+ itemText: {
44
+ ...radio.variants?.size?.sm?.itemText,
45
+ },
46
+ },
47
+ md: {
48
+ item: {
49
+ ...radio.variants?.size?.md?.item,
50
+ },
51
+ itemControl: {
52
+ ...radio.variants?.size?.md?.itemControl,
53
+ },
54
+ itemText: {
55
+ ...radio.variants?.size?.md?.itemText,
56
+ },
57
+ },
58
+ lg: {
59
+ item: {
60
+ ...radio.variants?.size?.lg?.item,
61
+ },
62
+ itemControl: {
63
+ ...radio.variants?.size?.lg?.itemControl,
64
+ },
65
+ itemText: {
66
+ ...radio.variants?.size?.lg?.itemText,
67
+ },
68
+ },
69
+ },
70
+ },
71
+ defaultVariants: {
72
+ size: "sm",
73
+ },
74
+ });
@@ -0,0 +1,227 @@
1
+ /**
2
+ * source:
3
+ * https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Radio/Radio.tsx
4
+ */
5
+ import { defineSlotRecipe } from "@pandacss/dev";
6
+
7
+ export default defineSlotRecipe({
8
+ className: "radio",
9
+ slots: ["item", "itemControl", "itemText"],
10
+ base: {
11
+ item: {
12
+ /**
13
+ * flex w-fit items-start py-2
14
+ */
15
+ display: "flex",
16
+ width: "fit-content",
17
+ alignItems: "start",
18
+ py: 2,
19
+ },
20
+ itemControl: {
21
+ /**
22
+ * flex items-center justify-center shrink-0 rounded-full
23
+ * has-[input:hover:not(:focus):not([aria-disabled="true"])]:bg-solid-gray-420
24
+ */
25
+ /*
26
+ display: "flex",
27
+ alignItems: "center",
28
+ justifyContent: "center",
29
+ flexShrink: 0,
30
+ rounded: "full",
31
+ */
32
+ /**
33
+ * appearance-none size-[calc(5/6*100%)] rounded-full
34
+ */
35
+ appearance: "none",
36
+ rounded: "full",
37
+ width: "calc(var(--radio-size) * 5 / 6)",
38
+ height: "calc(var(--radio-size) * 5 / 6)",
39
+ m: "calc(var(--radio-size) / 12)",
40
+ flexShrink: 0,
41
+ /**
42
+ * bg-white aria-disabled:!bg-solid-gray-50
43
+ */
44
+ bg: { base: "white", _disabled: "solid-gray.50" },
45
+ borderColor: {
46
+ /**
47
+ * border-solid-gray-600
48
+ * hover:border-black
49
+ * checked:border-blue-900
50
+ * checked:hover:border-blue-1100
51
+ * forced-colors:!border-[ButtonText] forced-colors:checked:!border-[Highlight]
52
+ */
53
+ base: "solid-gray.600",
54
+ _hover: "black",
55
+ _highContrast: { base: "ButtonText" },
56
+ _checked: {
57
+ base: "keyColor.900",
58
+ _hover: "keyColor.1100",
59
+ _disabled: "solid-gray.300",
60
+ _highContrast: "Highlight",
61
+ },
62
+ /**
63
+ * data-[error]:border-error-1 data-[error]:hover:border-red-1000
64
+ */
65
+ _invalid: { base: "error.1", _hover: "red.1000" },
66
+ /**
67
+ * aria-disabled:!border-solid-gray-300
68
+ * forced-colors:aria-disabled:!border-[GrayText]
69
+ */
70
+ _disabled: { base: "solid-gray.300", _highContrast: "GrayText" },
71
+ },
72
+ /**
73
+ * outline on hover
74
+ * has-[input:hover:not(:focus):not([aria-disabled="true"])]:bg-solid-gray-420
75
+ */
76
+ '&:is(:hover, [data-hover]):not(:focus):not([aria-disabled="true"])': {
77
+ outlineStyle: "solid",
78
+ outlineWidth: "calc(var(--radio-size) / 12)",
79
+ outlineColor: "solid-gray.420",
80
+ },
81
+ /**
82
+ * focus:outline focus:outline-4 focus:outline-black
83
+ * focus:outline-offset-[calc(2/16*1rem)]
84
+ * focus:ring-[calc(2/16*1rem)] focus:ring-yellow-300
85
+ */
86
+ _focus: {
87
+ outlineStyle: "solid",
88
+ outlineWidth: "4px",
89
+ outlineColor: "black",
90
+ outlineOffset: "calc(2 / 16 * 1rem)",
91
+ focusRing: "calc(2 / 16 * 1rem)",
92
+ },
93
+ _before: {
94
+ /**
95
+ * before:hidden
96
+ * before:size-full
97
+ * before:[clip-path:circle(calc(5/16*100%))]
98
+ * before:bg-white
99
+ */
100
+ content: '""',
101
+ display: "none",
102
+ width: "full",
103
+ height: "full",
104
+ clipPath: "circle(calc(5 / 16 * 100%))",
105
+ bg: "white",
106
+ },
107
+ _checked: {
108
+ /**
109
+ * checked:before:block
110
+ * checked:before:bg-blue-900 checked:hover:before:bg-blue-1100
111
+ * data-[error]:checked:before:bg-error-1
112
+ * data-[error]:checked:hover:before:bg-red-1000
113
+ * aria-disabled:checked:before:!bg-solid-gray-300
114
+ * forced-colors:checked:before:!bg-[Highlight]
115
+ * forced-colors:aria-disabled:checked:before:!bg-[GrayText]
116
+ */
117
+ _before: {
118
+ display: "block",
119
+ bg: "keyColor.900",
120
+ _hover: "keyColor.1100",
121
+ _invalid: {
122
+ base: "error.1",
123
+ _hover: "red.1000",
124
+ },
125
+ _highContrast: "Highlight",
126
+ },
127
+ _disabled: {
128
+ _before: {
129
+ base: "solid-gray.300",
130
+ _highContrast: "GrayText",
131
+ },
132
+ },
133
+ },
134
+ },
135
+ itemText: {
136
+ /**
137
+ * text-solid-gray-800
138
+ */
139
+ color: "solid-gray.800",
140
+ },
141
+ },
142
+ variants: {
143
+ size: {
144
+ sm: {
145
+ item: {
146
+ /**
147
+ * data-[size=sm]:gap-1
148
+ */
149
+ gap: 1,
150
+ },
151
+ itemControl: {
152
+ /**
153
+ * data-[size=sm]:size-6
154
+ */
155
+ "--radio-size": "{spacing.6}",
156
+ /**
157
+ * data-[size=sm]:border-[calc(2/16*1rem)]
158
+ */
159
+ borderWidth: "calc(2 / 16 * 1rem)",
160
+ },
161
+ itemText: {
162
+ /**
163
+ * data-[size=sm]:pt-px
164
+ * data-[size=sm]:text-dns-16N-130
165
+ */
166
+ pt: "1px",
167
+ textStyle: "dns-16N-130",
168
+ },
169
+ },
170
+ md: {
171
+ item: {
172
+ /**
173
+ * data-[size=md]:gap-2
174
+ */
175
+ gap: 2,
176
+ },
177
+ itemControl: {
178
+ /**
179
+ * data-[size=md]:size-8
180
+ */
181
+ "--radio-size": "{spacing.8}",
182
+ /**
183
+ * data-[size=md]:border-[calc(2/16*1rem)]
184
+ */
185
+ borderWidth: "calc(2 / 16 * 1rem)",
186
+ },
187
+ itemText: {
188
+ /**
189
+ * data-[size=md]:pt-1
190
+ * data-[size=md]:text-dns-16N-130
191
+ */
192
+ pt: 1,
193
+ textStyle: "dns-16N-130",
194
+ },
195
+ },
196
+ lg: {
197
+ item: {
198
+ /**
199
+ * data-[size=lg]:gap-3
200
+ */
201
+ gap: 3,
202
+ },
203
+ itemControl: {
204
+ /**
205
+ * data-[size=lg]:size-11
206
+ */
207
+ "--radio-size": "{spacing.11}",
208
+ /**
209
+ * data-[size=lg]:border-[calc(3/16*1rem)]
210
+ */
211
+ borderWidth: "calc(3 / 16 * 1rem)",
212
+ },
213
+ itemText: {
214
+ /**
215
+ * data-[size=lg]:pt-2.5
216
+ * data-[size=lg]:text-dns-17N-130
217
+ */
218
+ pt: 2.5,
219
+ textStyle: "dns-17N-130",
220
+ },
221
+ },
222
+ },
223
+ },
224
+ defaultVariants: {
225
+ size: "sm",
226
+ },
227
+ });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * source:
3
+ * https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/RequirementBadge/RequirementBadge.tsx
4
+ */
5
+ import { defineRecipe } from "@pandacss/dev";
6
+
7
+ export default defineRecipe({
8
+ className: "requirement-badge",
9
+ base: {
10
+ /**
11
+ * text-oln-16N-100 text-red-800
12
+ */
13
+ textStyle: "oln-16N-100",
14
+ color: "red.800",
15
+ },
16
+ variants: {
17
+ isOptional: {
18
+ true: {
19
+ /**
20
+ * data-[is-optional]:text-solid-gray-800
21
+ */
22
+ color: "solid-gray.800",
23
+ },
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ isOptional: false,
28
+ },
29
+ });