ksk-design-system 1.46.0 → 1.46.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.
- package/contracts/components.json +2 -1
- package/contracts/token-hex-cache.json +1 -1
- package/dist/class-names.js +1 -1
- package/dist/index.js +32 -9
- package/dist/{server-variants-BtHHqzwI.js → server-variants-DF8guEvD.js} +1 -1
- package/dist/types/components/ui/button.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Component Contracts",
|
|
4
|
-
"version": "1.46.
|
|
4
|
+
"version": "1.46.1",
|
|
5
5
|
"description": "全コンポーネントの構造化定義。バリアント・アクセシビリティ要件・使用ルールを機械可読形式で管理。",
|
|
6
6
|
"counts": {
|
|
7
7
|
"ui": 67,
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
],
|
|
53
53
|
"rules": [
|
|
54
54
|
"Must use <Button> not <button>",
|
|
55
|
+
"リンクを Button として表示する場合は <Button asChild><a href=... /></Button> を使う",
|
|
55
56
|
"Icon-only buttons require aria-label",
|
|
56
57
|
"Native Button supports loading/loadingLabel and leadingIcon/trailingIcon; do not wrap ActivityIndicator in Text",
|
|
57
58
|
"variant=glass は背景がグラデーション/写真の場合のみ使用",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Semantic Token Hex Cache",
|
|
4
|
-
"version": "1.46.
|
|
4
|
+
"version": "1.46.1",
|
|
5
5
|
"description": "semantic / semanticDark トークン(var(--Primitive-*) 参照)を実 hex に解決したサイドカー生成物。hex はデフォルト(Blue)テーマでの解決値であり、Brand 系(meta.themeDependentKeys に列挙)はテーマ差し替え(orange/green/violet 等)で実色が変わる。テーマ別の完全解決値は `ksk-design-system/native` エクスポート(バンドル済み native トークンモジュール)の themes を参照。tokens.json 本体のスキーマは変更せず、AI がこのファイルだけで実色を把握できるようにし、primitive 値の変更による semantic 実色のドリフトを --check で機械検出する。",
|
|
6
6
|
"generatedBy": "scripts/generate-token-hex-cache.mjs",
|
|
7
7
|
"theme": "default",
|
package/dist/class-names.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./server-variants-
|
|
1
|
+
import { t as e } from "./server-variants-DF8guEvD.js";
|
|
2
2
|
export { e as buttonVariants };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { n as e } from "./rolldown-runtime-Df-vAQej.js";
|
|
3
|
-
import { t } from "./server-variants-
|
|
3
|
+
import { t } from "./server-variants-DF8guEvD.js";
|
|
4
4
|
import * as n from "react";
|
|
5
5
|
import r, { createContext as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
6
6
|
import { Accordion as f, AlertDialog as p, Avatar as m, Checkbox as h, Collapsible as g, Dialog as _, DropdownMenu as v, HoverCard as y, Label as b, Popover as x, Progress as S, RadioGroup as C, ScrollArea as w, Select as T, Separator as E, Slider as D, Switch as ee, Tabs as O, Tooltip as k } from "radix-ui";
|
|
@@ -228,23 +228,46 @@ var Ee = {
|
|
|
228
228
|
30
|
|
229
229
|
]
|
|
230
230
|
};
|
|
231
|
-
function W({ className: e, variant: r, size: i, layout: a,
|
|
232
|
-
let u = n.useCallback((e) => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
function W({ className: e, variant: r, size: i, layout: a, asChild: o = !1, haptic: s, onClick: c, type: l, disabled: u, tabIndex: d, "aria-disabled": f, children: p, ...m }) {
|
|
232
|
+
let h = o ? ue : "button", g = u || f === !0 || f === "true", _ = n.useCallback((e) => {
|
|
233
|
+
if (g) {
|
|
234
|
+
e.preventDefault(), e.stopPropagation();
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
s && typeof navigator < "u" && "vibrate" in navigator && navigator.vibrate(Ee[s]), c?.(e);
|
|
238
|
+
}, [
|
|
239
|
+
s,
|
|
240
|
+
g,
|
|
241
|
+
c
|
|
242
|
+
]), v = n.useCallback((e) => {
|
|
243
|
+
e.preventDefault(), e.stopPropagation();
|
|
244
|
+
}, []), y = o && g && n.isValidElement(p) ? n.cloneElement(p, {
|
|
245
|
+
onClick: _,
|
|
246
|
+
onClickCapture: v,
|
|
247
|
+
onAuxClickCapture: v,
|
|
248
|
+
onContextMenuCapture: v,
|
|
249
|
+
"aria-disabled": !0,
|
|
250
|
+
tabIndex: -1,
|
|
251
|
+
disabled: void 0,
|
|
252
|
+
...p.type === "a" ? { href: void 0 } : {}
|
|
253
|
+
}) : p;
|
|
254
|
+
return /* @__PURE__ */ N(h, {
|
|
236
255
|
"data-slot": "button",
|
|
237
256
|
"data-variant": r ?? "default",
|
|
238
257
|
"data-size": i ?? "default",
|
|
239
|
-
type:
|
|
258
|
+
type: o ? void 0 : l ?? "button",
|
|
259
|
+
disabled: o ? void 0 : u,
|
|
260
|
+
"aria-disabled": o && g ? !0 : f,
|
|
261
|
+
tabIndex: o && g ? -1 : d,
|
|
240
262
|
className: U(t({
|
|
241
263
|
variant: r,
|
|
242
264
|
size: i,
|
|
243
265
|
layout: a,
|
|
244
266
|
className: e
|
|
245
267
|
})),
|
|
246
|
-
onClick:
|
|
247
|
-
...
|
|
268
|
+
onClick: o && g ? void 0 : _,
|
|
269
|
+
...m,
|
|
270
|
+
children: y
|
|
248
271
|
});
|
|
249
272
|
}
|
|
250
273
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
|
2
2
|
//#region src/lib/server-variants/button-variants.ts
|
|
3
|
-
var t = e("inline-flex items-center justify-center gap-2 whitespace-nowrap typo-label-md transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 cursor-pointer", {
|
|
3
|
+
var t = e("inline-flex items-center justify-center gap-2 whitespace-nowrap typo-label-md transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 cursor-pointer", {
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
6
|
default: "bg-[var(--Brand-Primary)] text-[var(--Text-on-Inverse)] hover:bg-[var(--Hover-Primary-Button)] active:bg-[var(--Active-Primary-Button)] rounded-full",
|
|
@@ -5,6 +5,8 @@ import { buttonVariants } from "../../lib/server-variants/button-variants";
|
|
|
5
5
|
declare const HAPTIC_PATTERNS: Record<string, number | number[]>;
|
|
6
6
|
type HapticType = keyof typeof HAPTIC_PATTERNS;
|
|
7
7
|
interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
8
|
+
/** 子要素へ Button の見た目と操作属性を委譲する。リンクを Button として見せる場合に使用。 */
|
|
9
|
+
asChild?: boolean;
|
|
8
10
|
/** モバイルでの触覚フィードバック。navigator.vibrate() を使用。未対応環境では無視される。 */
|
|
9
11
|
haptic?: HapticType;
|
|
10
12
|
}
|
|
@@ -26,6 +28,6 @@ interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeo
|
|
|
26
28
|
* - `hero`: トップ hero / final-CTA 向けのピル型特大 CTA。
|
|
27
29
|
* - `icon` / `icon-sm` / `icon-lg` / `icon-xl`: アイコンのみのボタン(aria-label 必須)。
|
|
28
30
|
*/
|
|
29
|
-
declare function Button({ className, variant, size, layout, haptic, onClick, type, ...props }: ButtonProps): React.JSX.Element;
|
|
31
|
+
declare function Button({ className, variant, size, layout, asChild, haptic, onClick, type, disabled, tabIndex, "aria-disabled": ariaDisabled, children, ...props }: ButtonProps): React.JSX.Element;
|
|
30
32
|
export { Button, buttonVariants };
|
|
31
33
|
export type { ButtonProps, HapticType };
|