@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.
- package/.turbo/turbo-build.log +20 -0
- package/README.md +30 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +3022 -0
- package/dist/index.mjs +2989 -0
- package/eslint.config.mjs +6 -0
- package/package.json +60 -0
- package/src/anatomy.ts +41 -0
- package/src/index.ts +32 -0
- package/src/recipes/accordion.ts +128 -0
- package/src/recipes/breadcrumb.ts +64 -0
- package/src/recipes/button.ts +192 -0
- package/src/recipes/checkbox.ts +297 -0
- package/src/recipes/disclosure.ts +98 -0
- package/src/recipes/divider.ts +21 -0
- package/src/recipes/drawer.ts +126 -0
- package/src/recipes/error-text.ts +16 -0
- package/src/recipes/hamburger-menu-button.ts +45 -0
- package/src/recipes/index.ts +71 -0
- package/src/recipes/input-text.ts +76 -0
- package/src/recipes/input.ts +81 -0
- package/src/recipes/label.ts +32 -0
- package/src/recipes/legend.ts +44 -0
- package/src/recipes/link.ts +66 -0
- package/src/recipes/list.ts +11 -0
- package/src/recipes/menu-item.ts +99 -0
- package/src/recipes/menu-list.ts +67 -0
- package/src/recipes/menu.ts +101 -0
- package/src/recipes/notification-banner.ts +246 -0
- package/src/recipes/ordered-list.ts +23 -0
- package/src/recipes/radio-group.ts +74 -0
- package/src/recipes/radio.ts +227 -0
- package/src/recipes/requirement-badge.ts +29 -0
- package/src/recipes/resource-list.ts +122 -0
- package/src/recipes/select-box.ts +81 -0
- package/src/recipes/select.ts +117 -0
- package/src/recipes/support-text.ts +16 -0
- package/src/recipes/table.ts +146 -0
- package/src/recipes/tabs.ts +90 -0
- package/src/recipes/textarea.ts +63 -0
- package/src/recipes/tree-view.ts +89 -0
- package/src/recipes/unordered-list.ts +19 -0
- package/src/recipes/utility-link.ts +56 -0
- package/tsconfig.json +4 -0
- package/tsup.config.ts +9 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Input/Input.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineSlotRecipe } from "@pandacss/dev";
|
|
6
|
+
import { anatomy as fieldAnatomy } from "@ark-ui/anatomy/field";
|
|
7
|
+
import errorText from "./error-text";
|
|
8
|
+
import input from "./input";
|
|
9
|
+
import label from "./label";
|
|
10
|
+
import selectBox from "./select-box";
|
|
11
|
+
import supportText from "./support-text";
|
|
12
|
+
import textarea from "./textarea";
|
|
13
|
+
|
|
14
|
+
const inputText = defineSlotRecipe({
|
|
15
|
+
className: "input-text",
|
|
16
|
+
description:
|
|
17
|
+
"インプットテキストコンポーネントは、名前や電話番号など、1行以内のテキストを入力する場合に使用します。",
|
|
18
|
+
slots: fieldAnatomy.keys(),
|
|
19
|
+
base: {
|
|
20
|
+
root: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
gap: 1.5,
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
...label.base,
|
|
27
|
+
},
|
|
28
|
+
input: {
|
|
29
|
+
...input.base,
|
|
30
|
+
},
|
|
31
|
+
textarea: {
|
|
32
|
+
...textarea.base,
|
|
33
|
+
},
|
|
34
|
+
select: {
|
|
35
|
+
...selectBox.base,
|
|
36
|
+
},
|
|
37
|
+
errorText: {
|
|
38
|
+
...errorText.base,
|
|
39
|
+
},
|
|
40
|
+
helperText: {
|
|
41
|
+
...supportText.base,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
variants: {
|
|
45
|
+
size: {
|
|
46
|
+
lg: {
|
|
47
|
+
label: { ...label.variants?.size?.lg },
|
|
48
|
+
input: { ...input.variants?.size?.lg },
|
|
49
|
+
select: { ...selectBox.variants?.size?.lg },
|
|
50
|
+
},
|
|
51
|
+
md: {
|
|
52
|
+
label: { ...label.variants?.size?.md },
|
|
53
|
+
input: { ...input.variants?.size?.md },
|
|
54
|
+
select: { ...selectBox.variants?.size?.md },
|
|
55
|
+
},
|
|
56
|
+
sm: {
|
|
57
|
+
label: { ...label.variants?.size?.sm },
|
|
58
|
+
input: { ...input.variants?.size?.sm },
|
|
59
|
+
select: { ...selectBox.variants?.size?.sm },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
invalid: {
|
|
63
|
+
true: {
|
|
64
|
+
input: { ...input.variants?.invalid?.true },
|
|
65
|
+
select: { ...selectBox.variants?.invalid?.true },
|
|
66
|
+
textarea: { ...textarea.variants?.invalid?.true },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
size: "lg",
|
|
72
|
+
invalid: false,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export default inputText;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Input/Input.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
6
|
+
|
|
7
|
+
export default defineRecipe({
|
|
8
|
+
className: "input",
|
|
9
|
+
description:
|
|
10
|
+
"インプットテキストコンポーネントは、名前や電話番号など、1行以内のテキストを入力する場合に使用します。",
|
|
11
|
+
base: {
|
|
12
|
+
/**
|
|
13
|
+
* max-w-full px-4 py-3 rounded-8
|
|
14
|
+
*/
|
|
15
|
+
// minWidth: "80px",
|
|
16
|
+
maxWidth: "full",
|
|
17
|
+
rounded: 8,
|
|
18
|
+
px: 4,
|
|
19
|
+
py: 3,
|
|
20
|
+
/**
|
|
21
|
+
* border border-solid-gray-600 hover:border-black
|
|
22
|
+
* aria-disabled:border-solid-gray-300
|
|
23
|
+
* aria-disabled:forced-colors:border-[GrayText]
|
|
24
|
+
*/
|
|
25
|
+
borderWidth: "1px",
|
|
26
|
+
borderColor: {
|
|
27
|
+
base: "solid-gray.600",
|
|
28
|
+
_hover: "black",
|
|
29
|
+
_disabled: { base: "solid-gray.300", _highContrast: "GrayText" },
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* bg-white text-oln-16N-100 text-solid-gray-800
|
|
33
|
+
* aria-disabled:bg-solid-gray-50 aria-disabled:text-solid-gray-420
|
|
34
|
+
* aria-disabled:forced-colors:text-[GrayText]
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
bg: { base: "white", _disabled: "solid-gray.50" },
|
|
38
|
+
color: {
|
|
39
|
+
base: "solid-gray.800",
|
|
40
|
+
_disabled: { base: "solid-gray.420", _highContrast: "GrayText" },
|
|
41
|
+
},
|
|
42
|
+
textStyle: "oln-16N-100",
|
|
43
|
+
/**
|
|
44
|
+
* focus:outline focus:outline-4 focus:outline-black
|
|
45
|
+
* focus:outline-offset-[calc(2/16*1rem)] focus:ring-[calc(2/16*1rem)] focus:ring-yellow-300
|
|
46
|
+
*/
|
|
47
|
+
_focus: {
|
|
48
|
+
outlineStyle: "solid",
|
|
49
|
+
outlineWidth: "4px",
|
|
50
|
+
outlineColor: "black",
|
|
51
|
+
outlineOffset: "calc(2 / 16 * 1rem)",
|
|
52
|
+
focusRing: "calc(2 / 16 * 1rem)",
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* aria-disabled:pointer-events-none
|
|
56
|
+
*/
|
|
57
|
+
pointerEvents: { base: "inherit", _disabled: "none" },
|
|
58
|
+
},
|
|
59
|
+
variants: {
|
|
60
|
+
size: {
|
|
61
|
+
/**
|
|
62
|
+
* data-[size=sm]:h-10 data-[size=md]:h-12 data-[size=lg]:h-14
|
|
63
|
+
*/
|
|
64
|
+
sm: { height: 10 },
|
|
65
|
+
md: { height: 12 },
|
|
66
|
+
lg: { height: 14 },
|
|
67
|
+
},
|
|
68
|
+
invalid: {
|
|
69
|
+
true: {
|
|
70
|
+
/**
|
|
71
|
+
* aria-[invalid=true]:border-error-1 aria-[invalid=true]:hover:border-red-1000
|
|
72
|
+
*/
|
|
73
|
+
borderColor: { base: "error.1", _hover: "red.1000" },
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
size: "lg",
|
|
79
|
+
invalid: false,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Label/Label.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
6
|
+
|
|
7
|
+
export default defineRecipe({
|
|
8
|
+
className: "label",
|
|
9
|
+
base: {
|
|
10
|
+
/**
|
|
11
|
+
* flex w-fit items-center gap-2 text-solid-gray-800
|
|
12
|
+
*/
|
|
13
|
+
display: "flex",
|
|
14
|
+
width: "fit-content",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: 2,
|
|
17
|
+
color: "solid-gray.800",
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
/**
|
|
22
|
+
* data-[size=sm]:text-std-16B-170 data-[size=md]:text-std-17B-170 data-[size=lg]:text-std-18B-160
|
|
23
|
+
*/
|
|
24
|
+
sm: { textStyle: "std-16B-170" },
|
|
25
|
+
md: { textStyle: "std-17B-170" },
|
|
26
|
+
lg: { textStyle: "std-18B-160" },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
size: "md",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Legend/Legend.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
6
|
+
|
|
7
|
+
export default defineRecipe({
|
|
8
|
+
className: "legend",
|
|
9
|
+
base: {
|
|
10
|
+
/**
|
|
11
|
+
* flex w-fit items-center gap-2 text-solid-gray-800
|
|
12
|
+
*/
|
|
13
|
+
display: "flex",
|
|
14
|
+
width: "fit-content",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: 2,
|
|
17
|
+
color: "solid-gray.800",
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
sm: {
|
|
22
|
+
/**
|
|
23
|
+
* data-[size=sm]:text-std-16B-170
|
|
24
|
+
*/
|
|
25
|
+
textStyle: "std-16B-170",
|
|
26
|
+
},
|
|
27
|
+
md: {
|
|
28
|
+
/**
|
|
29
|
+
* data-[size=md]:text-std-17B-170
|
|
30
|
+
*/
|
|
31
|
+
textStyle: "std-17B-170",
|
|
32
|
+
},
|
|
33
|
+
lg: {
|
|
34
|
+
/**
|
|
35
|
+
* data-[size=lg]:text-std-18B-160
|
|
36
|
+
*/
|
|
37
|
+
textStyle: "std-18B-160",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
size: "md",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/Link/Link.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
6
|
+
|
|
7
|
+
export default defineRecipe({
|
|
8
|
+
className: "link",
|
|
9
|
+
description:
|
|
10
|
+
"リンクテキストは通常、色や下線などの視覚的な表現で通常のテキストと区別され、URLと関連づけられたテキスト文字列です。この関連付けをハイパーリンクと呼び、これはウェブをウェブたらしめている基本的な概念のひとつです。",
|
|
11
|
+
base: {
|
|
12
|
+
/**
|
|
13
|
+
* text-blue-1000 visited:text-magenta-900 hover:text-blue-1000
|
|
14
|
+
* focus-visible:text-blue-1000 active:text-orange-700
|
|
15
|
+
*/
|
|
16
|
+
color: {
|
|
17
|
+
base: "keyColor.1000",
|
|
18
|
+
_visited: "magenta.900",
|
|
19
|
+
_hover: "keyColor.1000",
|
|
20
|
+
_focusVisible: "keyColor.1000",
|
|
21
|
+
_active: "orange.700",
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* focus-visible:bg-yellow-300
|
|
25
|
+
*/
|
|
26
|
+
bg: {
|
|
27
|
+
base: "transparent",
|
|
28
|
+
_focusVisible: "yellow.300",
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* underline underline-offset-[calc(3/16*1rem)] hover:decoration-[calc(3/16*1rem)]
|
|
32
|
+
* active:decoration-1
|
|
33
|
+
*/
|
|
34
|
+
textDecoration: "underline",
|
|
35
|
+
textDecorationThickness: {
|
|
36
|
+
base: "1px",
|
|
37
|
+
_hover: "calc(3 / 16 * 1rem)",
|
|
38
|
+
_active: "1px",
|
|
39
|
+
},
|
|
40
|
+
textUnderlineOffset: "calc(3 / 16 * 1rem)",
|
|
41
|
+
/**
|
|
42
|
+
* focus-visible:rounded-4
|
|
43
|
+
* focus-visible:outline focus-visible:outline-4
|
|
44
|
+
* focus-visible:outline-black focus-visible:outline-offset-[calc(2/16*1rem)]
|
|
45
|
+
* focus-visible:ring-[calc(2/16*1rem)] focus-visible:ring-yellow-300
|
|
46
|
+
*/
|
|
47
|
+
_focusVisible: {
|
|
48
|
+
rounded: 4,
|
|
49
|
+
outlineStyle: "solid",
|
|
50
|
+
outlineWidth: "4px",
|
|
51
|
+
outlineColor: "black",
|
|
52
|
+
outlineOffset: "calc(2 / 16 * 1rem)",
|
|
53
|
+
focusRing: "calc(2 / 16 * 1rem)",
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* with icon
|
|
57
|
+
*/
|
|
58
|
+
display: "inline-flex",
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
gap: 1,
|
|
61
|
+
"& svg": {
|
|
62
|
+
width: "1em",
|
|
63
|
+
height: "1em",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reference:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/LanguageSelector/parts/MenuItem.tsx
|
|
4
|
+
*/
|
|
5
|
+
import { defineRecipe } from "@pandacss/dev";
|
|
6
|
+
|
|
7
|
+
export default defineRecipe({
|
|
8
|
+
className: "menu-item",
|
|
9
|
+
base: {
|
|
10
|
+
/**
|
|
11
|
+
* flex relative items-center bg-white hover:bg-solid-gray-50 text-nowrap
|
|
12
|
+
* text-oln-16N-100 text-solid-gray-800
|
|
13
|
+
* ${isCurrent ? '!text-blue-1000 !bg-blue-100 font-bold' : ''}
|
|
14
|
+
*/
|
|
15
|
+
display: "flex",
|
|
16
|
+
position: "relative",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
textStyle: "dns-16N-130",
|
|
19
|
+
bg: {
|
|
20
|
+
base: "transparent",
|
|
21
|
+
_hover: "solid-gray.50",
|
|
22
|
+
_selected: {
|
|
23
|
+
base: "keyColor.100",
|
|
24
|
+
_hover: "keyColor.100",
|
|
25
|
+
},
|
|
26
|
+
_checked: {
|
|
27
|
+
base: "keyColor.100",
|
|
28
|
+
_hover: "keyColor.100",
|
|
29
|
+
},
|
|
30
|
+
_open: {
|
|
31
|
+
base: "keyColor.50",
|
|
32
|
+
_hover: "keyColor.50",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
base: "solid-gray.800",
|
|
37
|
+
_selected: "keyColor.1000",
|
|
38
|
+
_checked: "keyColor.1000",
|
|
39
|
+
_open: "keyColor.1000",
|
|
40
|
+
},
|
|
41
|
+
fontWeight: { base: "normal", _selected: "bold", _checked: "bold" },
|
|
42
|
+
/**
|
|
43
|
+
* hover:underline hover:underline-offset-[calc(3/16*1rem)]
|
|
44
|
+
*/
|
|
45
|
+
_hover: {
|
|
46
|
+
textDecoration: "underline",
|
|
47
|
+
textUnderlineOffset: "calc(3 / 16 * 1rem)",
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* py-3 pl-3 pr-6 gap-x-2
|
|
51
|
+
*/
|
|
52
|
+
py: 3,
|
|
53
|
+
pl: 3,
|
|
54
|
+
pr: 6,
|
|
55
|
+
columnGap: 2,
|
|
56
|
+
/**
|
|
57
|
+
* focus-visible:outline focus-visible:outline-4 focus-visible:outline-black
|
|
58
|
+
* focus-visible:-outline-offset-4 focus-visible:bg-yellow-300
|
|
59
|
+
* focus-visible:ring-[calc(6/16*1rem)] focus-visible:ring-inset
|
|
60
|
+
* focus-visible:ring-yellow-300
|
|
61
|
+
*/
|
|
62
|
+
_focusVisible: {
|
|
63
|
+
// rounded: 4,
|
|
64
|
+
outlineStyle: "solid",
|
|
65
|
+
outlineWidth: "4px",
|
|
66
|
+
outlineColor: "black",
|
|
67
|
+
outlineOffset: "calc(2 / 16 * 1rem)",
|
|
68
|
+
focusRing: "calc(6 / 16 * 1rem)",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
variants: {
|
|
72
|
+
variant: {
|
|
73
|
+
standard: {
|
|
74
|
+
rounded: 4,
|
|
75
|
+
},
|
|
76
|
+
boxed: {
|
|
77
|
+
rounded: {
|
|
78
|
+
base: 0,
|
|
79
|
+
_focusVisible: 4,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
isCondensed: {
|
|
84
|
+
true: {
|
|
85
|
+
/**
|
|
86
|
+
* ${isCondensed ? 'py-1.5 pl-1.5 pr-4 gap-x-1.5'}
|
|
87
|
+
*/
|
|
88
|
+
py: 1.5,
|
|
89
|
+
pl: 1.5,
|
|
90
|
+
pr: 4,
|
|
91
|
+
columnGap: 1.5,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
variant: "standard",
|
|
97
|
+
isCondensed: false,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineSlotRecipe } from "@pandacss/dev";
|
|
2
|
+
import { menuListAnatomy } from "../anatomy";
|
|
3
|
+
import menuItem from "./menu-item";
|
|
4
|
+
|
|
5
|
+
export default defineSlotRecipe({
|
|
6
|
+
className: "menu-list",
|
|
7
|
+
slots: menuListAnatomy.keys(),
|
|
8
|
+
base: {
|
|
9
|
+
root: {},
|
|
10
|
+
label: {
|
|
11
|
+
py: 3,
|
|
12
|
+
pl: 3,
|
|
13
|
+
pr: 6,
|
|
14
|
+
textStyle: "oln-17B-100",
|
|
15
|
+
textWrap: "nowrap",
|
|
16
|
+
display: "block",
|
|
17
|
+
mb: 2,
|
|
18
|
+
},
|
|
19
|
+
content: {},
|
|
20
|
+
item: {
|
|
21
|
+
...menuItem.base,
|
|
22
|
+
},
|
|
23
|
+
itemGroup: {
|
|
24
|
+
my: 1,
|
|
25
|
+
},
|
|
26
|
+
itemGroupLabel: {
|
|
27
|
+
...menuItem.base,
|
|
28
|
+
position: "sticky",
|
|
29
|
+
top: 0,
|
|
30
|
+
bg: "white",
|
|
31
|
+
},
|
|
32
|
+
itemText: {},
|
|
33
|
+
itemIndicator: {
|
|
34
|
+
position: "absolute",
|
|
35
|
+
top: "50%",
|
|
36
|
+
right: 4,
|
|
37
|
+
transform: "translateY(-50%)",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
variants: {
|
|
41
|
+
variant: {
|
|
42
|
+
standard: {
|
|
43
|
+
item: {
|
|
44
|
+
...menuItem.variants?.variant?.standard,
|
|
45
|
+
},
|
|
46
|
+
itemGroupLabel: {
|
|
47
|
+
...menuItem.variants?.variant?.standard,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
boxed: {
|
|
51
|
+
item: {
|
|
52
|
+
...menuItem.variants?.variant?.boxed,
|
|
53
|
+
},
|
|
54
|
+
itemGroupLabel: {
|
|
55
|
+
...menuItem.variants?.variant?.boxed,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
isCondensed: {
|
|
60
|
+
true: {},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
variant: "standard",
|
|
65
|
+
isCondensed: false,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* source:
|
|
3
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/LanguageSelector/parts/Menu.tsx
|
|
4
|
+
* https://github.com/digital-go-jp/design-system-example-components/blob/main/src/components/LanguageSelector/parts/MenuItem.tsx
|
|
5
|
+
*/
|
|
6
|
+
import { defineSlotRecipe, type SystemStyleObject } from "@pandacss/dev";
|
|
7
|
+
import { anatomy as menuAnatomy } from "@ark-ui/anatomy/menu";
|
|
8
|
+
import menuItem from "./menu-item";
|
|
9
|
+
|
|
10
|
+
const itemStyle = {
|
|
11
|
+
...menuItem.base,
|
|
12
|
+
} satisfies SystemStyleObject;
|
|
13
|
+
|
|
14
|
+
export default defineSlotRecipe({
|
|
15
|
+
className: "menu",
|
|
16
|
+
slots: menuAnatomy.keys(),
|
|
17
|
+
base: {
|
|
18
|
+
content: {
|
|
19
|
+
minWidth: "fit-content",
|
|
20
|
+
width: "auto",
|
|
21
|
+
maxHeight: "calc((44 * 6.5 + 16) / 16 * 1rem)",
|
|
22
|
+
py: 2,
|
|
23
|
+
borderWidth: "1px",
|
|
24
|
+
borderColor: "solid-gray.420",
|
|
25
|
+
bg: "white",
|
|
26
|
+
rounded: "lg",
|
|
27
|
+
boxShadow: 1,
|
|
28
|
+
/**
|
|
29
|
+
* min-w-fit w-auto py-2 border border-solid-grey-420 bg-white shadow-1 rounded-lg
|
|
30
|
+
has-[>:nth-child(7)]:rounded-r-none
|
|
31
|
+
${isCondensed ? 'max-h-[calc((32*6.5+16)/16*1rem)]' : 'max-h-[calc((44*6.5+16)/16*1rem)]'}
|
|
32
|
+
*/
|
|
33
|
+
},
|
|
34
|
+
itemGroupLabel: {
|
|
35
|
+
...itemStyle,
|
|
36
|
+
fontWeight: "bold",
|
|
37
|
+
},
|
|
38
|
+
triggerItem: {
|
|
39
|
+
...itemStyle,
|
|
40
|
+
},
|
|
41
|
+
item: {
|
|
42
|
+
...itemStyle,
|
|
43
|
+
textDecoration: {
|
|
44
|
+
base: "none",
|
|
45
|
+
_hover: "underline",
|
|
46
|
+
},
|
|
47
|
+
textUnderlineOffset: "calc(3 / 16 * 1rem)",
|
|
48
|
+
_checked: {
|
|
49
|
+
bg: "keyColor.100",
|
|
50
|
+
color: "keyColor.1000",
|
|
51
|
+
fontWeight: "bold",
|
|
52
|
+
},
|
|
53
|
+
_focusVisible: {
|
|
54
|
+
outlineStyle: "solid",
|
|
55
|
+
outlineWidth: "4px",
|
|
56
|
+
outlineColor: "black",
|
|
57
|
+
outlineOffset: "calc(2 / 16 * 1rem)",
|
|
58
|
+
focusRing: "calc(2 / 16 * 1rem)",
|
|
59
|
+
zIndex: 1,
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* flex relative items-center bg-white text-nowrap text-oln-16N-1 text-solid-grey-800
|
|
63
|
+
${isCondensed ? 'py-1.5 pl-1.5 pr-4 gap-x-1.5' : 'py-3 pl-3 pr-6 gap-x-2'}
|
|
64
|
+
${isCurrent && '!text-blue-1000 !bg-blue-100 font-bold'}
|
|
65
|
+
hover:underline hover:underline-offset-[calc(3/16*1rem)] hover:bg-solid-grey-50
|
|
66
|
+
focus-visible:outline focus-visible:outline-4 focus-visible:outline-black focus-visible:-outline-offset-4 focus-visible:bg-yellow-300 focus-visible:ring-[calc(6/16*1rem)] focus-visible:ring-inset focus-visible:ring-yellow-300
|
|
67
|
+
${className ?? ''}
|
|
68
|
+
*/
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
variants: {
|
|
72
|
+
isCondensed: {
|
|
73
|
+
true: {
|
|
74
|
+
content: {
|
|
75
|
+
maxHeight: "calc((32 * 6.5 + 16) / 16 * 1rem)",
|
|
76
|
+
},
|
|
77
|
+
itemGroupLabel: {
|
|
78
|
+
py: 1.5,
|
|
79
|
+
pl: 1.5,
|
|
80
|
+
pr: 4,
|
|
81
|
+
columnGap: 1.5,
|
|
82
|
+
},
|
|
83
|
+
item: {
|
|
84
|
+
py: 1.5,
|
|
85
|
+
pl: 1.5,
|
|
86
|
+
pr: 4,
|
|
87
|
+
columnGap: 1.5,
|
|
88
|
+
},
|
|
89
|
+
triggerItem: {
|
|
90
|
+
py: 1.5,
|
|
91
|
+
pl: 1.5,
|
|
92
|
+
pr: 4,
|
|
93
|
+
columnGap: 1.5,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
isCondensed: false,
|
|
100
|
+
},
|
|
101
|
+
});
|