@cakejp/design-system 0.17.1 → 0.19.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/CLAUDE.md +15 -0
  3. package/contracts/components.json +144 -16
  4. package/contracts/composition.json +1 -1
  5. package/contracts/rules.json +5 -1
  6. package/contracts/screen-patterns.json +1 -1
  7. package/dist/components/ec/admin-shell.js +7 -6
  8. package/dist/components/ec/product-card.js +107 -102
  9. package/dist/components/ec/product-option.js +1 -0
  10. package/dist/components/ec/review-card.js +22 -20
  11. package/dist/components/ec/review-form.js +1 -0
  12. package/dist/components/foundations/accordion.js +23 -22
  13. package/dist/components/foundations/alert.js +1 -0
  14. package/dist/components/foundations/aspect-ratio.js +3 -2
  15. package/dist/components/foundations/avatar.js +1 -0
  16. package/dist/components/foundations/button.js +7 -1
  17. package/dist/components/foundations/calendar.js +1 -0
  18. package/dist/components/foundations/checkbox-group.js +1 -0
  19. package/dist/components/foundations/checkbox.js +1 -0
  20. package/dist/components/foundations/command.js +1 -0
  21. package/dist/components/foundations/context-menu.js +1 -0
  22. package/dist/components/foundations/drawer.js +1 -0
  23. package/dist/components/foundations/file-input.js +1 -0
  24. package/dist/components/foundations/form.js +26 -25
  25. package/dist/components/foundations/pagination.js +49 -46
  26. package/dist/components/foundations/popover.js +9 -8
  27. package/dist/components/foundations/radio-group.js +3 -2
  28. package/dist/components/foundations/responsive-dialog.js +1 -0
  29. package/dist/components/foundations/separator.js +7 -6
  30. package/dist/components/foundations/sheet.js +40 -33
  31. package/dist/components/foundations/slider.js +7 -6
  32. package/dist/components/foundations/social-icon.js +30 -10
  33. package/dist/components/foundations/sonner.js +5 -4
  34. package/dist/components/foundations/tabs.js +45 -25
  35. package/dist/components/foundations/toggle-group.js +6 -5
  36. package/dist/components/primitives/admin-side-nav.js +1 -0
  37. package/dist/components/primitives/chat-composer.js +1 -0
  38. package/dist/components/primitives/combobox.js +1 -0
  39. package/dist/components/primitives/content-card.js +111 -0
  40. package/dist/components/primitives/content-carousel.js +9 -8
  41. package/dist/components/primitives/date-picker.js +9 -8
  42. package/dist/components/primitives/footer.js +169 -100
  43. package/dist/components/primitives/form-field.js +1 -0
  44. package/dist/components/primitives/header.js +220 -176
  45. package/dist/components/primitives/image-carousel.js +8 -7
  46. package/dist/components/primitives/image-gallery.js +15 -14
  47. package/dist/components/primitives/image-input.js +9 -8
  48. package/dist/components/primitives/list-item.js +9 -8
  49. package/dist/components/primitives/menu-drawer.js +60 -56
  50. package/dist/components/primitives/multi-select.js +7 -6
  51. package/dist/components/primitives/number-input.js +1 -0
  52. package/dist/components/primitives/prose.js +52 -0
  53. package/dist/components/primitives/search-bar.js +81 -66
  54. package/dist/components/primitives/section-header.js +58 -55
  55. package/dist/components/primitives/share-buttons.js +93 -85
  56. package/dist/components/primitives/status-count-tabs.js +8 -7
  57. package/dist/components/primitives/sub-nav.js +52 -52
  58. package/dist/index.css +1 -1
  59. package/dist/index.js +1513 -559
  60. package/dist/lib/field-labelling.js +7 -6
  61. package/dist/lib/link-component.js +6 -0
  62. package/dist/lib/use-value-length.js +1 -0
  63. package/dist/types/components/ec/product-card.d.ts +12 -19
  64. package/dist/types/components/ec/review-card.d.ts +6 -1
  65. package/dist/types/components/foundations/button.d.ts +1 -1
  66. package/dist/types/components/foundations/chip-variants.d.ts +1 -1
  67. package/dist/types/components/foundations/data-table.d.ts +9 -1
  68. package/dist/types/components/foundations/pagination.d.ts +7 -1
  69. package/dist/types/components/foundations/sheet.d.ts +6 -1
  70. package/dist/types/components/foundations/social-icon.d.ts +1 -1
  71. package/dist/types/components/foundations/tabs.d.ts +2 -1
  72. package/dist/types/components/primitives/content-card.d.ts +67 -0
  73. package/dist/types/components/primitives/footer.d.ts +21 -1
  74. package/dist/types/components/primitives/header.d.ts +30 -2
  75. package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
  76. package/dist/types/components/primitives/prose.d.ts +35 -0
  77. package/dist/types/components/primitives/search-bar.d.ts +14 -1
  78. package/dist/types/components/primitives/section-header.d.ts +2 -1
  79. package/dist/types/components/primitives/share-buttons.d.ts +26 -4
  80. package/dist/types/components/primitives/sub-nav.d.ts +16 -1
  81. package/dist/types/index.d.ts +4 -0
  82. package/dist/types/lib/link-component.d.ts +26 -0
  83. package/package.json +4 -3
  84. package/src/components/COMPONENT_LOOKUP.md +7 -5
  85. package/src/preset-standalone.css +1 -0
  86. package/src/preset.css +8 -0
  87. package/src/styles/semantic.css +1 -0
  88. package/tokens.json +8 -1
@@ -1,30 +1,30 @@
1
- import { jsxs as a, jsx as e, Fragment as z } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as e, Fragment as L } from "react/jsx-runtime";
2
2
  import "react";
3
- import B from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
4
- import L from "iconsax-reactjs/dist/esm/ArrowRight2.js";
5
- import { cn as i } from "../../lib/utils.js";
3
+ import M from "iconsax-reactjs/dist/esm/ArrowLeft2.js";
4
+ import S from "iconsax-reactjs/dist/esm/ArrowRight2.js";
5
+ import { cn as l } from "../../lib/utils.js";
6
6
  import { Button as b } from "../foundations/button.js";
7
- const M = {
7
+ const F = {
8
8
  "3xl": "h1",
9
9
  "2xl": "h2",
10
10
  xl: "h3",
11
11
  lg: "h4",
12
12
  md: "h5",
13
13
  sm: "h6"
14
- }, S = {
14
+ }, H = {
15
15
  "3xl": "typo-heading-3xl",
16
16
  "2xl": "typo-heading-2xl",
17
17
  xl: "typo-heading-xl",
18
18
  lg: "typo-heading-lg",
19
19
  md: "typo-heading-md",
20
20
  sm: "typo-heading-sm"
21
- }, F = {
21
+ }, I = {
22
22
  "5xl": "@md:typo-heading-5xl",
23
23
  "4xl": "@md:typo-heading-4xl"
24
24
  };
25
- function D({
25
+ function J({
26
26
  className: d,
27
- title: N,
27
+ title: w,
28
28
  subtitle: c,
29
29
  moreHref: t,
30
30
  moreLabel: o = "もっと見る",
@@ -32,23 +32,23 @@ function D({
32
32
  action: m,
33
33
  onPrev: x,
34
34
  onNext: p,
35
- prevDisabled: w = !1,
36
- nextDisabled: C = !1,
35
+ prevDisabled: C = !1,
36
+ nextDisabled: T = !1,
37
37
  size: s = "lg",
38
38
  desktopSize: g,
39
- as: T,
40
- align: k = "start",
39
+ as: k,
40
+ align: j = "start",
41
41
  eyebrow: f,
42
- ...y
42
+ ...u
43
43
  }) {
44
- const j = T ?? M[s], A = ["3xl", "2xl", "xl", "lg"].includes(s), u = x || p, v = t || h, l = k === "center", E = !!t && !l, n = (v || m || u) && /* @__PURE__ */ a("div", { className: i("flex shrink-0 items-center gap-2", l && "justify-center"), children: [
45
- v && (t ? /* @__PURE__ */ e(
44
+ const A = k ?? F[s], E = ["3xl", "2xl", "xl", "lg"].includes(s), v = x || p, y = t || h, i = j === "center", z = !!t && !i, n = (y || m || v) && /* @__PURE__ */ a("div", { className: l("flex shrink-0 items-center gap-2", i && "justify-center"), children: [
45
+ y && (t ? /* @__PURE__ */ e(
46
46
  "a",
47
47
  {
48
48
  href: t,
49
49
  className: "typo-label-lg text-[var(--Text-Accent-Primary)] whitespace-nowrap",
50
- tabIndex: l ? void 0 : -1,
51
- "aria-hidden": l ? void 0 : "true",
50
+ tabIndex: i ? void 0 : -1,
51
+ "aria-hidden": i ? void 0 : "true",
52
52
  children: o
53
53
  }
54
54
  ) : /* @__PURE__ */ e(
@@ -61,7 +61,7 @@ function D({
61
61
  }
62
62
  )),
63
63
  m,
64
- u && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
64
+ v && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
65
65
  /* @__PURE__ */ e(
66
66
  b,
67
67
  {
@@ -69,9 +69,9 @@ function D({
69
69
  size: "icon-sm",
70
70
  "aria-label": "前へ",
71
71
  onClick: x,
72
- disabled: w,
72
+ disabled: C,
73
73
  className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
74
- children: /* @__PURE__ */ e(B, { size: 16 })
74
+ children: /* @__PURE__ */ e(M, { size: 16 })
75
75
  }
76
76
  ),
77
77
  /* @__PURE__ */ e(
@@ -81,48 +81,48 @@ function D({
81
81
  size: "icon-sm",
82
82
  "aria-label": "次へ",
83
83
  onClick: p,
84
- disabled: C,
84
+ disabled: T,
85
85
  className: "rounded-full border border-[var(--Border-Medium-Emphasis)]",
86
- children: /* @__PURE__ */ e(L, { size: 16 })
86
+ children: /* @__PURE__ */ e(S, { size: 16 })
87
87
  }
88
88
  )
89
89
  ] })
90
- ] }), r = /* @__PURE__ */ a(z, { children: [
91
- /* @__PURE__ */ e(
92
- j,
93
- {
94
- className: i(
95
- "text-[var(--Text-High-Emphasis)]",
96
- S[s],
97
- g && F[g]
98
- ),
99
- children: N
100
- }
101
- ),
102
- c && /* @__PURE__ */ e(
103
- "p",
104
- {
105
- className: i(
106
- "text-[var(--Text-High-Emphasis)]",
107
- A ? "typo-body-lg" : "typo-body-md"
108
- ),
109
- children: c
110
- }
111
- )
90
+ ] }), r = /* @__PURE__ */ e(
91
+ A,
92
+ {
93
+ className: l(
94
+ "text-[var(--Text-High-Emphasis)]",
95
+ H[s],
96
+ g && I[g]
97
+ ),
98
+ children: w
99
+ }
100
+ ), N = c && /* @__PURE__ */ e(
101
+ "p",
102
+ {
103
+ className: l(
104
+ "text-[var(--Text-High-Emphasis)]",
105
+ E ? "typo-body-lg" : "typo-body-md"
106
+ ),
107
+ children: c
108
+ }
109
+ ), B = /* @__PURE__ */ a(L, { children: [
110
+ r,
111
+ N
112
112
  ] });
113
- return l ? /* @__PURE__ */ a(
113
+ return i ? /* @__PURE__ */ a(
114
114
  "div",
115
115
  {
116
116
  "data-slot": "section-header",
117
117
  "data-align": "center",
118
- className: i(
118
+ className: l(
119
119
  "flex flex-col items-center gap-2 text-center [&>p]:mx-auto [&>p]:max-w-2xl",
120
120
  d
121
121
  ),
122
- ...y,
122
+ ...u,
123
123
  children: [
124
124
  f,
125
- r,
125
+ B,
126
126
  n && /* @__PURE__ */ e("div", { className: "pt-1", children: n })
127
127
  ]
128
128
  }
@@ -131,18 +131,21 @@ function D({
131
131
  {
132
132
  "data-slot": "section-header",
133
133
  "data-align": "start",
134
- className: i("flex flex-col gap-2", d),
135
- ...y,
134
+ className: l("flex flex-col gap-2", d),
135
+ ...u,
136
136
  children: [
137
137
  f,
138
- /* @__PURE__ */ a("div", { className: "flex items-baseline justify-between gap-2 min-w-0", children: [
139
- E ? /* @__PURE__ */ e("a", { href: t, className: "flex min-w-0 flex-1 flex-col gap-1", children: r }) : /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: r }),
140
- n
138
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: [
139
+ /* @__PURE__ */ a("div", { className: "flex items-baseline justify-between gap-2 min-w-0", children: [
140
+ z ? /* @__PURE__ */ e("a", { href: t, className: "min-w-0 flex-1", children: r }) : /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: r }),
141
+ n
142
+ ] }),
143
+ N
141
144
  ] })
142
145
  ]
143
146
  }
144
147
  );
145
148
  }
146
149
  export {
147
- D as SectionHeader
150
+ J as SectionHeader
148
151
  };
@@ -1,102 +1,110 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import * as n from "react";
1
+ "use client";
2
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
3
+ import * as c from "react";
3
4
  import g from "iconsax-reactjs/dist/esm/Link2.js";
4
- import { cn as N } from "../../lib/utils.js";
5
- import { Button as i } from "../foundations/button.js";
6
- import { SocialIcon as c } from "../foundations/social-icon.js";
7
- function L({
8
- className: m,
9
- url: r = "",
10
- text: p = "",
5
+ import { cn as S } from "../../lib/utils.js";
6
+ import { Button as h } from "../foundations/button.js";
7
+ import { SocialIcon as l } from "../foundations/social-icon.js";
8
+ const E = ["line", "x", "copy"], w = {
9
+ line: {
10
+ label: "LINE",
11
+ ariaLabel: "LINEでシェア",
12
+ href: (t) => `https://social-plugins.line.me/lineit/share?url=${encodeURIComponent(t)}`,
13
+ icon: /* @__PURE__ */ o(l, { platform: "line", size: 16 })
14
+ },
15
+ x: {
16
+ label: "X",
17
+ ariaLabel: "Xでシェア",
18
+ href: (t, a) => `https://twitter.com/intent/tweet?url=${encodeURIComponent(t)}&text=${encodeURIComponent(a)}`,
19
+ // X のブランド色は黒固定でダーク地に溶けるため、地の文字色に追従させる
20
+ icon: /* @__PURE__ */ o(l, { platform: "x", size: 14, tone: "mono" })
21
+ },
22
+ facebook: {
23
+ label: "Facebook",
24
+ ariaLabel: "Facebookでシェア",
25
+ href: (t) => `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`,
26
+ icon: /* @__PURE__ */ o(l, { platform: "facebook", size: 16 })
27
+ },
28
+ hatena: {
29
+ label: "はてブ",
30
+ ariaLabel: "はてなブックマークに追加",
31
+ href: (t, a) => `https://b.hatena.ne.jp/entry/panel/?url=${encodeURIComponent(t)}&title=${encodeURIComponent(a)}`,
32
+ icon: /* @__PURE__ */ o(l, { platform: "hatena", size: 16 })
33
+ }
34
+ };
35
+ function A({
36
+ className: t,
37
+ url: a = "",
38
+ text: s = "",
39
+ services: b = E,
11
40
  copyLabel: d = "URLをコピー",
12
- copiedLabel: u = "コピーしました",
13
- copyErrorLabel: f = "コピーできませんでした",
14
- onCopy: h,
15
- ...y
41
+ copiedLabel: y = "コピーしました",
42
+ copyErrorLabel: R = "コピーできませんでした",
43
+ onCopy: C,
44
+ ...L
16
45
  }) {
17
- const [s, l] = n.useState(
46
+ const [p, m] = c.useState(
18
47
  "idle"
19
- ), t = n.useRef(null);
20
- n.useEffect(() => () => {
21
- t.current && clearTimeout(t.current);
48
+ ), n = c.useRef(null);
49
+ c.useEffect(() => () => {
50
+ n.current && clearTimeout(n.current);
22
51
  }, []);
23
- const b = async () => {
24
- let a = "error";
52
+ const I = async () => {
53
+ let e = "error";
25
54
  try {
26
- r && navigator.clipboard && (await navigator.clipboard.writeText(r), a = "success");
55
+ a && navigator.clipboard && (await navigator.clipboard.writeText(a), e = "success");
27
56
  } catch {
28
- a = "error";
57
+ e = "error";
29
58
  }
30
- l(a), h?.(a), t.current && clearTimeout(t.current), t.current = setTimeout(() => l("idle"), 2e3);
31
- }, x = s === "success" ? u : s === "error" ? f : d;
59
+ m(e), C?.(e), n.current && clearTimeout(n.current), n.current = setTimeout(() => m("idle"), 2e3);
60
+ }, x = p === "success" ? y : p === "error" ? R : d, f = (e, r, i, k, U) => /* @__PURE__ */ o(h, { variant: "tertiary", size: "sm", className: "flex-1 gap-1.5", asChild: !0, children: /* @__PURE__ */ u("a", { href: r, target: "_blank", rel: "noopener noreferrer", "aria-label": i, children: [
61
+ k,
62
+ /* @__PURE__ */ o("span", { className: "typo-body-sm", children: U })
63
+ ] }) }, e);
32
64
  return /* @__PURE__ */ o(
33
65
  "div",
34
66
  {
35
67
  "data-slot": "share-buttons",
36
- className: N("flex items-center gap-2", m),
37
- ...y,
38
- children: [
39
- /* @__PURE__ */ e(
40
- i,
41
- {
42
- variant: "tertiary",
43
- size: "sm",
44
- className: "flex-1 gap-1.5",
45
- asChild: !0,
46
- children: /* @__PURE__ */ o(
47
- "a",
48
- {
49
- href: `https://social-plugins.line.me/lineit/share?url=${encodeURIComponent(r)}`,
50
- target: "_blank",
51
- rel: "noopener noreferrer",
52
- "aria-label": "LINEでシェア",
53
- children: [
54
- /* @__PURE__ */ e(c, { platform: "line", size: 16 }),
55
- /* @__PURE__ */ e("span", { className: "typo-body-sm", children: "LINE" })
56
- ]
57
- }
58
- )
59
- }
60
- ),
61
- /* @__PURE__ */ e(
62
- i,
63
- {
64
- variant: "tertiary",
65
- size: "sm",
66
- className: "flex-1 gap-1.5",
67
- asChild: !0,
68
- children: /* @__PURE__ */ o(
69
- "a",
70
- {
71
- href: `https://twitter.com/intent/tweet?url=${encodeURIComponent(r)}&text=${encodeURIComponent(p)}`,
72
- target: "_blank",
73
- rel: "noopener noreferrer",
74
- "aria-label": "Xでシェア",
75
- children: [
76
- /* @__PURE__ */ e(c, { platform: "x", size: 14, tone: "mono" }),
77
- /* @__PURE__ */ e("span", { className: "typo-body-sm", children: "X" })
78
- ]
79
- }
80
- )
81
- }
82
- ),
83
- /* @__PURE__ */ o(
84
- i,
85
- {
86
- variant: "tertiary",
87
- size: "sm",
88
- className: "flex-1 gap-1.5",
89
- onClick: b,
90
- children: [
91
- /* @__PURE__ */ e(g, { size: 14, "aria-hidden": "true" }),
92
- /* @__PURE__ */ e("span", { className: "typo-body-sm", "aria-live": "polite", children: x })
93
- ]
94
- }
95
- )
96
- ]
68
+ className: S("flex items-center gap-2", t),
69
+ ...L,
70
+ children: b.map((e) => {
71
+ if (typeof e != "string") {
72
+ const i = e.href.replace("{url}", encodeURIComponent(a)).replace("{text}", encodeURIComponent(s));
73
+ return f(
74
+ e.key,
75
+ i,
76
+ e.ariaLabel ?? e.label,
77
+ e.icon,
78
+ e.label
79
+ );
80
+ }
81
+ if (e === "copy")
82
+ return /* @__PURE__ */ u(
83
+ h,
84
+ {
85
+ variant: "tertiary",
86
+ size: "sm",
87
+ className: "flex-1 gap-1.5",
88
+ onClick: I,
89
+ children: [
90
+ /* @__PURE__ */ o(g, { size: 14, "aria-hidden": "true" }),
91
+ /* @__PURE__ */ o("span", { className: "typo-body-sm", "aria-live": "polite", children: x })
92
+ ]
93
+ },
94
+ "copy"
95
+ );
96
+ const r = w[e];
97
+ return f(
98
+ e,
99
+ r.href(a, s),
100
+ r.ariaLabel,
101
+ r.icon,
102
+ r.label
103
+ );
104
+ })
97
105
  }
98
106
  );
99
107
  }
100
108
  export {
101
- L as ShareButtons
109
+ A as ShareButtons
102
110
  };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as l } from "react/jsx-runtime";
2
3
  import * as r from "react";
3
4
  import { cn as f } from "../../lib/utils.js";
@@ -8,12 +9,12 @@ function h({
8
9
  onSelect: n,
9
10
  className: u
10
11
  }) {
11
- const [e, s] = r.useState(o);
12
+ const [s, a] = r.useState(o);
12
13
  r.useEffect(() => {
13
- s(o);
14
+ a(o);
14
15
  }, [o]);
15
16
  const i = (t) => {
16
- s(t), n?.(t);
17
+ a(t), n?.(t);
17
18
  };
18
19
  return /* @__PURE__ */ l(
19
20
  "div",
@@ -21,15 +22,15 @@ function h({
21
22
  "data-slot": "status-count-tabs",
22
23
  className: f("flex gap-2 overflow-x-auto scrollbar-hide", u),
23
24
  role: "tablist",
24
- children: c.map((t, a) => /* @__PURE__ */ l(
25
+ children: c.map((t, e) => /* @__PURE__ */ l(
25
26
  m,
26
27
  {
27
- selected: e === a,
28
+ selected: s === e,
28
29
  count: t.count,
29
30
  size: "sm",
30
- onClick: () => i(a),
31
+ onClick: () => i(e),
31
32
  role: "tab",
32
- "aria-selected": e === a,
33
+ "aria-selected": s === e,
33
34
  children: t.label
34
35
  },
35
36
  t.label
@@ -1,67 +1,67 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as a } from "../../lib/utils.js";
4
- function u({
5
- className: s,
6
- items: n,
7
- variant: c = "text",
3
+ import { cn as e } from "../../lib/utils.js";
4
+ import { resolveLinkComponent as f } from "../../lib/link-component.js";
5
+ import { containerVariants as g } from "./container.js";
6
+ const u = "px-4 md:px-6";
7
+ function N({
8
+ className: t,
9
+ items: x,
10
+ variant: n = "text",
11
+ linkComponent: b,
12
+ containerSize: o,
8
13
  ...l
9
14
  }) {
10
- return c === "chip" ? /* @__PURE__ */ e(
15
+ const i = () => x.map((r) => {
16
+ const p = r.href ? f(b) : "button", v = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
17
+ return n === "chip" ? /* @__PURE__ */ a(
18
+ p,
19
+ {
20
+ className: e(
21
+ "shrink-0 rounded-full px-3 typo-label-sm transition-colors h-8 inline-flex items-center justify-center",
22
+ r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Tertiary)]"
23
+ ),
24
+ ...v,
25
+ children: r.label
26
+ },
27
+ r.label
28
+ ) : /* @__PURE__ */ m(
29
+ p,
30
+ {
31
+ className: e(
32
+ "relative shrink-0 py-2.5 typo-label-md transition-colors",
33
+ r.isActive ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
34
+ ),
35
+ ...v,
36
+ children: [
37
+ r.label,
38
+ r.isActive && /* @__PURE__ */ a("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-[var(--Text-High-Emphasis)]" })
39
+ ]
40
+ },
41
+ r.label
42
+ );
43
+ }), s = n === "chip", c = s ? "div" : "nav", d = s ? e("flex gap-2 overflow-x-auto py-2 scrollbar-hide", u) : e("flex gap-4 overflow-x-auto scrollbar-hide", u), h = s ? void 0 : "border-b border-[var(--Border-Low-Emphasis)]";
44
+ return o ? /* @__PURE__ */ a(c, { "data-slot": "sub-nav", className: e(h, t), ...l, children: /* @__PURE__ */ a(
11
45
  "div",
12
46
  {
13
- "data-slot": "sub-nav",
14
- className: a(
15
- "flex gap-2 overflow-x-auto px-4 py-2 scrollbar-hide",
16
- s
47
+ "data-slot": "sub-nav-container",
48
+ "data-container-size": o,
49
+ className: e(
50
+ g({ size: o, gutter: "none" }),
51
+ d
17
52
  ),
18
- ...l,
19
- children: n.map((r) => {
20
- const o = r.href ? "a" : "button", t = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
21
- return /* @__PURE__ */ e(
22
- o,
23
- {
24
- className: a(
25
- "shrink-0 rounded-full px-3 typo-label-sm transition-colors h-8 inline-flex items-center justify-center",
26
- r.isActive ? "bg-[var(--Brand-Cake-Orange)] text-[var(--Text-on-Inverse)]" : "bg-[var(--Surface-Secondary)] text-[var(--Text-Medium-Emphasis)] hover:bg-[var(--Surface-Tertiary)]"
27
- ),
28
- ...t,
29
- children: r.label
30
- },
31
- r.label
32
- );
33
- })
53
+ children: i()
34
54
  }
35
- ) : /* @__PURE__ */ e(
36
- "nav",
55
+ ) }) : /* @__PURE__ */ a(
56
+ c,
37
57
  {
38
58
  "data-slot": "sub-nav",
39
- className: a(
40
- "flex gap-4 overflow-x-auto border-b border-[var(--Border-Low-Emphasis)] px-4 scrollbar-hide",
41
- s
42
- ),
59
+ className: e(h, d, t),
43
60
  ...l,
44
- children: n.map((r) => {
45
- const o = r.href ? "a" : "button", t = r.href ? { href: r.href } : { type: "button", onClick: r.onClick };
46
- return /* @__PURE__ */ i(
47
- o,
48
- {
49
- className: a(
50
- "relative shrink-0 py-2.5 typo-label-md transition-colors",
51
- r.isActive ? "text-[var(--Text-High-Emphasis)]" : "text-[var(--Text-Medium-Emphasis)] hover:text-[var(--Text-High-Emphasis)]"
52
- ),
53
- ...t,
54
- children: [
55
- r.label,
56
- r.isActive && /* @__PURE__ */ e("span", { className: "absolute inset-x-0 bottom-0 h-0.5 rounded-full bg-[var(--Text-High-Emphasis)]" })
57
- ]
58
- },
59
- r.label
60
- );
61
- })
61
+ children: i()
62
62
  }
63
63
  );
64
64
  }
65
65
  export {
66
- u as SubNav
66
+ N as SubNav
67
67
  };