@k8o/arte-odyssey 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,17 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Accordion } from "./accordion";
3
- import { AccordionButton } from "./accordion-button";
4
- import { AccordionItem } from "./accordion-item";
5
- import { AccordionPanel } from "./accordion-panel";
2
+ import { Accordion } from ".";
6
3
  const meta = {
7
4
  title: "components/accordion",
8
- component: Accordion
5
+ component: Accordion.Root
9
6
  };
10
7
  var accordion_stories_default = meta;
11
8
  const Primary = {
12
9
  args: {},
13
10
  render: () => {
14
- return /* @__PURE__ */ jsxs(Accordion, { children: [
15
- /* @__PURE__ */ jsxs(AccordionItem, { children: [
16
- /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(AccordionButton, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u96E8\u30CB\u30E2\u30DE\u30B1\u30BA" }) }) }),
17
- /* @__PURE__ */ jsxs(AccordionPanel, { children: [
11
+ return /* @__PURE__ */ jsxs(Accordion.Root, { children: [
12
+ /* @__PURE__ */ jsxs(Accordion.Item, { children: [
13
+ /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(Accordion.Button, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u96E8\u30CB\u30E2\u30DE\u30B1\u30BA" }) }) }),
14
+ /* @__PURE__ */ jsxs(Accordion.Panel, { children: [
18
15
  /* @__PURE__ */ jsx("p", { children: "\u96E8\u30CB\u30E2\u30DE\u30B1\u30BA" }),
19
16
  /* @__PURE__ */ jsx("p", { children: "\u98A8\u30CB\u30E2\u30DE\u30B1\u30BA" }),
20
17
  /* @__PURE__ */ jsx("p", { children: "\u96EA\u30CB\u30E2\u590F\u30CE\u6691\u30B5\u30CB\u30E2\u30DE\u30B1\u30CC" }),
@@ -47,9 +44,9 @@ const Primary = {
47
44
  /* @__PURE__ */ jsx("p", { children: "\u30EF\u30BF\u30B7\u30CF\u30CA\u30EA\u30BF\u30A4" })
48
45
  ] })
49
46
  ] }),
50
- /* @__PURE__ */ jsxs(AccordionItem, { children: [
51
- /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(AccordionButton, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u3042\u3069\u3051\u306A\u3044\u8A71" }) }) }),
52
- /* @__PURE__ */ jsxs(AccordionPanel, { children: [
47
+ /* @__PURE__ */ jsxs(Accordion.Item, { children: [
48
+ /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(Accordion.Button, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u3042\u3069\u3051\u306A\u3044\u8A71" }) }) }),
49
+ /* @__PURE__ */ jsxs(Accordion.Panel, { children: [
53
50
  /* @__PURE__ */ jsx("p", { children: "\u667A\u6075\u5B50\u306F\u6771\u4EAC\u306B\u7A7A\u304C\u7121\u3044\u3068\u3044\u3075\u3001" }),
54
51
  /* @__PURE__ */ jsx("p", { children: "\u307B\u3093\u3068\u306E\u7A7A\u304C\u898B\u305F\u3044\u3068\u3044\u3075\u3002" }),
55
52
  /* @__PURE__ */ jsx("p", { children: "\u79C1\u306F\u9A5A\u3044\u3066\u7A7A\u3092\u898B\u308B\u3002" }),
@@ -65,9 +62,9 @@ const Primary = {
65
62
  /* @__PURE__ */ jsx("p", { children: "\u3042\u3069\u3051\u306A\u3044\u7A7A\u306E\u8A71\u3067\u3042\u308B\u3002" })
66
63
  ] })
67
64
  ] }),
68
- /* @__PURE__ */ jsxs(AccordionItem, { children: [
69
- /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(AccordionButton, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u304B\u306A\u3057\u307F" }) }) }),
70
- /* @__PURE__ */ jsx(AccordionPanel, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
65
+ /* @__PURE__ */ jsxs(Accordion.Item, { children: [
66
+ /* @__PURE__ */ jsx("h3", { children: /* @__PURE__ */ jsx(Accordion.Button, { children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "\u304B\u306A\u3057\u307F" }) }) }),
67
+ /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
71
68
  /* @__PURE__ */ jsxs("div", { children: [
72
69
  /* @__PURE__ */ jsx("p", { children: "\u3042\u306E\u9752\u3044\u7A7A\u306E\u6CE2\u306E\u97F3\u304C\u805E\u3048\u308B\u3042\u305F\u308A\u306B" }),
73
70
  /* @__PURE__ */ jsx("p", { children: "\u4F55\u304B\u3068\u3093\u3067\u3082\u306A\u3044\u304A\u3068\u3057\u7269\u3092" }),
@@ -1,4 +1,14 @@
1
- export * from './accordion';
2
- export * from './accordion-button';
3
- export * from './accordion-item';
4
- export * from './accordion-panel';
1
+ export declare const Accordion: {
2
+ readonly Root: React.FC<{
3
+ children?: React.ReactNode | undefined;
4
+ }>;
5
+ readonly Button: React.FC<{
6
+ children?: React.ReactNode | undefined;
7
+ }>;
8
+ readonly Item: React.FC<React.PropsWithChildren<{
9
+ defaultOpen?: boolean;
10
+ }>>;
11
+ readonly Panel: React.FC<{
12
+ children?: React.ReactNode | undefined;
13
+ }>;
14
+ };
@@ -1,4 +1,13 @@
1
- export * from "./accordion";
2
- export * from "./accordion-button";
3
- export * from "./accordion-item";
4
- export * from "./accordion-panel";
1
+ import { Accordion as Root } from "./accordion";
2
+ import { AccordionButton } from "./accordion-button";
3
+ import { AccordionItem } from "./accordion-item";
4
+ import { AccordionPanel } from "./accordion-panel";
5
+ const Accordion = {
6
+ Root,
7
+ Button: AccordionButton,
8
+ Item: AccordionItem,
9
+ Panel: AccordionPanel
10
+ };
11
+ export {
12
+ Accordion
13
+ };
@@ -1,11 +1,11 @@
1
1
  import type { ReactNode } from 'react';
2
- export declare const Anchor: ({ href, children, openInNewTab, renderAnchor, }: {
3
- href: string;
2
+ export declare const Anchor: <T extends string>({ href, children, openInNewTab, renderAnchor, }: {
3
+ href: T;
4
4
  children: ReactNode;
5
5
  openInNewTab?: boolean;
6
6
  renderAnchor?: (props: {
7
7
  type: "internal" | "external";
8
- href: string;
8
+ href: NoInfer<T>;
9
9
  className: string;
10
10
  target?: string;
11
11
  rel?: string;
@@ -1,18 +1,18 @@
1
1
  import type { FC, PropsWithChildren } from 'react';
2
2
  export declare const Breadcrumb: {
3
- List: FC<PropsWithChildren<{
3
+ readonly List: FC<PropsWithChildren<{
4
4
  size?: "sm" | "md" | "lg";
5
5
  }>>;
6
- Item: FC<{
6
+ readonly Item: FC<{
7
7
  children?: React.ReactNode | undefined;
8
8
  }>;
9
- Separator: FC;
10
- Link: FC<PropsWithChildren<{
11
- href: string;
9
+ readonly Separator: FC;
10
+ readonly Link: <T extends string>({ href, current, children, component, }: PropsWithChildren<{
11
+ href: T;
12
12
  current?: boolean;
13
13
  component?: FC<{
14
- href: string;
14
+ href: T;
15
15
  className: string;
16
16
  }>;
17
- }>>;
17
+ }>) => import("react/jsx-runtime").JSX.Element;
18
18
  };
@@ -21,7 +21,12 @@ const Item = ({ children }) => {
21
21
  const Separator = () => {
22
22
  return /* @__PURE__ */ jsx("li", { className: "text-fg-mute", children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "right", size: "sm" }) });
23
23
  };
24
- const _Link = ({ href, current = false, children, component }) => {
24
+ const _Link = ({
25
+ href,
26
+ current = false,
27
+ children,
28
+ component
29
+ }) => {
25
30
  const Link = component ?? "a";
26
31
  return current ? /* @__PURE__ */ jsx("span", { className: "text-fg-base", children }) : /* @__PURE__ */ jsx(Link, { className: "text-fg-mute underline hover:text-fg-base", href, children });
27
32
  };
@@ -1,17 +1,17 @@
1
1
  import { type FC, type PropsWithChildren, type Ref } from 'react';
2
2
  export declare const Content: FC<PropsWithChildren>;
3
3
  export declare const Dialog: {
4
- Root: FC<PropsWithChildren<{
4
+ readonly Root: FC<PropsWithChildren<{
5
5
  ref?: Ref<HTMLElement> | undefined;
6
6
  id?: string | undefined;
7
7
  tabIndex?: number | undefined;
8
8
  role?: string | undefined;
9
9
  }>>;
10
- Header: FC<{
10
+ readonly Header: FC<{
11
11
  title: string;
12
12
  onClose: () => void;
13
13
  }>;
14
- Content: FC<{
14
+ readonly Content: FC<{
15
15
  children?: React.ReactNode | undefined;
16
16
  }>;
17
17
  };
@@ -2,22 +2,22 @@ import { type Placement } from '@floating-ui/react';
2
2
  import { type ComponentProps, type FC, type MouseEventHandler, type PropsWithChildren, type ReactNode } from 'react';
3
3
  import { Button } from '../button';
4
4
  export declare const DropdownMenu: {
5
- Root: FC<PropsWithChildren<{
5
+ readonly Root: FC<PropsWithChildren<{
6
6
  placement?: Placement;
7
7
  }>>;
8
- Content: FC<{
8
+ readonly Content: FC<{
9
9
  children?: ReactNode | undefined;
10
10
  }>;
11
- Item: FC<{
11
+ readonly Item: FC<{
12
12
  onClick: MouseEventHandler;
13
13
  label: string;
14
14
  }>;
15
- Trigger: FC<{
15
+ readonly Trigger: FC<{
16
16
  text: string;
17
17
  size?: ComponentProps<typeof Button>["size"];
18
18
  variant?: ComponentProps<typeof Button>["variant"];
19
19
  }>;
20
- IconTrigger: FC<{
20
+ readonly IconTrigger: FC<{
21
21
  icon: ReactNode;
22
22
  label: string;
23
23
  }>;
@@ -1,17 +1,15 @@
1
- import type { FC, PropsWithChildren, ReactNode } from 'react';
2
- type IconLinkProps = PropsWithChildren<{
3
- size?: 'sm' | 'md' | 'lg';
4
- bg?: 'transparent' | 'base';
1
+ import type { PropsWithChildren, ReactNode } from 'react';
2
+ export declare const IconLink: <T extends string>({ size, bg, label, href, children, openInNewTab, renderAnchor, }: PropsWithChildren<{
3
+ size?: "sm" | "md" | "lg";
4
+ bg?: "transparent" | "base";
5
5
  label?: string;
6
- href: string;
6
+ href: T;
7
7
  openInNewTab?: boolean;
8
8
  renderAnchor?: (props: {
9
- href: string;
9
+ href: NoInfer<T>;
10
10
  className: string;
11
11
  target?: string;
12
12
  rel?: string;
13
13
  children: ReactNode;
14
14
  }) => ReactNode;
15
- }>;
16
- export declare const IconLink: FC<IconLinkProps>;
17
- export {};
15
+ }>) => ReactNode;
@@ -1,19 +1,19 @@
1
- import type { FC, ReactNode } from 'react';
2
- export declare const LinkButton: FC<{
3
- variant?: 'contained' | 'outlined' | 'skeleton';
4
- size?: 'sm' | 'md' | 'lg';
5
- href: string;
1
+ import type { ReactNode } from 'react';
2
+ export declare const LinkButton: <T extends string>({ children, size, variant, href, startIcon, endIcon, active, openInNewTab, renderAnchor, }: {
3
+ variant?: "contained" | "outlined" | "skeleton";
4
+ size?: "sm" | "md" | "lg";
5
+ href: T;
6
6
  startIcon?: ReactNode;
7
7
  endIcon?: ReactNode;
8
8
  active?: boolean;
9
9
  openInNewTab?: boolean;
10
10
  children: string;
11
11
  renderAnchor?: (props: {
12
- 'aria-label'?: string;
13
- href: string;
12
+ "aria-label"?: string;
13
+ href: NoInfer<T>;
14
14
  className: string;
15
15
  target?: string;
16
16
  rel?: string;
17
17
  children: ReactNode;
18
18
  }) => ReactNode;
19
- }>;
19
+ }) => ReactNode;
@@ -3,19 +3,19 @@ import { type ComponentProps, type FC, type PropsWithChildren, type ReactElement
3
3
  import { Button } from '../button';
4
4
  import { type Option } from './hooks';
5
5
  export declare const ListBox: {
6
- Root: FC<PropsWithChildren<{
6
+ readonly Root: FC<PropsWithChildren<{
7
7
  placement?: Placement;
8
8
  options: Option[];
9
9
  value: Option["key"] | undefined;
10
10
  onSelect: (key: Option["key"]) => void;
11
11
  }>>;
12
- Content: FC<{
12
+ readonly Content: FC<{
13
13
  helpContent?: ReactElement;
14
14
  }>;
15
- Trigger: FC<{
15
+ readonly Trigger: FC<{
16
16
  size?: ComponentProps<typeof Button>["size"];
17
17
  }>;
18
- TriggerIcon: FC<{
18
+ readonly TriggerIcon: FC<{
19
19
  size?: ComponentProps<typeof Button>["size"];
20
20
  icon: ReactElement;
21
21
  }>;
@@ -3,16 +3,16 @@ import { type Variants } from 'motion/react';
3
3
  import { type FC, type HTMLProps, type PropsWithChildren, type ReactElement } from 'react';
4
4
  export { useOpenContext } from './hooks';
5
5
  export declare const Popover: {
6
- Root: FC<PropsWithChildren<{
6
+ readonly Root: FC<PropsWithChildren<{
7
7
  placement?: Placement;
8
8
  type?: "dialog" | "menu" | "tooltip" | "listbox";
9
9
  flipDisabled?: boolean;
10
10
  }>>;
11
- Content: FC<{
11
+ readonly Content: FC<{
12
12
  renderItem: (props: Record<string, unknown>) => ReactElement;
13
13
  motionVariants?: Variants;
14
14
  }>;
15
- Trigger: FC<{
15
+ readonly Trigger: FC<{
16
16
  renderItem: (props: Omit<HTMLProps<HTMLButtonElement>, "selected" | "active" | "color">) => ReactElement;
17
17
  }>;
18
18
  };
@@ -1,16 +1,16 @@
1
1
  import { type FC, type PropsWithChildren } from 'react';
2
2
  export declare const Tabs: {
3
- Root: FC<PropsWithChildren<{
3
+ readonly Root: FC<PropsWithChildren<{
4
4
  defaultSelectedId?: string | null;
5
5
  ids: [string, ...string[]];
6
6
  }>>;
7
- List: FC<PropsWithChildren<{
7
+ readonly List: FC<PropsWithChildren<{
8
8
  label: string;
9
9
  }>>;
10
- Tab: FC<PropsWithChildren<{
10
+ readonly Tab: FC<PropsWithChildren<{
11
11
  id: string;
12
12
  }>>;
13
- Panel: FC<PropsWithChildren<{
13
+ readonly Panel: FC<PropsWithChildren<{
14
14
  id: string;
15
15
  }>>;
16
16
  };
@@ -1,13 +1,13 @@
1
1
  import type { Placement } from '@floating-ui/react';
2
2
  import type { FC, PropsWithChildren, ReactElement } from 'react';
3
3
  export declare const Tooltip: {
4
- Root: FC<PropsWithChildren<{
4
+ readonly Root: FC<PropsWithChildren<{
5
5
  placement?: Placement;
6
6
  }>>;
7
- Trigger: FC<{
7
+ readonly Trigger: FC<{
8
8
  renderItem: (props: Record<string, unknown>) => ReactElement;
9
9
  }>;
10
- Content: FC<{
10
+ readonly Content: FC<{
11
11
  children?: React.ReactNode | undefined;
12
12
  }>;
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8o/arte-odyssey",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "k8o's react ui library",
5
5
  "author": "k8o <kosakanoki@gmail.com>",
6
6
  "keywords": [
@@ -87,10 +87,10 @@
87
87
  "peerDependencies": {
88
88
  "@types/react": ">=19.0.0",
89
89
  "@types/react-dom": ">=19.0.0",
90
- "react": "19.1.1",
91
- "react-dom": "19.1.1",
92
- "tailwindcss": "4.1.12",
93
- "typescript": "5.9.2"
90
+ "react": ">=19.0.0",
91
+ "react-dom": ">=19.0.0",
92
+ "tailwindcss": ">=4.0.0",
93
+ "typescript": ">=5.9.0"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "pnpm run build:clean && pnpm build:js && pnpm build:css",