@entifix/react-controls 0.1.1 → 0.1.3

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 (155) hide show
  1. package/README.md +5 -5
  2. package/dist/i18n/catalog/es.d.ts +2 -2
  3. package/dist/i18n/catalog/es.js +2 -2
  4. package/dist/i18n/catalog/es.js.map +1 -1
  5. package/dist/i18n/entity-labels.d.ts +2 -1
  6. package/dist/i18n/entity-labels.d.ts.map +1 -1
  7. package/dist/i18n/entity-labels.js +2 -1
  8. package/dist/i18n/entity-labels.js.map +1 -1
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +12 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/primitives.d.ts +12 -0
  14. package/dist/primitives.d.ts.map +1 -1
  15. package/dist/primitives.js +12 -0
  16. package/dist/primitives.js.map +1 -1
  17. package/dist/theme/index.d.ts +1 -0
  18. package/dist/theme/index.d.ts.map +1 -1
  19. package/dist/theme/index.js +1 -0
  20. package/dist/theme/index.js.map +1 -1
  21. package/dist/theme/theme-script.d.ts +26 -0
  22. package/dist/theme/theme-script.d.ts.map +1 -0
  23. package/dist/theme/theme-script.js +38 -0
  24. package/dist/theme/theme-script.js.map +1 -0
  25. package/dist/ui/actions/index.d.ts +1 -0
  26. package/dist/ui/actions/index.d.ts.map +1 -1
  27. package/dist/ui/actions/index.js +1 -0
  28. package/dist/ui/actions/index.js.map +1 -1
  29. package/dist/ui/actions/render-link.d.ts +40 -0
  30. package/dist/ui/actions/render-link.d.ts.map +1 -0
  31. package/dist/ui/actions/render-link.js +8 -0
  32. package/dist/ui/actions/render-link.js.map +1 -0
  33. package/dist/ui/atoms/external-link/external-link.d.ts +9 -0
  34. package/dist/ui/atoms/external-link/external-link.d.ts.map +1 -0
  35. package/dist/ui/atoms/external-link/external-link.js +13 -0
  36. package/dist/ui/atoms/external-link/external-link.js.map +1 -0
  37. package/dist/ui/atoms/external-link/index.d.ts +2 -0
  38. package/dist/ui/atoms/external-link/index.d.ts.map +1 -0
  39. package/dist/ui/atoms/external-link/index.js +3 -0
  40. package/dist/ui/atoms/external-link/index.js.map +1 -0
  41. package/dist/ui/atoms/switch/index.d.ts +2 -0
  42. package/dist/ui/atoms/switch/index.d.ts.map +1 -0
  43. package/dist/ui/atoms/switch/index.js +3 -0
  44. package/dist/ui/atoms/switch/index.js.map +1 -0
  45. package/dist/ui/atoms/switch/switch.d.ts +10 -0
  46. package/dist/ui/atoms/switch/switch.d.ts.map +1 -0
  47. package/dist/ui/atoms/switch/switch.js +43 -0
  48. package/dist/ui/atoms/switch/switch.js.map +1 -0
  49. package/dist/ui/atoms/text/text.d.ts +5 -0
  50. package/dist/ui/atoms/text/text.d.ts.map +1 -1
  51. package/dist/ui/atoms/text/text.js +5 -1
  52. package/dist/ui/atoms/text/text.js.map +1 -1
  53. package/dist/ui/molecules/nav-menu/index.d.ts +2 -0
  54. package/dist/ui/molecules/nav-menu/index.d.ts.map +1 -0
  55. package/dist/ui/molecules/nav-menu/index.js +3 -0
  56. package/dist/ui/molecules/nav-menu/index.js.map +1 -0
  57. package/dist/ui/molecules/nav-menu/nav-menu.d.ts +30 -0
  58. package/dist/ui/molecules/nav-menu/nav-menu.d.ts.map +1 -0
  59. package/dist/ui/molecules/nav-menu/nav-menu.js +58 -0
  60. package/dist/ui/molecules/nav-menu/nav-menu.js.map +1 -0
  61. package/dist/ui/molecules/segmented-control/index.d.ts +2 -0
  62. package/dist/ui/molecules/segmented-control/index.d.ts.map +1 -0
  63. package/dist/ui/molecules/segmented-control/index.js +3 -0
  64. package/dist/ui/molecules/segmented-control/index.js.map +1 -0
  65. package/dist/ui/molecules/segmented-control/segmented-control.d.ts +21 -0
  66. package/dist/ui/molecules/segmented-control/segmented-control.d.ts.map +1 -0
  67. package/dist/ui/molecules/segmented-control/segmented-control.js +55 -0
  68. package/dist/ui/molecules/segmented-control/segmented-control.js.map +1 -0
  69. package/dist/ui/molecules/segmented-nav/index.d.ts +2 -0
  70. package/dist/ui/molecules/segmented-nav/index.d.ts.map +1 -0
  71. package/dist/ui/molecules/segmented-nav/index.js +3 -0
  72. package/dist/ui/molecules/segmented-nav/index.js.map +1 -0
  73. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts +9 -0
  74. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts.map +1 -0
  75. package/dist/ui/molecules/segmented-nav/segment-classes.js +9 -0
  76. package/dist/ui/molecules/segmented-nav/segment-classes.js.map +1 -0
  77. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts +30 -0
  78. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts.map +1 -0
  79. package/dist/ui/molecules/segmented-nav/segmented-nav.js +46 -0
  80. package/dist/ui/molecules/segmented-nav/segmented-nav.js.map +1 -0
  81. package/dist/ui/molecules/split-button/index.d.ts +2 -0
  82. package/dist/ui/molecules/split-button/index.d.ts.map +1 -0
  83. package/dist/ui/molecules/split-button/index.js +3 -0
  84. package/dist/ui/molecules/split-button/index.js.map +1 -0
  85. package/dist/ui/molecules/split-button/split-button.d.ts +21 -0
  86. package/dist/ui/molecules/split-button/split-button.d.ts.map +1 -0
  87. package/dist/ui/molecules/split-button/split-button.js +35 -0
  88. package/dist/ui/molecules/split-button/split-button.js.map +1 -0
  89. package/dist/ui/molecules/split-view/index.d.ts +2 -0
  90. package/dist/ui/molecules/split-view/index.d.ts.map +1 -0
  91. package/dist/ui/molecules/split-view/index.js +3 -0
  92. package/dist/ui/molecules/split-view/index.js.map +1 -0
  93. package/dist/ui/molecules/split-view/split-view.d.ts +35 -0
  94. package/dist/ui/molecules/split-view/split-view.d.ts.map +1 -0
  95. package/dist/ui/molecules/split-view/split-view.js +76 -0
  96. package/dist/ui/molecules/split-view/split-view.js.map +1 -0
  97. package/dist/ui/organisms/entity-form/entity-form.d.ts +1 -1
  98. package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -1
  99. package/dist/ui/organisms/entity-form/entity-form.js +12 -10
  100. package/dist/ui/organisms/entity-form/entity-form.js.map +1 -1
  101. package/dist/ui/organisms/entity-form/entity-form.types.d.ts +6 -0
  102. package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -1
  103. package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -1
  104. package/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
  105. package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
  106. package/dist/ui/organisms/entity-table/entity-table.js +16 -7
  107. package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
  108. package/dist/ui/organisms/entity-table/entity-table.types.d.ts +7 -0
  109. package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
  110. package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
  111. package/dist/ui/utils/active-heading/active-heading.d.ts +16 -0
  112. package/dist/ui/utils/active-heading/active-heading.d.ts.map +1 -0
  113. package/dist/ui/utils/active-heading/active-heading.js +68 -0
  114. package/dist/ui/utils/active-heading/active-heading.js.map +1 -0
  115. package/dist/ui/utils/active-heading/index.d.ts +2 -0
  116. package/dist/ui/utils/active-heading/index.d.ts.map +1 -0
  117. package/dist/ui/utils/active-heading/index.js +3 -0
  118. package/dist/ui/utils/active-heading/index.js.map +1 -0
  119. package/dist/ui/utils/active-section/active-section.d.ts +11 -0
  120. package/dist/ui/utils/active-section/active-section.d.ts.map +1 -0
  121. package/dist/ui/utils/active-section/active-section.js +45 -0
  122. package/dist/ui/utils/active-section/active-section.js.map +1 -0
  123. package/dist/ui/utils/active-section/index.d.ts +2 -0
  124. package/dist/ui/utils/active-section/index.d.ts.map +1 -0
  125. package/dist/ui/utils/active-section/index.js +3 -0
  126. package/dist/ui/utils/active-section/index.js.map +1 -0
  127. package/dist/ui/utils/fold-script/fold-script.d.ts +20 -0
  128. package/dist/ui/utils/fold-script/fold-script.d.ts.map +1 -0
  129. package/dist/ui/utils/fold-script/fold-script.js +30 -0
  130. package/dist/ui/utils/fold-script/fold-script.js.map +1 -0
  131. package/dist/ui/utils/fold-script/index.d.ts +2 -0
  132. package/dist/ui/utils/fold-script/index.d.ts.map +1 -0
  133. package/dist/ui/utils/fold-script/index.js +3 -0
  134. package/dist/ui/utils/fold-script/index.js.map +1 -0
  135. package/dist/ui/utils/keep-section/index.d.ts +2 -0
  136. package/dist/ui/utils/keep-section/index.d.ts.map +1 -0
  137. package/dist/ui/utils/keep-section/index.js +3 -0
  138. package/dist/ui/utils/keep-section/index.js.map +1 -0
  139. package/dist/ui/utils/keep-section/keep-section.d.ts +8 -0
  140. package/dist/ui/utils/keep-section/keep-section.d.ts.map +1 -0
  141. package/dist/ui/utils/keep-section/keep-section.js +24 -0
  142. package/dist/ui/utils/keep-section/keep-section.js.map +1 -0
  143. package/dist/ui/utils/media-query/index.d.ts +2 -0
  144. package/dist/ui/utils/media-query/index.d.ts.map +1 -0
  145. package/dist/ui/utils/media-query/index.js +3 -0
  146. package/dist/ui/utils/media-query/index.js.map +1 -0
  147. package/dist/ui/utils/media-query/media-query.d.ts +7 -0
  148. package/dist/ui/utils/media-query/media-query.d.ts.map +1 -0
  149. package/dist/ui/utils/media-query/media-query.js +18 -0
  150. package/dist/ui/utils/media-query/media-query.js.map +1 -0
  151. package/package.json +5 -8
  152. package/dist/i18n/spec-support/catalogs.d.ts +0 -2
  153. package/dist/i18n/spec-support/catalogs.d.ts.map +0 -1
  154. package/dist/i18n/spec-support/catalogs.js +0 -142
  155. package/dist/i18n/spec-support/catalogs.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/external-link/external-link.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\n/**\n * A link that leaves the site: a new tab, with no `window.opener` and no\n * referrer handed to the other side.\n */\nexport function ExternalLink(\n props: ComponentPropsWithoutRef<'a'> & { href: string },\n) {\n return <a {...props} target=\"_blank\" rel=\"noopener noreferrer\" />;\n}\n"],"names":["ExternalLink","props","a","target","rel"],"mappings":";;AAEA;;;CAGC,GACD,OAAO,SAASA,aACdC,KAAuD;IAEvD,qBAAO,KAACC,kBAAMD;QAAOE,QAAO;QAASC,KAAI;;AAC3C"}
@@ -0,0 +1,2 @@
1
+ export * from './external-link.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/external-link/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './external-link.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/external-link/index.ts"],"sourcesContent":["export * from './external-link.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
@@ -0,0 +1,2 @@
1
+ export * from './switch.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/switch/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './switch.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/switch/index.ts"],"sourcesContent":["export * from './switch.js';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc"}
@@ -0,0 +1,10 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ /**
3
+ * An on/off choice: a native checkbox announced as a switch, drawn as a track
4
+ * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the
5
+ * track only shows its state.
6
+ */
7
+ export declare function Switch({ children, className, ...input }: Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role' | 'children'> & {
8
+ children: ReactNode;
9
+ }): import("react").JSX.Element;
10
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAejE;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,GAAG;IACzE,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAgBA"}
@@ -0,0 +1,43 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ /** The label: the switch, then its text, on one line. */ const LABEL = 'inline-flex cursor-pointer items-center gap-3xs';
5
+ /**
6
+ * Off: an outlined track, its thumb muted at the start. On: filled with the
7
+ * primary colour, its thumb the surface's, at the end.
8
+ */ const TRACK = 'relative inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border border-content-muted bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[0.875rem] peer-checked:[&>span]:bg-surface';
9
+ const THUMB = 'ml-[0.125rem] size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none';
10
+ /**
11
+ * An on/off choice: a native checkbox announced as a switch, drawn as a track
12
+ * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the
13
+ * track only shows its state.
14
+ */ export function Switch(_0) {
15
+ let { children, className } = _0, input = _object_without_properties_loose(_0, [
16
+ "children",
17
+ "className"
18
+ ]);
19
+ return /*#__PURE__*/ _jsxs("label", {
20
+ "data-slot": "switch",
21
+ className: className != null ? className : LABEL,
22
+ children: [
23
+ /*#__PURE__*/ _jsx("input", _extends({}, input, {
24
+ type: "checkbox",
25
+ role: "switch",
26
+ "data-slot": "switch-input",
27
+ className: "peer sr-only"
28
+ })),
29
+ /*#__PURE__*/ _jsx("span", {
30
+ "data-slot": "switch-track",
31
+ "aria-hidden": "true",
32
+ className: TRACK,
33
+ children: /*#__PURE__*/ _jsx("span", {
34
+ "data-slot": "switch-thumb",
35
+ className: THUMB
36
+ })
37
+ }),
38
+ children
39
+ ]
40
+ });
41
+ }
42
+
43
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/atoms/switch/switch.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\n/** The label: the switch, then its text, on one line. */\nconst LABEL = 'inline-flex cursor-pointer items-center gap-3xs';\n\n/**\n * Off: an outlined track, its thumb muted at the start. On: filled with the\n * primary colour, its thumb the surface's, at the end.\n */\nconst TRACK =\n 'relative inline-flex h-[1.125rem] w-8 shrink-0 items-center rounded-full border border-content-muted bg-transparent transition-colors motion-reduce:transition-none peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus-ring peer-disabled:cursor-not-allowed peer-disabled:opacity-50 peer-checked:[&>span]:translate-x-[0.875rem] peer-checked:[&>span]:bg-surface';\n\nconst THUMB =\n 'ml-[0.125rem] size-3 rounded-full bg-content-muted transition-[translate,background-color] motion-reduce:transition-none';\n\n/**\n * An on/off choice: a native checkbox announced as a switch, drawn as a track\n * and a thumb. The checkbox keeps the keyboard, the form and `onChange`; the\n * track only shows its state.\n */\nexport function Switch({\n children,\n className,\n ...input\n}: Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'role' | 'children'> & {\n children: ReactNode;\n}) {\n return (\n <label data-slot=\"switch\" className={className ?? LABEL}>\n <input\n {...input}\n type=\"checkbox\"\n role=\"switch\"\n data-slot=\"switch-input\"\n className=\"peer sr-only\"\n />\n <span data-slot=\"switch-track\" aria-hidden=\"true\" className={TRACK}>\n <span data-slot=\"switch-thumb\" className={THUMB} />\n </span>\n {children}\n </label>\n );\n}\n"],"names":["LABEL","TRACK","THUMB","Switch","children","className","input","label","data-slot","type","role","span","aria-hidden"],"mappings":";;;AAEA,uDAAuD,GACvD,MAAMA,QAAQ;AAEd;;;CAGC,GACD,MAAMC,QACJ;AAEF,MAAMC,QACJ;AAEF;;;;CAIC,GACD,OAAO,SAASC,OAAO,EAMtB;QANsB,EACrBC,QAAQ,EACRC,SAAS,EAIV,OAHIC;;;;IAIH,qBACE,MAACC;QAAMC,aAAU;QAASH,SAAS,EAAEA,oBAAAA,YAAaL;;0BAChD,KAACM,sBACKA;gBACJG,MAAK;gBACLC,MAAK;gBACLF,aAAU;gBACVH,WAAU;;0BAEZ,KAACM;gBAAKH,aAAU;gBAAeI,eAAY;gBAAOP,WAAWJ;0BAC3D,cAAA,KAACU;oBAAKH,aAAU;oBAAeH,WAAWH;;;YAE3CE;;;AAGP"}
@@ -52,6 +52,11 @@ export declare function Em({ className, ...props }: ComponentPropsWithoutRef<'em
52
52
  export declare function Code({ className, ...props }: ComponentPropsWithoutRef<'code'>): import("react").JSX.Element;
53
53
  /** Keyboard key. */
54
54
  export declare function Kbd({ className, ...props }: ComponentPropsWithoutRef<'kbd'>): import("react").JSX.Element;
55
+ /**
56
+ * {@link Link}'s styling on its own, for a host that renders its own link
57
+ * component (a router's) and should still look like one.
58
+ */
59
+ export declare const linkClassName: string;
55
60
  /** Themed anchor. */
56
61
  export declare function Link({ className, children, ...props }: ComponentPropsWithoutRef<'a'>): import("react").JSX.Element;
57
62
  /** Pull quote — left border + muted italic body. */
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,OAAO,CA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,wBAAgB,IAAI,CAAC,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAYvE;AAED,qCAAqC;AACrC,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,IAAI,CAAC,+BAEhC;AAID,MAAM,WAAW,YAAa,SAAQ,wBAAwB,CAAC,IAAI,CAAC;IAClE,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,EACtB,IAAQ,EACR,MAAmB,EACnB,EAAE,EAAE,GAAU,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,YAAY,+BAYd;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;AAElE,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,+BAElD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,+BAElD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAEpD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,+BAEnD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,+BAEnD;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAUpE"}
@@ -123,13 +123,17 @@ const CLAMP_CLASS = {
123
123
  className: cn('inline-flex items-center rounded-md border border-border bg-surface-elevated', 'px-2xs py-3xs font-mono text-step-xs text-content-muted shadow-edge', className)
124
124
  }, props));
125
125
  }
126
+ /**
127
+ * {@link Link}'s styling on its own, for a host that renders its own link
128
+ * component (a router's) and should still look like one.
129
+ */ export const linkClassName = cn('font-medium text-primary underline underline-offset-2', 'transition-colors duration-200 ease-smooth hover:text-accent', 'focus-ring');
126
130
  /** Themed anchor. */ export function Link(_0) {
127
131
  let { className, children } = _0, props = _object_without_properties_loose(_0, [
128
132
  "className",
129
133
  "children"
130
134
  ]);
131
135
  return /*#__PURE__*/ _jsx("a", _extends({
132
- className: cn('font-medium text-primary underline underline-offset-2', 'transition-colors duration-200 ease-smooth hover:text-accent', 'focus-ring', className)
136
+ className: cn(linkClassName, className)
133
137
  }, props, {
134
138
  children: children
135
139
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/atoms/text/text.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ElementType } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/** Fluid type step (Utopia). Negatives taper below body for fine print. */\ntype Step = -2 | -1 | 0 | 1 | 2 | 3;\n\nconst STEP_CLASS: Record<Step, string> = {\n '-2': 'text-step-xs',\n '-1': 'text-step-sm',\n 0: 'text-step-0',\n 1: 'text-step-1',\n 2: 'text-step-2',\n 3: 'text-step-3',\n};\n\n/**\n * Three weights, and no fourth.\n *\n * 400 body, 500 secondary emphasis, 600 headings and labels. `bold` (700) was\n * removed: \"heading\" and \"emphatic heading\" were never distinct roles here,\n * only different authors — measured, `font-bold` appeared three times against\n * `font-semibold`'s thirteen, all of them headings that had no reason to differ\n * from their neighbours. A fourth weight comes back when a role needs it, not\n * when a screen wants one.\n */\ntype Weight = 'normal' | 'medium' | 'semibold';\n\nconst WEIGHT_CLASS: Record<Weight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n};\n\n/** Semantic content color. Superset of the legacy `muted` flag. */\ntype Tone = 'default' | 'muted' | 'primary' | 'accent';\n\nconst TONE_CLASS: Record<Tone, string> = {\n default: 'text-content',\n muted: 'text-content-muted',\n primary: 'text-primary',\n accent: 'text-accent',\n};\n\ntype Align = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<Align, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n/** Multi-line clamp (static classes so Tailwind can see them). */\ntype Clamp = 1 | 2 | 3 | 4;\n\nconst CLAMP_CLASS: Record<Clamp, string> = {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n};\n\nexport interface TextProps extends ComponentPropsWithoutRef<'p'> {\n /** Fluid type step (Utopia). Defaults to body (0). */\n step?: Step;\n /** Font weight. */\n weight?: Weight;\n /** Semantic color. */\n tone?: Tone;\n /** Text alignment. */\n align?: Align;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n /** Clamp to N lines with an ellipsis. */\n lineClamp?: Clamp;\n /** Shortcut for `tone=\"muted\"`. */\n muted?: boolean;\n as?: ElementType;\n}\n\n/** Body text with fluid sizing and theme-driven color. */\nexport function Text({\n step = 0,\n weight,\n tone = 'default',\n align,\n truncate = false,\n lineClamp,\n muted = false,\n as: Tag = 'p',\n className,\n ...props\n}: TextProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n weight && WEIGHT_CLASS[weight],\n TONE_CLASS[muted ? 'muted' : tone],\n align && ALIGN_CLASS[align],\n truncate && 'truncate',\n lineClamp && CLAMP_CLASS[lineClamp],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Larger intro paragraph — sets a subject up before the body copy. */\nexport function Lead({ className, ...props }: Omit<TextProps, 'step'>) {\n return (\n <Text\n step={1}\n tone=\"muted\"\n className={cn('max-w-prose leading-relaxed', className)}\n {...props}\n />\n );\n}\n\n/** Small supporting copy (helper text, meta). */\nexport function Small({ className, ...props }: Omit<TextProps, 'step' | 'as'>) {\n return <Text as=\"small\" step={-1} className={className} {...props} />;\n}\n\n/** Caption / fine print — smallest step, muted by default. */\nexport function Caption({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as'>) {\n return (\n <Text as=\"span\" step={-2} tone=\"muted\" className={className} {...props} />\n );\n}\n\n/** Overline / eyebrow — uppercase tracked label above a heading. */\nexport function Overline({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as' | 'weight'>) {\n return (\n <Text\n as=\"span\"\n step={-2}\n weight=\"semibold\"\n tone=\"muted\"\n className={cn('tracking-wide uppercase', className)}\n {...props}\n />\n );\n}\n\n/* ---------- Inline emphasis ---------- */\n\n/** Bold inline emphasis. */\nexport function Strong({\n className,\n ...props\n}: ComponentPropsWithoutRef<'strong'>) {\n return (\n <strong\n className={cn('font-semibold text-content', className)}\n {...props}\n />\n );\n}\n\n/** Italic inline emphasis. */\nexport function Em({ className, ...props }: ComponentPropsWithoutRef<'em'>) {\n return <em className={cn('italic', className)} {...props} />;\n}\n\n/** Inline code. */\nexport function Code({\n className,\n ...props\n}: ComponentPropsWithoutRef<'code'>) {\n return (\n <code\n className={cn(\n 'rounded-sm border border-border bg-surface px-2xs py-3xs',\n 'font-mono text-step-sm text-content tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Keyboard key. */\nexport function Kbd({ className, ...props }: ComponentPropsWithoutRef<'kbd'>) {\n return (\n <kbd\n className={cn(\n 'inline-flex items-center rounded-md border border-border bg-surface-elevated',\n 'px-2xs py-3xs font-mono text-step-xs text-content-muted shadow-edge',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Themed anchor. */\nexport function Link({\n className,\n children,\n ...props\n}: ComponentPropsWithoutRef<'a'>) {\n return (\n <a\n className={cn(\n 'font-medium text-primary underline underline-offset-2',\n 'transition-colors duration-200 ease-smooth hover:text-accent',\n 'focus-ring',\n className,\n )}\n {...props}\n >\n {children}\n </a>\n );\n}\n\n/* ---------- Block-level ---------- */\n\n/** Pull quote — left border + muted italic body. */\nexport function Blockquote({\n className,\n ...props\n}: ComponentPropsWithoutRef<'blockquote'>) {\n return (\n <blockquote\n className={cn(\n 'border-l-4 border-primary pl-s italic',\n 'text-step-1 text-content-muted',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ListProps extends ComponentPropsWithoutRef<'ul'> {\n /** Render an ordered list (`<ol>`) with numeric markers. */\n ordered?: boolean;\n}\n\n/** Bulleted or numbered list with themed markers and fluid spacing. */\nexport function List({ ordered = false, className, ...props }: ListProps) {\n const Tag = ordered ? 'ol' : 'ul';\n return (\n <Tag\n className={cn(\n ordered ? 'list-decimal' : 'list-disc',\n 'ms-m flex flex-col gap-2xs text-step-0 text-content marker:text-content-muted',\n className,\n )}\n {...(props as ComponentPropsWithoutRef<'ol'>)}\n />\n );\n}\n\n/** List item — pairs with `List`. */\nexport function ListItem({\n className,\n ...props\n}: ComponentPropsWithoutRef<'li'>) {\n return <li className={cn('ps-2xs', className)} {...props} />;\n}\n\n/* ---------- Headings ---------- */\n\nexport interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {\n step?: Step;\n weight?: Weight;\n as?: ElementType;\n}\n\n/** Heading primitive — fluid step + weight, defaults to the largest step. */\nexport function Heading({\n step = 3,\n weight = 'semibold',\n as: Tag = 'h2',\n className,\n ...props\n}: HeadingProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n WEIGHT_CLASS[weight],\n 'text-content',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Semantic heading components (h1–h6) mapped to the fluid type scale.\n * Sizes taper past the four Utopia steps by dropping weight for h5/h6.\n */\nexport type NamedHeadingProps = Omit<HeadingProps, 'as' | 'step'>;\n\nexport function HeadingOne(props: NamedHeadingProps) {\n return <Heading as=\"h1\" step={3} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingTwo(props: NamedHeadingProps) {\n return <Heading as=\"h2\" step={2} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingThree(props: NamedHeadingProps) {\n return <Heading as=\"h3\" step={1} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFour(props: NamedHeadingProps) {\n return <Heading as=\"h4\" step={0} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFive(props: NamedHeadingProps) {\n return <Heading as=\"h5\" step={0} weight=\"medium\" {...props} />;\n}\n\nexport function HeadingSix({ className, ...props }: NamedHeadingProps) {\n return (\n <Heading\n as=\"h6\"\n step={0}\n weight=\"medium\"\n className={cn('tracking-wide text-content-muted uppercase', className)}\n {...props}\n />\n );\n}\n"],"names":["cn","STEP_CLASS","WEIGHT_CLASS","normal","medium","semibold","TONE_CLASS","default","muted","primary","accent","ALIGN_CLASS","start","center","end","CLAMP_CLASS","Text","step","weight","tone","align","truncate","lineClamp","as","Tag","className","props","Lead","Small","Caption","Overline","Strong","strong","Em","em","Code","code","Kbd","kbd","Link","children","a","Blockquote","blockquote","List","ordered","ListItem","li","Heading","HeadingOne","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAKvC,MAAMC,aAAmC;IACvC,MAAM;IACN,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAcA,MAAMC,eAAuC;IAC3CC,QAAQ;IACRC,QAAQ;IACRC,UAAU;AACZ;AAKA,MAAMC,aAAmC;IACvCC,SAAS;IACTC,OAAO;IACPC,SAAS;IACTC,QAAQ;AACV;AAIA,MAAMC,cAAqC;IACzCC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAKA,MAAMC,cAAqC;IACzC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAoBA,wDAAwD,GACxD,OAAO,SAASC,KAAK,EAWT;QAXS,EACnBC,OAAO,CAAC,EACRC,MAAM,EACNC,OAAO,SAAS,EAChBC,KAAK,EACLC,WAAW,KAAK,EAChBC,SAAS,EACTd,QAAQ,KAAK,EACbe,IAAIC,MAAM,GAAG,EACbC,SAAS,EAEC,OADPC;;;;;;;;;;;IAEH,qBACE,KAACF;QACCC,WAAWzB,GACTC,UAAU,CAACgB,KAAK,EAChBC,UAAUhB,YAAY,CAACgB,OAAO,EAC9BZ,UAAU,CAACE,QAAQ,UAAUW,KAAK,EAClCC,SAAST,WAAW,CAACS,MAAM,EAC3BC,YAAY,YACZC,aAAaP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WAAWxB,KAAwB;IACjD,qBAAO,KAACsB;QAAQzB,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAASyB,aAAazB,KAAwB;IACnD,qBAAO,KAACsB;QAAQzB,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS0B,YAAY1B,KAAwB;IAClD,qBAAO,KAACsB;QAAQzB,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS2B,YAAY3B,KAAwB;IAClD,qBAAO,KAACsB;QAAQzB,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAaQ;AACvD;AAEA,OAAO,SAAS4B,WAAW,EAA0C;QAA1C,EAAE7B,SAAS,EAA+B,OAA1BC;;;IACzC,qBACE,KAACsB;QACCzB,IAAG;QACHN,MAAM;QACNC,QAAO;QACPO,WAAWzB,GAAG,8CAA8CyB;OACxDC;AAGV"}
1
+ {"version":3,"sources":["../../../../src/ui/atoms/text/text.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ElementType } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/** Fluid type step (Utopia). Negatives taper below body for fine print. */\ntype Step = -2 | -1 | 0 | 1 | 2 | 3;\n\nconst STEP_CLASS: Record<Step, string> = {\n '-2': 'text-step-xs',\n '-1': 'text-step-sm',\n 0: 'text-step-0',\n 1: 'text-step-1',\n 2: 'text-step-2',\n 3: 'text-step-3',\n};\n\n/**\n * Three weights, and no fourth.\n *\n * 400 body, 500 secondary emphasis, 600 headings and labels. `bold` (700) was\n * removed: \"heading\" and \"emphatic heading\" were never distinct roles here,\n * only different authors — measured, `font-bold` appeared three times against\n * `font-semibold`'s thirteen, all of them headings that had no reason to differ\n * from their neighbours. A fourth weight comes back when a role needs it, not\n * when a screen wants one.\n */\ntype Weight = 'normal' | 'medium' | 'semibold';\n\nconst WEIGHT_CLASS: Record<Weight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n};\n\n/** Semantic content color. Superset of the legacy `muted` flag. */\ntype Tone = 'default' | 'muted' | 'primary' | 'accent';\n\nconst TONE_CLASS: Record<Tone, string> = {\n default: 'text-content',\n muted: 'text-content-muted',\n primary: 'text-primary',\n accent: 'text-accent',\n};\n\ntype Align = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<Align, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n/** Multi-line clamp (static classes so Tailwind can see them). */\ntype Clamp = 1 | 2 | 3 | 4;\n\nconst CLAMP_CLASS: Record<Clamp, string> = {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n};\n\nexport interface TextProps extends ComponentPropsWithoutRef<'p'> {\n /** Fluid type step (Utopia). Defaults to body (0). */\n step?: Step;\n /** Font weight. */\n weight?: Weight;\n /** Semantic color. */\n tone?: Tone;\n /** Text alignment. */\n align?: Align;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n /** Clamp to N lines with an ellipsis. */\n lineClamp?: Clamp;\n /** Shortcut for `tone=\"muted\"`. */\n muted?: boolean;\n as?: ElementType;\n}\n\n/** Body text with fluid sizing and theme-driven color. */\nexport function Text({\n step = 0,\n weight,\n tone = 'default',\n align,\n truncate = false,\n lineClamp,\n muted = false,\n as: Tag = 'p',\n className,\n ...props\n}: TextProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n weight && WEIGHT_CLASS[weight],\n TONE_CLASS[muted ? 'muted' : tone],\n align && ALIGN_CLASS[align],\n truncate && 'truncate',\n lineClamp && CLAMP_CLASS[lineClamp],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Larger intro paragraph — sets a subject up before the body copy. */\nexport function Lead({ className, ...props }: Omit<TextProps, 'step'>) {\n return (\n <Text\n step={1}\n tone=\"muted\"\n className={cn('max-w-prose leading-relaxed', className)}\n {...props}\n />\n );\n}\n\n/** Small supporting copy (helper text, meta). */\nexport function Small({ className, ...props }: Omit<TextProps, 'step' | 'as'>) {\n return <Text as=\"small\" step={-1} className={className} {...props} />;\n}\n\n/** Caption / fine print — smallest step, muted by default. */\nexport function Caption({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as'>) {\n return (\n <Text as=\"span\" step={-2} tone=\"muted\" className={className} {...props} />\n );\n}\n\n/** Overline / eyebrow — uppercase tracked label above a heading. */\nexport function Overline({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as' | 'weight'>) {\n return (\n <Text\n as=\"span\"\n step={-2}\n weight=\"semibold\"\n tone=\"muted\"\n className={cn('tracking-wide uppercase', className)}\n {...props}\n />\n );\n}\n\n/* ---------- Inline emphasis ---------- */\n\n/** Bold inline emphasis. */\nexport function Strong({\n className,\n ...props\n}: ComponentPropsWithoutRef<'strong'>) {\n return (\n <strong\n className={cn('font-semibold text-content', className)}\n {...props}\n />\n );\n}\n\n/** Italic inline emphasis. */\nexport function Em({ className, ...props }: ComponentPropsWithoutRef<'em'>) {\n return <em className={cn('italic', className)} {...props} />;\n}\n\n/** Inline code. */\nexport function Code({\n className,\n ...props\n}: ComponentPropsWithoutRef<'code'>) {\n return (\n <code\n className={cn(\n 'rounded-sm border border-border bg-surface px-2xs py-3xs',\n 'font-mono text-step-sm text-content tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Keyboard key. */\nexport function Kbd({ className, ...props }: ComponentPropsWithoutRef<'kbd'>) {\n return (\n <kbd\n className={cn(\n 'inline-flex items-center rounded-md border border-border bg-surface-elevated',\n 'px-2xs py-3xs font-mono text-step-xs text-content-muted shadow-edge',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * {@link Link}'s styling on its own, for a host that renders its own link\n * component (a router's) and should still look like one.\n */\nexport const linkClassName = cn(\n 'font-medium text-primary underline underline-offset-2',\n 'transition-colors duration-200 ease-smooth hover:text-accent',\n 'focus-ring',\n);\n\n/** Themed anchor. */\nexport function Link({\n className,\n children,\n ...props\n}: ComponentPropsWithoutRef<'a'>) {\n return (\n <a className={cn(linkClassName, className)} {...props}>\n {children}\n </a>\n );\n}\n\n/* ---------- Block-level ---------- */\n\n/** Pull quote — left border + muted italic body. */\nexport function Blockquote({\n className,\n ...props\n}: ComponentPropsWithoutRef<'blockquote'>) {\n return (\n <blockquote\n className={cn(\n 'border-l-4 border-primary pl-s italic',\n 'text-step-1 text-content-muted',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ListProps extends ComponentPropsWithoutRef<'ul'> {\n /** Render an ordered list (`<ol>`) with numeric markers. */\n ordered?: boolean;\n}\n\n/** Bulleted or numbered list with themed markers and fluid spacing. */\nexport function List({ ordered = false, className, ...props }: ListProps) {\n const Tag = ordered ? 'ol' : 'ul';\n return (\n <Tag\n className={cn(\n ordered ? 'list-decimal' : 'list-disc',\n 'ms-m flex flex-col gap-2xs text-step-0 text-content marker:text-content-muted',\n className,\n )}\n {...(props as ComponentPropsWithoutRef<'ol'>)}\n />\n );\n}\n\n/** List item — pairs with `List`. */\nexport function ListItem({\n className,\n ...props\n}: ComponentPropsWithoutRef<'li'>) {\n return <li className={cn('ps-2xs', className)} {...props} />;\n}\n\n/* ---------- Headings ---------- */\n\nexport interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {\n step?: Step;\n weight?: Weight;\n as?: ElementType;\n}\n\n/** Heading primitive — fluid step + weight, defaults to the largest step. */\nexport function Heading({\n step = 3,\n weight = 'semibold',\n as: Tag = 'h2',\n className,\n ...props\n}: HeadingProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n WEIGHT_CLASS[weight],\n 'text-content',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Semantic heading components (h1–h6) mapped to the fluid type scale.\n * Sizes taper past the four Utopia steps by dropping weight for h5/h6.\n */\nexport type NamedHeadingProps = Omit<HeadingProps, 'as' | 'step'>;\n\nexport function HeadingOne(props: NamedHeadingProps) {\n return <Heading as=\"h1\" step={3} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingTwo(props: NamedHeadingProps) {\n return <Heading as=\"h2\" step={2} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingThree(props: NamedHeadingProps) {\n return <Heading as=\"h3\" step={1} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFour(props: NamedHeadingProps) {\n return <Heading as=\"h4\" step={0} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFive(props: NamedHeadingProps) {\n return <Heading as=\"h5\" step={0} weight=\"medium\" {...props} />;\n}\n\nexport function HeadingSix({ className, ...props }: NamedHeadingProps) {\n return (\n <Heading\n as=\"h6\"\n step={0}\n weight=\"medium\"\n className={cn('tracking-wide text-content-muted uppercase', className)}\n {...props}\n />\n );\n}\n"],"names":["cn","STEP_CLASS","WEIGHT_CLASS","normal","medium","semibold","TONE_CLASS","default","muted","primary","accent","ALIGN_CLASS","start","center","end","CLAMP_CLASS","Text","step","weight","tone","align","truncate","lineClamp","as","Tag","className","props","Lead","Small","Caption","Overline","Strong","strong","Em","em","Code","code","Kbd","kbd","linkClassName","Link","children","a","Blockquote","blockquote","List","ordered","ListItem","li","Heading","HeadingOne","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAKvC,MAAMC,aAAmC;IACvC,MAAM;IACN,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAcA,MAAMC,eAAuC;IAC3CC,QAAQ;IACRC,QAAQ;IACRC,UAAU;AACZ;AAKA,MAAMC,aAAmC;IACvCC,SAAS;IACTC,OAAO;IACPC,SAAS;IACTC,QAAQ;AACV;AAIA,MAAMC,cAAqC;IACzCC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAKA,MAAMC,cAAqC;IACzC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAoBA,wDAAwD,GACxD,OAAO,SAASC,KAAK,EAWT;QAXS,EACn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GvB,WAAWzB,GAAG,UAAUyB;OAAgBC;AACrD;AAUA,2EAA2E,GAC3E,OAAO,SAASuB,QAAQ,EAMT;QANS,EACtBhC,OAAO,CAAC,EACRC,SAAS,UAAU,EACnBK,IAAIC,MAAM,IAAI,EACdC,SAAS,EAEI,OADVC;;;;;;IAEH,qBACE,KAACF;QACCC,WAAWzB,GACTC,UAAU,CAACgB,KAAK,EAChBf,YAAY,CAACgB,OAAO,EACpB,gBACAO;OAEEC;AAGV;AAQA,OAAO,SAASwB,WAAWxB,KAAwB;IACjD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAASyB,WAAWzB,KAAwB;IACjD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS0B,aAAa1B,KAAwB;IACnD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS2B,YAAY3B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS4B,YAAY5B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAaQ;AACvD;AAEA,OAAO,SAAS6B,WAAW,EAA0C;QAA1C,EAAE9B,SAAS,EAA+B,OAA1BC;;;IACzC,qBACE,KAACuB;QACC1B,IAAG;QACHN,MAAM;QACNC,QAAO;QACPO,WAAWzB,GAAG,8CAA8CyB;OACxDC;AAGV"}
@@ -0,0 +1,2 @@
1
+ export * from './nav-menu.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/nav-menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './nav-menu.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/nav-menu/index.ts"],"sourcesContent":["export * from './nav-menu.js';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB"}
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * A dropdown in a navigation bar: a native `<details>` disclosure, so it opens
4
+ * and its links work with scripting off. What a dropdown is expected to do on
5
+ * top — one open at a time, closed by a click elsewhere or Escape — is the
6
+ * page's to add.
7
+ *
8
+ * No hooks, so a client component can render it too. Its parts carry
9
+ * `data-slot` (`nav-menu`, `nav-menu-trigger`, `nav-menu-chevron`,
10
+ * `nav-menu-panel`), so a page can restyle them — a panel as wide as the bar
11
+ * on a phone, say — without knowing the classes underneath.
12
+ */
13
+ export declare function NavMenu({ label, icon, summary, chevron, className, triggerClassName, children, }: {
14
+ /** The accessible name of the trigger. */
15
+ label: string;
16
+ icon: ReactNode;
17
+ /** What the trigger shows beside the icon, if anything. */
18
+ summary?: ReactNode;
19
+ /** A chevron after the trigger's content: a menu of choices has one. */
20
+ chevron?: boolean;
21
+ className?: string;
22
+ /** Replaces the trigger's look: a split button draws it as its own segment. */
23
+ triggerClassName?: string;
24
+ children: ReactNode;
25
+ }): import("react").JSX.Element;
26
+ /** A check beside the chosen entry; an equal space beside the others. */
27
+ export declare function NavMenuCheck({ checked }: {
28
+ checked: boolean;
29
+ }): import("react").JSX.Element;
30
+ //# sourceMappingURL=nav-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-menu.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/nav-menu/nav-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAc,EACd,SAAS,EACT,gBAA0B,EAC1B,QAAQ,GACT,EAAE;IACD,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BA8BA;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,+BAW7D"}
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../utils/cn.js';
3
+ /** A bar's trigger: quiet until hovered or open. */ const TRIGGER = 'focus-ring flex h-[2rem] cursor-pointer list-none items-center gap-3xs rounded-md border border-transparent px-2xs text-step-sm font-medium text-content select-none transition-[background-color,border-color] duration-(--duration-fast,150ms) hover:border-border hover:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)] [&::-webkit-details-marker]:hidden [[open]>&]:border-border [[open]>&]:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)]';
4
+ /**
5
+ * A dropdown in a navigation bar: a native `<details>` disclosure, so it opens
6
+ * and its links work with scripting off. What a dropdown is expected to do on
7
+ * top — one open at a time, closed by a click elsewhere or Escape — is the
8
+ * page's to add.
9
+ *
10
+ * No hooks, so a client component can render it too. Its parts carry
11
+ * `data-slot` (`nav-menu`, `nav-menu-trigger`, `nav-menu-chevron`,
12
+ * `nav-menu-panel`), so a page can restyle them — a panel as wide as the bar
13
+ * on a phone, say — without knowing the classes underneath.
14
+ */ export function NavMenu({ label, icon, summary, chevron = true, className, triggerClassName = TRIGGER, children }) {
15
+ return /*#__PURE__*/ _jsxs("details", {
16
+ "data-slot": "nav-menu",
17
+ className: cn('relative', className),
18
+ children: [
19
+ /*#__PURE__*/ _jsxs("summary", {
20
+ "aria-label": label,
21
+ title: label,
22
+ "data-slot": "nav-menu-trigger",
23
+ className: triggerClassName,
24
+ children: [
25
+ icon,
26
+ summary,
27
+ chevron && /*#__PURE__*/ _jsx("svg", {
28
+ "aria-hidden": "true",
29
+ viewBox: "0 0 24 24",
30
+ "data-slot": "nav-menu-chevron",
31
+ className: "size-[0.875rem] flex-none fill-none stroke-current stroke-2 text-content-muted transition-[rotate] duration-(--duration-fast,150ms) [stroke-linecap:round] [stroke-linejoin:round] [[open]>summary>&]:rotate-180",
32
+ children: /*#__PURE__*/ _jsx("path", {
33
+ d: "m7 10 5 5 5-5"
34
+ })
35
+ })
36
+ ]
37
+ }),
38
+ /*#__PURE__*/ _jsx("div", {
39
+ "data-slot": "nav-menu-panel",
40
+ className: "right-0 ease-out starting:-translate-y-1 [&_ul]:m-0 [&_ul]:p-0 absolute top-[calc(100%+var(--spacing-3xs))] z-60 min-w-[10rem] rounded-lg border border-border bg-surface-elevated p-3xs shadow-[var(--shadow-overlay)] transition-[opacity,translate] duration-[120ms] motion-reduce:transition-none starting:opacity-0 [&_ul]:list-none",
41
+ children: children
42
+ })
43
+ ]
44
+ });
45
+ }
46
+ /** A check beside the chosen entry; an equal space beside the others. */ export function NavMenuCheck({ checked }) {
47
+ return /*#__PURE__*/ _jsx("svg", {
48
+ "aria-hidden": "true",
49
+ viewBox: "0 0 24 24",
50
+ "data-slot": "nav-menu-check",
51
+ className: "size-[1rem] flex-none fill-none stroke-current stroke-2 [stroke-linecap:round] [stroke-linejoin:round]",
52
+ children: checked && /*#__PURE__*/ _jsx("path", {
53
+ d: "m5 12.5 4.5 4.5L19 7.5"
54
+ })
55
+ });
56
+ }
57
+
58
+ //# sourceMappingURL=nav-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/nav-menu/nav-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/** A bar's trigger: quiet until hovered or open. */\nconst TRIGGER =\n 'focus-ring flex h-[2rem] cursor-pointer list-none items-center gap-3xs rounded-md border border-transparent px-2xs text-step-sm font-medium text-content select-none transition-[background-color,border-color] duration-(--duration-fast,150ms) hover:border-border hover:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)] [&::-webkit-details-marker]:hidden [[open]>&]:border-border [[open]>&]:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)]';\n\n/**\n * A dropdown in a navigation bar: a native `<details>` disclosure, so it opens\n * and its links work with scripting off. What a dropdown is expected to do on\n * top — one open at a time, closed by a click elsewhere or Escape — is the\n * page's to add.\n *\n * No hooks, so a client component can render it too. Its parts carry\n * `data-slot` (`nav-menu`, `nav-menu-trigger`, `nav-menu-chevron`,\n * `nav-menu-panel`), so a page can restyle them — a panel as wide as the bar\n * on a phone, say — without knowing the classes underneath.\n */\nexport function NavMenu({\n label,\n icon,\n summary,\n chevron = true,\n className,\n triggerClassName = TRIGGER,\n children,\n}: {\n /** The accessible name of the trigger. */\n label: string;\n icon: ReactNode;\n /** What the trigger shows beside the icon, if anything. */\n summary?: ReactNode;\n /** A chevron after the trigger's content: a menu of choices has one. */\n chevron?: boolean;\n className?: string;\n /** Replaces the trigger's look: a split button draws it as its own segment. */\n triggerClassName?: string;\n children: ReactNode;\n}) {\n return (\n <details data-slot=\"nav-menu\" className={cn('relative', className)}>\n <summary\n aria-label={label}\n title={label}\n data-slot=\"nav-menu-trigger\"\n className={triggerClassName}\n >\n {icon}\n {summary}\n {chevron && (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n data-slot=\"nav-menu-chevron\"\n className=\"size-[0.875rem] flex-none fill-none stroke-current stroke-2 text-content-muted transition-[rotate] duration-(--duration-fast,150ms) [stroke-linecap:round] [stroke-linejoin:round] [[open]>summary>&]:rotate-180\"\n >\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n )}\n </summary>\n <div\n data-slot=\"nav-menu-panel\"\n className=\"right-0 ease-out starting:-translate-y-1 [&_ul]:m-0 [&_ul]:p-0 absolute top-[calc(100%+var(--spacing-3xs))] z-60 min-w-[10rem] rounded-lg border border-border bg-surface-elevated p-3xs shadow-[var(--shadow-overlay)] transition-[opacity,translate] duration-[120ms] motion-reduce:transition-none starting:opacity-0 [&_ul]:list-none\"\n >\n {children}\n </div>\n </details>\n );\n}\n\n/** A check beside the chosen entry; an equal space beside the others. */\nexport function NavMenuCheck({ checked }: { checked: boolean }) {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n data-slot=\"nav-menu-check\"\n className=\"size-[1rem] flex-none fill-none stroke-current stroke-2 [stroke-linecap:round] [stroke-linejoin:round]\"\n >\n {checked && <path d=\"m5 12.5 4.5 4.5L19 7.5\" />}\n </svg>\n );\n}\n"],"names":["cn","TRIGGER","NavMenu","label","icon","summary","chevron","className","triggerClassName","children","details","data-slot","aria-label","title","svg","aria-hidden","viewBox","path","d","div","NavMenuCheck","checked"],"mappings":";AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAEvC,kDAAkD,GAClD,MAAMC,UACJ;AAEF;;;;;;;;;;CAUC,GACD,OAAO,SAASC,QAAQ,EACtBC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,IAAI,EACdC,SAAS,EACTC,mBAAmBP,OAAO,EAC1BQ,QAAQ,EAaT;IACC,qBACE,MAACC;QAAQC,aAAU;QAAWJ,WAAWP,GAAG,YAAYO;;0BACtD,MAACF;gBACCO,cAAYT;gBACZU,OAAOV;gBACPQ,aAAU;gBACVJ,WAAWC;;oBAEVJ;oBACAC;oBACAC,yBACC,KAACQ;wBACCC,eAAY;wBACZC,SAAQ;wBACRL,aAAU;wBACVJ,WAAU;kCAEV,cAAA,KAACU;4BAAKC,GAAE;;;;;0BAId,KAACC;gBACCR,aAAU;gBACVJ,WAAU;0BAETE;;;;AAIT;AAEA,uEAAuE,GACvE,OAAO,SAASW,aAAa,EAAEC,OAAO,EAAwB;IAC5D,qBACE,KAACP;QACCC,eAAY;QACZC,SAAQ;QACRL,aAAU;QACVJ,WAAU;kBAETc,yBAAW,KAACJ;YAAKC,GAAE;;;AAG1B"}
@@ -0,0 +1,2 @@
1
+ export * from './segmented-control.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/segmented-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './segmented-control.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/segmented-control/index.ts"],"sourcesContent":["export * from './segmented-control.js';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A choice within the page, drawn as `SegmentedNav` draws a choice between
3
+ * pages: one bordered track, the chosen segment filled.
4
+ *
5
+ * A radio group: one segment in the tab order, the arrow keys, Home and End
6
+ * moving the choice and the focus with it. It holds no state; the page keeps
7
+ * the value. Parts carry `data-slot` (`segmented-control`,
8
+ * `segmented-control-option`).
9
+ */
10
+ export declare function SegmentedControl<Key extends string>({ label, options, value, onChange, className, }: {
11
+ /** The group's accessible name. */
12
+ label: string;
13
+ options: readonly {
14
+ readonly key: Key;
15
+ readonly label: string;
16
+ }[];
17
+ value: Key;
18
+ onChange: (key: Key) => void;
19
+ className?: string;
20
+ }): import("react").JSX.Element;
21
+ //# sourceMappingURL=segmented-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/segmented-control/segmented-control.tsx"],"names":[],"mappings":"AAsBA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,SAAS,MAAM,EAAE,EACnD,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClE,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA+CA"}
@@ -0,0 +1,55 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from '../../utils/cn.js';
4
+ import { CURRENT, LIST, OTHER } from '../segmented-nav/segment-classes.js';
5
+ /** A segment as a button: the shared look, without a link's defaults. */ const BUTTON = 'cursor-pointer border-0 font-[inherit]';
6
+ /** The keys that move the choice, and where each moves it. */ const MOVES = {
7
+ ArrowRight: (index, count)=>(index + 1) % count,
8
+ ArrowDown: (index, count)=>(index + 1) % count,
9
+ ArrowLeft: (index, count)=>(index - 1 + count) % count,
10
+ ArrowUp: (index, count)=>(index - 1 + count) % count,
11
+ Home: ()=>0,
12
+ End: (_, count)=>count - 1
13
+ };
14
+ /**
15
+ * A choice within the page, drawn as `SegmentedNav` draws a choice between
16
+ * pages: one bordered track, the chosen segment filled.
17
+ *
18
+ * A radio group: one segment in the tab order, the arrow keys, Home and End
19
+ * moving the choice and the focus with it. It holds no state; the page keeps
20
+ * the value. Parts carry `data-slot` (`segmented-control`,
21
+ * `segmented-control-option`).
22
+ */ export function SegmentedControl({ label, options, value, onChange, className }) {
23
+ const chosen = Math.max(0, options.findIndex((option)=>option.key === value));
24
+ const move = (event)=>{
25
+ var _event_currentTarget_querySelectorAll_next;
26
+ const to = MOVES[event.key];
27
+ if (to === undefined) return;
28
+ event.preventDefault();
29
+ const next = to(chosen, options.length);
30
+ (_event_currentTarget_querySelectorAll_next = event.currentTarget.querySelectorAll('[role="radio"]')[next]) == null ? void 0 : _event_currentTarget_querySelectorAll_next.focus();
31
+ onChange(options[next].key);
32
+ };
33
+ return /*#__PURE__*/ _jsx("div", {
34
+ role: "radiogroup",
35
+ "aria-label": label,
36
+ "data-slot": "segmented-control",
37
+ onKeyDown: move,
38
+ className: cn(LIST, className),
39
+ children: options.map((option, index)=>{
40
+ const checked = index === chosen;
41
+ return /*#__PURE__*/ _jsx("button", {
42
+ type: "button",
43
+ role: "radio",
44
+ "aria-checked": checked,
45
+ tabIndex: checked ? 0 : -1,
46
+ "data-slot": "segmented-control-option",
47
+ className: cn(checked ? `${CURRENT} focus-ring` : `${OTHER} bg-transparent`, BUTTON),
48
+ onClick: ()=>onChange(option.key),
49
+ children: option.label
50
+ }, option.key);
51
+ })
52
+ });
53
+ }
54
+
55
+ //# sourceMappingURL=segmented-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/segmented-control/segmented-control.tsx"],"sourcesContent":["'use client';\n\nimport type { KeyboardEvent } from 'react';\n\nimport { cn } from '../../utils/cn.js';\nimport { CURRENT, LIST, OTHER } from '../segmented-nav/segment-classes.js';\n\n/** A segment as a button: the shared look, without a link's defaults. */\nconst BUTTON = 'cursor-pointer border-0 font-[inherit]';\n\n/** The keys that move the choice, and where each moves it. */\nconst MOVES: Readonly<\n Record<string, (index: number, count: number) => number>\n> = {\n ArrowRight: (index, count) => (index + 1) % count,\n ArrowDown: (index, count) => (index + 1) % count,\n ArrowLeft: (index, count) => (index - 1 + count) % count,\n ArrowUp: (index, count) => (index - 1 + count) % count,\n Home: () => 0,\n End: (_, count) => count - 1,\n};\n\n/**\n * A choice within the page, drawn as `SegmentedNav` draws a choice between\n * pages: one bordered track, the chosen segment filled.\n *\n * A radio group: one segment in the tab order, the arrow keys, Home and End\n * moving the choice and the focus with it. It holds no state; the page keeps\n * the value. Parts carry `data-slot` (`segmented-control`,\n * `segmented-control-option`).\n */\nexport function SegmentedControl<Key extends string>({\n label,\n options,\n value,\n onChange,\n className,\n}: {\n /** The group's accessible name. */\n label: string;\n options: readonly { readonly key: Key; readonly label: string }[];\n value: Key;\n onChange: (key: Key) => void;\n className?: string;\n}) {\n const chosen = Math.max(\n 0,\n options.findIndex(option => option.key === value),\n );\n\n const move = (event: KeyboardEvent<HTMLDivElement>) => {\n const to = MOVES[event.key];\n if (to === undefined) return;\n event.preventDefault();\n const next = to(chosen, options.length);\n event.currentTarget\n .querySelectorAll<HTMLElement>('[role=\"radio\"]')\n [next]?.focus();\n onChange((options[next] as (typeof options)[number]).key);\n };\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n data-slot=\"segmented-control\"\n onKeyDown={move}\n className={cn(LIST, className)}\n >\n {options.map((option, index) => {\n const checked = index === chosen;\n return (\n <button\n key={option.key}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n tabIndex={checked ? 0 : -1}\n data-slot=\"segmented-control-option\"\n className={cn(\n checked ? `${CURRENT} focus-ring` : `${OTHER} bg-transparent`,\n BUTTON,\n )}\n onClick={() => onChange(option.key)}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"names":["cn","CURRENT","LIST","OTHER","BUTTON","MOVES","ArrowRight","index","count","ArrowDown","ArrowLeft","ArrowUp","Home","End","_","SegmentedControl","label","options","value","onChange","className","chosen","Math","max","findIndex","option","key","move","event","to","undefined","preventDefault","next","length","currentTarget","querySelectorAll","focus","div","role","aria-label","data-slot","onKeyDown","map","checked","button","type","aria-checked","tabIndex","onClick"],"mappings":"AAAA;;AAIA,SAASA,EAAE,QAAQ,oBAAoB;AACvC,SAASC,OAAO,EAAEC,IAAI,EAAEC,KAAK,QAAQ,sCAAsC;AAE3E,uEAAuE,GACvE,MAAMC,SAAS;AAEf,4DAA4D,GAC5D,MAAMC,QAEF;IACFC,YAAY,CAACC,OAAOC,QAAU,AAACD,CAAAA,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C,EAC7DC;gBAEF4C,SAAS,IAAM7B,SAASM,OAAOC,GAAG;0BAEjCD,OAAOT,KAAK;eAZRS,OAAOC,GAAG;QAerB;;AAGN"}
@@ -0,0 +1,2 @@
1
+ export * from './segmented-nav.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/segmented-nav/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './segmented-nav.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/segmented-nav/index.ts"],"sourcesContent":["export * from './segmented-nav.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The segmented look, shared by `SegmentedNav` (links) and `SegmentedControl`
3
+ * (a choice in the page): one bordered track, the chosen segment filled.
4
+ */
5
+ /** The joined segments; scrolls sideways rather than wrapping. */
6
+ export declare const LIST = "m-0 flex w-max max-w-full list-none overflow-x-auto rounded-md border border-border p-[0.1875rem] [scrollbar-width:none]";
7
+ export declare const OTHER = "block rounded-[calc(var(--radius-md,0.375rem)-0.125rem)] px-xs py-[0.3125rem] text-step-sm whitespace-nowrap no-underline transition-colors duration-(--duration-fast,150ms) motion-reduce:transition-none focus-ring text-content hover:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)] hover:text-primary";
8
+ export declare const CURRENT = "block rounded-[calc(var(--radius-md,0.375rem)-0.125rem)] px-xs py-[0.3125rem] text-step-sm whitespace-nowrap no-underline transition-colors duration-(--duration-fast,150ms) motion-reduce:transition-none bg-primary font-medium text-primary-content";
9
+ //# sourceMappingURL=segment-classes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-classes.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/segmented-nav/segment-classes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,kEAAkE;AAClE,eAAO,MAAM,IAAI,6HAC2G,CAAC;AAK7H,eAAO,MAAM,KAAK,4TAA4H,CAAC;AAE/I,eAAO,MAAM,OAAO,2PAA2D,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The segmented look, shared by `SegmentedNav` (links) and `SegmentedControl`
3
+ * (a choice in the page): one bordered track, the chosen segment filled.
4
+ */ /** The joined segments; scrolls sideways rather than wrapping. */ export const LIST = 'm-0 flex w-max max-w-full list-none overflow-x-auto rounded-md border border-border p-[0.1875rem] [scrollbar-width:none]';
5
+ const SEGMENT = 'block rounded-[calc(var(--radius-md,0.375rem)-0.125rem)] px-xs py-[0.3125rem] text-step-sm whitespace-nowrap no-underline transition-colors duration-(--duration-fast,150ms) motion-reduce:transition-none';
6
+ export const OTHER = `${SEGMENT} focus-ring text-content hover:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)] hover:text-primary`;
7
+ export const CURRENT = `${SEGMENT} bg-primary font-medium text-primary-content`;
8
+
9
+ //# sourceMappingURL=segment-classes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/segmented-nav/segment-classes.ts"],"sourcesContent":["/**\n * The segmented look, shared by `SegmentedNav` (links) and `SegmentedControl`\n * (a choice in the page): one bordered track, the chosen segment filled.\n */\n/** The joined segments; scrolls sideways rather than wrapping. */\nexport const LIST =\n 'm-0 flex w-max max-w-full list-none overflow-x-auto rounded-md border border-border p-[0.1875rem] [scrollbar-width:none]';\n\nconst SEGMENT =\n 'block rounded-[calc(var(--radius-md,0.375rem)-0.125rem)] px-xs py-[0.3125rem] text-step-sm whitespace-nowrap no-underline transition-colors duration-(--duration-fast,150ms) motion-reduce:transition-none';\n\nexport const OTHER = `${SEGMENT} focus-ring text-content hover:bg-[color-mix(in_srgb,var(--color-content)_6%,transparent)] hover:text-primary`;\n\nexport const CURRENT = `${SEGMENT} bg-primary font-medium text-primary-content`;\n"],"names":["LIST","SEGMENT","OTHER","CURRENT"],"mappings":"AAAA;;;CAGC,GACD,gEAAgE,GAChE,OAAO,MAAMA,OACX,2HAA2H;AAE7H,MAAMC,UACJ;AAEF,OAAO,MAAMC,QAAQ,GAAGD,QAAQ,6GAA6G,CAAC,CAAC;AAE/I,OAAO,MAAME,UAAU,GAAGF,QAAQ,4CAA4C,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ /** One segment: a page of its own, the current one marked. */
3
+ export interface SegmentedNavItem {
4
+ readonly key: string;
5
+ readonly label: ReactNode;
6
+ readonly href: string;
7
+ readonly current: boolean;
8
+ }
9
+ /** What renders a segment that leads elsewhere: an `<a>`, or a router's link. */
10
+ export type SegmentedNavLink = ComponentType<{
11
+ href: string;
12
+ className?: string;
13
+ children: ReactNode;
14
+ }>;
15
+ /**
16
+ * A choice between pages, drawn as one segmented control: each segment is a
17
+ * link, the current page's is a marked span. A visible label names the
18
+ * choice; the `<nav>` carries it for assistive technology.
19
+ *
20
+ * No hooks, so a server component renders it, and every segment works with
21
+ * scripting off. Its parts carry `data-slot` (`segmented-nav`,
22
+ * `segmented-nav-label`, `segmented-nav-list`, `segmented-nav-item`).
23
+ */
24
+ export declare function SegmentedNav({ label, items, link: Link, className, }: {
25
+ label: string;
26
+ items: readonly SegmentedNavItem[];
27
+ link?: SegmentedNavLink;
28
+ className?: string;
29
+ }): import("react").JSX.Element;
30
+ //# sourceMappingURL=segmented-nav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-nav.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/segmented-nav/segmented-nav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC,CAAC;AAIH;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,IAAI,EAAE,IAAa,EACnB,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA+BA"}
@@ -0,0 +1,46 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CURRENT, LIST, OTHER } from './segment-classes.js';
4
+ const ANCHOR = (props)=>/*#__PURE__*/ _jsx("a", _extends({}, props));
5
+ /**
6
+ * A choice between pages, drawn as one segmented control: each segment is a
7
+ * link, the current page's is a marked span. A visible label names the
8
+ * choice; the `<nav>` carries it for assistive technology.
9
+ *
10
+ * No hooks, so a server component renders it, and every segment works with
11
+ * scripting off. Its parts carry `data-slot` (`segmented-nav`,
12
+ * `segmented-nav-label`, `segmented-nav-list`, `segmented-nav-item`).
13
+ */ export function SegmentedNav({ label, items, link: Link = ANCHOR, className }) {
14
+ return /*#__PURE__*/ _jsxs("nav", {
15
+ "data-slot": "segmented-nav",
16
+ "aria-label": label,
17
+ className: className,
18
+ children: [
19
+ /*#__PURE__*/ _jsx("span", {
20
+ "data-slot": "segmented-nav-label",
21
+ "aria-hidden": "true",
22
+ className: "text-step-sm text-content-muted",
23
+ children: label
24
+ }),
25
+ /*#__PURE__*/ _jsx("ul", {
26
+ "data-slot": "segmented-nav-list",
27
+ className: LIST,
28
+ children: items.map((item)=>/*#__PURE__*/ _jsx("li", {
29
+ "data-slot": "segmented-nav-item",
30
+ className: "flex-none",
31
+ children: item.current ? /*#__PURE__*/ _jsx("span", {
32
+ "aria-current": "page",
33
+ className: CURRENT,
34
+ children: item.label
35
+ }) : /*#__PURE__*/ _jsx(Link, {
36
+ href: item.href,
37
+ className: OTHER,
38
+ children: item.label
39
+ })
40
+ }, item.key))
41
+ })
42
+ ]
43
+ });
44
+ }
45
+
46
+ //# sourceMappingURL=segmented-nav.js.map