@k8o/arte-odyssey 1.4.2 → 2.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/dist/components/accordion/accordion-button.js +8 -7
- package/dist/components/accordion/accordion-item.js +1 -1
- package/dist/components/accordion/accordion-panel.js +1 -1
- package/dist/components/accordion/accordion.js +1 -11
- package/dist/components/alert/alert.js +3 -4
- package/dist/components/alert/alert.stories.js +6 -2
- package/dist/components/anchor/anchor.js +3 -2
- package/dist/components/baseline-status/baseline-status.js +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +9 -2
- package/dist/components/button/button.js +6 -6
- package/dist/components/card/card.js +3 -3
- package/dist/components/card/card.stories.js +20 -18
- package/dist/components/card/interactive-card.js +4 -12
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/drawer/drawer.stories.js +6 -6
- package/dist/components/dropdown-menu/dropdown-menu.js +4 -4
- package/dist/components/dropdown-menu/dropdown-menu.stories.js +16 -16
- package/dist/components/form/autocomplete/autocomplete.d.ts +11 -3
- package/dist/components/form/autocomplete/autocomplete.js +6 -6
- package/dist/components/form/autocomplete/autocomplete.stories.js +6 -2
- package/dist/components/form/checkbox/checkbox.d.ts +10 -2
- package/dist/components/form/checkbox/checkbox.js +16 -6
- package/dist/components/form/file-field/file-field.js +3 -3
- package/dist/components/form/number-field/number-field.d.ts +12 -4
- package/dist/components/form/number-field/number-field.js +21 -13
- package/dist/components/form/number-field/number-field.stories.js +2 -7
- package/dist/components/form/radio/radio.d.ts +12 -3
- package/dist/components/form/radio/radio.js +4 -2
- package/dist/components/form/radio/radio.stories.js +14 -39
- package/dist/components/form/range-field/range-field.d.ts +13 -5
- package/dist/components/form/range-field/range-field.js +19 -9
- package/dist/components/form/range-field/range-field.stories.js +11 -104
- package/dist/components/form/select/select.d.ts +10 -2
- package/dist/components/form/select/select.js +2 -2
- package/dist/components/form/select/select.stories.js +1 -4
- package/dist/components/form/text-field/text-field.d.ts +10 -2
- package/dist/components/form/text-field/text-field.js +1 -1
- package/dist/components/form/text-field/text-field.stories.js +1 -5
- package/dist/components/form/textarea/textarea.d.ts +10 -2
- package/dist/components/form/textarea/textarea.js +1 -1
- package/dist/components/form/textarea/textarea.stories.js +1 -5
- package/dist/components/icon-button/icon-button.js +3 -3
- package/dist/components/icon-button/icon-button.stories.js +1 -4
- package/dist/components/icon-link/icon-link.d.ts +1 -1
- package/dist/components/icon-link/icon-link.js +3 -2
- package/dist/components/icon-link/icon-link.stories.js +7 -1
- package/dist/components/icons/icons.stories.js +0 -5
- package/dist/components/icons/index.d.ts +0 -1
- package/dist/components/icons/index.js +0 -1
- package/dist/components/link-button/link-button.d.ts +2 -1
- package/dist/components/link-button/link-button.js +9 -6
- package/dist/components/link-button/link-button.stories.js +21 -2
- package/dist/components/list-box/list-box.js +6 -8
- package/dist/components/list-box/list-box.stories.js +10 -19
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/modal/modal.stories.js +2 -2
- package/dist/components/popover/popover.stories.js +3 -3
- package/dist/components/progress/progress.js +2 -2
- package/dist/components/scroll-linked/scroll-linked.js +1 -1
- package/dist/components/scroll-linked/scroll-linked.stories.js +7 -7
- package/dist/components/separator/separator.d.ts +1 -0
- package/dist/components/separator/separator.js +21 -12
- package/dist/components/separator/separator.stories.js +12 -0
- package/dist/components/tabs/tabs.js +3 -3
- package/dist/components/tabs/tabs.stories.js +33 -26
- package/dist/components/text-tag/text-tag.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/tooltip/tooltip.stories.js +3 -3
- package/dist/styles/index.css +0 -3
- package/package.json +20 -20
- package/dist/components/icons/zenn.d.ts +0 -6
- package/dist/components/icons/zenn.js +0 -41
|
@@ -30,7 +30,7 @@ const Textarea = ({
|
|
|
30
30
|
"aria-invalid": isInvalid,
|
|
31
31
|
"aria-required": isRequired,
|
|
32
32
|
className: cn(
|
|
33
|
-
"w-full resize-none rounded-
|
|
33
|
+
"w-full resize-none rounded-lg border border-border-base bg-bg-base px-3 py-2",
|
|
34
34
|
"aria-invalid:border-border-error",
|
|
35
35
|
"disabled:cursor-not-allowed disabled:border-border-mute disabled:bg-bg-mute disabled:hover:bg-bg-mute",
|
|
36
36
|
"focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info",
|
|
@@ -13,12 +13,12 @@ const IconButton = ({
|
|
|
13
13
|
{
|
|
14
14
|
"aria-label": props.role ? label : void 0,
|
|
15
15
|
className: cn(
|
|
16
|
-
"inline-flex cursor-pointer rounded-full bg-transparent",
|
|
16
|
+
"inline-flex cursor-pointer rounded-full bg-transparent transition-colors",
|
|
17
17
|
"hover:bg-bg-subtle",
|
|
18
18
|
"focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info active:bg-bg-emphasize",
|
|
19
|
-
bg === "base" && "bg-bg-base
|
|
19
|
+
bg === "base" && "bg-bg-base",
|
|
20
20
|
bg === "transparent" && "bg-transparent",
|
|
21
|
-
bg === "primary" && "bg-primary-bg
|
|
21
|
+
bg === "primary" && "bg-primary-bg hover:bg-primary-bg/90 active:bg-primary-bg-emphasize",
|
|
22
22
|
size === "sm" && "p-1",
|
|
23
23
|
size === "md" && "p-2",
|
|
24
24
|
size === "lg" && "p-3",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
export declare const IconLink: <T extends string>({ size, bg, label, href, children, openInNewTab, renderAnchor, }: PropsWithChildren<{
|
|
3
3
|
size?: "sm" | "md" | "lg";
|
|
4
|
-
bg?: "transparent" | "base";
|
|
4
|
+
bg?: "transparent" | "base" | "primary";
|
|
5
5
|
label?: string;
|
|
6
6
|
href: T;
|
|
7
7
|
openInNewTab?: boolean;
|
|
@@ -18,9 +18,10 @@ const IconLink = ({
|
|
|
18
18
|
return renderAnchor({
|
|
19
19
|
href,
|
|
20
20
|
className: cn(
|
|
21
|
-
"inline-flex rounded-full hover:bg-bg-subtle active:bg-bg-emphasize focus-visible:ring-2 focus-visible:ring-border-info",
|
|
22
|
-
bg === "base" && "bg-bg-base
|
|
21
|
+
"inline-flex rounded-full transition-colors hover:bg-bg-subtle active:bg-bg-emphasize focus-visible:ring-2 focus-visible:ring-border-info",
|
|
22
|
+
bg === "base" && "bg-bg-base",
|
|
23
23
|
bg === "transparent" && "bg-transparent",
|
|
24
|
+
bg === "primary" && "bg-primary-bg hover:bg-primary-bg/90 active:bg-primary-bg-emphasize",
|
|
24
25
|
size === "sm" && "p-1",
|
|
25
26
|
size === "md" && "p-2",
|
|
26
27
|
size === "lg" && "p-3"
|
|
@@ -7,7 +7,7 @@ const meta = {
|
|
|
7
7
|
args: {
|
|
8
8
|
href: "https://example.com",
|
|
9
9
|
children: /* @__PURE__ */ jsx(CopyIcon, {}),
|
|
10
|
-
label: "
|
|
10
|
+
label: "\u30B3\u30D4\u30FC"
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
var icon_link_stories_default = meta;
|
|
@@ -31,8 +31,14 @@ const BgBase = {
|
|
|
31
31
|
bg: "base"
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
const BgPrimary = {
|
|
35
|
+
args: {
|
|
36
|
+
bg: "primary"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
34
39
|
export {
|
|
35
40
|
BgBase,
|
|
41
|
+
BgPrimary,
|
|
36
42
|
Large,
|
|
37
43
|
Medium,
|
|
38
44
|
Small,
|
|
@@ -47,7 +47,6 @@ import {
|
|
|
47
47
|
} from "./lucide";
|
|
48
48
|
import { QiitaIcon } from "./qiita";
|
|
49
49
|
import { TwitterIcon } from "./twitter";
|
|
50
|
-
import { ZennIcon } from "./zenn";
|
|
51
50
|
const meta = {
|
|
52
51
|
title: "components/icons"
|
|
53
52
|
};
|
|
@@ -259,10 +258,6 @@ const Primary = {
|
|
|
259
258
|
/* @__PURE__ */ jsx(QiitaIcon, {}),
|
|
260
259
|
/* @__PURE__ */ jsx("p", { className: "text-center", children: "Qiita" })
|
|
261
260
|
] }),
|
|
262
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
263
|
-
/* @__PURE__ */ jsx(ZennIcon, {}),
|
|
264
|
-
/* @__PURE__ */ jsx("p", { className: "text-center", children: "Zenn" })
|
|
265
|
-
] }),
|
|
266
261
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
267
262
|
/* @__PURE__ */ jsx(ArteOdyssey, {}),
|
|
268
263
|
/* @__PURE__ */ jsx("p", { className: "text-center", children: "Arte Odyssey" })
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export declare const LinkButton: <T extends string>({ children, size, variant, href, startIcon, endIcon, active, openInNewTab, renderAnchor, }: {
|
|
2
|
+
export declare const LinkButton: <T extends string>({ children, size, color, variant, href, startIcon, endIcon, active, openInNewTab, renderAnchor, }: {
|
|
3
3
|
variant?: "contained" | "outlined" | "skeleton";
|
|
4
4
|
size?: "sm" | "md" | "lg";
|
|
5
|
+
color?: "primary" | "gray";
|
|
5
6
|
href: T;
|
|
6
7
|
startIcon?: ReactNode;
|
|
7
8
|
endIcon?: ReactNode;
|
|
@@ -4,6 +4,7 @@ import { isInternalRoute } from "./../../helpers/is-internal-route";
|
|
|
4
4
|
const LinkButton = ({
|
|
5
5
|
children,
|
|
6
6
|
size = "md",
|
|
7
|
+
color = "primary",
|
|
7
8
|
variant = "contained",
|
|
8
9
|
href,
|
|
9
10
|
startIcon,
|
|
@@ -15,15 +16,17 @@ const LinkButton = ({
|
|
|
15
16
|
const type = isInternalRoute(href) && !openInNewTab ? "internal" : "external";
|
|
16
17
|
const props = type === "internal" ? {} : { target: "_blank", rel: "noopener noreferrer" };
|
|
17
18
|
const className = cn(
|
|
18
|
-
"rounded-lg text-center font-bold",
|
|
19
|
+
"rounded-lg border-2 text-center font-bold transition-colors",
|
|
19
20
|
{
|
|
20
|
-
"bg-primary-bg text-fg hover:bg-primary-bg/90 active:bg-primary-bg/80": variant === "contained",
|
|
21
|
-
"border-
|
|
22
|
-
"bg-
|
|
21
|
+
"border-transparent bg-primary-bg text-fg hover:bg-primary-bg/90 active:bg-primary-bg/80": variant === "contained" && color === "primary",
|
|
22
|
+
"border-transparent bg-bg-subtle text-fg-base hover:bg-bg-mute active:bg-bg-emphasize": variant === "contained" && color === "gray",
|
|
23
|
+
"border-primary-border bg-bg-base text-primary-fg hover:bg-bg-subtle active:bg-bg-emphasize": variant === "outlined" && color === "primary",
|
|
24
|
+
"border-border-base bg-bg-base text-fg-base hover:bg-bg-subtle active:bg-bg-emphasize": variant === "outlined" && color === "gray",
|
|
25
|
+
"border-transparent bg-transparent text-fg-mute hover:text-fg-base active:text-fg-base": variant === "skeleton"
|
|
23
26
|
},
|
|
24
|
-
"focus-visible:border-transparent focus-visible:
|
|
27
|
+
"focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info",
|
|
25
28
|
size === "sm" && "px-3 py-1 text-sm",
|
|
26
|
-
size === "md" && "
|
|
29
|
+
size === "md" && "px-4 py-2 text-md",
|
|
27
30
|
size === "lg" && "px-6 py-3 text-lg",
|
|
28
31
|
Boolean(startIcon ?? endIcon) && "flex items-center gap-2",
|
|
29
32
|
Boolean(endIcon) && "justify-between",
|
|
@@ -25,11 +25,27 @@ const Small = {
|
|
|
25
25
|
size: "sm"
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
const
|
|
28
|
+
const Outlined = {
|
|
29
29
|
args: {
|
|
30
30
|
variant: "outlined"
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
const Skeleton = {
|
|
34
|
+
args: {
|
|
35
|
+
variant: "skeleton"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const Gray = {
|
|
39
|
+
args: {
|
|
40
|
+
color: "gray"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const GrayOutlined = {
|
|
44
|
+
args: {
|
|
45
|
+
color: "gray",
|
|
46
|
+
variant: "outlined"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
33
49
|
const StartIcon = {
|
|
34
50
|
args: {
|
|
35
51
|
startIcon: /* @__PURE__ */ jsx(CopyIcon, {})
|
|
@@ -42,9 +58,12 @@ const EndIcon = {
|
|
|
42
58
|
};
|
|
43
59
|
export {
|
|
44
60
|
EndIcon,
|
|
61
|
+
Gray,
|
|
62
|
+
GrayOutlined,
|
|
45
63
|
Large,
|
|
46
64
|
Medium,
|
|
47
|
-
|
|
65
|
+
Outlined,
|
|
66
|
+
Skeleton,
|
|
48
67
|
Small,
|
|
49
68
|
StartIcon,
|
|
50
69
|
link_button_stories_default as default
|
|
@@ -73,7 +73,7 @@ const Content = ({ helpContent }) => {
|
|
|
73
73
|
{
|
|
74
74
|
...props,
|
|
75
75
|
...contentProps,
|
|
76
|
-
className: "flex max-h-48 min-w-40 flex-col overflow-y-auto rounded-lg border border-border-mute bg-bg-base py-2 shadow-
|
|
76
|
+
className: "flex max-h-48 min-w-40 flex-col overflow-y-auto rounded-lg border border-border-mute bg-bg-base py-2 shadow-md",
|
|
77
77
|
children: [
|
|
78
78
|
helpContent,
|
|
79
79
|
options.map(({ key, label }, idx) => /* @__PURE__ */ jsx(Item, { index: idx, label }, key))
|
|
@@ -89,16 +89,14 @@ const Item = ({ label, index }) => {
|
|
|
89
89
|
"button",
|
|
90
90
|
{
|
|
91
91
|
className: cn(
|
|
92
|
-
"
|
|
93
|
-
"hover:bg-
|
|
94
|
-
"focus-visible:border-transparent focus-visible:bg-
|
|
95
|
-
!selected && "pl-9",
|
|
96
|
-
selected && "inline-flex items-center gap-1"
|
|
92
|
+
"flex w-full items-center justify-between px-3 py-2 text-left transition-colors",
|
|
93
|
+
"hover:bg-bg-mute",
|
|
94
|
+
"focus-visible:border-transparent focus-visible:bg-bg-mute focus-visible:outline-hidden"
|
|
97
95
|
),
|
|
98
96
|
...props,
|
|
99
97
|
children: [
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
label,
|
|
99
|
+
selected && /* @__PURE__ */ jsx("span", { className: "text-fg-success", children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
102
100
|
]
|
|
103
101
|
}
|
|
104
102
|
);
|
|
@@ -17,25 +17,16 @@ const meta = {
|
|
|
17
17
|
};
|
|
18
18
|
var list_box_stories_default = meta;
|
|
19
19
|
const OPTIONS = [
|
|
20
|
-
{ key: "1", label: "
|
|
21
|
-
{ key: "2", label: "
|
|
22
|
-
{ key: "3", label: "
|
|
23
|
-
{ key: "4", label: "
|
|
24
|
-
{ key: "5", label: "
|
|
25
|
-
{ key: "6", label: "
|
|
26
|
-
{ key: "7", label: "
|
|
27
|
-
{ key: "8", label: "
|
|
28
|
-
{ key: "9", label: "
|
|
29
|
-
{ key: "10", label: "
|
|
30
|
-
{ key: "11", label: "mango" },
|
|
31
|
-
{ key: "12", label: "nectarine" },
|
|
32
|
-
{ key: "13", label: "orange" },
|
|
33
|
-
{ key: "14", label: "pear" },
|
|
34
|
-
{ key: "15", label: "quince" },
|
|
35
|
-
{ key: "16", label: "raspberry" },
|
|
36
|
-
{ key: "17", label: "strawberry" },
|
|
37
|
-
{ key: "18", label: "tangerine" },
|
|
38
|
-
{ key: "19", label: "watermelon" }
|
|
20
|
+
{ key: "1", label: "\u308A\u3093\u3054" },
|
|
21
|
+
{ key: "2", label: "\u30D0\u30CA\u30CA" },
|
|
22
|
+
{ key: "3", label: "\u3055\u304F\u3089\u3093\u307C" },
|
|
23
|
+
{ key: "4", label: "\u3076\u3069\u3046" },
|
|
24
|
+
{ key: "5", label: "\u30E1\u30ED\u30F3" },
|
|
25
|
+
{ key: "6", label: "\u3044\u3061\u3054" },
|
|
26
|
+
{ key: "7", label: "\u307F\u304B\u3093" },
|
|
27
|
+
{ key: "8", label: "\u3082\u3082" },
|
|
28
|
+
{ key: "9", label: "\u30AD\u30A6\u30A4" },
|
|
29
|
+
{ key: "10", label: "\u30EC\u30E2\u30F3" }
|
|
39
30
|
];
|
|
40
31
|
const Default = {
|
|
41
32
|
render: () => {
|
|
@@ -95,7 +95,7 @@ const Modal = ({ ref, type = "center", defaultOpen, isOpen, onClose, children })
|
|
|
95
95
|
{
|
|
96
96
|
animate: realDialogOpen ? "open" : "closed",
|
|
97
97
|
className: cn(
|
|
98
|
-
"border-border-mute bg-bg-base shadow-
|
|
98
|
+
"border-border-mute bg-bg-base shadow-md backdrop:bg-back-drop",
|
|
99
99
|
type === "center" && "m-auto max-h-lg w-5/6 max-w-2xl rounded-lg dark:border",
|
|
100
100
|
type === "bottom" && "mt-auto w-screen max-w-screen rounded-t-lg dark:border-t",
|
|
101
101
|
type === "right" && "ml-auto min-h-svh w-screen max-w-sm rounded-l-lg dark:border-l"
|
|
@@ -11,8 +11,8 @@ const Default = {
|
|
|
11
11
|
args: {
|
|
12
12
|
defaultOpen: true,
|
|
13
13
|
children: /* @__PURE__ */ jsxs(Dialog.Root, { children: [
|
|
14
|
-
/* @__PURE__ */ jsx(Dialog.Header, { onClose: fn(), title: "
|
|
15
|
-
/* @__PURE__ */ jsx(Dialog.Content, { children: "
|
|
14
|
+
/* @__PURE__ */ jsx(Dialog.Header, { onClose: fn(), title: "\u78BA\u8A8D" }),
|
|
15
|
+
/* @__PURE__ */ jsx(Dialog.Content, { children: /* @__PURE__ */ jsx("p", { children: "\u3053\u306E\u64CD\u4F5C\u3092\u5B9F\u884C\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F" }) })
|
|
16
16
|
] })
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -21,19 +21,19 @@ const Default = {
|
|
|
21
21
|
/* @__PURE__ */ jsx(
|
|
22
22
|
Popover.Trigger,
|
|
23
23
|
{
|
|
24
|
-
renderItem: (props) => /* @__PURE__ */ jsx(Button, { ...props, size: "md", type: "button", children: "
|
|
24
|
+
renderItem: (props) => /* @__PURE__ */ jsx(Button, { ...props, size: "md", type: "button", children: "\u30E1\u30CB\u30E5\u30FC" })
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
27
|
/* @__PURE__ */ jsx(
|
|
28
28
|
Popover.Content,
|
|
29
29
|
{
|
|
30
|
-
renderItem: (props) => /* @__PURE__ */ jsx("div", { className: "rounded-
|
|
30
|
+
renderItem: (props) => /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-bg-mute p-4 shadow-md", ...props, children: /* @__PURE__ */ jsx("div", { role: "menuitem", children: "\u30DD\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC\u306E\u30B3\u30F3\u30C6\u30F3\u30C4" }) })
|
|
31
31
|
}
|
|
32
32
|
)
|
|
33
33
|
] }),
|
|
34
34
|
play: async ({ canvas, userEvent }) => {
|
|
35
35
|
const trigger = canvas.getByRole("button", {
|
|
36
|
-
name: "
|
|
36
|
+
name: "\u30E1\u30CB\u30E5\u30FC"
|
|
37
37
|
});
|
|
38
38
|
trigger.focus();
|
|
39
39
|
await userEvent.keyboard("{Enter}");
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { toPrecision } from "./../../helpers/number";
|
|
3
3
|
const Progress = ({ progress, maxProgress, minProgress = 0, label }) => {
|
|
4
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full rounded-
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full rounded-full bg-bg-emphasize", children: /* @__PURE__ */ jsx(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
"aria-label": label ?? `${toPrecision(progress / maxProgress).toString()}%`,
|
|
8
8
|
"aria-valuemax": maxProgress,
|
|
9
9
|
"aria-valuemin": minProgress,
|
|
10
10
|
"aria-valuenow": progress,
|
|
11
|
-
className: "h-4 rounded-
|
|
11
|
+
className: "h-4 rounded-full bg-primary-bg transition-all",
|
|
12
12
|
role: "progressbar",
|
|
13
13
|
style: {
|
|
14
14
|
width: `${(progress / maxProgress * 100).toString()}%`
|
|
@@ -11,7 +11,7 @@ const ScrollLinked = ({ container }) => {
|
|
|
11
11
|
return /* @__PURE__ */ jsx(
|
|
12
12
|
motion.div,
|
|
13
13
|
{
|
|
14
|
-
className: "fixed top-0 right-0 left-0 h-2 origin-left bg-primary-
|
|
14
|
+
className: "fixed top-0 right-0 left-0 h-2 origin-left bg-primary-bg",
|
|
15
15
|
style: { scaleX }
|
|
16
16
|
}
|
|
17
17
|
);
|
|
@@ -19,20 +19,20 @@ const WithContainer = {
|
|
|
19
19
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
20
20
|
"section",
|
|
21
21
|
{
|
|
22
|
-
"aria-label": "
|
|
23
|
-
className: "relative h-96 overflow-y-scroll rounded border border-
|
|
22
|
+
"aria-label": "\u30B9\u30AF\u30ED\u30FC\u30EB\u30B3\u30F3\u30C6\u30CA\u306E\u4F8B",
|
|
23
|
+
className: "relative h-96 overflow-y-scroll rounded-lg border border-border-mute",
|
|
24
24
|
ref: containerRef,
|
|
25
25
|
tabIndex: 0,
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ jsx(Story, { args: { container: containerRef } }),
|
|
28
28
|
/* @__PURE__ */ jsxs("div", { className: "h-[200vh] p-4", children: [
|
|
29
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-4 font-bold text-xl", children: "
|
|
30
|
-
/* @__PURE__ */ jsx("p", { className: "mb-4", children: "
|
|
31
|
-
/* @__PURE__ */ jsx("p", { className: "mb-4", children: "
|
|
29
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-4 font-bold text-xl", children: "\u30B3\u30F3\u30C6\u30CA\u5185\u30B9\u30AF\u30ED\u30FC\u30EB\u306E\u4F8B" }),
|
|
30
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4", children: "\u3053\u306E\u30B3\u30F3\u30C6\u30CA\u5185\u3092\u30B9\u30AF\u30ED\u30FC\u30EB\u3059\u308B\u3068\u3001\u4E0A\u90E8\u306B\u30D7\u30ED\u30B0\u30EC\u30B9\u30D0\u30FC\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }),
|
|
31
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4", children: "\u30D7\u30ED\u30B0\u30EC\u30B9\u30D0\u30FC\u306F\u30A6\u30A3\u30F3\u30C9\u30A6\u3067\u306F\u306A\u304F\u3001\u3053\u306E\u30B3\u30F3\u30C6\u30CA\u306E\u30B9\u30AF\u30ED\u30FC\u30EB\u4F4D\u7F6E\u3092\u8FFD\u8DE1\u3057\u307E\u3059\u3002" }),
|
|
32
32
|
/* @__PURE__ */ jsx("div", { className: "mt-8 space-y-4", children: Array.from({ length: 20 }, (_, i) => (
|
|
33
33
|
// biome-ignore lint/suspicious/noArrayIndexKey: Static demo content
|
|
34
|
-
/* @__PURE__ */ jsxs("p", { className: "rounded bg-
|
|
35
|
-
"
|
|
34
|
+
/* @__PURE__ */ jsxs("p", { className: "rounded-lg bg-bg-mute p-4", children: [
|
|
35
|
+
"\u30B3\u30F3\u30C6\u30F3\u30C4\u30D6\u30ED\u30C3\u30AF ",
|
|
36
36
|
i + 1
|
|
37
37
|
] }, `content-${i}`)
|
|
38
38
|
)) })
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "./../../helpers/cn";
|
|
3
|
-
const Separator = ({ orientation = "horizontal" }) => {
|
|
3
|
+
const Separator = ({ orientation = "horizontal", color = "base" }) => {
|
|
4
4
|
const isVertical = orientation === "vertical";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
return (
|
|
6
|
+
// biome-ignore lint/a11y/useFocusableInteractive: decorative separator
|
|
7
|
+
// biome-ignore lint/a11y/useSemanticElements: need color prop support
|
|
8
|
+
/* @__PURE__ */ jsx(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
"aria-orientation": orientation,
|
|
12
|
+
className: cn(
|
|
13
|
+
"block",
|
|
14
|
+
{
|
|
15
|
+
"h-full w-px": isVertical,
|
|
16
|
+
"h-px w-full": !isVertical
|
|
17
|
+
},
|
|
18
|
+
color === "base" && "bg-border-base",
|
|
19
|
+
color === "mute" && "bg-border-mute",
|
|
20
|
+
color === "subtle" && "bg-border-subtle"
|
|
21
|
+
),
|
|
22
|
+
role: "separator"
|
|
23
|
+
}
|
|
24
|
+
)
|
|
16
25
|
);
|
|
17
26
|
};
|
|
18
27
|
export {
|
|
@@ -20,7 +20,19 @@ const Vertical = {
|
|
|
20
20
|
orientation: "vertical"
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
const ColorMute = {
|
|
24
|
+
args: {
|
|
25
|
+
color: "mute"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const ColorSubtle = {
|
|
29
|
+
args: {
|
|
30
|
+
color: "subtle"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
23
33
|
export {
|
|
34
|
+
ColorMute,
|
|
35
|
+
ColorSubtle,
|
|
24
36
|
Horizontal,
|
|
25
37
|
Vertical,
|
|
26
38
|
separator_stories_default as default
|
|
@@ -78,7 +78,7 @@ const Tab = ({ id, children }) => {
|
|
|
78
78
|
"aria-controls": selectedId === id ? `${rootId}-panel-${id}` : void 0,
|
|
79
79
|
"aria-selected": selectedId === id,
|
|
80
80
|
className: cn(
|
|
81
|
-
"relative cursor-pointer rounded-
|
|
81
|
+
"relative cursor-pointer rounded-lg p-2 transition-colors",
|
|
82
82
|
"focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info"
|
|
83
83
|
),
|
|
84
84
|
id: `${rootId}-tab-${id}`,
|
|
@@ -106,7 +106,7 @@ const Tab = ({ id, children }) => {
|
|
|
106
106
|
selectedId === id && /* @__PURE__ */ jsx(
|
|
107
107
|
motion.div,
|
|
108
108
|
{
|
|
109
|
-
className: "-bottom-0.5
|
|
109
|
+
className: "absolute right-0 -bottom-0.5 left-0 h-1 bg-primary-border",
|
|
110
110
|
layoutId: "underline"
|
|
111
111
|
}
|
|
112
112
|
),
|
|
@@ -125,7 +125,7 @@ const Panel = ({ id, children }) => {
|
|
|
125
125
|
{
|
|
126
126
|
"aria-labelledby": `${rootId}-tab-${id}`,
|
|
127
127
|
className: cn(
|
|
128
|
-
"
|
|
128
|
+
"grow rounded-lg p-2",
|
|
129
129
|
"focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info"
|
|
130
130
|
),
|
|
131
131
|
id: `${rootId}-panel-${id}`,
|
|
@@ -7,39 +7,46 @@ const meta = {
|
|
|
7
7
|
};
|
|
8
8
|
var tabs_stories_default = meta;
|
|
9
9
|
const Primary = {
|
|
10
|
-
render: () => /* @__PURE__ */ jsxs(Tabs.Root, { ids: ["
|
|
11
|
-
/* @__PURE__ */ jsxs(Tabs.List, { label: "
|
|
12
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { id: "
|
|
13
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { id: "
|
|
14
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { id: "
|
|
10
|
+
render: () => /* @__PURE__ */ jsxs(Tabs.Root, { ids: ["overview", "settings", "history"], children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(Tabs.List, { label: "\u8A2D\u5B9A\u30E1\u30CB\u30E5\u30FC", children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "overview", children: "\u6982\u8981" }),
|
|
13
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "settings", children: "\u8A2D\u5B9A" }),
|
|
14
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "history", children: "\u5C65\u6B74" })
|
|
15
15
|
] }),
|
|
16
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { id: "
|
|
17
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { id: "
|
|
18
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { id: "
|
|
16
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "overview", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u6982\u8981\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) }),
|
|
17
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "settings", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u8A2D\u5B9A\u9805\u76EE\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "history", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u5C65\u6B74\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) })
|
|
19
19
|
] }),
|
|
20
20
|
play: async ({ canvas, userEvent }) => {
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("
|
|
24
|
-
await userEvent.click(
|
|
25
|
-
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("
|
|
26
|
-
await userEvent.click(
|
|
27
|
-
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("
|
|
21
|
+
const settingsTab = canvas.getByRole("tab", { name: "\u8A2D\u5B9A" });
|
|
22
|
+
const historyTab = canvas.getByRole("tab", { name: "\u5C65\u6B74" });
|
|
23
|
+
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("\u6982\u8981");
|
|
24
|
+
await userEvent.click(settingsTab);
|
|
25
|
+
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("\u8A2D\u5B9A\u9805\u76EE");
|
|
26
|
+
await userEvent.click(historyTab);
|
|
27
|
+
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("\u5C65\u6B74");
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const DefaultSelected = {
|
|
31
|
-
render: () => /* @__PURE__ */ jsxs(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
render: () => /* @__PURE__ */ jsxs(
|
|
32
|
+
Tabs.Root,
|
|
33
|
+
{
|
|
34
|
+
defaultSelectedId: "settings",
|
|
35
|
+
ids: ["overview", "settings", "history"],
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(Tabs.List, { label: "\u8A2D\u5B9A\u30E1\u30CB\u30E5\u30FC", children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "overview", children: "\u6982\u8981" }),
|
|
39
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "settings", children: "\u8A2D\u5B9A" }),
|
|
40
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { id: "history", children: "\u5C65\u6B74" })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "overview", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u6982\u8981\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) }),
|
|
43
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "settings", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u8A2D\u5B9A\u9805\u76EE\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) }),
|
|
44
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { id: "history", children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u5C65\u6B74\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002" }) })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
41
48
|
play: async ({ canvas }) => {
|
|
42
|
-
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("
|
|
49
|
+
await expect(canvas.getByRole("tabpanel")).toHaveTextContent("\u8A2D\u5B9A\u9805\u76EE");
|
|
43
50
|
}
|
|
44
51
|
};
|
|
45
52
|
export {
|
|
@@ -9,7 +9,7 @@ const TextTag = ({
|
|
|
9
9
|
"span",
|
|
10
10
|
{
|
|
11
11
|
className: cn(
|
|
12
|
-
"inline-block rounded-full bg-bg-mute font-medium",
|
|
12
|
+
"inline-block rounded-full bg-bg-mute font-medium transition-colors",
|
|
13
13
|
clickable && "cursor-pointer hover:bg-bg-emphasize",
|
|
14
14
|
size === "sm" && "px-2 py-0.5 text-xs",
|
|
15
15
|
size === "md" && "px-3 py-1 text-sm"
|
|
@@ -21,14 +21,14 @@ const Default = {
|
|
|
21
21
|
/* @__PURE__ */ jsx(
|
|
22
22
|
Tooltip.Trigger,
|
|
23
23
|
{
|
|
24
|
-
renderItem: (props) => /* @__PURE__ */ jsx(Button, { type: "button", ...props, children: "
|
|
24
|
+
renderItem: (props) => /* @__PURE__ */ jsx(Button, { type: "button", ...props, children: "\u30D8\u30EB\u30D7" })
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */ jsx(Tooltip.Content, { children: /* @__PURE__ */ jsx("p", { children: "
|
|
27
|
+
/* @__PURE__ */ jsx(Tooltip.Content, { children: /* @__PURE__ */ jsx("p", { children: "\u3053\u3053\u306B\u88DC\u8DB3\u60C5\u5831\u304C\u8868\u793A\u3055\u308C\u307E\u3059" }) })
|
|
28
28
|
] }),
|
|
29
29
|
play: async ({ canvas, userEvent }) => {
|
|
30
30
|
const trigger = canvas.getByRole("button", {
|
|
31
|
-
name: "
|
|
31
|
+
name: "\u30D8\u30EB\u30D7"
|
|
32
32
|
});
|
|
33
33
|
trigger.focus();
|
|
34
34
|
await userEvent.keyboard("{Enter}");
|