@k8o/arte-odyssey 9.0.0 → 9.1.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/buttons/button/button.d.mts +1 -1
- package/dist/components/buttons/button/button.mjs +1 -1
- package/dist/components/buttons/icon-button/icon-button.d.mts +1 -1
- package/dist/components/data-display/accordion/accordion-button.mjs +2 -2
- package/dist/components/data-display/accordion/accordion-item.mjs +4 -1
- package/dist/components/data-display/accordion/accordion.mjs +1 -1
- package/dist/components/data-display/avatar/avatar.d.mts +1 -1
- package/dist/components/data-display/avatar/avatar.mjs +2 -2
- package/dist/components/data-display/badge/badge.d.mts +1 -1
- package/dist/components/data-display/badge/badge.mjs +3 -3
- package/dist/components/data-display/card/card.mjs +2 -2
- package/dist/components/data-display/card/interactive-card.mjs +2 -2
- package/dist/components/data-display/card/type.d.mts +1 -1
- package/dist/components/data-display/code/code.d.mts +1 -1
- package/dist/components/data-display/code/code.mjs +3 -4
- package/dist/components/data-display/heading/heading.d.mts +1 -1
- package/dist/components/data-display/heading/heading.mjs +7 -7
- package/dist/components/data-display/table/table.d.mts +12 -17
- package/dist/components/data-display/table/table.mjs +23 -21
- package/dist/components/feedback/alert/alert.d.mts +1 -1
- package/dist/components/feedback/alert/alert.mjs +2 -2
- package/dist/components/feedback/progress/progress.d.mts +1 -1
- package/dist/components/feedback/progress/progress.mjs +5 -6
- package/dist/components/feedback/skeleton/skeleton.d.mts +1 -1
- package/dist/components/feedback/skeleton/skeleton.mjs +2 -2
- package/dist/components/feedback/spinner/spinner.d.mts +1 -1
- package/dist/components/feedback/spinner/spinner.mjs +2 -2
- package/dist/components/feedback/toast/provider.mjs +1 -1
- package/dist/components/form/autocomplete/autocomplete.d.mts +1 -1
- package/dist/components/form/autocomplete/autocomplete.mjs +62 -39
- package/dist/components/form/checkbox/checkbox.d.mts +1 -1
- package/dist/components/form/checkbox-card/checkbox-card.d.mts +1 -1
- package/dist/components/form/checkbox-card/checkbox-card.mjs +2 -2
- package/dist/components/form/checkbox-group/checkbox-group.d.mts +1 -1
- package/dist/components/form/checkbox-group/index.d.mts +3 -3
- package/dist/components/form/file-field/file-field.d.mts +1 -1
- package/dist/components/form/form/form.d.mts +1 -1
- package/dist/components/form/form/form.mjs +2 -3
- package/dist/components/form/number-field/number-field.d.mts +1 -1
- package/dist/components/form/number-field/number-field.mjs +5 -5
- package/dist/components/form/password-input/password-input.d.mts +1 -1
- package/dist/components/form/password-input/password-input.mjs +3 -3
- package/dist/components/form/radio/radio.d.mts +1 -1
- package/dist/components/form/radio-card/radio-card.d.mts +1 -1
- package/dist/components/form/radio-card/radio-card.mjs +4 -3
- package/dist/components/form/select/select.d.mts +1 -1
- package/dist/components/form/select/select.mjs +5 -4
- package/dist/components/form/slider/slider.d.mts +1 -1
- package/dist/components/form/slider/slider.mjs +15 -8
- package/dist/components/form/switch/switch.d.mts +1 -1
- package/dist/components/form/switch/switch.mjs +2 -2
- package/dist/components/form/text-field/text-field.d.mts +1 -1
- package/dist/components/form/text-field/text-field.mjs +1 -1
- package/dist/components/form/textarea/textarea.d.mts +1 -1
- package/dist/components/form/textarea/textarea.mjs +1 -1
- package/dist/components/layout/separator/separator.d.mts +1 -1
- package/dist/components/layout/separator/separator.mjs +2 -5
- package/dist/components/navigation/anchor/anchor.d.mts +1 -1
- package/dist/components/navigation/breadcrumb/breadcrumb.mjs +1 -1
- package/dist/components/navigation/pagination/pagination.mjs +12 -6
- package/dist/components/navigation/tabs/tabs.mjs +21 -12
- package/dist/components/overlays/drawer/drawer.mjs +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +1 -1
- package/dist/components/overlays/list-box/list-box.mjs +1 -1
- package/dist/components/overlays/modal/modal.mjs +9 -5
- package/dist/components/overlays/popover/popover.mjs +8 -2
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/hooks/writing-mode/index.d.mts +7 -0
- package/dist/hooks/writing-mode/index.mjs +22 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/styles/index.css +37 -0
- package/dist/styles/tokens.d.mts +12 -1
- package/dist/styles/tokens.mjs +25 -1
- package/docs/references/typography.md +29 -0
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ type Props = {
|
|
|
15
15
|
className: string;
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
}) => ReactNode;
|
|
18
|
-
} & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type'>;
|
|
18
|
+
} & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type' | 'className' | 'style'>;
|
|
19
19
|
declare const Button: FC<Props>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { Button };
|
|
@@ -31,7 +31,7 @@ const Button = ({ ref, children, type = "button", size = "md", color = "primary"
|
|
|
31
31
|
"border-secondary-border bg-bg-base text-secondary-fg hover:bg-bg-subtle active:bg-bg-mute": variant === "outlined" && color === "secondary",
|
|
32
32
|
"border-border-base bg-bg-base text-fg-base hover:bg-bg-subtle active:bg-bg-mute": variant === "outlined" && color === "gray",
|
|
33
33
|
"border-transparent bg-transparent text-fg-mute hover:bg-bg-subtle hover:text-fg-base active:bg-bg-mute active:text-fg-base": variant === "skeleton"
|
|
34
|
-
}, "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info", size === "sm" && "px-3 py-1 text-sm", size === "md" && "px-4 py-2 text-md", size === "lg" && "px-6 py-3 text-lg", fullWidth && "w-full", (hasStartIcon || hasEndIcon) && "flex items-center gap-2", hasStartIcon && hasEndIcon ? "justify-between" : hasStartIcon && variant !== "skeleton" ? "justify-center" : hasEndIcon && "justify-between", isActive && "text-fg-info");
|
|
34
|
+
}, "focus-visible:border-transparent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info", size === "sm" && "px-3 py-1 text-sm", size === "md" && "px-4 py-2 text-md", size === "lg" && "px-6 py-3 text-lg", fullWidth && "w-full vertical:w-auto", (hasStartIcon || hasEndIcon) && "flex items-center gap-2", hasStartIcon && hasEndIcon ? "justify-between" : hasStartIcon && variant !== "skeleton" ? "justify-center" : hasEndIcon && "justify-between", isActive && "text-fg-info");
|
|
35
35
|
const composedChildren = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
36
36
|
resolvedStartIcon,
|
|
37
37
|
children,
|
|
@@ -17,7 +17,7 @@ type Props = {
|
|
|
17
17
|
'aria-label': string;
|
|
18
18
|
triggerProps: IconButtonTriggerProps;
|
|
19
19
|
}) => ReactNode;
|
|
20
|
-
} & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type'>;
|
|
20
|
+
} & Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type' | 'className' | 'style'>;
|
|
21
21
|
declare const IconButton: FC<Props>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { IconButton, IconButtonTriggerProps };
|
|
@@ -11,12 +11,12 @@ const AccordionButton = ({ children }) => {
|
|
|
11
11
|
return /* @__PURE__ */ jsxs("button", {
|
|
12
12
|
"aria-controls": `${id}-panel`,
|
|
13
13
|
"aria-expanded": open,
|
|
14
|
-
className: cn("flex w-full cursor-pointer items-center justify-between rounded-md p-4 text-fg-base transition-colors", "hover:bg-primary-bg-subtle hover:text-primary-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-info"),
|
|
14
|
+
className: cn("flex w-full cursor-pointer items-center justify-between rounded-md p-4 text-fg-base transition-colors vertical:h-full", "hover:bg-primary-bg-subtle hover:text-primary-fg", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-info"),
|
|
15
15
|
id: `${id}-button`,
|
|
16
16
|
onClick: toggleOpen,
|
|
17
17
|
type: "button",
|
|
18
18
|
children: [children, /* @__PURE__ */ jsx("span", {
|
|
19
|
-
className: cn("transition-transform duration-150", open && "rotate-180"),
|
|
19
|
+
className: cn("transition-transform duration-150", !open && "vertical:rotate-90", open && "rotate-180 vertical:-rotate-90"),
|
|
20
20
|
children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "down" })
|
|
21
21
|
})]
|
|
22
22
|
});
|
|
@@ -7,7 +7,10 @@ const AccordionItem = ({ children, defaultOpen = false }) => {
|
|
|
7
7
|
return /* @__PURE__ */ jsx(AccordionItemProvider, {
|
|
8
8
|
defaultOpen,
|
|
9
9
|
id: useId(),
|
|
10
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
10
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: "vertical:h-full",
|
|
12
|
+
children
|
|
13
|
+
})
|
|
11
14
|
});
|
|
12
15
|
};
|
|
13
16
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
//#region src/components/data-display/accordion/accordion.tsx
|
|
3
3
|
const Accordion = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
4
|
-
className: "divide-border-mute divide-y",
|
|
4
|
+
className: "divide-border-mute vertical:flex vertical:h-full vertical:flex-col vertical:divide-y-0 vertical:[&>:not(:last-child)]:border-l vertical:[&>:not(:last-child)]:border-border-mute divide-y",
|
|
5
5
|
children
|
|
6
6
|
});
|
|
7
7
|
//#endregion
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
name?: string;
|
|
8
8
|
size?: 'sm' | 'md' | 'lg';
|
|
9
9
|
src?: string;
|
|
10
|
-
} & Omit<HTMLAttributes<HTMLSpanElement>, 'role' | 'aria-label'>;
|
|
10
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'role' | 'aria-label' | 'className' | 'style'>;
|
|
11
11
|
declare const Avatar: FC<Props>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Avatar };
|
|
@@ -8,7 +8,7 @@ const getInitials = (name) => {
|
|
|
8
8
|
const initials = name.trim().split(/\s+/).slice(0, 2).map((part) => part.charAt(0).toUpperCase()).join("");
|
|
9
9
|
return initials === "" ? "?" : initials;
|
|
10
10
|
};
|
|
11
|
-
const Avatar = ({ alt, fallback, name, size = "md", src,
|
|
11
|
+
const Avatar = ({ alt, fallback, name, size = "md", src, ...rest }) => {
|
|
12
12
|
const [failedSrc, setFailedSrc] = useState(null);
|
|
13
13
|
const showImage = Boolean(src) && failedSrc !== src;
|
|
14
14
|
const label = alt ?? name ?? "Avatar";
|
|
@@ -16,7 +16,7 @@ const Avatar = ({ alt, fallback, name, size = "md", src, className, ...rest }) =
|
|
|
16
16
|
return /* @__PURE__ */ jsx("span", {
|
|
17
17
|
...rest,
|
|
18
18
|
"aria-label": label,
|
|
19
|
-
className: cn("inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border-base bg-bg-mute font-medium text-fg-base", size === "sm" && "size-8 text-xs", size === "md" && "size-10 text-sm", size === "lg" && "size-14 text-lg"
|
|
19
|
+
className: cn("inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border-base bg-bg-mute font-medium text-fg-base", size === "sm" && "size-8 text-xs", size === "md" && "size-10 text-sm", size === "lg" && "size-14 text-lg"),
|
|
20
20
|
role: "img",
|
|
21
21
|
children: showImage ? /* @__PURE__ */ jsx("img", {
|
|
22
22
|
alt: alt ?? "",
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
interactive?: boolean;
|
|
8
8
|
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
9
9
|
variant?: 'solid' | 'outline';
|
|
10
|
-
} & Omit<HTMLAttributes<HTMLElement>, 'children'>;
|
|
10
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>;
|
|
11
11
|
declare const Badge: FC<Props>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Badge };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/data-display/badge/badge.tsx
|
|
4
|
-
const Badge = ({ interactive = false, size = "md", text, tone = "neutral", variant = "solid",
|
|
4
|
+
const Badge = ({ interactive = false, size = "md", text, tone = "neutral", variant = "solid", ...rest }) => {
|
|
5
5
|
const interactiveClassName = cn(interactive && "cursor-pointer focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info", interactive && tone === "neutral" && variant === "solid" && "hover:bg-bg-emphasize active:bg-bg-base", interactive && tone === "neutral" && variant === "outline" && "hover:bg-bg-subtle active:bg-bg-mute", interactive && tone === "info" && variant === "solid" && "hover:bg-bg-info/80 active:bg-bg-info/60", interactive && tone === "info" && variant === "outline" && "hover:bg-bg-info active:bg-bg-info/80", interactive && tone === "success" && variant === "solid" && "hover:bg-bg-success/80 active:bg-bg-success/60", interactive && tone === "success" && variant === "outline" && "hover:bg-bg-success active:bg-bg-success/80", interactive && tone === "warning" && variant === "solid" && "hover:bg-bg-warning/80 active:bg-bg-warning/60", interactive && tone === "warning" && variant === "outline" && "hover:bg-bg-warning active:bg-bg-warning/80", interactive && tone === "error" && variant === "solid" && "hover:bg-bg-error/80 active:bg-bg-error/60", interactive && tone === "error" && variant === "outline" && "hover:bg-bg-error active:bg-bg-error/80");
|
|
6
6
|
const badgeClassName = cn("inline-flex items-center rounded-full border font-medium transition-colors", size === "sm" && "px-2 py-0.5 text-xs", size === "md" && "px-2.5 py-1 text-xs", tone === "neutral" && variant === "solid" && "border-border-mute bg-bg-mute text-fg-base", tone === "neutral" && variant === "outline" && "border-border-base bg-bg-base text-fg-base", tone === "info" && variant === "solid" && "border-border-info bg-bg-info text-fg-info", tone === "info" && variant === "outline" && "border-border-info bg-bg-base text-fg-info", tone === "success" && variant === "solid" && "border-border-success bg-bg-success text-fg-success", tone === "success" && variant === "outline" && "border-border-success bg-bg-base text-fg-success", tone === "warning" && variant === "solid" && "border-border-warning bg-bg-warning text-fg-warning", tone === "warning" && variant === "outline" && "border-border-warning bg-bg-base text-fg-warning", tone === "error" && variant === "solid" && "border-border-error bg-bg-error text-fg-error", tone === "error" && variant === "outline" && "border-border-error bg-bg-base text-fg-error", interactiveClassName);
|
|
7
7
|
if (interactive) return /* @__PURE__ */ jsx("button", {
|
|
8
8
|
...rest,
|
|
9
|
-
className:
|
|
9
|
+
className: badgeClassName,
|
|
10
10
|
type: "button",
|
|
11
11
|
children: text
|
|
12
12
|
});
|
|
13
13
|
return /* @__PURE__ */ jsx("span", {
|
|
14
14
|
...rest,
|
|
15
|
-
className:
|
|
15
|
+
className: badgeClassName,
|
|
16
16
|
children: text
|
|
17
17
|
});
|
|
18
18
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/data-display/card/card.tsx
|
|
4
|
-
const Card = ({ children, width = "full", appearance = "shadow",
|
|
4
|
+
const Card = ({ children, width = "full", appearance = "shadow", ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
5
5
|
...rest,
|
|
6
|
-
className: cn("rounded-xl", appearance === "shadow" && "shadow-sm", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"
|
|
6
|
+
className: cn("rounded-xl", appearance === "shadow" && "shadow-sm", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"),
|
|
7
7
|
children
|
|
8
8
|
});
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/data-display/card/interactive-card.tsx
|
|
4
|
-
const InteractiveCard = ({ children, width = "full", appearance = "shadow",
|
|
4
|
+
const InteractiveCard = ({ children, width = "full", appearance = "shadow", ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
5
5
|
...rest,
|
|
6
|
-
className: cn("rounded-xl transition-transform hover:scale-[1.02] active:scale-[0.98]", appearance === "shadow" && "shadow-sm", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"
|
|
6
|
+
className: cn("rounded-xl transition-transform hover:scale-[1.02] active:scale-[0.98]", appearance === "shadow" && "shadow-sm", appearance === "bordered" && "border border-border-mute", width === "full" && "w-full", width === "fit" && "w-fit", "bg-bg-base"),
|
|
7
7
|
children
|
|
8
8
|
});
|
|
9
9
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import { FC, HTMLAttributes } from "react";
|
|
|
3
3
|
//#region src/components/data-display/code/code.d.ts
|
|
4
4
|
type Props = {
|
|
5
5
|
children: string;
|
|
6
|
-
} & Omit<HTMLAttributes<HTMLElement>, 'children'>;
|
|
6
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>;
|
|
7
7
|
declare const Code: FC<Props>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Code };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { cn } from "../../../helpers/cn.mjs";
|
|
2
1
|
import { findAllColors } from "./find-all-colors.mjs";
|
|
3
2
|
import { Fragment } from "react";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
//#region src/components/data-display/code/code.tsx
|
|
6
|
-
const Code = ({ children,
|
|
5
|
+
const Code = ({ children, ...rest }) => {
|
|
7
6
|
const colors = findAllColors(children);
|
|
8
7
|
if (colors.length === 0) return /* @__PURE__ */ jsx("code", {
|
|
9
8
|
...rest,
|
|
10
|
-
className:
|
|
9
|
+
className: "bg-bg-mute m-0.5 rounded-md px-1.5 sm:py-0.5",
|
|
11
10
|
children
|
|
12
11
|
});
|
|
13
12
|
const parts = [];
|
|
@@ -25,7 +24,7 @@ const Code = ({ children, className, ...rest }) => {
|
|
|
25
24
|
if (lastIndex < children.length) parts.push(children.slice(lastIndex));
|
|
26
25
|
return /* @__PURE__ */ jsx("code", {
|
|
27
26
|
...rest,
|
|
28
|
-
className:
|
|
27
|
+
className: "bg-bg-mute vertical:inline vertical:gap-0 m-0.5 inline-flex items-center gap-1 rounded-md px-1.5 sm:py-0.5",
|
|
29
28
|
children: parts
|
|
30
29
|
});
|
|
31
30
|
};
|
|
@@ -4,7 +4,7 @@ import { FC, HTMLAttributes } from "react";
|
|
|
4
4
|
type Props = {
|
|
5
5
|
type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
6
|
lineClamp?: number;
|
|
7
|
-
} & HTMLAttributes<HTMLHeadingElement>;
|
|
7
|
+
} & Omit<HTMLAttributes<HTMLHeadingElement>, 'className' | 'style'>;
|
|
8
8
|
declare const Heading: FC<Props>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Heading };
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/data-display/heading/heading.tsx
|
|
4
|
-
const Heading = ({ children, type, lineClamp,
|
|
4
|
+
const Heading = ({ children, type, lineClamp, ...rest }) => {
|
|
5
5
|
const lineClampClass = { [`line-clamp-${lineClamp?.toString() ?? ""}`]: lineClamp };
|
|
6
6
|
if (type === "h1") return /* @__PURE__ */ jsx("h1", {
|
|
7
7
|
...rest,
|
|
8
|
-
className: cn("font-bold text-2xl md:text-3xl", lineClampClass
|
|
8
|
+
className: cn("font-bold text-2xl md:text-3xl", lineClampClass),
|
|
9
9
|
children
|
|
10
10
|
});
|
|
11
11
|
if (type === "h2") return /* @__PURE__ */ jsx("h2", {
|
|
12
12
|
...rest,
|
|
13
|
-
className: cn("font-bold text-xl md:text-2xl", lineClampClass
|
|
13
|
+
className: cn("font-bold text-xl md:text-2xl", lineClampClass),
|
|
14
14
|
children
|
|
15
15
|
});
|
|
16
16
|
if (type === "h3") return /* @__PURE__ */ jsx("h3", {
|
|
17
17
|
...rest,
|
|
18
|
-
className: cn("font-bold text-lg md:text-xl", lineClampClass
|
|
18
|
+
className: cn("font-bold text-lg md:text-xl", lineClampClass),
|
|
19
19
|
children
|
|
20
20
|
});
|
|
21
21
|
if (type === "h4") return /* @__PURE__ */ jsx("h4", {
|
|
22
22
|
...rest,
|
|
23
|
-
className: cn("font-bold text-md md:text-lg", lineClampClass
|
|
23
|
+
className: cn("font-bold text-md md:text-lg", lineClampClass),
|
|
24
24
|
children
|
|
25
25
|
});
|
|
26
26
|
if (type === "h5") return /* @__PURE__ */ jsx("h5", {
|
|
27
27
|
...rest,
|
|
28
|
-
className: cn("font-bold text-sm md:text-md", lineClampClass
|
|
28
|
+
className: cn("font-bold text-sm md:text-md", lineClampClass),
|
|
29
29
|
children
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ jsx("h6", {
|
|
32
32
|
...rest,
|
|
33
|
-
className: cn("font-bold text-xs md:text-sm", lineClampClass
|
|
33
|
+
className: cn("font-bold text-xs md:text-sm", lineClampClass),
|
|
34
34
|
children
|
|
35
35
|
});
|
|
36
36
|
};
|
|
@@ -1,43 +1,38 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/data-display/table/table.d.ts
|
|
4
|
-
type RootProps = PropsWithChildren<{
|
|
5
|
-
className?: string;
|
|
6
|
-
containerClassName?: string;
|
|
7
|
-
}>;
|
|
8
4
|
type RowProps = PropsWithChildren<{
|
|
9
|
-
className?: string;
|
|
10
5
|
interactive?: boolean;
|
|
11
6
|
}>;
|
|
12
7
|
type CellAlign = 'left' | 'center' | 'right';
|
|
13
8
|
type HeaderCellProps = PropsWithChildren<{
|
|
14
9
|
align?: CellAlign;
|
|
15
|
-
className?: string;
|
|
16
10
|
}>;
|
|
17
11
|
type CellProps = PropsWithChildren<{
|
|
18
12
|
align?: CellAlign;
|
|
19
|
-
className?: string;
|
|
20
13
|
colSpan?: number;
|
|
21
14
|
tone?: 'default' | 'muted';
|
|
22
15
|
}>;
|
|
23
|
-
type SectionProps = PropsWithChildren<{
|
|
24
|
-
className?: string;
|
|
25
|
-
}>;
|
|
26
|
-
type CaptionProps = PropsWithChildren<{
|
|
27
|
-
className?: string;
|
|
28
|
-
}>;
|
|
29
16
|
type EmptyStateProps = {
|
|
30
17
|
colSpan: number;
|
|
31
18
|
children: ReactNode;
|
|
32
19
|
};
|
|
33
20
|
declare const Table: {
|
|
34
|
-
readonly Root: FC<
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
readonly Root: FC<{
|
|
22
|
+
children?: ReactNode | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
readonly Head: FC<{
|
|
25
|
+
children?: ReactNode | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
readonly Body: FC<{
|
|
28
|
+
children?: ReactNode | undefined;
|
|
29
|
+
}>;
|
|
37
30
|
readonly Row: FC<RowProps>;
|
|
38
31
|
readonly HeaderCell: FC<HeaderCellProps>;
|
|
39
32
|
readonly Cell: FC<CellProps>;
|
|
40
|
-
readonly Caption: FC<
|
|
33
|
+
readonly Caption: FC<{
|
|
34
|
+
children?: ReactNode | undefined;
|
|
35
|
+
}>;
|
|
41
36
|
readonly EmptyState: FC<EmptyStateProps>;
|
|
42
37
|
};
|
|
43
38
|
//#endregion
|
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/data-display/table/table.tsx
|
|
4
|
-
const Root = ({ children
|
|
5
|
-
className:
|
|
4
|
+
const Root = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
5
|
+
className: "border-border-mute bg-bg-base vertical:writing-sideways-rl vertical:h-fit vertical:w-fit w-full overflow-x-auto rounded-lg border",
|
|
6
6
|
children: /* @__PURE__ */ jsx("table", {
|
|
7
|
-
className:
|
|
7
|
+
className: "min-w-full border-collapse text-left text-sm",
|
|
8
8
|
children
|
|
9
9
|
})
|
|
10
10
|
});
|
|
11
|
-
const Head = ({ children
|
|
12
|
-
className:
|
|
11
|
+
const Head = ({ children }) => /* @__PURE__ */ jsx("thead", {
|
|
12
|
+
className: "bg-bg-subtle",
|
|
13
13
|
children
|
|
14
14
|
});
|
|
15
|
-
const Body = ({ children
|
|
16
|
-
className:
|
|
15
|
+
const Body = ({ children }) => /* @__PURE__ */ jsx("tbody", {
|
|
16
|
+
className: "vertical:[&_tr:last-child]:border-l-0 [&_tr:last-child]:border-b-0",
|
|
17
17
|
children
|
|
18
18
|
});
|
|
19
|
-
const Row = ({ children,
|
|
20
|
-
className: cn("border-border-mute border-b transition-colors", interactive && "hover:bg-bg-mute"
|
|
19
|
+
const Row = ({ children, interactive = false }) => /* @__PURE__ */ jsx("tr", {
|
|
20
|
+
className: cn("border-border-mute border-b transition-colors vertical:border-b-0 vertical:border-l", interactive && "hover:bg-bg-mute"),
|
|
21
21
|
children
|
|
22
22
|
});
|
|
23
|
-
const HeaderCell = ({ align = "left", children
|
|
24
|
-
className: cn("px-4 py-3 font-medium text-fg-base", align === "center" && "text-center", align === "right" && "text-right"
|
|
23
|
+
const HeaderCell = ({ align = "left", children }) => /* @__PURE__ */ jsx("th", {
|
|
24
|
+
className: cn("px-4 py-3 font-medium text-fg-base", align === "center" && "text-center", align === "right" && "text-right"),
|
|
25
25
|
scope: "col",
|
|
26
26
|
children
|
|
27
27
|
});
|
|
28
|
-
const Cell = ({ align = "left", children,
|
|
29
|
-
className: cn("px-4 py-3 align-middle", tone === "muted" ? "text-fg-mute" : "text-fg-base", align === "center" && "text-center", align === "right" && "text-right"
|
|
28
|
+
const Cell = ({ align = "left", children, colSpan, tone = "default" }) => /* @__PURE__ */ jsx("td", {
|
|
29
|
+
className: cn("px-4 py-3 align-middle", tone === "muted" ? "text-fg-mute" : "text-fg-base", align === "center" && "text-center", align === "right" && "text-right"),
|
|
30
30
|
colSpan,
|
|
31
31
|
children
|
|
32
32
|
});
|
|
33
|
-
const Caption = ({ children
|
|
34
|
-
className:
|
|
33
|
+
const Caption = ({ children }) => /* @__PURE__ */ jsx("caption", {
|
|
34
|
+
className: "text-fg-mute caption-bottom px-4 py-3 text-sm",
|
|
35
35
|
children
|
|
36
36
|
});
|
|
37
|
-
const EmptyState = ({ children, colSpan }) => /* @__PURE__ */ jsx(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const EmptyState = ({ children, colSpan }) => /* @__PURE__ */ jsx("tr", {
|
|
38
|
+
className: "border-border-mute border-b transition-colors",
|
|
39
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
40
|
+
className: "text-fg-mute px-4 py-10 text-center align-middle",
|
|
41
|
+
colSpan,
|
|
42
|
+
children
|
|
43
|
+
})
|
|
44
|
+
});
|
|
43
45
|
const Table = {
|
|
44
46
|
Root,
|
|
45
47
|
Head,
|
|
@@ -5,7 +5,7 @@ import { FC, HTMLAttributes } from "react";
|
|
|
5
5
|
type Props = {
|
|
6
6
|
status: Status;
|
|
7
7
|
message: string | string[];
|
|
8
|
-
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'>;
|
|
8
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role' | 'className' | 'style'>;
|
|
9
9
|
declare const Alert: FC<Props>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Alert };
|
|
@@ -8,9 +8,9 @@ const STATUS_LABEL = {
|
|
|
8
8
|
warning: "警告",
|
|
9
9
|
error: "エラー"
|
|
10
10
|
};
|
|
11
|
-
const Alert = ({ status, message,
|
|
11
|
+
const Alert = ({ status, message, ...rest }) => /* @__PURE__ */ jsxs("div", {
|
|
12
12
|
...rest,
|
|
13
|
-
className: cn("flex items-center gap-3 rounded-lg p-4", status === "success" && "bg-bg-success", status === "info" && "bg-bg-info", status === "warning" && "bg-bg-warning", status === "error" && "bg-bg-error"
|
|
13
|
+
className: cn("flex items-center gap-3 rounded-lg p-4", status === "success" && "bg-bg-success", status === "info" && "bg-bg-info", status === "warning" && "bg-bg-warning", status === "error" && "bg-bg-error"),
|
|
14
14
|
role: status === "error" || status === "warning" ? "alert" : "status",
|
|
15
15
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
16
16
|
className: cn(status === "success" && "text-fg-success", status === "info" && "text-fg-info", status === "warning" && "text-fg-warning", status === "error" && "text-fg-error"),
|
|
@@ -6,7 +6,7 @@ type Props = {
|
|
|
6
6
|
maxProgress: number;
|
|
7
7
|
minProgress?: number;
|
|
8
8
|
label?: string;
|
|
9
|
-
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
9
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>;
|
|
10
10
|
declare const Progress: FC<Props>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Progress };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { cn } from "../../../helpers/cn.mjs";
|
|
2
1
|
import { toPrecision } from "../../../internal/to-precision.mjs";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/feedback/progress/progress.tsx
|
|
5
|
-
const Progress = ({ progress, maxProgress, minProgress = 0, label,
|
|
4
|
+
const Progress = ({ progress, maxProgress, minProgress = 0, label, ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
6
5
|
...rest,
|
|
7
|
-
className:
|
|
6
|
+
className: "bg-bg-emphasize vertical:inline-48 rounded-full block-4 inline-full",
|
|
7
|
+
style: { "--progress-fill": `${(progress / maxProgress * 100).toString()}%` },
|
|
8
8
|
children: /* @__PURE__ */ jsx("div", {
|
|
9
9
|
"aria-label": label ?? `${toPrecision(progress / maxProgress).toString()}%`,
|
|
10
10
|
"aria-valuemax": maxProgress,
|
|
11
11
|
"aria-valuemin": minProgress,
|
|
12
12
|
"aria-valuenow": progress,
|
|
13
|
-
className: "bg-primary-bg
|
|
14
|
-
role: "progressbar"
|
|
15
|
-
style: { width: `${(progress / maxProgress * 100).toString()}%` }
|
|
13
|
+
className: "bg-primary-bg rounded-full transition-all block-full inline-(--progress-fill)",
|
|
14
|
+
role: "progressbar"
|
|
16
15
|
})
|
|
17
16
|
});
|
|
18
17
|
//#endregion
|
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
animate?: boolean;
|
|
6
6
|
shape?: 'rect' | 'circle';
|
|
7
7
|
size?: 'sm' | 'md' | 'lg';
|
|
8
|
-
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
8
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>;
|
|
9
9
|
declare const Skeleton: FC<Props>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Skeleton };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/feedback/skeleton/skeleton.tsx
|
|
4
|
-
const Skeleton = ({ animate = true, shape = "rect", size = "md",
|
|
4
|
+
const Skeleton = ({ animate = true, shape = "rect", size = "md", ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
5
5
|
...rest,
|
|
6
6
|
"aria-hidden": true,
|
|
7
|
-
className: cn("bg-bg-mute", animate && "animate-pulse", shape === "rect" && "rounded-lg", shape === "rect" && size === "sm" && "h-3 w-24", shape === "rect" && size === "md" && "h-4 w-40", shape === "rect" && size === "lg" && "h-5 w-56", shape === "circle" && "rounded-full", shape === "circle" && size === "sm" && "size-8", shape === "circle" && size === "md" && "size-12", shape === "circle" && size === "lg" && "size-16"
|
|
7
|
+
className: cn("bg-bg-mute", animate && "animate-pulse", shape === "rect" && "rounded-lg", shape === "rect" && size === "sm" && "h-3 w-24", shape === "rect" && size === "md" && "h-4 w-40", shape === "rect" && size === "lg" && "h-5 w-56", shape === "circle" && "rounded-full", shape === "circle" && size === "sm" && "size-8", shape === "circle" && size === "md" && "size-12", shape === "circle" && size === "lg" && "size-16")
|
|
8
8
|
});
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Skeleton };
|
|
@@ -4,7 +4,7 @@ import { FC, OutputHTMLAttributes } from "react";
|
|
|
4
4
|
type Props = {
|
|
5
5
|
label?: string;
|
|
6
6
|
size?: 'sm' | 'md' | 'lg';
|
|
7
|
-
} & Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'aria-label'>;
|
|
7
|
+
} & Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'aria-label' | 'className' | 'style'>;
|
|
8
8
|
declare const Spinner: FC<Props>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Spinner };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/feedback/spinner/spinner.tsx
|
|
4
|
-
const Spinner = ({ label = "Loading", size = "md",
|
|
4
|
+
const Spinner = ({ label = "Loading", size = "md", ...rest }) => /* @__PURE__ */ jsxs("output", {
|
|
5
5
|
...rest,
|
|
6
6
|
"aria-label": label,
|
|
7
7
|
"aria-live": "polite",
|
|
8
|
-
className:
|
|
8
|
+
className: "inline-flex items-center justify-center",
|
|
9
9
|
children: [/* @__PURE__ */ jsx("span", {
|
|
10
10
|
"aria-hidden": true,
|
|
11
11
|
className: cn("inline-block animate-spin rounded-full border-4 border-border-base border-t-primary-border", size === "sm" && "size-4", size === "md" && "size-6", size === "lg" && "size-8")
|
|
@@ -54,7 +54,7 @@ const ToastProvider = ({ children, portalRef = null, position = "fixed" }) => {
|
|
|
54
54
|
children: [children, container ? createPortal(/* @__PURE__ */ jsx("section", {
|
|
55
55
|
"aria-label": "通知",
|
|
56
56
|
"aria-live": "polite",
|
|
57
|
-
className: cn("absolute bottom-3 z-
|
|
57
|
+
className: cn("absolute bottom-3 z-toast flex w-full flex-col items-center justify-center gap-4", position === "fixed" && "fixed", position === "absolute" && "absolute"),
|
|
58
58
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
59
59
|
initial: false,
|
|
60
60
|
children: toasts.map((toast) => /* @__PURE__ */ jsx(motion$1.div, {
|
|
@@ -6,7 +6,7 @@ type BaseProps = {
|
|
|
6
6
|
id: string;
|
|
7
7
|
invalid?: boolean;
|
|
8
8
|
options: readonly Option[];
|
|
9
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'className' | 'value' | 'onChange' | 'defaultValue' | 'children' | 'id' | 'autoComplete' | 'aria-autocomplete' | 'aria-controls' | 'aria-expanded'>;
|
|
9
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'role' | 'className' | 'style' | 'value' | 'onChange' | 'defaultValue' | 'children' | 'id' | 'autoComplete' | 'aria-autocomplete' | 'aria-controls' | 'aria-expanded'>;
|
|
10
10
|
type ControlledProps = {
|
|
11
11
|
value: string[];
|
|
12
12
|
onChange: (value: string[]) => void;
|