@seekalfred/primitives 0.7.4 → 0.8.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 (87) hide show
  1. package/README.md +255 -3
  2. package/dist/alert/alert.d.ts +2 -2
  3. package/dist/alert/alert.js +1 -1
  4. package/dist/alert/alert.js.map +1 -1
  5. package/dist/alert-dialog/alert-dialog.js +1 -1
  6. package/dist/alert-dialog/alert-dialog.js.map +1 -1
  7. package/dist/avatar/avatar.d.ts +1 -1
  8. package/dist/badge/badge.d.ts +16 -1
  9. package/dist/badge/badge.js +12 -5
  10. package/dist/badge/badge.js.map +1 -1
  11. package/dist/button/button.d.ts +24 -2
  12. package/dist/button/button.js +62 -13
  13. package/dist/button/button.js.map +1 -1
  14. package/dist/card/card.js +1 -1
  15. package/dist/card/card.js.map +1 -1
  16. package/dist/checkbox/checkbox.d.ts +25 -1
  17. package/dist/checkbox/checkbox.js +103 -28
  18. package/dist/checkbox/checkbox.js.map +1 -1
  19. package/dist/checkbox/index.d.ts +2 -2
  20. package/dist/checkbox/index.js +2 -2
  21. package/dist/code-block/code-block.d.ts +45 -0
  22. package/dist/code-block/code-block.js +74 -0
  23. package/dist/code-block/code-block.js.map +1 -0
  24. package/dist/code-block/index.d.ts +2 -0
  25. package/dist/code-block/index.js +2 -0
  26. package/dist/command-palette/command-palette.d.ts +128 -0
  27. package/dist/command-palette/command-palette.js +371 -0
  28. package/dist/command-palette/command-palette.js.map +1 -0
  29. package/dist/command-palette/index.d.ts +2 -0
  30. package/dist/command-palette/index.js +2 -0
  31. package/dist/dialog/dialog.js +1 -1
  32. package/dist/dialog/dialog.js.map +1 -1
  33. package/dist/empty-state/empty-state.d.ts +17 -0
  34. package/dist/empty-state/empty-state.js +9 -7
  35. package/dist/empty-state/empty-state.js.map +1 -1
  36. package/dist/index.d.ts +8 -4
  37. package/dist/index.js +12 -8
  38. package/dist/info-tooltip/index.d.ts +2 -0
  39. package/dist/info-tooltip/index.js +2 -0
  40. package/dist/info-tooltip/info-tooltip.d.ts +35 -0
  41. package/dist/info-tooltip/info-tooltip.js +49 -0
  42. package/dist/info-tooltip/info-tooltip.js.map +1 -0
  43. package/dist/input/input.js +1 -1
  44. package/dist/lib/selection-control.js +32 -1
  45. package/dist/lib/selection-control.js.map +1 -1
  46. package/dist/line-chart/line-chart.d.ts +2 -1
  47. package/dist/line-chart/line-chart.js +2 -2
  48. package/dist/line-chart/line-chart.js.map +1 -1
  49. package/dist/mention-input/mention-input.js +1 -1
  50. package/dist/money-input/money-input.js +1 -1
  51. package/dist/multi-select/multi-select.js +1 -1
  52. package/dist/number-field/number-field.js +1 -1
  53. package/dist/password-field/password-field.js +1 -1
  54. package/dist/password-strength/password-strength.js +1 -1
  55. package/dist/phone-input/phone-input.js +1 -1
  56. package/dist/popover/popover.js +1 -1
  57. package/dist/popover/popover.js.map +1 -1
  58. package/dist/progress/progress.d.ts +3 -3
  59. package/dist/radio-group/radio-group.d.ts +12 -3
  60. package/dist/radio-group/radio-group.js +62 -52
  61. package/dist/radio-group/radio-group.js.map +1 -1
  62. package/dist/rich-text-editor/rich-text-editor.js +1 -1
  63. package/dist/scroll-area/scroll-area.d.ts +1 -1
  64. package/dist/search-field/search-field.js +1 -1
  65. package/dist/select/select.d.ts +1 -1
  66. package/dist/select/select.js +1 -1
  67. package/dist/separator/separator.d.ts +1 -1
  68. package/dist/shortcut-recorder/shortcut-recorder.js +1 -1
  69. package/dist/stat-card/stat-card.d.ts +2 -2
  70. package/dist/styles.css +1 -1
  71. package/dist/table/index.d.ts +2 -2
  72. package/dist/table/index.js +2 -2
  73. package/dist/table/table.d.ts +99 -1
  74. package/dist/table/table.js +123 -23
  75. package/dist/table/table.js.map +1 -1
  76. package/dist/tabs/tabs.d.ts +4 -2
  77. package/dist/tabs/tabs.js +7 -5
  78. package/dist/tabs/tabs.js.map +1 -1
  79. package/dist/tag-input/tag-input.js +1 -1
  80. package/dist/textarea/textarea.js +1 -1
  81. package/dist/toast/toast.d.ts +2 -2
  82. package/dist/toggle-button/index.d.ts +2 -0
  83. package/dist/toggle-button/index.js +2 -0
  84. package/dist/toggle-button/toggle-button.d.ts +93 -0
  85. package/dist/toggle-button/toggle-button.js +199 -0
  86. package/dist/toggle-button/toggle-button.js.map +1 -0
  87. package/package.json +19 -3
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn, cnAll } from "../lib/cn.js";
3
- import { selectionLabelVariants, selectionRingVariants } from "../lib/selection-control.js";
3
+ import { selectionCardVariants, selectionLabelVariants, selectionRingVariants } from "../lib/selection-control.js";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { createContext, forwardRef, useContext, useId } from "react";
6
6
  import { Radio, RadioGroup } from "react-aria-components";
@@ -26,10 +26,24 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
26
26
  */
27
27
  const radioGroupVariants = cva(["box-border font-sans"], {
28
28
  variants: {
29
- /** `card` lays the choices out as a grid; add `sm:grid-cols-2` and the like. */
29
+ /**
30
+ * `card` lays the choices out as a grid; add `sm:grid-cols-2` and the like.
31
+ * `framed` keeps ordinary radios and draws one bordered frame around the row.
32
+ */
30
33
  variant: {
31
34
  default: "flex flex-col gap-2",
32
- card: "grid gap-3"
35
+ card: "grid gap-3",
36
+ framed: [
37
+ "inline-flex flex-col gap-2 px-2 py-0.5",
38
+ "rounded-control border-(length:--border-width) border-border bg-surface",
39
+ "data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:items-center data-[orientation=horizontal]:gap-3",
40
+ "has-[[data-focus-visible]]:border-foreground",
41
+ "[&_[data-slot=radio-dot]]:outline-hidden!",
42
+ "forced-colors:has-[[data-focus-visible]]:outline-solid",
43
+ "forced-colors:has-[[data-focus-visible]]:outline-(length:--focus-ring-width)",
44
+ "forced-colors:has-[[data-focus-visible]]:outline-offset-(--focus-ring-offset)",
45
+ "motion-safe:transition-[border-color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle"
46
+ ]
33
47
  } },
34
48
  defaultVariants: { variant: "default" }
35
49
  });
@@ -56,21 +70,7 @@ const radioVariants = cva([...radioMark, selectionRingVariants()]);
56
70
  * pair (`border-primary-strong`, hover darkens an unselected edge), so a
57
71
  * selected card and a selected stat card read the same.
58
72
  */
59
- const radioCardVariants = cva([
60
- "group flex items-start gap-3 p-4",
61
- "rounded-panel border-(length:--border-width) border-border bg-surface",
62
- "box-border font-sans text-sm leading-(--leading-normal) text-foreground text-start",
63
- "cursor-pointer select-none",
64
- "motion-safe:transition-[border-color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle",
65
- "data-[hovered]:not-data-[selected]:border-muted-foreground",
66
- "data-[selected]:border-primary-strong",
67
- "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)",
68
- "outline-none",
69
- "data-[focus-visible]:outline-solid",
70
- "data-[focus-visible]:outline-(length:--focus-ring-width)",
71
- "data-[focus-visible]:outline-offset-(--focus-ring-offset)",
72
- "data-[focus-visible]:outline-(--color-ring)"
73
- ]);
73
+ const radioCardVariants = selectionCardVariants;
74
74
  const radioCardDotVariants = cva([...radioMark, "mt-0.5"]);
75
75
  /** The group hands its variant down, so every Radio inside matches it. */
76
76
  const RadioVariantContext = createContext("default");
@@ -96,7 +96,7 @@ const Radio$1 = forwardRef(function Radio(props, ref) {
96
96
  ref
97
97
  });
98
98
  });
99
- const RadioDefault = forwardRef(function RadioDefault({ className, children, description: _description, icon: _icon, ...props }, ref) {
99
+ const RadioDefault = forwardRef(function RadioDefault({ className, children, description: _description, icon: _icon, media: _media, ...props }, ref) {
100
100
  return /* @__PURE__ */ jsx(Radio, {
101
101
  ...props,
102
102
  inputRef: ref,
@@ -117,7 +117,7 @@ const RadioDefault = forwardRef(function RadioDefault({ className, children, des
117
117
  })] })
118
118
  });
119
119
  });
120
- const RadioCard = forwardRef(function RadioCard({ className, children, description, icon, ...props }, ref) {
120
+ const RadioCard = forwardRef(function RadioCard({ className, children, description, icon, media, ...props }, ref) {
121
121
  const id = useId();
122
122
  const titleId = `${id}-title`;
123
123
  const descriptionId = `${id}-description`;
@@ -128,39 +128,49 @@ const RadioCard = forwardRef(function RadioCard({ className, children, descripti
128
128
  inputRef: ref,
129
129
  "data-slot": "radio",
130
130
  "data-variant": "card",
131
- className: cn(radioCardVariants(), className),
132
- children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
133
- icon == null ? null : /* @__PURE__ */ jsx("span", {
134
- "aria-hidden": "true",
135
- "data-slot": "radio-icon",
136
- className: "mt-0.5 inline-flex shrink-0 text-text-secondary [&_svg]:size-4",
137
- children: icon
138
- }),
139
- /* @__PURE__ */ jsxs("span", {
140
- className: "flex min-w-0 flex-1 flex-col gap-1",
141
- children: [children == null ? null : /* @__PURE__ */ jsx("span", {
142
- id: titleId,
143
- "data-slot": "radio-label",
144
- className: "font-medium",
145
- children
146
- }), description == null ? null : /* @__PURE__ */ jsx("span", {
147
- id: descriptionId,
148
- "data-slot": "radio-description",
149
- className: "text-text-secondary",
150
- children: description
151
- })]
152
- }),
153
- /* @__PURE__ */ jsx("span", {
154
- "aria-hidden": "true",
155
- "data-slot": "radio-dot",
156
- className: radioCardDotVariants(),
157
- children: /* @__PURE__ */ jsx("span", {
158
- "data-slot": "radio-indicator",
159
- "data-selected": isSelected || void 0,
160
- className: "radio-dot size-1.5 rounded-full bg-current"
131
+ className: cn(cnAll(radioCardVariants(), media != null && "flex-col items-stretch"), className),
132
+ children: ({ isSelected }) => {
133
+ const row = /* @__PURE__ */ jsxs(Fragment$1, { children: [
134
+ icon == null ? null : /* @__PURE__ */ jsx("span", {
135
+ "aria-hidden": "true",
136
+ "data-slot": "radio-icon",
137
+ className: "mt-0.5 inline-flex shrink-0 text-text-secondary [&_svg]:size-4",
138
+ children: icon
139
+ }),
140
+ /* @__PURE__ */ jsxs("span", {
141
+ className: "flex min-w-0 flex-1 flex-col gap-1",
142
+ children: [children == null ? null : /* @__PURE__ */ jsx("span", {
143
+ id: titleId,
144
+ "data-slot": "radio-label",
145
+ className: "font-medium",
146
+ children
147
+ }), description == null ? null : /* @__PURE__ */ jsx("span", {
148
+ id: descriptionId,
149
+ "data-slot": "radio-description",
150
+ className: "text-text-secondary",
151
+ children: description
152
+ })]
153
+ }),
154
+ /* @__PURE__ */ jsx("span", {
155
+ "aria-hidden": "true",
156
+ "data-slot": "radio-dot",
157
+ className: radioCardDotVariants(),
158
+ children: /* @__PURE__ */ jsx("span", {
159
+ "data-slot": "radio-indicator",
160
+ "data-selected": isSelected || void 0,
161
+ className: "radio-dot size-1.5 rounded-full bg-current"
162
+ })
161
163
  })
162
- })
163
- ] })
164
+ ] });
165
+ return media == null ? row : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
166
+ "data-slot": "radio-media",
167
+ className: "block w-full min-w-0",
168
+ children: media
169
+ }), /* @__PURE__ */ jsx("span", {
170
+ className: "flex w-full items-start gap-3",
171
+ children: row
172
+ })] });
173
+ }
164
174
  });
165
175
  });
166
176
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","names":["RadioGroup","AriaRadioGroup","Radio","AriaRadio"],"sources":["../../src/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { createContext, forwardRef, useContext, useId, type ReactNode } from \"react\";\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type RadioGroupProps as AriaRadioGroupProps,\n type RadioProps as AriaRadioProps,\n} from \"react-aria-components\";\n\nimport { cn, cnAll } from \"../lib/cn.js\";\nimport { selectionLabelVariants, selectionRingVariants } from \"../lib/selection-control.js\";\n\n/**\n * RadioGroup, ported from the legacy shadcn/Radix component onto React Aria.\n *\n * Census: 1 file, 3 uses -- `RadioGroup` 1, `RadioGroupItem` 2. The\n * smallest real surface in the migration, so the port is deliberately plain.\n *\n * THE LABEL MOVES INSIDE THE ITEM. Radix's `RadioGroupItem` is a bare\n * button and the caller pairs it with a separate `<Label htmlFor>`; React\n * Aria's `Radio` takes its label as `children` and wires the association\n * itself. That is the one rename a call site has to make, and it removes\n * the id bookkeeping.\n *\n * `border-primary` becomes `border-border` for the same reason it did on\n * Checkbox: brand orange is 2.44:1 on white and cannot legally be the only\n * thing describing a control's edge (WCAG 1.4.11). Selected reuses\n * Checkbox's exact pair -- `bg-primary` with a `primary-strong` boundary --\n * so a radio and a checkbox in the same form agree.\n */\nexport const radioGroupVariants = cva([\"box-border font-sans\"], {\n variants: {\n /** `card` lays the choices out as a grid; add `sm:grid-cols-2` and the like. */\n variant: {\n default: \"flex flex-col gap-2\",\n card: \"grid gap-3\",\n },\n },\n defaultVariants: { variant: \"default\" },\n});\n\n/**\n * The box and dot, shared by both variants. Only the default variant rings\n * the dot itself: a card rings the whole card, and a second ring on the dot\n * inside it would just be noise.\n */\nconst radioMark = [\n \"inline-flex size-4 shrink-0 items-center justify-center\",\n \"rounded-full border-(length:--border-width) box-border\",\n \"bg-surface border-control-edge\",\n // Colours ease, the mark dips under a press and springs back (see radio-mark).\n \"radio-mark\",\n \"group-data-[selected]:bg-primary group-data-[selected]:border-primary-strong\",\n \"group-data-[selected]:text-primary-foreground\",\n];\n\nexport const radioVariants = cva([...radioMark, selectionRingVariants()]);\n\n/**\n * One choice drawn as a selectable card: a bordered surface the whole of\n * which is the hit target, with the title, an optional description and icon.\n *\n * Selection is shown twice, by the border AND by the dot, so it never rests\n * on colour alone (WCAG 1.4.1). The border reuses StatCard's selected filter\n * pair (`border-primary-strong`, hover darkens an unselected edge), so a\n * selected card and a selected stat card read the same.\n */\nexport const radioCardVariants = cva([\n \"group flex items-start gap-3 p-4\",\n \"rounded-panel border-(length:--border-width) border-border bg-surface\",\n \"box-border font-sans text-sm leading-(--leading-normal) text-foreground text-start\",\n \"cursor-pointer select-none\",\n \"motion-safe:transition-[border-color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle\",\n \"data-[hovered]:not-data-[selected]:border-muted-foreground\",\n \"data-[selected]:border-primary-strong\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n // The same ring as selectionRingVariants, on purpose not reused: that helper\n // reads the state from a `group-data-[focus-visible]:` parent, and here the\n // card IS the group, so its own `data-[focus-visible]:` is the state. Keep\n // the two in step. outline-solid is load-bearing: outline-none sets the\n // style the width utility resolves from (see selectionRingVariants).\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n]);\n\nconst radioCardDotVariants = cva([...radioMark, \"mt-0.5\"]);\n\n/** Which look the group's radios take. */\nexport type RadioGroupVariant = \"default\" | \"card\";\n\n/** The group hands its variant down, so every Radio inside matches it. */\nconst RadioVariantContext = createContext<RadioGroupVariant>(\"default\");\n\n/**\n * A set of mutually exclusive choices.\n *\n * @example\n * <RadioGroup value={plan} onChange={setPlan} aria-label=\"Plan\">\n * <Radio value=\"free\">Free</Radio>\n * <Radio value=\"pro\">Pro</Radio>\n * </RadioGroup>\n */\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, \"className\" | \"style\"> {\n /**\n * `card` draws each choice as a selectable card, with a title, an optional\n * `description` and `icon` on each `Radio`. The keyboard model is the same:\n * one tab stop, arrow keys move and select.\n *\n * @default \"default\"\n */\n variant?: RadioGroupVariant;\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n { className, variant = \"default\", children, ...props },\n ref,\n) {\n return (\n <AriaRadioGroup\n ref={ref}\n {...props}\n data-slot=\"radio-group\"\n data-variant={variant === \"default\" ? undefined : variant}\n className={cn(radioGroupVariants({ variant }), className)}\n >\n {(renderProps) => (\n <RadioVariantContext.Provider value={variant}>\n {typeof children === \"function\" ? children(renderProps) : children}\n </RadioVariantContext.Provider>\n )}\n </AriaRadioGroup>\n );\n});\n\n/**\n * One choice.\n *\n * @example\n * <Radio value=\"pro\">Pro</Radio>\n */\nexport interface RadioProps extends Omit<AriaRadioProps, \"className\" | \"style\" | \"children\"> {\n /** The label, and this option's accessible name. In a card, the title. */\n children?: ReactNode;\n /**\n * A line under the title, read as the option's description\n * (`aria-describedby`), not as part of its name. Card variant only; the\n * default variant ignores it.\n */\n description?: ReactNode;\n /** A decorative icon before the title. Card variant only; hidden from assistive tech. */\n icon?: ReactNode;\n /** Extra classes for the label (the whole card in the card variant). Merged last, so they win conflicts. */\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(props, ref) {\n const variant = useContext(RadioVariantContext);\n return variant === \"card\" ? <RadioCard {...props} ref={ref} /> : <RadioDefault {...props} ref={ref} />;\n});\n\nconst RadioDefault = forwardRef<HTMLInputElement, RadioProps>(function RadioDefault(\n // description and icon belong to the card; pulled out so they never reach the DOM.\n { className, children, description: _description, icon: _icon, ...props },\n ref,\n) {\n return (\n <AriaRadio\n {...props}\n // inputRef, not ref: AriaRadio's own ref targets the label it renders\n // around a visually-hidden native input, and a label cannot be\n // focused -- ref.current.focus() would silently no-op. inputRef is\n // React Aria's own escape hatch to the real control.\n inputRef={ref}\n data-slot=\"radio\"\n // justify-start, overriding the shared label's centring: a radio sits\n // in a vertical list where every label must start on the same line,\n // not centre itself in a 24px box.\n className={cn(cnAll(selectionLabelVariants(), \"justify-start\"), className)}\n >\n {({ isSelected }) => (\n <>\n <span aria-hidden=\"true\" data-slot=\"radio-dot\" className={radioVariants()}>\n {/*\n Always there: the state decides whether it shows, so the dot can\n spring in and shrink away. data-selected carries the state to a\n test, which can no longer read it from the dot's presence.\n */}\n <span\n data-slot=\"radio-indicator\"\n data-selected={isSelected || undefined}\n className=\"radio-dot size-1.5 rounded-full bg-current\"\n />\n </span>\n {children == null ? null : <span data-slot=\"radio-label\">{children}</span>}\n </>\n )}\n </AriaRadio>\n );\n});\n\nconst RadioCard = forwardRef<HTMLInputElement, RadioProps>(function RadioCard(\n { className, children, description, icon, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n <AriaRadio\n // The title alone names the option; the description describes it. Left\n // to the wrapping <label>, the name would be title and description run\n // together. A caller's own labelling wins: their aria-labelledby or\n // aria-describedby by the spread below, and their aria-label because the\n // title's aria-labelledby is then left off (it would outrank aria-label\n // in the name computation).\n aria-labelledby={children == null || props[\"aria-label\"] != null ? undefined : titleId}\n aria-describedby={description == null ? undefined : descriptionId}\n {...props}\n inputRef={ref}\n data-slot=\"radio\"\n data-variant=\"card\"\n className={cn(radioCardVariants(), className)}\n >\n {({ isSelected }) => (\n <>\n {icon == null ? null : (\n <span\n aria-hidden=\"true\"\n data-slot=\"radio-icon\"\n className=\"mt-0.5 inline-flex shrink-0 text-text-secondary [&_svg]:size-4\"\n >\n {icon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n {children == null ? null : (\n <span id={titleId} data-slot=\"radio-label\" className=\"font-medium\">\n {children}\n </span>\n )}\n {description == null ? null : (\n <span id={descriptionId} data-slot=\"radio-description\" className=\"text-text-secondary\">\n {description}\n </span>\n )}\n </span>\n <span aria-hidden=\"true\" data-slot=\"radio-dot\" className={radioCardDotVariants()}>\n <span\n data-slot=\"radio-indicator\"\n data-selected={isSelected || undefined}\n className=\"radio-dot size-1.5 rounded-full bg-current\"\n />\n </span>\n </>\n )}\n </AriaRadio>\n );\n});\n"],"mappings":"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"}
1
+ {"version":3,"file":"radio-group.js","names":["RadioGroup","AriaRadioGroup","Radio","AriaRadio"],"sources":["../../src/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { createContext, forwardRef, useContext, useId, type ReactNode } from \"react\";\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type RadioGroupProps as AriaRadioGroupProps,\n type RadioProps as AriaRadioProps,\n} from \"react-aria-components\";\n\nimport { cn, cnAll } from \"../lib/cn.js\";\nimport {\n selectionCardVariants,\n selectionLabelVariants,\n selectionRingVariants,\n} from \"../lib/selection-control.js\";\n\n/**\n * RadioGroup, ported from the legacy shadcn/Radix component onto React Aria.\n *\n * Census: 1 file, 3 uses -- `RadioGroup` 1, `RadioGroupItem` 2. The\n * smallest real surface in the migration, so the port is deliberately plain.\n *\n * THE LABEL MOVES INSIDE THE ITEM. Radix's `RadioGroupItem` is a bare\n * button and the caller pairs it with a separate `<Label htmlFor>`; React\n * Aria's `Radio` takes its label as `children` and wires the association\n * itself. That is the one rename a call site has to make, and it removes\n * the id bookkeeping.\n *\n * `border-primary` becomes `border-border` for the same reason it did on\n * Checkbox: brand orange is 2.44:1 on white and cannot legally be the only\n * thing describing a control's edge (WCAG 1.4.11). Selected reuses\n * Checkbox's exact pair -- `bg-primary` with a `primary-strong` boundary --\n * so a radio and a checkbox in the same form agree.\n */\nexport const radioGroupVariants = cva([\"box-border font-sans\"], {\n variants: {\n /**\n * `card` lays the choices out as a grid; add `sm:grid-cols-2` and the like.\n * `framed` keeps ordinary radios and draws one bordered frame around the row.\n */\n variant: {\n default: \"flex flex-col gap-2\",\n card: \"grid gap-3\",\n framed: [\n \"inline-flex flex-col gap-2 px-2 py-0.5\",\n \"rounded-control border-(length:--border-width) border-border bg-surface\",\n \"data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:items-center data-[orientation=horizontal]:gap-3\",\n // Focus is the FRAME's own border going dark, not a ring on the dot: the\n // approved style. :has() reads React Aria's data-focus-visible off the\n // radio's label. The dot's own ring is switched off in this variant, and\n // forced colours (which override a border colour) get an outline on the frame.\n \"has-[[data-focus-visible]]:border-foreground\",\n \"[&_[data-slot=radio-dot]]:outline-hidden!\",\n \"forced-colors:has-[[data-focus-visible]]:outline-solid\",\n \"forced-colors:has-[[data-focus-visible]]:outline-(length:--focus-ring-width)\",\n \"forced-colors:has-[[data-focus-visible]]:outline-offset-(--focus-ring-offset)\",\n \"motion-safe:transition-[border-color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle\",\n ],\n },\n },\n defaultVariants: { variant: \"default\" },\n});\n\n/**\n * The box and dot, shared by both variants. Only the default variant rings\n * the dot itself: a card rings the whole card, and a second ring on the dot\n * inside it would just be noise.\n */\nconst radioMark = [\n \"inline-flex size-4 shrink-0 items-center justify-center\",\n \"rounded-full border-(length:--border-width) box-border\",\n \"bg-surface border-control-edge\",\n // Colours ease, the mark dips under a press and springs back (see radio-mark).\n \"radio-mark\",\n \"group-data-[selected]:bg-primary group-data-[selected]:border-primary-strong\",\n \"group-data-[selected]:text-primary-foreground\",\n];\n\nexport const radioVariants = cva([...radioMark, selectionRingVariants()]);\n\n/**\n * One choice drawn as a selectable card: a bordered surface the whole of\n * which is the hit target, with the title, an optional description and icon.\n *\n * Selection is shown twice, by the border AND by the dot, so it never rests\n * on colour alone (WCAG 1.4.1). The border reuses StatCard's selected filter\n * pair (`border-primary-strong`, hover darkens an unselected edge), so a\n * selected card and a selected stat card read the same.\n */\nexport const radioCardVariants = selectionCardVariants;\n\nconst radioCardDotVariants = cva([...radioMark, \"mt-0.5\"]);\n\n/** Which look the group's radios take. */\nexport type RadioGroupVariant = \"default\" | \"card\" | \"framed\";\n\n/** The group hands its variant down, so every Radio inside matches it. */\nconst RadioVariantContext = createContext<RadioGroupVariant>(\"default\");\n\n/**\n * A set of mutually exclusive choices.\n *\n * @example\n * <RadioGroup value={plan} onChange={setPlan} aria-label=\"Plan\">\n * <Radio value=\"free\">Free</Radio>\n * <Radio value=\"pro\">Pro</Radio>\n * </RadioGroup>\n */\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, \"className\" | \"style\"> {\n /**\n * `card` draws each choice as a selectable card, with a title, an optional\n * `description` and `icon` on each `Radio`. The keyboard model is the same:\n * one tab stop, arrow keys move and select. `framed` draws a single bordered\n * frame around ordinary radios (laid out by `orientation`); its focus is the\n * frame's border turning dark.\n *\n * @default \"default\"\n */\n variant?: RadioGroupVariant;\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n { className, variant = \"default\", children, ...props },\n ref,\n) {\n return (\n <AriaRadioGroup\n ref={ref}\n {...props}\n data-slot=\"radio-group\"\n data-variant={variant === \"default\" ? undefined : variant}\n className={cn(radioGroupVariants({ variant }), className)}\n >\n {(renderProps) => (\n <RadioVariantContext.Provider value={variant}>\n {typeof children === \"function\" ? children(renderProps) : children}\n </RadioVariantContext.Provider>\n )}\n </AriaRadioGroup>\n );\n});\n\n/**\n * One choice.\n *\n * @example\n * <Radio value=\"pro\">Pro</Radio>\n */\nexport interface RadioProps extends Omit<AriaRadioProps, \"className\" | \"style\" | \"children\"> {\n /** The label, and this option's accessible name. In a card, the title. */\n children?: ReactNode;\n /**\n * A line under the title, read as the option's description\n * (`aria-describedby`), not as part of its name. Card variant only; the\n * default variant ignores it.\n */\n description?: ReactNode;\n /** A decorative icon before the title. Card variant only; hidden from assistive tech. */\n icon?: ReactNode;\n /**\n * Content above the title, edge to edge in the card: a thumbnail, a preview.\n * Card variant only. With it the card stacks (media, then the icon, title and\n * dot row). Give an `<img>` its own `alt`, or `alt=\"\"` when the title says it\n * all; the slot adds no name of its own.\n */\n media?: ReactNode;\n /** Extra classes for the label (the whole card in the card variant). Merged last, so they win conflicts. */\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(props, ref) {\n const variant = useContext(RadioVariantContext);\n return variant === \"card\" ? <RadioCard {...props} ref={ref} /> : <RadioDefault {...props} ref={ref} />;\n});\n\nconst RadioDefault = forwardRef<HTMLInputElement, RadioProps>(function RadioDefault(\n // description and icon belong to the card; pulled out so they never reach the DOM.\n { className, children, description: _description, icon: _icon, media: _media, ...props },\n ref,\n) {\n return (\n <AriaRadio\n {...props}\n // inputRef, not ref: AriaRadio's own ref targets the label it renders\n // around a visually-hidden native input, and a label cannot be\n // focused -- ref.current.focus() would silently no-op. inputRef is\n // React Aria's own escape hatch to the real control.\n inputRef={ref}\n data-slot=\"radio\"\n // justify-start, overriding the shared label's centring: a radio sits\n // in a vertical list where every label must start on the same line,\n // not centre itself in a 24px box.\n className={cn(cnAll(selectionLabelVariants(), \"justify-start\"), className)}\n >\n {({ isSelected }) => (\n <>\n <span aria-hidden=\"true\" data-slot=\"radio-dot\" className={radioVariants()}>\n {/*\n Always there: the state decides whether it shows, so the dot can\n spring in and shrink away. data-selected carries the state to a\n test, which can no longer read it from the dot's presence.\n */}\n <span\n data-slot=\"radio-indicator\"\n data-selected={isSelected || undefined}\n className=\"radio-dot size-1.5 rounded-full bg-current\"\n />\n </span>\n {children == null ? null : <span data-slot=\"radio-label\">{children}</span>}\n </>\n )}\n </AriaRadio>\n );\n});\n\nconst RadioCard = forwardRef<HTMLInputElement, RadioProps>(function RadioCard(\n { className, children, description, icon, media, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n return (\n <AriaRadio\n // The title alone names the option; the description describes it. Left\n // to the wrapping <label>, the name would be title and description run\n // together. A caller's own labelling wins: their aria-labelledby or\n // aria-describedby by the spread below, and their aria-label because the\n // title's aria-labelledby is then left off (it would outrank aria-label\n // in the name computation).\n aria-labelledby={children == null || props[\"aria-label\"] != null ? undefined : titleId}\n aria-describedby={description == null ? undefined : descriptionId}\n {...props}\n inputRef={ref}\n data-slot=\"radio\"\n data-variant=\"card\"\n className={cn(cnAll(radioCardVariants(), media != null && \"flex-col items-stretch\"), className)}\n >\n {({ isSelected }) => {\n const row = (\n <>\n {icon == null ? null : (\n <span\n aria-hidden=\"true\"\n data-slot=\"radio-icon\"\n className=\"mt-0.5 inline-flex shrink-0 text-text-secondary [&_svg]:size-4\"\n >\n {icon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n {children == null ? null : (\n <span id={titleId} data-slot=\"radio-label\" className=\"font-medium\">\n {children}\n </span>\n )}\n {description == null ? null : (\n <span\n id={descriptionId}\n data-slot=\"radio-description\"\n className=\"text-text-secondary\"\n >\n {description}\n </span>\n )}\n </span>\n <span aria-hidden=\"true\" data-slot=\"radio-dot\" className={radioCardDotVariants()}>\n <span\n data-slot=\"radio-indicator\"\n data-selected={isSelected || undefined}\n className=\"radio-dot size-1.5 rounded-full bg-current\"\n />\n </span>\n </>\n );\n return media == null ? (\n row\n ) : (\n <>\n <span data-slot=\"radio-media\" className=\"block w-full min-w-0\">\n {media}\n </span>\n <span className=\"flex w-full items-start gap-3\">{row}</span>\n </>\n );\n }}\n </AriaRadio>\n );\n});\n"],"mappings":"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"}
@@ -2,9 +2,9 @@
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { useIsomorphicLayoutEffect } from "../lib/motion.js";
4
4
  import { Button } from "../button/button.js";
5
- import { Tooltip, TooltipTrigger } from "../tooltip/tooltip.js";
6
5
  import { Label } from "../label/label.js";
7
6
  import { FieldShell, useFieldWiring } from "../lib/field-shell.js";
7
+ import { Tooltip, TooltipTrigger } from "../tooltip/tooltip.js";
8
8
  import { isSafeUrl, normalizeUrl } from "./rich-text-html.js";
9
9
  import { $isDocumentEmpty, $readFormats, NO_FORMATS, applyLink, beginLink, createRichTextEditor, loadHtml, loadMarkdown, readValue, setBlock, syncDividers, toggleMark } from "./rich-text-engine.js";
10
10
  import { BackIcon, BoldIcon, CheckIcon, CodeBlockIcon, CodeIcon, DividerIcon, Heading1Icon, Heading2Icon, Heading3Icon, ItalicIcon, LinkIcon, ListIcon, ListOrderedIcon, ParagraphIcon, QuoteIcon, StrikeIcon, UnderlineIcon, UnlinkIcon } from "./rich-text-icons.js";
@@ -32,7 +32,7 @@ export declare const scrollAreaRootVariants: (props?: ({
32
32
  framed?: boolean | null | undefined;
33
33
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
34
34
  export declare const scrollAreaVariants: (props?: ({
35
- orientation?: "vertical" | "horizontal" | "both" | null | undefined;
35
+ orientation?: "both" | "horizontal" | "vertical" | null | undefined;
36
36
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
37
37
  /**
38
38
  * A scrolling region.
@@ -2,8 +2,8 @@
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { mergeRefs } from "../lib/merge-refs.js";
4
4
  import { prefersReducedMotion, useExitBackstop, useIsomorphicLayoutEffect } from "../lib/motion.js";
5
- import { fieldBoxSize, fieldSurfaceVariants, fieldTextSize } from "../lib/field-surface.js";
6
5
  import { FieldShell, useFieldWiring } from "../lib/field-shell.js";
6
+ import { fieldBoxSize, fieldSurfaceVariants, fieldTextSize } from "../lib/field-surface.js";
7
7
  import { cva } from "class-variance-authority";
8
8
  import { forwardRef, useCallback, useMemo, useRef, useState } from "react";
9
9
  import { Button, Group, Input } from "react-aria-components";
@@ -30,7 +30,7 @@ export declare const selectTriggerVariants: (props?: ({
30
30
  size?: "sm" | "md" | "lg" | null | undefined;
31
31
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
32
32
  export declare const selectPopoverVariants: (props?: ({
33
- reveal?: "fade" | "grow" | null | undefined;
33
+ reveal?: "grow" | "fade" | null | undefined;
34
34
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
35
35
  export declare const selectItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
36
36
  /**
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { cn, cnAll } from "../lib/cn.js";
3
3
  import { useIsomorphicLayoutEffect } from "../lib/motion.js";
4
- import { fieldBoxSize, fieldSurfaceVariants, fieldTextSize } from "../lib/field-surface.js";
5
4
  import { labelVariants } from "../label/label.js";
6
5
  import { RequiredMarker } from "../lib/required-marker.js";
6
+ import { fieldBoxSize, fieldSurfaceVariants, fieldTextSize } from "../lib/field-surface.js";
7
7
  import { RollingValue } from "../lib/rolling-value.js";
8
8
  import { cva } from "class-variance-authority";
9
9
  import { forwardRef, useContext, useState } from "react";
@@ -24,7 +24,7 @@ import { SeparatorProps } from "react-aria-components";
24
24
  * simply never be emitted.
25
25
  */
26
26
  export declare const separatorVariants: (props?: ({
27
- orientation?: "vertical" | "horizontal" | null | undefined;
27
+ orientation?: "horizontal" | "vertical" | null | undefined;
28
28
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
29
29
  /**
30
30
  * A visual divider between two groups of content.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn, cnAll } from "../lib/cn.js";
3
- import { fieldSurfaceVariants } from "../lib/field-surface.js";
4
3
  import { FieldShell, useFieldWiring } from "../lib/field-shell.js";
4
+ import { fieldSurfaceVariants } from "../lib/field-surface.js";
5
5
  import { formatShortcut, keyId, modifiersFromEvent, normalizeShortcut, shortcutFromEvent, shortcutTokens, splitShortcut } from "./shortcut-model.js";
6
6
  import { forwardRef, useCallback, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
7
7
  import { Button } from "react-aria-components";
@@ -51,7 +51,7 @@ export declare const statCardVariants: (props?: ({
51
51
  export declare const statCardHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
52
52
  export declare const statCardLabelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
53
53
  export declare const statCardValueVariants: (props?: ({
54
- tone?: "neutral" | "positive" | "negative" | "warning" | "attention" | null | undefined;
54
+ tone?: "neutral" | "warning" | "positive" | "negative" | "attention" | null | undefined;
55
55
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
56
56
  /** An optional icon before the label. Decorative: the label names the figure. */
57
57
  export declare const statCardIconVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -62,7 +62,7 @@ export declare const statCardSubVariants: (props?: import("class-variance-author
62
62
  * box, and with it the card, keeps the height of the loaded copy.
63
63
  */
64
64
  export declare const statCardSkeletonVariants: (props?: ({
65
- part?: "label" | "value" | "sub" | null | undefined;
65
+ part?: "label" | "sub" | "value" | null | undefined;
66
66
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
67
67
  export type StatCardTone = "neutral" | "positive" | "negative" | "warning" | "attention";
68
68
  /** Which way is good for this figure: up (`normal`), down (`inverse`), or neither (`neutral`). */