ksk-design-system 2.1.1 → 2.3.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/index.js CHANGED
@@ -8474,7 +8474,7 @@ function ju({ steps: e, open: t, onComplete: n, onSkip: r, variant: i = "default
8474
8474
  let e = 0, n = 0, r = () => {
8475
8475
  let t = Array.from(_.querySelectorAll("button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]")).find((e) => e.tabIndex >= 0);
8476
8476
  if (t) {
8477
- t.focus();
8477
+ t.focus({ preventScroll: !0 });
8478
8478
  return;
8479
8479
  }
8480
8480
  n++ < 5 && (e = requestAnimationFrame(r));
@@ -8538,7 +8538,7 @@ function ju({ steps: e, open: t, onComplete: n, onSkip: r, variant: i = "default
8538
8538
  trapped: !0,
8539
8539
  loop: !0,
8540
8540
  onMountAutoFocus: (e) => {
8541
- c || (e.preventDefault(), e.currentTarget instanceof HTMLElement && e.currentTarget.focus());
8541
+ c || (e.preventDefault(), e.currentTarget instanceof HTMLElement && e.currentTarget.focus({ preventScroll: !0 }));
8542
8542
  },
8543
8543
  onUnmountAutoFocus: (e) => {
8544
8544
  l || e.preventDefault();
@@ -8579,9 +8579,9 @@ function ju({ steps: e, open: t, onComplete: n, onSkip: r, variant: i = "default
8579
8579
  className: "fixed pointer-events-none",
8580
8580
  style: D && h ? {
8581
8581
  top: h.top,
8582
- left: h.left + h.width / 2,
8583
- width: 1,
8584
- height: 1
8582
+ left: h.left,
8583
+ width: h.width,
8584
+ height: h.height
8585
8585
  } : {
8586
8586
  top: "50%",
8587
8587
  left: "50%"
@@ -12983,13 +12983,13 @@ function xf({ className: e, label: t, icon: n, showLabel: r = !1, placement: i =
12983
12983
  }
12984
12984
  //#endregion
12985
12985
  //#region src/components/patterns/mobile-app-header.tsx
12986
- function Sf({ className: e, brand: t, leading: n, status: r, compactStatus: i, actions: a, sticky: o = !0, bordered: s = !0, landmark: c = !0, children: l, ...u }) {
12986
+ function Sf({ className: e, brand: t, leading: n, status: r, compactStatus: i, actions: a, sticky: o = !0, bordered: s = !0, landmark: c = !0, verticalAlignment: l = "center", children: u, ...d }) {
12987
12987
  return /* @__PURE__ */ V(c ? "header" : "div", {
12988
12988
  "data-slot": "mobile-app-header",
12989
12989
  className: G("bg-[var(--Surface-Primary)] text-[var(--Text-High-Emphasis)]", o && "sticky top-0 z-[var(--Z-Nav)]", s && "border-b border-[var(--Border-Low-Emphasis)]", e),
12990
- ...u,
12990
+ ...d,
12991
12991
  children: [/* @__PURE__ */ V("div", {
12992
- className: "flex min-h-14 items-center gap-2 px-4",
12992
+ className: G("flex min-h-14 gap-2 px-4", l === "top" ? "items-start" : "items-center"),
12993
12993
  children: [
12994
12994
  n && /* @__PURE__ */ B("div", {
12995
12995
  "data-slot": "mobile-app-header-leading",
@@ -13020,7 +13020,7 @@ function Sf({ className: e, brand: t, leading: n, status: r, compactStatus: i, a
13020
13020
  ]
13021
13021
  })
13022
13022
  ]
13023
- }), l]
13023
+ }), u]
13024
13024
  });
13025
13025
  }
13026
13026
  //#endregion
@@ -16172,35 +16172,35 @@ function Nm({ accept: e, maxSize: t, multiple: n = !1, maxFiles: r = 10, onUploa
16172
16172
  }
16173
16173
  //#endregion
16174
16174
  //#region src/components/patterns/compact-file-picker.tsx
16175
- function Pm({ className: e, inputClassName: t, label: n = "ファイル", description: r, triggerLabel: i = "選択する", icon: a, loading: o = !1, disabled: s, id: c, multiple: l, onFilesChange: d, ...f }) {
16176
- let p = u.useId(), m = c ?? p, h = u.useRef(null), g = s || o;
16175
+ function Pm({ className: e, inputClassName: t, label: n = "ファイル", description: r, triggerLabel: i = "選択する", loadingLabel: a = "処理中", icon: o, loading: s = !1, disabled: c, id: l, multiple: d, onFilesChange: f, ...p }) {
16176
+ let m = u.useId(), h = l ?? m, g = u.useRef(null), _ = c || s;
16177
16177
  return /* @__PURE__ */ V("div", {
16178
16178
  "data-slot": "compact-file-picker",
16179
16179
  className: G("flex items-center gap-3", e),
16180
16180
  children: [
16181
16181
  /* @__PURE__ */ B("input", {
16182
- ...f,
16183
- ref: h,
16184
- id: m,
16182
+ ...p,
16183
+ ref: g,
16184
+ id: h,
16185
16185
  type: "file",
16186
- multiple: l,
16187
- disabled: g,
16186
+ multiple: d,
16187
+ disabled: _,
16188
16188
  className: G("sr-only", t),
16189
16189
  onChange: (e) => {
16190
16190
  let t = Array.from(e.currentTarget.files ?? []);
16191
- d?.(t), e.currentTarget.value = "";
16191
+ f?.(t), e.currentTarget.value = "";
16192
16192
  }
16193
16193
  }),
16194
16194
  /* @__PURE__ */ V("div", {
16195
16195
  className: "flex min-w-0 flex-1 items-center gap-3",
16196
16196
  children: [/* @__PURE__ */ B("span", {
16197
16197
  className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--Surface-Secondary)] text-[var(--Object-Medium-Emphasis)]",
16198
- children: a ?? /* @__PURE__ */ B(se, {
16198
+ children: o ?? /* @__PURE__ */ B(se, {
16199
16199
  size: 20,
16200
16200
  "aria-hidden": !0
16201
16201
  })
16202
16202
  }), /* @__PURE__ */ V("label", {
16203
- htmlFor: m,
16203
+ htmlFor: h,
16204
16204
  className: "min-w-0 flex-1",
16205
16205
  children: [/* @__PURE__ */ B("span", {
16206
16206
  className: "typo-label-md block truncate text-[var(--Text-High-Emphasis)]",
@@ -16215,9 +16215,10 @@ function Pm({ className: e, inputClassName: t, label: n = "ファイル", descri
16215
16215
  type: "button",
16216
16216
  variant: "secondary",
16217
16217
  size: "sm",
16218
- disabled: g,
16219
- onClick: () => h.current?.click(),
16220
- children: o ? "処理中" : i
16218
+ disabled: _,
16219
+ "aria-busy": s || void 0,
16220
+ onClick: () => g.current?.click(),
16221
+ children: s ? a : i
16221
16222
  })
16222
16223
  ]
16223
16224
  });
package/dist/native/ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../prompt-coordinator-sBFZKQIX.js";
2
- import { a as u, i as d, n as f, r as p, t as m } from "../native-DlR32_Lk.js";
2
+ import { a as u, i as d, n as f, r as p, t as m } from "../native-E7YOVABy.js";
3
3
  import * as h from "react";
4
4
  import g, { createContext as _, useCallback as v, useContext as y, useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
5
5
  import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
@@ -291,7 +291,7 @@ function X({ variant: e = "primary", elevation: t = "flat", containerStyle: n, p
291
291
  secondary: {
292
292
  bg: m.surface["accent-primary-light"],
293
293
  bgActive: m.active["secondary-button"],
294
- fg: m.text["accent-primary"],
294
+ fg: g === "dark" ? m.text["high-emphasis"] : m.text["accent-primary"],
295
295
  border: m.border["accent-primary"],
296
296
  bottomBorder: m.active["secondary-button"]
297
297
  },
@@ -2736,34 +2736,34 @@ function _n({ tone: e = "info", title: t, description: n, children: r }) {
2736
2736
  //#endregion
2737
2737
  //#region src/native/components/Dialog.tsx
2738
2738
  function vn({ open: e, onClose: t, title: n, description: r, footer: i, children: a, dismissOnBackdrop: o = !0, position: s = "center", safeArea: c = !0 }) {
2739
- let { theme: l, scales: u } = G(), d = q(), f = s === "fullscreen", p = ue(u.spacing.scale[5], d, c);
2739
+ let { theme: l, scales: u, mode: d } = G(), f = q(), p = s === "fullscreen", m = ue(u.spacing.scale[5], f, c);
2740
2740
  return /* @__PURE__ */ E(I, {
2741
2741
  visible: e,
2742
- transparent: !f,
2742
+ transparent: !p,
2743
2743
  animationType: "fade",
2744
2744
  onRequestClose: t,
2745
2745
  children: /* @__PURE__ */ E(R, {
2746
- onPress: () => o && !f && t(),
2746
+ onPress: () => o && !p && t(),
2747
2747
  style: {
2748
2748
  flex: 1,
2749
- backgroundColor: f ? l.surface.primary : l.overlay.dark,
2749
+ backgroundColor: p ? l.surface.primary : l.overlay.dark,
2750
2750
  alignItems: "center",
2751
2751
  justifyContent: s === "top" ? "flex-start" : "center",
2752
- ...f ? { padding: 0 } : {
2752
+ ...p ? { padding: 0 } : {
2753
2753
  padding: u.spacing.scale[4],
2754
- ...s === "top" ? { paddingTop: u.spacing.scale[4] + J(d, "top", c) } : null
2754
+ ...s === "top" ? { paddingTop: u.spacing.scale[4] + J(f, "top", c) } : null
2755
2755
  }
2756
2756
  },
2757
2757
  children: /* @__PURE__ */ D(R, {
2758
2758
  onPress: () => {},
2759
2759
  style: {
2760
2760
  width: "100%",
2761
- backgroundColor: l.surface.primary,
2761
+ backgroundColor: !p && d === "dark" ? l.surface.secondary : l.surface.primary,
2762
2762
  gap: u.spacing.scale[3],
2763
- ...f ? {
2763
+ ...p ? {
2764
2764
  flex: 1,
2765
2765
  borderRadius: 0,
2766
- ...p
2766
+ ...m
2767
2767
  } : {
2768
2768
  maxWidth: 480,
2769
2769
  borderRadius: u.borderRadius["2xl"],
@@ -5441,22 +5441,22 @@ function ai({ title: e, subtitle: t, leading: n, trailing: r, onBack: i, centere
5441
5441
  }
5442
5442
  //#endregion
5443
5443
  //#region src/native/components/MobileAppHeader.tsx
5444
- function oi({ brand: e, leading: t, status: n, compactStatus: r, actions: i, children: a, bordered: o = !0, style: s }) {
5445
- let { theme: c, scales: l } = G();
5444
+ function oi({ brand: e, leading: t, status: n, compactStatus: r, actions: i, children: a, bordered: o = !0, verticalAlignment: s = "center", style: c }) {
5445
+ let { theme: l, scales: u } = G();
5446
5446
  return /* @__PURE__ */ D(H, {
5447
5447
  style: [{
5448
- backgroundColor: c.surface.primary,
5448
+ backgroundColor: l.surface.primary,
5449
5449
  borderBottomWidth: +!!o,
5450
- borderBottomColor: c.border["low-emphasis"],
5451
- paddingTop: L.OS === "ios" ? 48 : l.spacing.scale[3]
5452
- }, s],
5450
+ borderBottomColor: l.border["low-emphasis"],
5451
+ paddingTop: L.OS === "ios" ? 48 : u.spacing.scale[3]
5452
+ }, c],
5453
5453
  children: [/* @__PURE__ */ D(H, {
5454
5454
  style: {
5455
5455
  minHeight: 56,
5456
- paddingHorizontal: l.spacing.scale[4],
5456
+ paddingHorizontal: u.spacing.scale[4],
5457
5457
  flexDirection: "row",
5458
- alignItems: "center",
5459
- gap: l.spacing.scale[2]
5458
+ alignItems: s === "top" ? "flex-start" : "center",
5459
+ gap: u.spacing.scale[2]
5460
5460
  },
5461
5461
  children: [
5462
5462
  t,
@@ -5474,7 +5474,7 @@ function oi({ brand: e, leading: t, status: n, compactStatus: r, actions: i, chi
5474
5474
  flexDirection: "row",
5475
5475
  justifyContent: "flex-end",
5476
5476
  alignItems: "center",
5477
- gap: l.spacing.scale[2]
5477
+ gap: u.spacing.scale[2]
5478
5478
  },
5479
5479
  children: [r ?? n, i]
5480
5480
  })
@@ -6802,23 +6802,23 @@ function $i({ item: e, itemDirection: t, onReveal: n }) {
6802
6802
  }
6803
6803
  //#endregion
6804
6804
  //#region src/native/components/CompactFilePicker.tsx
6805
- function ea({ label: e = "ファイル", description: t, triggerLabel: n = "選択する", icon: r, loading: i = !1, disabled: a = !1, onPress: o, style: s }) {
6806
- let { theme: c, scales: l } = G(), u = a || i;
6805
+ function ea({ label: e = "ファイル", description: t, triggerLabel: n = "選択する", loadingLabel: r, icon: i, loading: a = !1, disabled: o = !1, onPress: s, style: c }) {
6806
+ let { theme: l, scales: u } = G(), d = o || a;
6807
6807
  return /* @__PURE__ */ D(R, {
6808
- disabled: u,
6809
- onPress: o,
6808
+ disabled: d,
6809
+ onPress: s,
6810
6810
  accessibilityRole: "button",
6811
6811
  accessibilityState: {
6812
- disabled: u,
6813
- busy: i
6812
+ disabled: d,
6813
+ busy: a
6814
6814
  },
6815
6815
  style: [{
6816
6816
  minHeight: 56,
6817
6817
  flexDirection: "row",
6818
6818
  alignItems: "center",
6819
- gap: l.spacing.scale[3],
6820
- opacity: u ? .5 : 1
6821
- }, s],
6819
+ gap: u.spacing.scale[3],
6820
+ opacity: d ? .5 : 1
6821
+ }, c],
6822
6822
  children: [
6823
6823
  /* @__PURE__ */ E(H, {
6824
6824
  style: {
@@ -6826,11 +6826,11 @@ function ea({ label: e = "ファイル", description: t, triggerLabel: n = "選
6826
6826
  height: 40,
6827
6827
  alignItems: "center",
6828
6828
  justifyContent: "center",
6829
- borderRadius: l.borderRadius.lg,
6830
- backgroundColor: c.surface.secondary
6829
+ borderRadius: u.borderRadius.lg,
6830
+ backgroundColor: l.surface.secondary
6831
6831
  },
6832
- children: r ?? /* @__PURE__ */ E(B, {
6833
- style: [Y("heading.md"), { color: c.text["medium-emphasis"] }],
6832
+ children: i ?? /* @__PURE__ */ E(B, {
6833
+ style: [Y("heading.md"), { color: l.text["medium-emphasis"] }],
6834
6834
  children: "+"
6835
6835
  })
6836
6836
  }),
@@ -6841,11 +6841,11 @@ function ea({ label: e = "ファイル", description: t, triggerLabel: n = "選
6841
6841
  },
6842
6842
  children: [typeof e == "string" ? /* @__PURE__ */ E(B, {
6843
6843
  numberOfLines: 1,
6844
- style: [Y("label.md"), { color: c.text["high-emphasis"] }],
6844
+ style: [Y("label.md"), { color: l.text["high-emphasis"] }],
6845
6845
  children: e
6846
6846
  }) : e, t && (typeof t == "string" ? /* @__PURE__ */ E(B, {
6847
6847
  style: [Y("body.sm"), {
6848
- color: c.text["medium-emphasis"],
6848
+ color: l.text["medium-emphasis"],
6849
6849
  marginTop: 2
6850
6850
  }],
6851
6851
  children: t
@@ -6853,9 +6853,10 @@ function ea({ label: e = "ファイル", description: t, triggerLabel: n = "選
6853
6853
  }),
6854
6854
  /* @__PURE__ */ E(X, {
6855
6855
  variant: "secondary",
6856
- disabled: u,
6857
- loading: i,
6858
- onPress: o,
6856
+ disabled: d,
6857
+ loading: a,
6858
+ loadingLabel: r,
6859
+ onPress: s,
6859
6860
  children: n
6860
6861
  })
6861
6862
  ]