@krizaka/ui 3.27.0 → 3.28.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 (169) hide show
  1. package/README.md +1 -0
  2. package/dist/chip-link.js +4 -27
  3. package/dist/chip-link.js.map +1 -1
  4. package/dist/chip-row.d.ts +78 -0
  5. package/dist/chip-row.js +61 -0
  6. package/dist/chip-row.js.map +1 -0
  7. package/dist/chunk-BTTDIVVJ.js +33 -0
  8. package/dist/chunk-BTTDIVVJ.js.map +1 -0
  9. package/dist/native.d.ts +32 -1
  10. package/dist/native.js +344 -286
  11. package/dist/native.js.map +1 -1
  12. package/package.json +19 -5
  13. package/registry/account-menu.json +1 -1
  14. package/registry/achievement.json +1 -1
  15. package/registry/action-bar.json +1 -1
  16. package/registry/activity-feed.json +1 -1
  17. package/registry/alert.json +1 -1
  18. package/registry/app-header.json +1 -1
  19. package/registry/app-shell.json +1 -1
  20. package/registry/argument-card.json +1 -1
  21. package/registry/audio-player.json +1 -1
  22. package/registry/auth-layout.json +1 -1
  23. package/registry/avatar.json +1 -1
  24. package/registry/badge.json +1 -1
  25. package/registry/button.json +1 -1
  26. package/registry/captcha.json +1 -1
  27. package/registry/card-grid.json +1 -1
  28. package/registry/card.json +1 -1
  29. package/registry/catalogue-page.json +1 -1
  30. package/registry/changelog-page.json +1 -1
  31. package/registry/chat.json +1 -1
  32. package/registry/checkbox.json +1 -1
  33. package/registry/chip-link.json +1 -1
  34. package/registry/chip-row.json +173 -0
  35. package/registry/chip.json +1 -1
  36. package/registry/choice-grid.json +1 -1
  37. package/registry/code-block.json +1 -1
  38. package/registry/combobox.json +1 -1
  39. package/registry/command.json +1 -1
  40. package/registry/comparison-table.json +1 -1
  41. package/registry/component-page.json +1 -1
  42. package/registry/confirm-button.json +1 -1
  43. package/registry/contact-page.json +1 -1
  44. package/registry/continue-prompt.json +1 -1
  45. package/registry/countdown.json +1 -1
  46. package/registry/cover-hero.json +1 -1
  47. package/registry/cta-panel.json +1 -1
  48. package/registry/dashboard-layout.json +1 -1
  49. package/registry/data-table.json +1 -1
  50. package/registry/date-picker.json +1 -1
  51. package/registry/decision-list.json +1 -1
  52. package/registry/description-list.json +1 -1
  53. package/registry/detail-layout.json +1 -1
  54. package/registry/dialog.json +1 -1
  55. package/registry/docs-article-page.json +1 -1
  56. package/registry/docs-hub-page.json +1 -1
  57. package/registry/docs-layout.json +1 -1
  58. package/registry/docs-nav.json +1 -1
  59. package/registry/document-viewer.json +1 -1
  60. package/registry/dropdown-menu.json +1 -1
  61. package/registry/empty-state.json +1 -1
  62. package/registry/error-page.json +1 -1
  63. package/registry/examples/chip-row/audience.d.ts +4 -0
  64. package/registry/examples/chip-row/audience.js +15 -0
  65. package/registry/examples/chip-row/audience.tsx +16 -0
  66. package/registry/examples/chip-row/many.d.ts +4 -0
  67. package/registry/examples/chip-row/many.js +12 -0
  68. package/registry/examples/chip-row/many.tsx +16 -0
  69. package/registry/examples/settings-layout/native/account.d.ts +4 -0
  70. package/registry/examples/settings-layout/native/account.dark.png +0 -0
  71. package/registry/examples/settings-layout/native/account.js +22 -0
  72. package/registry/examples/settings-layout/native/account.light.png +0 -0
  73. package/registry/examples/settings-layout/native/account.tsx +18 -0
  74. package/registry/field.json +1 -1
  75. package/registry/file-upload.json +1 -1
  76. package/registry/filter-bar.json +1 -1
  77. package/registry/force-update-screen.json +1 -1
  78. package/registry/form.json +1 -1
  79. package/registry/gallery-page.json +1 -1
  80. package/registry/genui.json +1 -1
  81. package/registry/glow-card.json +1 -1
  82. package/registry/goal-gauge.json +1 -1
  83. package/registry/how-it-works-page.json +1 -1
  84. package/registry/image-cropper.json +1 -1
  85. package/registry/index.json +42 -10
  86. package/registry/iso.json +1 -1
  87. package/registry/kanban.json +1 -1
  88. package/registry/kbd.json +1 -1
  89. package/registry/landing-page.json +1 -1
  90. package/registry/landscape.json +1 -1
  91. package/registry/language-switch.json +1 -1
  92. package/registry/legal-page.json +1 -1
  93. package/registry/link-card.json +1 -1
  94. package/registry/list.json +1 -1
  95. package/registry/loader.json +1 -1
  96. package/registry/longform-page.json +1 -1
  97. package/registry/maintenance-screen.json +1 -1
  98. package/registry/map.json +2 -2
  99. package/registry/markdown.json +1 -1
  100. package/registry/marketing-layout.json +1 -1
  101. package/registry/marquee.json +1 -1
  102. package/registry/mascot-quote.json +1 -1
  103. package/registry/mascot-state.json +1 -1
  104. package/registry/mascots.json +1 -1
  105. package/registry/match-dialog.json +1 -1
  106. package/registry/media-capture.json +1 -1
  107. package/registry/media-gallery.json +1 -1
  108. package/registry/media-grid.json +1 -1
  109. package/registry/meta-row.json +1 -1
  110. package/registry/meter.json +1 -1
  111. package/registry/nav-bar.json +2 -2
  112. package/registry/number-ticker.json +1 -1
  113. package/registry/opening-hours.json +1 -1
  114. package/registry/page-header.json +1 -1
  115. package/registry/page-hero.json +1 -1
  116. package/registry/page.json +1 -1
  117. package/registry/pagination.json +1 -1
  118. package/registry/photo-grid.json +1 -1
  119. package/registry/pointer-light.json +1 -1
  120. package/registry/popover.json +1 -1
  121. package/registry/pricing-page.json +1 -1
  122. package/registry/product-page.json +1 -1
  123. package/registry/profile-card.json +1 -1
  124. package/registry/progress.json +1 -1
  125. package/registry/promise-card.json +1 -1
  126. package/registry/radio-group.json +1 -1
  127. package/registry/rail-nav.json +2 -2
  128. package/registry/recipes.json +1 -1
  129. package/registry/scroll-stage.json +1 -1
  130. package/registry/search-field.json +1 -1
  131. package/registry/section-backdrop.json +1 -1
  132. package/registry/separator.json +1 -1
  133. package/registry/service-card.json +1 -1
  134. package/registry/settings-layout.json +110 -7
  135. package/registry/showcase.json +1 -1
  136. package/registry/site-footer.json +2 -2
  137. package/registry/sites.json +1 -1
  138. package/registry/skeleton.json +1 -1
  139. package/registry/skip-link.json +1 -1
  140. package/registry/slider.json +1 -1
  141. package/registry/slot-picker.json +1 -1
  142. package/registry/slot.json +1 -1
  143. package/registry/spinner.json +1 -1
  144. package/registry/split-view.json +1 -1
  145. package/registry/stage-banner.json +1 -1
  146. package/registry/stat.json +1 -1
  147. package/registry/status-page.json +1 -1
  148. package/registry/step-progress.json +1 -1
  149. package/registry/step-showcase.json +1 -1
  150. package/registry/stepper.json +1 -1
  151. package/registry/sticky-action.json +1 -1
  152. package/registry/swipe-deck.json +1 -1
  153. package/registry/switch.json +1 -1
  154. package/registry/tabs.json +1 -1
  155. package/registry/tag-input.json +1 -1
  156. package/registry/tag-selector.json +1 -1
  157. package/registry/terminal-replay.json +1 -1
  158. package/registry/theme.json +1 -1
  159. package/registry/toast.json +1 -1
  160. package/registry/toc.json +1 -1
  161. package/registry/tooltip.json +1 -1
  162. package/registry/tree-view.json +1 -1
  163. package/registry/update-prompt.json +1 -1
  164. package/registry/verified-badge.json +1 -1
  165. package/registry/vertical-video.json +1 -1
  166. package/registry/video-player.json +1 -1
  167. package/registry/video-trimmer.json +1 -1
  168. package/registry/virtual.json +1 -1
  169. package/registry/waveform.json +1 -1
package/README.md CHANGED
@@ -153,6 +153,7 @@ light or a product's — is a set of tokens.
153
153
  | `@krizaka/ui/site-footer` | `SiteFooter` (`current`, `labels`, `version`, `env`, `legal`; own columns as children) `.Column` (`title`) `.Link` (`active`, `asChild`): the footer of every Krizaka site — the family in columns, “A Krizaka company / product / open-source project”, the version, Montréal | client |
154
154
  | `@krizaka/ui/chip` | `Chip` (`selected`/`defaultSelected` + `onSelectedChange`, `size` sm·md; `removable` + `removeLabel` + `onRemove`), `Chip.Group` (`type` single·multiple, `label`, `required` for single), `chip` (the slots) | client |
155
155
  | `@krizaka/ui/chip-link` | `ChipLink` (a filter that is a link: `selected`, `current`, `size`, `asChild`), `chipVariants` (`size`, `selected`) | server |
156
+ | `@krizaka/ui/chip-row` | `ChipRow`, `ChipRow.Item` (a scroll-snap row of chip links, wraps from `md`: `selected`, `badge`, `asChild`) | client (arrow keys) |
156
157
  | `@krizaka/ui/meta-row` | `MetaRow` (`items`, `chips`, `size` sm·md): one quiet line of dot-separated facts with status chips at its end; a real list, dots hidden from assistive technology; `/native` has the same | server |
157
158
  | `@krizaka/ui/switch` | `Switch` (`checked`/`defaultChecked` + `onCheckedChange`, `label` unless a visible label names it, `size` sm·md, `invalid`), `switchVariants` | client |
158
159
  | `@krizaka/ui/slider` | `Slider` (`value`: a number or a `[min, max]` range, `onValueChange`, `onValueCommit`, `label`, `thumbLabels`, `formatValue` → aria-valuetext, `showLabel`, `origin`), `slider` (the slots) | client |
package/dist/chip-link.js CHANGED
@@ -1,30 +1,7 @@
1
- // src/chip-link/chip-link.tsx
2
- import { Slot } from "radix-ui";
3
- import { tv } from "tailwind-variants";
4
- import { jsx } from "react/jsx-runtime";
5
- var chipVariants = tv({
6
- base: "inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-full border font-semibold no-underline transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
7
- variants: {
8
- size: { sm: "h-7 px-3 text-xs", md: "h-9 px-3.5 text-xs" },
9
- selected: {
10
- false: "border-border-default bg-surface-1 text-fg-secondary hover:border-border-strong hover:text-fg",
11
- true: "border-accent bg-accent-soft text-fg"
12
- }
13
- },
14
- defaultVariants: { size: "md", selected: false }
15
- });
16
- function ChipLink({ size, selected = false, current = "page", asChild, className, ...props }) {
17
- const Comp = asChild ? Slot.Root : "a";
18
- return /* @__PURE__ */ jsx(
19
- Comp,
20
- {
21
- "data-state": selected ? "on" : "off",
22
- "aria-current": selected ? current : void 0,
23
- className: chipVariants({ size, selected, className }),
24
- ...props
25
- }
26
- );
27
- }
1
+ import {
2
+ ChipLink,
3
+ chipVariants
4
+ } from "./chunk-BTTDIVVJ.js";
28
5
  export {
29
6
  ChipLink,
30
7
  chipVariants
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chip-link/chip-link.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A chip that is a link — a filter that is an address (`/explore?tag=night`): the look\n// of `Chip`, the current filter marked by `selected` (`aria-current`, the accent), usable in a Server Component.\n// `chipVariants` styles anything else (a router link you render yourself).\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const chipVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-full border font-semibold no-underline transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n variants: {\n size: { sm: \"h-7 px-3 text-xs\", md: \"h-9 px-3.5 text-xs\" },\n selected: {\n false: \"border-border-default bg-surface-1 text-fg-secondary hover:border-border-strong hover:text-fg\",\n true: \"border-accent bg-accent-soft text-fg\",\n },\n },\n defaultVariants: { size: \"md\", selected: false },\n});\n\nexport type ChipVariantsProps = VariantProps<typeof chipVariants>;\n\nexport type ChipLinkProps = React.ComponentProps<\"a\"> & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: ChipVariantsProps[\"size\"];\n /** The current filter: the accent, `aria-current` (`page` by default) and `data-state=\"on\"`. */\n selected?: boolean;\n /**\n * What `aria-current` says when selected: `page` (a filter that is a page) or `true`.\n * @default \"page\"\n */\n current?: \"page\" | \"true\";\n /** Renders your router's `<Link>` with the chip's look. */\n asChild?: boolean;\n};\n\n/** A filter that is a link, with the look of `Chip`. */\nexport function ChipLink({ size, selected = false, current = \"page\", asChild, className, ...props }: ChipLinkProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-state={selected ? \"on\" : \"off\"}\n aria-current={selected ? current : undefined}\n className={chipVariants({ size, selected, className })}\n {...props}\n />\n );\n}\n"],"mappings":";AAGA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAuClC;AArCG,IAAM,eAAe,GAAG;AAAA,EAC7B,MACE;AAAA,EAEF,UAAU;AAAA,IACR,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB;AAAA,IACzD,UAAU;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,MAAM,UAAU,MAAM;AACjD,CAAC;AAsBM,SAAS,SAAS,EAAE,MAAM,WAAW,OAAO,UAAU,QAAQ,SAAS,WAAW,GAAG,MAAM,GAAkB;AAClH,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,WAAW,OAAO;AAAA,MAC9B,gBAAc,WAAW,UAAU;AAAA,MACnC,WAAW,aAAa,EAAE,MAAM,UAAU,UAAU,CAAC;AAAA,MACpD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,78 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as React from 'react';
3
+
4
+ declare const chipRow: tailwind_variants.TVReturnType<{
5
+ [key: string]: {
6
+ [key: string]: tailwind_variants.ClassValue | {
7
+ list?: tailwind_variants.ClassValue;
8
+ hint?: tailwind_variants.ClassValue;
9
+ root?: tailwind_variants.ClassValue;
10
+ item?: tailwind_variants.ClassValue;
11
+ badge?: tailwind_variants.ClassValue;
12
+ };
13
+ };
14
+ } | {
15
+ [x: string]: {
16
+ [x: string]: tailwind_variants.ClassValue | {
17
+ list?: tailwind_variants.ClassValue;
18
+ hint?: tailwind_variants.ClassValue;
19
+ root?: tailwind_variants.ClassValue;
20
+ item?: tailwind_variants.ClassValue;
21
+ badge?: tailwind_variants.ClassValue;
22
+ };
23
+ };
24
+ } | {}, {
25
+ root: string;
26
+ hint: string;
27
+ list: string;
28
+ item: string;
29
+ badge: string;
30
+ }, undefined, {
31
+ [key: string]: {
32
+ [key: string]: tailwind_variants.ClassValue | {
33
+ list?: tailwind_variants.ClassValue;
34
+ hint?: tailwind_variants.ClassValue;
35
+ root?: tailwind_variants.ClassValue;
36
+ item?: tailwind_variants.ClassValue;
37
+ badge?: tailwind_variants.ClassValue;
38
+ };
39
+ };
40
+ } | {}, {
41
+ root: string;
42
+ hint: string;
43
+ list: string;
44
+ item: string;
45
+ badge: string;
46
+ }, tailwind_variants.TVReturnTypeLike<unknown, {
47
+ root: string;
48
+ hint: string;
49
+ list: string;
50
+ item: string;
51
+ badge: string;
52
+ }>>;
53
+ type ChipRowProps = Omit<React.ComponentProps<"nav">, "aria-label"> & {
54
+ /** What the links choose among ("For whom?"): the row's accessible name, passed translated. */
55
+ label: string;
56
+ /** A line under the label that says how to choose; read with the row. */
57
+ hint?: React.ReactNode;
58
+ };
59
+ /** A scroll-snap row of chip links; wraps from `md`. Items: `ChipRow.Item`. */
60
+ declare function ChipRowRoot({ label, hint, className, children, ...props }: ChipRowProps): React.JSX.Element;
61
+ type ChipRowItemProps = React.ComponentProps<"a"> & {
62
+ /** The current choice: the accent and `aria-current`. */
63
+ selected?: boolean;
64
+ /** What `aria-current` says when selected.
65
+ * @default "page" */
66
+ current?: "page" | "true";
67
+ /** A small tag after the label ("Soon"), passed translated. */
68
+ badge?: React.ReactNode;
69
+ /** Renders your router's `<Link>` as the chip; put the label and the badge in your link's children yourself. */
70
+ asChild?: boolean;
71
+ };
72
+ /** One link of the row. */
73
+ declare function ChipRowItem({ selected, current, badge, asChild, className, children, ...props }: ChipRowItemProps): React.JSX.Element;
74
+ declare const ChipRow: typeof ChipRowRoot & {
75
+ Item: typeof ChipRowItem;
76
+ };
77
+
78
+ export { ChipRow, type ChipRowItemProps, type ChipRowProps, chipRow };
@@ -0,0 +1,61 @@
1
+ import {
2
+ chipVariants
3
+ } from "./chunk-BTTDIVVJ.js";
4
+
5
+ // src/chip-row/chip-row.tsx
6
+ import { Slot } from "radix-ui";
7
+ import * as React from "react";
8
+ import { tv } from "tailwind-variants";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ var chipRow = tv({
11
+ slots: {
12
+ root: "flex w-full flex-col gap-2",
13
+ hint: "text-xs text-fg-muted",
14
+ list: "m-0 flex list-none snap-x snap-proximity gap-2 overflow-x-auto p-0 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)] md:flex-wrap md:overflow-visible md:pb-0 md:[mask-image:none]",
15
+ item: "snap-start",
16
+ badge: "rounded-full bg-surface-3 px-1.5 py-0.5 text-[0.625rem] font-semibold uppercase leading-none tracking-wide text-fg-muted"
17
+ }
18
+ });
19
+ var s = chipRow();
20
+ function ChipRowRoot({ label, hint, className, children, ...props }) {
21
+ const id = React.useId();
22
+ const list = React.useRef(null);
23
+ const move = (event) => {
24
+ const keys = ["ArrowLeft", "ArrowRight", "Home", "End"];
25
+ if (!keys.includes(event.key)) return;
26
+ const links = [...list.current?.querySelectorAll("a[href],button:not([disabled])") ?? []];
27
+ const at = links.indexOf(event.target);
28
+ if (at < 0) return;
29
+ const last = links.length - 1;
30
+ const to = event.key === "Home" ? 0 : event.key === "End" ? last : Math.min(last, Math.max(0, at + (event.key === "ArrowRight" ? 1 : -1)));
31
+ event.preventDefault();
32
+ links[to]?.focus();
33
+ links[to]?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
34
+ };
35
+ return /* @__PURE__ */ jsxs("nav", { "aria-label": label, "aria-describedby": hint ? `${id}-hint` : void 0, className: s.root({ className }), ...props, children: [
36
+ hint ? /* @__PURE__ */ jsx("p", { id: `${id}-hint`, className: s.hint(), children: hint }) : null,
37
+ /* @__PURE__ */ jsx("ul", { ref: list, className: s.list(), onKeyDown: move, children })
38
+ ] });
39
+ }
40
+ function ChipRowItem({ selected = false, current = "page", badge, asChild, className, children, ...props }) {
41
+ const Comp = asChild ? Slot.Root : "a";
42
+ return /* @__PURE__ */ jsx("li", { className: s.item(), children: /* @__PURE__ */ jsx(
43
+ Comp,
44
+ {
45
+ "data-state": selected ? "on" : "off",
46
+ "aria-current": selected ? current : void 0,
47
+ className: chipVariants({ selected, className: ["min-h-11", className] }),
48
+ ...props,
49
+ children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ children,
51
+ badge ? /* @__PURE__ */ jsx("span", { className: s.badge(), children: badge }) : null
52
+ ] })
53
+ }
54
+ ) });
55
+ }
56
+ var ChipRow = Object.assign(ChipRowRoot, { Item: ChipRowItem });
57
+ export {
58
+ ChipRow,
59
+ chipRow
60
+ };
61
+ //# sourceMappingURL=chip-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/chip-row/chip-row.tsx"],"sourcesContent":["// Client (arrow-key focus only). A row of chip links that scrolls sideways with scroll-snap on a phone (the trailing edge\n// fades, no scrollbar) and wraps from `md`: an audience picker, the filters of a page. Each item is a `ChipLink`-style\n// link at least 44 px high; the current one carries `aria-current`. Tab goes through the links; ← → Home End move between them.\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { chipVariants } from \"../chip-link\";\n\nexport const chipRow = tv({\n slots: {\n root: \"flex w-full flex-col gap-2\",\n hint: \"text-xs text-fg-muted\",\n list:\n \"m-0 flex list-none snap-x snap-proximity gap-2 overflow-x-auto p-0 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_right,#000_calc(100%-2rem),transparent)] md:flex-wrap md:overflow-visible md:pb-0 md:[mask-image:none]\",\n item: \"snap-start\",\n badge: \"rounded-full bg-surface-3 px-1.5 py-0.5 text-[0.625rem] font-semibold uppercase leading-none tracking-wide text-fg-muted\",\n },\n});\n\nconst s = chipRow();\n\nexport type ChipRowProps = Omit<React.ComponentProps<\"nav\">, \"aria-label\"> & {\n /** What the links choose among (\"For whom?\"): the row's accessible name, passed translated. */\n label: string;\n /** A line under the label that says how to choose; read with the row. */\n hint?: React.ReactNode;\n};\n\n/** A scroll-snap row of chip links; wraps from `md`. Items: `ChipRow.Item`. */\nfunction ChipRowRoot({ label, hint, className, children, ...props }: ChipRowProps) {\n const id = React.useId();\n const list = React.useRef<HTMLUListElement>(null);\n const move = (event: React.KeyboardEvent<HTMLUListElement>) => {\n const keys = [\"ArrowLeft\", \"ArrowRight\", \"Home\", \"End\"];\n if (!keys.includes(event.key)) return;\n const links = [...(list.current?.querySelectorAll<HTMLElement>(\"a[href],button:not([disabled])\") ?? [])];\n const at = links.indexOf(event.target as HTMLElement);\n if (at < 0) return;\n const last = links.length - 1;\n const to = event.key === \"Home\" ? 0 : event.key === \"End\" ? last : Math.min(last, Math.max(0, at + (event.key === \"ArrowRight\" ? 1 : -1)));\n event.preventDefault();\n links[to]?.focus();\n links[to]?.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\" });\n };\n return (\n <nav aria-label={label} aria-describedby={hint ? `${id}-hint` : undefined} className={s.root({ className })} {...props}>\n {hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null}\n <ul ref={list} className={s.list()} onKeyDown={move}>\n {children}\n </ul>\n </nav>\n );\n}\n\nexport type ChipRowItemProps = React.ComponentProps<\"a\"> & {\n /** The current choice: the accent and `aria-current`. */\n selected?: boolean;\n /** What `aria-current` says when selected.\n * @default \"page\" */\n current?: \"page\" | \"true\";\n /** A small tag after the label (\"Soon\"), passed translated. */\n badge?: React.ReactNode;\n /** Renders your router's `<Link>` as the chip; put the label and the badge in your link's children yourself. */\n asChild?: boolean;\n};\n\n/** One link of the row. */\nfunction ChipRowItem({ selected = false, current = \"page\", badge, asChild, className, children, ...props }: ChipRowItemProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <li className={s.item()}>\n <Comp\n data-state={selected ? \"on\" : \"off\"}\n aria-current={selected ? current : undefined}\n className={chipVariants({ selected, className: [\"min-h-11\", className] })}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {badge ? <span className={s.badge()}>{badge}</span> : null}\n </>\n )}\n </Comp>\n </li>\n );\n}\n\nexport const ChipRow = Object.assign(ChipRowRoot, { Item: ChipRowItem });\n"],"mappings":";;;;;AAGA,SAAS,YAAY;AACrB,YAAY,WAAW;AACvB,SAAS,UAAU;AA0Cf,SAuCM,UArCF,KAFJ;AAtCG,IAAM,UAAU,GAAG;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MACE;AAAA,IAEF,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;AAED,IAAM,IAAI,QAAQ;AAUlB,SAAS,YAAY,EAAE,OAAO,MAAM,WAAW,UAAU,GAAG,MAAM,GAAiB;AACjF,QAAM,KAAW,YAAM;AACvB,QAAM,OAAa,aAAyB,IAAI;AAChD,QAAM,OAAO,CAAC,UAAiD;AAC7D,UAAM,OAAO,CAAC,aAAa,cAAc,QAAQ,KAAK;AACtD,QAAI,CAAC,KAAK,SAAS,MAAM,GAAG,EAAG;AAC/B,UAAM,QAAQ,CAAC,GAAI,KAAK,SAAS,iBAA8B,gCAAgC,KAAK,CAAC,CAAE;AACvG,UAAM,KAAK,MAAM,QAAQ,MAAM,MAAqB;AACpD,QAAI,KAAK,EAAG;AACZ,UAAM,OAAO,MAAM,SAAS;AAC5B,UAAM,KAAK,MAAM,QAAQ,SAAS,IAAI,MAAM,QAAQ,QAAQ,OAAO,KAAK,IAAI,MAAM,KAAK,IAAI,GAAG,MAAM,MAAM,QAAQ,eAAe,IAAI,GAAG,CAAC;AACzI,UAAM,eAAe;AACrB,UAAM,EAAE,GAAG,MAAM;AACjB,UAAM,EAAE,GAAG,iBAAiB,EAAE,OAAO,WAAW,QAAQ,UAAU,CAAC;AAAA,EACrE;AACA,SACE,qBAAC,SAAI,cAAY,OAAO,oBAAkB,OAAO,GAAG,EAAE,UAAU,QAAW,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC9G;AAAA,WACC,oBAAC,OAAE,IAAI,GAAG,EAAE,SAAS,WAAW,EAAE,KAAK,GACpC,gBACH,IACE;AAAA,IACJ,oBAAC,QAAG,KAAK,MAAM,WAAW,EAAE,KAAK,GAAG,WAAW,MAC5C,UACH;AAAA,KACF;AAEJ;AAeA,SAAS,YAAY,EAAE,WAAW,OAAO,UAAU,QAAQ,OAAO,SAAS,WAAW,UAAU,GAAG,MAAM,GAAqB;AAC5H,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE,oBAAC,QAAG,WAAW,EAAE,KAAK,GACpB;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,WAAW,OAAO;AAAA,MAC9B,gBAAc,WAAW,UAAU;AAAA,MACnC,WAAW,aAAa,EAAE,UAAU,WAAW,CAAC,YAAY,SAAS,EAAE,CAAC;AAAA,MACvE,GAAG;AAAA,MAEH,oBACC,WAEA,iCACG;AAAA;AAAA,QACA,QAAQ,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM,IAAU;AAAA,SACxD;AAAA;AAAA,EAEJ,GACF;AAEJ;AAEO,IAAM,UAAU,OAAO,OAAO,aAAa,EAAE,MAAM,YAAY,CAAC;","names":[]}
@@ -0,0 +1,33 @@
1
+ // src/chip-link/chip-link.tsx
2
+ import { Slot } from "radix-ui";
3
+ import { tv } from "tailwind-variants";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var chipVariants = tv({
6
+ base: "inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-full border font-semibold no-underline transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
7
+ variants: {
8
+ size: { sm: "h-7 px-3 text-xs", md: "h-9 px-3.5 text-xs" },
9
+ selected: {
10
+ false: "border-border-default bg-surface-1 text-fg-secondary hover:border-border-strong hover:text-fg",
11
+ true: "border-accent bg-accent-soft text-fg"
12
+ }
13
+ },
14
+ defaultVariants: { size: "md", selected: false }
15
+ });
16
+ function ChipLink({ size, selected = false, current = "page", asChild, className, ...props }) {
17
+ const Comp = asChild ? Slot.Root : "a";
18
+ return /* @__PURE__ */ jsx(
19
+ Comp,
20
+ {
21
+ "data-state": selected ? "on" : "off",
22
+ "aria-current": selected ? current : void 0,
23
+ className: chipVariants({ size, selected, className }),
24
+ ...props
25
+ }
26
+ );
27
+ }
28
+
29
+ export {
30
+ chipVariants,
31
+ ChipLink
32
+ };
33
+ //# sourceMappingURL=chunk-BTTDIVVJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/chip-link/chip-link.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A chip that is a link — a filter that is an address (`/explore?tag=night`): the look\n// of `Chip`, the current filter marked by `selected` (`aria-current`, the accent), usable in a Server Component.\n// `chipVariants` styles anything else (a router link you render yourself).\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const chipVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-full border font-semibold no-underline transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n variants: {\n size: { sm: \"h-7 px-3 text-xs\", md: \"h-9 px-3.5 text-xs\" },\n selected: {\n false: \"border-border-default bg-surface-1 text-fg-secondary hover:border-border-strong hover:text-fg\",\n true: \"border-accent bg-accent-soft text-fg\",\n },\n },\n defaultVariants: { size: \"md\", selected: false },\n});\n\nexport type ChipVariantsProps = VariantProps<typeof chipVariants>;\n\nexport type ChipLinkProps = React.ComponentProps<\"a\"> & {\n /**\n * sm · md.\n * @default \"md\"\n */\n size?: ChipVariantsProps[\"size\"];\n /** The current filter: the accent, `aria-current` (`page` by default) and `data-state=\"on\"`. */\n selected?: boolean;\n /**\n * What `aria-current` says when selected: `page` (a filter that is a page) or `true`.\n * @default \"page\"\n */\n current?: \"page\" | \"true\";\n /** Renders your router's `<Link>` with the chip's look. */\n asChild?: boolean;\n};\n\n/** A filter that is a link, with the look of `Chip`. */\nexport function ChipLink({ size, selected = false, current = \"page\", asChild, className, ...props }: ChipLinkProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-state={selected ? \"on\" : \"off\"}\n aria-current={selected ? current : undefined}\n className={chipVariants({ size, selected, className })}\n {...props}\n />\n );\n}\n"],"mappings":";AAGA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAuClC;AArCG,IAAM,eAAe,GAAG;AAAA,EAC7B,MACE;AAAA,EAEF,UAAU;AAAA,IACR,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB;AAAA,IACzD,UAAU;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,MAAM,UAAU,MAAM;AACjD,CAAC;AAsBM,SAAS,SAAS,EAAE,MAAM,WAAW,OAAO,UAAU,QAAQ,SAAS,WAAW,GAAG,MAAM,GAAkB;AAClH,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY,WAAW,OAAO;AAAA,MAC9B,gBAAc,WAAW,UAAU;AAAA,MACnC,WAAW,aAAa,EAAE,MAAM,UAAU,UAAU,CAAC;AAAA,MACpD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
package/dist/native.d.ts CHANGED
@@ -1760,6 +1760,37 @@ type SegmentedProps<T extends string> = {
1760
1760
  */
1761
1761
  declare function Segmented<T extends string>({ options, value, onValueChange, size, "aria-label": label, style }: SegmentedProps<T>): React$1.JSX.Element;
1762
1762
 
1763
+ type SettingsRowProps = {
1764
+ /** What the setting is ("Username"), passed translated. */
1765
+ label: string;
1766
+ /** One line of help under the label. */
1767
+ description?: string;
1768
+ /** An icon (24 pt) drawn in a tile before the label. */
1769
+ icon?: React$1.ReactNode;
1770
+ /** The current value on the right ("English", "Dark"). */
1771
+ value?: string;
1772
+ /** A control on the right (a `Switch`): the row is then not pressable by itself. */
1773
+ trailing?: React$1.ReactNode;
1774
+ /** Makes the row a button that opens something; a chevron is shown. */
1775
+ onPress?: () => void;
1776
+ /** Tints the label as dangerous ("Delete account"). */
1777
+ destructive?: boolean;
1778
+ /** The row's accessible name when the visible words do not say it all; by default the visible words (label, help, value) are read. */
1779
+ accessibilityLabel?: string;
1780
+ /** Not available: dimmed and not pressable. */
1781
+ disabled?: boolean;
1782
+ };
1783
+ /** One setting: its label and help on the left, its value or control on the right; a button when `onPress` is given. */
1784
+ declare function SettingsRow({ label, description, icon, value, trailing, onPress, destructive, accessibilityLabel, disabled }: SettingsRowProps): React$1.JSX.Element;
1785
+ type SettingsGroupProps = ViewProps & {
1786
+ /** The group's title ("Account"), passed translated; a heading for screen readers. */
1787
+ title?: string;
1788
+ /** The rows (`SettingsRow`). */
1789
+ children: React$1.ReactNode;
1790
+ };
1791
+ /** A titled card of `SettingsRow`s, divided by hairlines. */
1792
+ declare function SettingsGroup({ title, children, style, ...props }: SettingsGroupProps): React$1.JSX.Element;
1793
+
1763
1794
  type ShowcaseLabels = {
1764
1795
  /** The previous button's name. */
1765
1796
  previous: string;
@@ -2498,4 +2529,4 @@ declare function YomizakaMark({ size, animated, title, neutral }: NativeMarkProp
2498
2529
  */
2499
2530
  declare function YororisMark({ size, animated, title, neutral }: NativeMarkProps): React__default.JSX.Element;
2500
2531
 
2501
- export { ActionSheet, type ActionSheetAction, type ActionSheetProps, type ActivityEvent, ActivityFeed, type ActivityFeedLabels, type ActivityFeedProps, type ActivityTone, AkinazaMark, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, AvatarRoot, type AvatarSize, Badge, type BadgeProps, type BadgeTone, type BrandId, BrandedRefresh, type BrandedRefreshProps, type BrandedRefreshScrollProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarLabels, type CalendarProps, Card, CardBody, type CardBodyProps, CardDescription, CardFooter, CardImage, type CardImageProps, CardMedia, type CardMediaProps, CardOverlay, type CardOverlayProps, CardRoot, type CardRootProps, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipGroupProps, type ChipProps, type ChipSize, Combobox, type ComboboxLabels, type ComboboxProps, ConversationItem, type ConversationItemProps, Countdown, type CountdownProps, type CountdownUnits, DateField, type DateFieldLabels, type DateFieldProps, type DatePart, DateWheel, type DateWheelProps, DayStrip, type DayStripProps, type DefaultAvatar, type DefaultAvatarBrand, type DescriptionItem, DescriptionList, type DescriptionListProps, EmptyState, type EmptyStateProps, ErrorState, Fab, type FabProps, ForceUpdateScreen, type ForceUpdateScreenProps, GoalGauge, type GoalGaugeProps, type GridPhoto, type HapticKind, Header, type HeaderProps, IconButton, type IconButtonProps, ImageViewer, type ImageViewerProps, type Insets, KachizakaMark, KrizakaMark, Loader, LoaderGlyph, type LoaderGlyphProps, type LoaderProps, LoadingState, MaintenanceScreen, type MaintenanceScreenProps, Mascot, type MascotProps, MascotState, type MascotStateProps, MatchDialog, type MatchDialogProps, MessageBubble, type MessageBubbleLabels, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessageStatus, MetaRow, type MetaRowProps, Meter, type MeterPart, type MeterProps, type Mode, MonthPicker, type MonthPickerProps, type Motion, type NativeMarkProps, NumberTicker, type NumberTickerProps, Onboarding, type OnboardingProps, type OnboardingSlide, OrazakaMark, OrochiaMark, OtpInput, type OtpInputProps, Pagination, type PaginationLabels, type PaginationProps, PermissionPrompt, type PermissionPromptProps, type PermissionStatus, PersonCard, type PersonCardProps, Phoenix, type PhoenixProps, PhotoGrid, type PhotoGridLabels, type PhotoGridProps, ProductMark, ProfileCard, type ProfileCardProps, type ProfileStat, Progress, type ProgressProps, PullToRefresh, type PullToRefreshProps, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, Screen, type ScreenProps, SearchField, type SearchFieldProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectOption, type SelectProps, Sheet, type SheetProps, Showcase, type ShowcaseLabels, type ShowcaseProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderValue, Spinner, type SpinnerProps, SplashHandoff, type SplashHandoffProps, type Step, StepProgress, type StepProgressProps, type StepStatus, Stepper, type StepperProps, SuccessState, type SwipeAction, SwipeDeck, type SwipeDeckLabels, type SwipeDeckProps, type SwipeDirection, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TabBar, type TabBarItem, type TabBarProps, type TabItem, Tabs, type TabsProps, type TagOption, TagSelector, type TagSelectorProps, TextField, type TextFieldProps, type Theme, type ThemeContextValue, type ThemeFonts, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerLabels, type TimePickerProps, type TimeValue, type ToastItem, type ToastOptions, type ToastTone, Toaster, type ToasterProps, Txt, type TxtProps, type TxtTone, type TxtVariant, TypingIndicator, type TypingIndicatorProps, UpdatePrompt, type UpdatePromptProps, VerifiedBadge, type VerifiedBadgeProps, type ViewerImage, Waveform, type WaveformProps, WelcomeState, Wheel, WheelDivider, type WheelOption, WheelPicker, type WheelPickerProps, type WheelProps, YasakiaMark, YazakiaMark, YomizakaMark, YororisMark, addDays, addMonths, ageOn, alpha, calendarLabels, comboboxLabels, composeDate, dateFieldLabels, datePartsOrder, daysInMonth, defaultAvatarUrl, formatTime, isRealDate, latestBirthDate, monthNames, prefetchNeighbours, showcaseLabels, splitDuration, textStyles, timeSlots, timeToMinutes, toast, todayIso, useCollapsingHeader, useCountdown, useDelayedWait, useReducedMotion, useTheme, uses12Hours };
2532
+ export { ActionSheet, type ActionSheetAction, type ActionSheetProps, type ActivityEvent, ActivityFeed, type ActivityFeedLabels, type ActivityFeedProps, type ActivityTone, AkinazaMark, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, AvatarRoot, type AvatarSize, Badge, type BadgeProps, type BadgeTone, type BrandId, BrandedRefresh, type BrandedRefreshProps, type BrandedRefreshScrollProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarLabels, type CalendarProps, Card, CardBody, type CardBodyProps, CardDescription, CardFooter, CardImage, type CardImageProps, CardMedia, type CardMediaProps, CardOverlay, type CardOverlayProps, CardRoot, type CardRootProps, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipGroupProps, type ChipProps, type ChipSize, Combobox, type ComboboxLabels, type ComboboxProps, ConversationItem, type ConversationItemProps, Countdown, type CountdownProps, type CountdownUnits, DateField, type DateFieldLabels, type DateFieldProps, type DatePart, DateWheel, type DateWheelProps, DayStrip, type DayStripProps, type DefaultAvatar, type DefaultAvatarBrand, type DescriptionItem, DescriptionList, type DescriptionListProps, EmptyState, type EmptyStateProps, ErrorState, Fab, type FabProps, ForceUpdateScreen, type ForceUpdateScreenProps, GoalGauge, type GoalGaugeProps, type GridPhoto, type HapticKind, Header, type HeaderProps, IconButton, type IconButtonProps, ImageViewer, type ImageViewerProps, type Insets, KachizakaMark, KrizakaMark, Loader, LoaderGlyph, type LoaderGlyphProps, type LoaderProps, LoadingState, MaintenanceScreen, type MaintenanceScreenProps, Mascot, type MascotProps, MascotState, type MascotStateProps, MatchDialog, type MatchDialogProps, MessageBubble, type MessageBubbleLabels, type MessageBubbleProps, MessageComposer, type MessageComposerProps, type MessageStatus, MetaRow, type MetaRowProps, Meter, type MeterPart, type MeterProps, type Mode, MonthPicker, type MonthPickerProps, type Motion, type NativeMarkProps, NumberTicker, type NumberTickerProps, Onboarding, type OnboardingProps, type OnboardingSlide, OrazakaMark, OrochiaMark, OtpInput, type OtpInputProps, Pagination, type PaginationLabels, type PaginationProps, PermissionPrompt, type PermissionPromptProps, type PermissionStatus, PersonCard, type PersonCardProps, Phoenix, type PhoenixProps, PhotoGrid, type PhotoGridLabels, type PhotoGridProps, ProductMark, ProfileCard, type ProfileCardProps, type ProfileStat, Progress, type ProgressProps, PullToRefresh, type PullToRefreshProps, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, Screen, type ScreenProps, SearchField, type SearchFieldProps, Segmented, type SegmentedOption, type SegmentedProps, Select, type SelectOption, type SelectProps, SettingsGroup, type SettingsGroupProps, SettingsRow, type SettingsRowProps, Sheet, type SheetProps, Showcase, type ShowcaseLabels, type ShowcaseProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderValue, Spinner, type SpinnerProps, SplashHandoff, type SplashHandoffProps, type Step, StepProgress, type StepProgressProps, type StepStatus, Stepper, type StepperProps, SuccessState, type SwipeAction, SwipeDeck, type SwipeDeckLabels, type SwipeDeckProps, type SwipeDirection, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TabBar, type TabBarItem, type TabBarProps, type TabItem, Tabs, type TabsProps, type TagOption, TagSelector, type TagSelectorProps, TextField, type TextFieldProps, type Theme, type ThemeContextValue, type ThemeFonts, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, TimePicker, type TimePickerLabels, type TimePickerProps, type TimeValue, type ToastItem, type ToastOptions, type ToastTone, Toaster, type ToasterProps, Txt, type TxtProps, type TxtTone, type TxtVariant, TypingIndicator, type TypingIndicatorProps, UpdatePrompt, type UpdatePromptProps, VerifiedBadge, type VerifiedBadgeProps, type ViewerImage, Waveform, type WaveformProps, WelcomeState, Wheel, WheelDivider, type WheelOption, WheelPicker, type WheelPickerProps, type WheelProps, YasakiaMark, YazakiaMark, YomizakaMark, YororisMark, addDays, addMonths, ageOn, alpha, calendarLabels, comboboxLabels, composeDate, dateFieldLabels, datePartsOrder, daysInMonth, defaultAvatarUrl, formatTime, isRealDate, latestBirthDate, monthNames, prefetchNeighbours, showcaseLabels, splitDuration, textStyles, timeSlots, timeToMinutes, toast, todayIso, useCollapsingHeader, useCountdown, useDelayedWait, useReducedMotion, useTheme, uses12Hours };