sparkle-design 1.0.7 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.en.md +19 -0
  2. package/README.md +19 -0
  3. package/dist/components/ui/badge/index.d.ts +3 -3
  4. package/dist/components/ui/badge/index.js +16 -10
  5. package/dist/components/ui/breadcrumb/index.d.ts +6 -6
  6. package/dist/components/ui/breadcrumb/index.js +2 -2
  7. package/dist/components/ui/button/index.d.ts +70 -5
  8. package/dist/components/ui/button/index.js +261 -107
  9. package/dist/components/ui/card/index.d.ts +119 -23
  10. package/dist/components/ui/card/index.js +155 -45
  11. package/dist/components/ui/checkbox/index.d.ts +1 -1
  12. package/dist/components/ui/checkbox/index.js +38 -36
  13. package/dist/components/ui/dialog/index.d.ts +15 -15
  14. package/dist/components/ui/dialog/index.js +10 -9
  15. package/dist/components/ui/divider/index.d.ts +5 -2
  16. package/dist/components/ui/divider/index.js +6 -11
  17. package/dist/components/ui/form/index.d.ts +10 -7
  18. package/dist/components/ui/form/index.js +17 -7
  19. package/dist/components/ui/form/label.d.ts +1 -1
  20. package/dist/components/ui/icon/index.d.ts +20 -16
  21. package/dist/components/ui/icon/index.js +6 -11
  22. package/dist/components/ui/icon-button/index.d.ts +118 -5
  23. package/dist/components/ui/icon-button/index.js +272 -54
  24. package/dist/components/ui/inline-message/index.d.ts +13 -4
  25. package/dist/components/ui/inline-message/index.js +21 -21
  26. package/dist/components/ui/input/index.d.ts +6 -3
  27. package/dist/components/ui/input/index.js +21 -17
  28. package/dist/components/ui/input-password/index.d.ts +4 -1
  29. package/dist/components/ui/input-password/index.js +14 -2
  30. package/dist/components/ui/link/index.d.ts +13 -6
  31. package/dist/components/ui/link/index.js +20 -15
  32. package/dist/components/ui/modal/index.d.ts +11 -11
  33. package/dist/components/ui/modal/index.js +5 -4
  34. package/dist/components/ui/overlay/index.d.ts +5 -2
  35. package/dist/components/ui/overlay/index.js +4 -5
  36. package/dist/components/ui/radio/index.d.ts +10 -4
  37. package/dist/components/ui/radio/index.js +106 -34
  38. package/dist/components/ui/select/index.d.ts +11 -11
  39. package/dist/components/ui/select/index.js +23 -21
  40. package/dist/components/ui/skeleton/index.d.ts +1 -1
  41. package/dist/components/ui/skeleton/index.js +1 -1
  42. package/dist/components/ui/slider/index.d.ts +53 -1
  43. package/dist/components/ui/slider/index.js +75 -13
  44. package/dist/components/ui/spinner/index.d.ts +12 -9
  45. package/dist/components/ui/spinner/index.js +9 -14
  46. package/dist/components/ui/switch/index.d.ts +1 -1
  47. package/dist/components/ui/switch/index.js +11 -7
  48. package/dist/components/ui/tabs/index.d.ts +8 -4
  49. package/dist/components/ui/tabs/index.js +43 -40
  50. package/dist/components/ui/tag/index.d.ts +8 -3
  51. package/dist/components/ui/tag/index.js +33 -30
  52. package/dist/components/ui/textarea/index.d.ts +6 -3
  53. package/dist/components/ui/textarea/index.js +12 -18
  54. package/dist/components/ui/toast/index.d.ts +1 -1
  55. package/dist/components/ui/toast/index.js +1 -1
  56. package/dist/components/ui/tooltip/index.d.ts +4 -4
  57. package/dist/components/ui/tooltip/index.js +1 -1
  58. package/dist/lib/utils.d.ts +8 -0
  59. package/dist/lib/utils.js +60 -1
  60. package/dist/test/helpers.d.ts +3 -2
  61. package/dist/test/helpers.js +23 -4
  62. package/dist/test/setup.js +37 -31
  63. package/package.json +17 -10
package/README.en.md CHANGED
@@ -24,6 +24,25 @@ It implements [Goodpatch](https://goodpatch.com/)'s "Sparkle Design" system on t
24
24
  - 🎨 **Customizability** ... A dedicated CLI tool lets you apply the same customizations found in the Figma files. This makes it easy to spin up code for design systems built on Sparkle Design.
25
25
  - 🤖 **AI Friendly** ... Ships with skills and guard configurations for Claude Code, Cursor, and Codex. Maintain design system quality even during AI-assisted coding.
26
26
 
27
+ ## Versions, React and CLI support
28
+
29
+ | Version | React | sparkle-design-cli | Status |
30
+ |---|---|---|---|
31
+ | **2.x** | 19+ | Latest (currently beta: `npx --yes sparkle-design-cli@beta`) | Current. New features and components land here only (currently in beta: `npm install sparkle-design@beta`) |
32
+ | **1.x** | 18 (19 also works) | Latest (`npx --yes sparkle-design-cli`) | **Deprecated maintenance line.** Only bug and security fixes, plus token/style updates needed to stay compatible with the latest CLI |
33
+
34
+ 2.x receives `ref` as a regular prop (the React 19 approach) in every component, so on React 18 refs and Radix `asChild` compositions (e.g. Tooltip / Dialog triggers) don't work correctly. Use 1.x for React 18 projects (npm refuses to install 2.x into a React 18 project because of the peer dependency conflict).
35
+
36
+ ```bash
37
+ npm install sparkle-design@1
38
+ ```
39
+
40
+ Both lines use the latest CLI without pinning. When the tokens generated by the CLI change, 1.x follows, so 1.x looks the same as 2.x (only React 19-specific changes and new features stay out of 1.x).
41
+
42
+ Even if you stay on 1.x, run `migrate` to check your app's legacy token classes when the tokens generated by the CLI change.
43
+
44
+ To move from 1.x to 2.x, upgrade your project to React 19 first. `npx --yes sparkle-design-cli@beta migrate` reports how to replace legacy tokens (e.g. `text-neutral-900`) with the new ones (dry run by default; `--write` rewrites files).
45
+
27
46
  ## Quick Start
28
47
 
29
48
  ### 1. Set up
package/README.md CHANGED
@@ -24,6 +24,25 @@ shadcn/ui をベースに、[グッドパッチ](https://goodpatch.com/)のデ
24
24
  - 🎨 **カスタマイズ性** ... 専用CLIツールを利用し、Figmaファイルと同等のカスタマイズを適用することが出来ます。これによりSparkle Designをベースとしたデザインシステムのコードを素早く用意することが出来ます。
25
25
  - 🤖 **AI フレンドリー** ... Claude Code / Cursor / Codex 向けのスキルとガード設定を同梱。AI コーディングでもデザインシステムの品質を維持できます。
26
26
 
27
+ ## バージョンと React・CLI の対応
28
+
29
+ | バージョン | React | sparkle-design-cli | 状態 |
30
+ |---|---|---|---|
31
+ | **2.x** | 19 以上 | 最新(現在は beta: `npx --yes sparkle-design-cli@beta`) | 現行。新機能・新コンポーネントはこちらにだけ入ります(現在は beta: `npm install sparkle-design@beta`) |
32
+ | **1.x** | 18(19 でも可) | 最新(`npx --yes sparkle-design-cli`) | **非推奨(deprecated)のメンテナンスライン**。不具合・セキュリティの修正と、最新の CLI と噛み合わせるためのトークン・スタイルの追従だけを行います |
33
+
34
+ 2.x は全コンポーネントで `ref` を通常の props として受け取る React 19 の方式に移行しているため、React 18 では `ref` や Radix の `asChild` 経由の組み合わせ(Tooltip / Dialog のトリガーなど)が正しく動きません。React 18 のプロジェクトは 1.x をお使いください(2.x を React 18 のプロジェクトに入れると、npm では peer 依存の衝突で止まります)。
35
+
36
+ ```bash
37
+ npm install sparkle-design@1
38
+ ```
39
+
40
+ CLI はどちらのバージョンでも固定せず最新を使います。CLI が生成するトークンが変わるときは 1.x も追従するので、1.x でも見た目は 2.x と同じデザインになります(1.x に入らないのは React 19 前提の変更と新機能だけです)。
41
+
42
+ 1.x を使い続ける場合も、CLI が生成するトークンが変わったときは、アプリ側で使っている旧トークンのクラスを `migrate` で確認してください。
43
+
44
+ 1.x から 2.x へは、プロジェクトを React 19 に上げてから移行してください。旧トークン(`text-neutral-900` など)から新トークンへの置き換えは `npx --yes sparkle-design-cli@beta migrate` で確認できます(既定は変更内容の表示のみ。`--write` で書き換え)。
45
+
27
46
  ## クイックスタート
28
47
 
29
48
  ### 1. セットアップ
@@ -7,7 +7,7 @@ import { type VariantProps } from "class-variance-authority";
7
7
  declare const badgeVariants: (props?: ({
8
8
  variant?: "normal" | "emphasis" | null | undefined;
9
9
  isNumberVisible?: boolean | null | undefined;
10
- size?: "xs" | "sm" | "md" | "lg" | null | undefined;
10
+ size?: "2xs" | "xs" | "sm" | "md" | "lg" | null | undefined;
11
11
  isGapped?: boolean | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  type BadgeVariants = VariantProps<typeof badgeVariants>;
@@ -54,7 +54,7 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
54
54
  * // ❌ Wrong - ステータスラベルに Badge を使わない
55
55
  * <Badge>未紐付け</Badge>
56
56
  * ```
57
-
57
+ *
58
58
  * **使用例 / Usage Example**
59
59
  *
60
60
  * ```tsx
@@ -63,5 +63,5 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
63
63
  *
64
64
  * @param {BadgeProps} props
65
65
  */
66
- declare function Badge({ className, isNumberVisible, size, variant, isGapped, children, role, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
66
+ declare function Badge({ className, isNumberVisible, size, variant, isGapped, children, role, ...props }: BadgeProps): React.JSX.Element;
67
67
  export { Badge, badgeVariants };
@@ -12,18 +12,19 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { cva } from "class-variance-authority";
14
14
  import { cn } from "../../../lib/utils.js";
15
- const badgeVariants = cva("inline-flex items-center text-white text-center justify-center rounded-full transition-colors focus:outline-hidden focus:ring-2 focus:ring-[var(--color-ring-normal)] focus:ring-offset-2", {
15
+ const badgeVariants = cva("inline-flex overflow-hidden items-center text-text-inverse text-center justify-center rounded-full transition-colors focus:outline-hidden focus:ring-2 focus:ring-border-ring focus:ring-offset-2", {
16
16
  variants: {
17
17
  variant: {
18
- normal: "bg-info-500",
19
- emphasis: "bg-negative-500",
18
+ normal: "bg-surface-primary-high-enabled",
19
+ emphasis: "bg-surface-negative-high-enabled",
20
20
  },
21
21
  isNumberVisible: {
22
22
  true: "",
23
23
  false: "",
24
24
  },
25
25
  size: {
26
- xs: "w-2 h-2 min-w-2",
26
+ "2xs": "w-2 h-2 min-w-2",
27
+ xs: "w-3.5 h-3.5 min-w-3.5",
27
28
  sm: "w-4 h-4 min-w-4",
28
29
  md: "min-w-6 py-0.5 px-1.5 character-1-bold-mono",
29
30
  lg: "min-w-8 py-1 px-1.5 character-3-bold-mono",
@@ -35,25 +36,30 @@ const badgeVariants = cva("inline-flex items-center text-white text-center justi
35
36
  },
36
37
  compoundVariants: [
37
38
  // isGappedのボーダー設定
39
+ {
40
+ isGapped: true,
41
+ size: "2xs",
42
+ class: "outline-border-inverse outline-2",
43
+ },
38
44
  {
39
45
  isGapped: true,
40
46
  size: "xs",
41
- class: "outline-white outline-2",
47
+ class: "outline-border-inverse outline-4",
42
48
  },
43
49
  {
44
50
  isGapped: true,
45
51
  size: "sm",
46
- class: "outline-white outline-4",
52
+ class: "outline-border-inverse outline-4",
47
53
  },
48
54
  {
49
55
  isGapped: true,
50
56
  size: "md",
51
- class: "outline-white outline-4",
57
+ class: "outline-border-inverse outline-4",
52
58
  },
53
59
  {
54
60
  isGapped: true,
55
61
  size: "lg",
56
- class: "outline-white outline-4",
62
+ class: "outline-border-inverse outline-4",
57
63
  },
58
64
  // 数字がない場合はheightを指定
59
65
  {
@@ -95,7 +101,7 @@ const badgeVariants = cva("inline-flex items-center text-white text-center justi
95
101
  * // ❌ Wrong - ステータスラベルに Badge を使わない
96
102
  * <Badge>未紐付け</Badge>
97
103
  * ```
98
-
104
+ *
99
105
  * **使用例 / Usage Example**
100
106
  *
101
107
  * ```tsx
@@ -108,7 +114,7 @@ function Badge(_a) {
108
114
  var { className, isNumberVisible = true, size, variant = "normal", isGapped = false, children, role = "status" } = _a, props = __rest(_a, ["className", "isNumberVisible", "size", "variant", "isGapped", "children", "role"]);
109
115
  // sm以下のサイズの場合は、文字を非表示にする
110
116
  // en: Hide text for sizes sm and below
111
- if (size === "sm" || size === "xs") {
117
+ if (size === "sm" || size === "xs" || size === "2xs") {
112
118
  isNumberVisible = false;
113
119
  }
114
120
  // childrenがない場合はisNumberVisibleがfalseの扱いにする
@@ -32,39 +32,39 @@ import { Link } from "@/components/ui/link";
32
32
  *
33
33
  * @param {BreadcrumbProps} props
34
34
  */
35
- export declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
35
+ export declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
36
36
  /**
37
37
  * パンくずリスト(ol)
38
38
  * en: Breadcrumb list (ol)
39
39
  *
40
40
  * @param {React.ComponentProps<"ol">} props
41
41
  */
42
- export declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): import("react/jsx-runtime").JSX.Element;
42
+ export declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
43
43
  /**
44
44
  * パンくずアイテム(li)
45
45
  * en: Breadcrumb item (li)
46
46
  *
47
47
  * @param {React.ComponentProps<"li">} props
48
48
  */
49
- export declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
49
+ export declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
50
50
  /**
51
51
  * パンくずリンク
52
52
  * en: Breadcrumb link
53
53
  *
54
54
  * @param {React.ComponentProps<typeof Link>} props
55
55
  */
56
- export declare function BreadcrumbLink({ className, ...props }: React.ComponentProps<typeof Link>): import("react/jsx-runtime").JSX.Element;
56
+ export declare function BreadcrumbLink({ className, ...props }: React.ComponentProps<typeof Link>): React.JSX.Element;
57
57
  /**
58
58
  * パンくずの区切り(/など)
59
59
  * en: Breadcrumb separator (e.g. /)
60
60
  *
61
61
  * @param {React.ComponentProps<"span">} props
62
62
  */
63
- export declare function BreadcrumbSeparator({ className, children, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
63
+ export declare function BreadcrumbSeparator({ className, children, ...props }: React.ComponentProps<"span">): React.JSX.Element;
64
64
  /**
65
65
  * 現在ページ表示用
66
66
  * en: Current page label (not a link)
67
67
  *
68
68
  * @param {React.ComponentProps<"span">} props
69
69
  */
70
- export declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
70
+ export declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
@@ -82,7 +82,7 @@ export function BreadcrumbLink(_a) {
82
82
  */
83
83
  export function BreadcrumbSeparator(_a) {
84
84
  var { className, children } = _a, props = __rest(_a, ["className", "children"]);
85
- return (_jsx("span", Object.assign({ "aria-hidden": "true", "data-slot": "breadcrumb-separator", className: cn("mx-1 text-neutral-500 select-none", className) }, props, { children: children !== null && children !== void 0 ? children : "/" })));
85
+ return (_jsx("span", Object.assign({ "aria-hidden": "true", "data-slot": "breadcrumb-separator", className: cn("mx-1 text-text-neutral-low select-none", className) }, props, { children: children !== null && children !== void 0 ? children : "/" })));
86
86
  }
87
87
  /**
88
88
  * 現在ページ表示用
@@ -92,5 +92,5 @@ export function BreadcrumbSeparator(_a) {
92
92
  */
93
93
  export function BreadcrumbPage(_a) {
94
94
  var { className } = _a, props = __rest(_a, ["className"]);
95
- return (_jsx("span", Object.assign({ "data-slot": "breadcrumb-page", "aria-disabled": "true", "aria-current": "page", className: cn("character-3-regular-pro text-text-high cursor-default", className) }, props)));
95
+ return (_jsx("span", Object.assign({ "data-slot": "breadcrumb-page", "aria-current": "page", className: cn("character-3-regular-pro text-text-neutral-high cursor-default", className) }, props)));
96
96
  }
@@ -7,8 +7,15 @@ declare const buttonVariants: (props?: ({
7
7
  isLoading?: boolean | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  type ButtonVariantProps = VariantProps<typeof buttonVariants>;
10
- type NativeButtonProps = React.ComponentPropsWithoutRef<"button">;
11
- export interface ButtonProps extends Omit<NativeButtonProps, "onClick" | "onKeyDown"> {
10
+ type NativeButtonProps = React.ComponentProps<"button">;
11
+ export interface ButtonProps extends Omit<NativeButtonProps, "onClick" | "onKeyDown" | "onClickCapture" | "onKeyDownCapture" | "onAuxClickCapture" | "ref"> {
12
+ /**
13
+ * ルート要素への ref。`asChild` で `<a>` 等を差し込むケースを受け入れるため
14
+ * `HTMLButtonElement` ではなく `HTMLElement` で広く受ける
15
+ * en: Ref to the root element. Typed as `HTMLElement` (not `HTMLButtonElement`)
16
+ * so `asChild` targets such as `<a>` are accepted.
17
+ */
18
+ ref?: React.Ref<HTMLElement>;
12
19
  /**
13
20
  * ボタンのサイズバリエーション
14
21
  * en: Size variation of the button
@@ -61,6 +68,21 @@ export interface ButtonProps extends Omit<NativeButtonProps, "onClick" | "onKeyD
61
68
  * We intentionally type this as HTMLElement because `asChild` can render non-button elements.
62
69
  */
63
70
  onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
71
+ /**
72
+ * capture フェーズのクリックハンドラ。無効時はコンポーネント側のガードが優先される
73
+ * en: Capture-phase click handler. The component's disabled guard takes precedence.
74
+ */
75
+ onClickCapture?: React.MouseEventHandler<HTMLElement>;
76
+ /**
77
+ * capture フェーズのキー押下ハンドラ。無効時はコンポーネント側のガードが優先される
78
+ * en: Capture-phase keydown handler. The component's disabled guard takes precedence.
79
+ */
80
+ onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement>;
81
+ /**
82
+ * capture フェーズの中クリックハンドラ。無効時はコンポーネント側のガードが優先される
83
+ * en: Capture-phase auxclick handler. The component's disabled guard takes precedence.
84
+ */
85
+ onAuxClickCapture?: React.MouseEventHandler<HTMLElement>;
64
86
  /**
65
87
  * @deprecated アクセシビリティ観点(WCAG 2.5.2 Pointer Cancellation)により、基本的に使用を避けてください。
66
88
  * en: Deprecated for accessibility reasons (WCAG 2.5.2 Pointer Cancellation). Avoid using this in most cases.
@@ -106,6 +128,10 @@ export interface ButtonProps extends Omit<NativeButtonProps, "onClick" | "onKeyD
106
128
  * en: Use `IconButton` for icon-only buttons.
107
129
  * - `asChild` 使用時は `prefixIcon` / `suffixIcon` / `isLoading` が反映されません。必要ならスロット先でアイコンやローディング表現を構成してください。
108
130
  * en: In `asChild` mode, `prefixIcon`, `suffixIcon`, and `isLoading` are ignored. Render icons and loading states inside the slotted child when needed.
131
+ * - `asChild` で差し込んだ要素が指定した props(`type` や `disabled` など)は、Slot のマージで
132
+ * コンポーネント側の値より優先されます。
133
+ * en: Props set on the slotted element itself (such as `type` or `disabled`) win over the
134
+ * component's own values through Slot's prop merging.
109
135
  *
110
136
  * ```tsx
111
137
  * // ✅ Correct
@@ -128,15 +154,54 @@ export interface ButtonProps extends Omit<NativeButtonProps, "onClick" | "onKeyD
128
154
  * <Link href="/items/new">新規作成</Link>
129
155
  * </Button>
130
156
  * ```
131
-
157
+ *
132
158
  * **アクセシビリティ / Accessibility**
133
159
  *
134
160
  * - ボタンにはアクセシブルネームが必要です(通常は `children` のテキスト)。
135
161
  * アイコンのみの場合は `aria-label` / `aria-labelledby` を付与するか、可能なら `IconButton` を使用してください。
136
162
  * - `isLoading` の場合でもアクセシブルネームは維持されます。
137
- * - `asChild` を使う場合、子要素がボタン相当のセマンティクス(role/disabled/キーボード操作)を満たすようにしてください。
163
+ * - `asChild` を使う場合、子要素がボタン相当のセマンティクス(role/キーボード操作)を満たすようにしてください。
164
+ * - `asChild` で `<a>` など button 以外の要素を差し込んで無効化した場合、`aria-disabled` の付与、
165
+ * click / auxclick / Enter・Space の抑止、`aria-disabled:` プレフィックスによる無効時の配色まで
166
+ * このコンポーネントが行います(`data-disabled="true"` も利用側のスタイルフックとして出力)。
167
+ * 差し込み先が native の `<button>` の場合は `disabled` 属性がそのまま渡ります。
168
+ * - `type` / `form` / `value` など button 専用の props は、差し込み先が native の `<button>` の
169
+ * ときだけ転送されます。それ以外の要素では不正な属性になるため落とし、dev ビルドで警告します。
170
+ * 差し込み先が内部で `<button>` を描画するコンポーネントの場合のみ、その要素側に直接指定してください
171
+ * (Slot のマージで子の指定が優先されます)。`<a>` 等では属性自体が機能しないため指定不要です。
172
+ * en: Button-only props such as `type`, `form`, and `value` are forwarded only when the slot is a
173
+ * native `<button>`; on other elements they would be invalid attributes, so they are dropped with
174
+ * a dev warning. Set them on the slotted element only when that component renders a `<button>`
175
+ * internally (child props win in Slot's merge) — on `<a>` and friends the attributes do nothing.
176
+ * - `aria-disabled` を直接渡した場合も、無効時の配色が当たり操作が抑止されます(native の
177
+ * `disabled` 属性は付けないため、フォーカスは残ります)。無効化には基本的に `isDisabled` を
178
+ * 使ってください。
179
+ * en: Passing `aria-disabled` directly also applies the disabled colors and blocks activation
180
+ * (the native `disabled` attribute is not set, so the element stays focusable). Prefer
181
+ * `isDisabled` for disabling.
182
+ * なお `aria-disabled` の要素は既定でフォーカス可能なままです。無効な項目の存在と理由を
183
+ * 支援技術の利用者に伝えられるため通常はそのままで構いません。タブ順から外す必要がある場合のみ
184
+ * 差し込む要素側で `tabIndex={-1}` を指定してください。
185
+ * en: When disabled with `asChild` and a non-button element such as `<a>`, this component sets
186
+ * `aria-disabled`, blocks click / auxclick / Enter / Space, and applies the disabled colors via
187
+ * `aria-disabled:`-prefixed utilities (`data-disabled="true"` is also emitted as a styling hook).
188
+ * A slotted native `<button>` receives the real `disabled` attribute instead.
189
+ * - native の `<button>` かどうかは差し込んだ要素そのもので判定するため、内部で `<button>` を
190
+ * 描画するカスタムコンポーネントを渡した場合は非 button として扱われます。
191
+ * また無効時に抑止できるのは click / auxclick / Enter・Space までで、コンテキストメニューの
192
+ * 「新しいタブで開く」は止められません。確実に遷移させたくない場合は差し込む要素側で
193
+ * `href` を外してください。
194
+ * en: Whether the slot is a native `<button>` is decided from the slotted element itself, so a
195
+ * custom component that renders a `<button>` internally is treated as a non-button. Also, only
196
+ * click / auxclick / Enter / Space can be blocked while disabled — "open in new tab" from the
197
+ * context menu cannot. Drop `href` on the slotted element when navigation must not happen.
198
+ * An `aria-disabled` element stays focusable by design, which is usually what you want; set
199
+ * `tabIndex={-1}` on the slotted element only when it must leave the tab order.
138
200
  *
139
201
  * @param {ButtonProps} props
140
202
  */
141
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
203
+ declare function Button({ className, variant, size, theme, isLoading, isDisabled, asChild, disabled, prefixIcon, suffixIcon, ref, children, ...props }: ButtonProps): React.JSX.Element;
204
+ declare namespace Button {
205
+ var displayName: string;
206
+ }
142
207
  export { Button, buttonVariants };