@human-kit/ui 1.0.0-beta.5 → 1.0.0-beta.7

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 (255) hide show
  1. package/README.md +19 -17
  2. package/dist/accordion/README.md +3 -3
  3. package/dist/accordion/types.d.ts +37 -23
  4. package/dist/autocomplete/README.md +6 -7
  5. package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
  6. package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
  7. package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
  8. package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
  9. package/dist/autocomplete/item/autocomplete-item.svelte +10 -0
  10. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
  11. package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
  12. package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
  13. package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +2 -2
  14. package/dist/autocomplete/root/autocomplete.svelte +7 -7
  15. package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
  16. package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
  17. package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
  18. package/dist/button/README.md +1 -1
  19. package/dist/button/root/button-root.svelte +24 -10
  20. package/dist/button/root/button-root.svelte.d.ts +15 -10
  21. package/dist/calendar/README.md +3 -3
  22. package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
  23. package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
  24. package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
  25. package/dist/calendar/root/calendar-root.svelte +8 -2
  26. package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
  27. package/dist/calendar/trigger-next/README.md +1 -1
  28. package/dist/calendar/trigger-previous/README.md +1 -1
  29. package/dist/checkbox/README.md +1 -1
  30. package/dist/checkbox/indicator/README.md +1 -1
  31. package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -0
  32. package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
  33. package/dist/checkbox/root/README.md +2 -2
  34. package/dist/checkbox/root/checkbox-root.svelte +118 -40
  35. package/dist/checkbox/root/checkbox-root.svelte.d.ts +17 -10
  36. package/dist/checkbox-group/README.md +95 -0
  37. package/dist/checkbox-group/index.d.ts +15 -0
  38. package/dist/checkbox-group/index.js +6 -0
  39. package/dist/checkbox-group/index.parts.d.ts +4 -0
  40. package/dist/checkbox-group/index.parts.js +7 -0
  41. package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
  42. package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
  43. package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
  44. package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
  45. package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
  46. package/dist/checkbox-group/root/context.svelte.js +251 -0
  47. package/dist/checkbox-group/types.d.ts +57 -0
  48. package/dist/checkbox-group/types.js +1 -0
  49. package/dist/clock/README.md +3 -3
  50. package/dist/clock/axis/README.md +1 -1
  51. package/dist/clock/root/README.md +1 -1
  52. package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
  53. package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
  54. package/dist/collapsible/README.md +3 -3
  55. package/dist/collapsible/types.d.ts +10 -7
  56. package/dist/combobox/README.md +2 -2
  57. package/dist/combobox/button/README.md +6 -6
  58. package/dist/combobox/input/README.md +1 -1
  59. package/dist/combobox/input/combobox-input.svelte +3 -3
  60. package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
  61. package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
  62. package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
  63. package/dist/combobox/item-indicator/README.md +1 -1
  64. package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
  65. package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
  66. package/dist/combobox/list/combobox-listbox.svelte +11 -8
  67. package/dist/combobox/list/combobox-listbox.svelte.d.ts +11 -8
  68. package/dist/combobox/popover/README.md +1 -1
  69. package/dist/combobox/root/README.md +24 -24
  70. package/dist/combobox/root/combobox.svelte +26 -17
  71. package/dist/combobox/root/combobox.svelte.d.ts +26 -17
  72. package/dist/combobox/status/README.md +1 -1
  73. package/dist/combobox/status/combobox-status.svelte +1 -1
  74. package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
  75. package/dist/combobox/tag/README.md +1 -1
  76. package/dist/combobox/tag/combobox-tag.svelte +1 -1
  77. package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
  78. package/dist/combobox/tag-remove/README.md +1 -1
  79. package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
  80. package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
  81. package/dist/combobox/tags/README.md +1 -1
  82. package/dist/combobox/tags/combobox-tags.svelte +11 -11
  83. package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
  84. package/dist/combobox/trigger/README.md +7 -7
  85. package/dist/datepicker/README.md +4 -4
  86. package/dist/datepicker/input/date-picker-input.svelte +3 -4
  87. package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
  88. package/dist/datepicker/root/date-picker-root.svelte +1 -1
  89. package/dist/datepicker/trigger/README.md +1 -1
  90. package/dist/daterangepicker/README.md +3 -3
  91. package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
  92. package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
  93. package/dist/dialog/README.md +1 -1
  94. package/dist/dialog/close/dialog-close.svelte +3 -3
  95. package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
  96. package/dist/dialog/content/dialog-content.svelte +4 -4
  97. package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
  98. package/dist/dialog/description/dialog-description.svelte +3 -3
  99. package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
  100. package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
  101. package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
  102. package/dist/dialog/portal/dialog-portal.svelte +1 -1
  103. package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
  104. package/dist/dialog/root/README.md +1 -1
  105. package/dist/dialog/root/dialog-root.svelte +36 -11
  106. package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
  107. package/dist/dialog/title/dialog-title.svelte +3 -3
  108. package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
  109. package/dist/dialog/trigger/README.md +1 -1
  110. package/dist/drawer/README.md +3 -3
  111. package/dist/drawer/body/drawer-body.svelte +2 -2
  112. package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
  113. package/dist/drawer/close/drawer-close.svelte +3 -3
  114. package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
  115. package/dist/drawer/content/drawer-content.svelte +12 -9
  116. package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
  117. package/dist/drawer/description/drawer-description.svelte +3 -3
  118. package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
  119. package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
  120. package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
  121. package/dist/drawer/indent/drawer-indent.svelte +2 -2
  122. package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
  123. package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
  124. package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
  125. package/dist/drawer/portal/drawer-portal.svelte +1 -1
  126. package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
  127. package/dist/drawer/root/context.d.ts +1 -1
  128. package/dist/drawer/root/drawer-root.svelte +25 -23
  129. package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
  130. package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
  131. package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
  132. package/dist/drawer/title/drawer-title.svelte +3 -3
  133. package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
  134. package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
  135. package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
  136. package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
  137. package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
  138. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
  139. package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
  140. package/dist/dropzone/README.md +4 -6
  141. package/dist/index.d.ts +4 -0
  142. package/dist/index.js +4 -0
  143. package/dist/input/input.svelte +6 -6
  144. package/dist/input/input.svelte.d.ts +6 -6
  145. package/dist/listbox/README.md +3 -10
  146. package/dist/listbox/item/listbox-item.svelte +24 -15
  147. package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
  148. package/dist/listbox/root/README.md +1 -1
  149. package/dist/listbox/root/context.d.ts +1 -1
  150. package/dist/listbox/root/listbox.svelte +50 -38
  151. package/dist/listbox/root/listbox.svelte.d.ts +50 -38
  152. package/dist/locale-provider/README.md +1 -6
  153. package/dist/menu/README.md +6 -15
  154. package/dist/menu/content/menu-content.svelte +14 -10
  155. package/dist/menu/content/menu-content.svelte.d.ts +14 -10
  156. package/dist/menu/context-trigger/menu-context-trigger.svelte +8 -9
  157. package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +8 -9
  158. package/dist/menu/group/menu-group-label.svelte +1 -1
  159. package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
  160. package/dist/menu/item/menu-item.svelte +11 -8
  161. package/dist/menu/item/menu-item.svelte.d.ts +11 -8
  162. package/dist/menu/overlay/menu-overlay.svelte +1 -1
  163. package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
  164. package/dist/menu/root/context.d.ts +6 -3
  165. package/dist/menu/root/menu-root.svelte +14 -8
  166. package/dist/menu/root/menu-root.svelte.d.ts +14 -8
  167. package/dist/menu/root/menu-state.svelte.d.ts +1 -1
  168. package/dist/menu/separator/menu-separator.svelte +1 -1
  169. package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
  170. package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
  171. package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
  172. package/dist/numberfield/root/README.md +1 -1
  173. package/dist/numberfield/scrub-area-cursor/README.md +1 -1
  174. package/dist/popover/README.md +1 -1
  175. package/dist/popover/content/popover-content.svelte +19 -14
  176. package/dist/popover/content/popover-content.svelte.d.ts +19 -14
  177. package/dist/popover/overlay/popover-overlay.svelte +1 -1
  178. package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
  179. package/dist/popover/root/README.md +1 -1
  180. package/dist/popover/root/popover-root.svelte +13 -10
  181. package/dist/popover/root/popover-root.svelte.d.ts +13 -10
  182. package/dist/popover/trigger/README.md +1 -1
  183. package/dist/primitives/floating.d.ts +3 -3
  184. package/dist/primitives/focus-visible.svelte.d.ts +14 -0
  185. package/dist/primitives/focus-visible.svelte.js +19 -0
  186. package/dist/primitives/index.d.ts +1 -0
  187. package/dist/primitives/index.js +1 -0
  188. package/dist/primitives/input-modality.d.ts +7 -0
  189. package/dist/primitives/input-modality.js +32 -5
  190. package/dist/primitives/scroll-lock.js +37 -8
  191. package/dist/radio-group/README.md +103 -0
  192. package/dist/radio-group/index.d.ts +18 -0
  193. package/dist/radio-group/index.js +9 -0
  194. package/dist/radio-group/index.parts.d.ts +4 -0
  195. package/dist/radio-group/index.parts.js +4 -0
  196. package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
  197. package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
  198. package/dist/radio-group/item/context.d.ts +18 -0
  199. package/dist/radio-group/item/context.js +15 -0
  200. package/dist/radio-group/item/radio-group-item.svelte +377 -0
  201. package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
  202. package/dist/radio-group/label/radio-group-label.svelte +37 -0
  203. package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
  204. package/dist/radio-group/root/context.svelte.d.ts +57 -0
  205. package/dist/radio-group/root/context.svelte.js +284 -0
  206. package/dist/radio-group/root/radio-group-root.svelte +193 -0
  207. package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
  208. package/dist/radio-group/types.d.ts +50 -0
  209. package/dist/radio-group/types.js +1 -0
  210. package/dist/switch/root/README.md +2 -2
  211. package/dist/switch/root/switch-root.svelte +32 -18
  212. package/dist/switch/root/switch-root.svelte.d.ts +23 -18
  213. package/dist/switch/thumb/switch-thumb.svelte +1 -1
  214. package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
  215. package/dist/table/README.md +15 -10
  216. package/dist/table/checkbox-indicator/README.md +1 -1
  217. package/dist/table/column-header-cell/table-column-header-cell.svelte +24 -0
  218. package/dist/table/column-resizer/README.md +2 -2
  219. package/dist/table/root/README.md +1 -1
  220. package/dist/table/root/table-root.svelte +29 -6
  221. package/dist/table/sort-trigger/README.md +1 -1
  222. package/dist/table/types.d.ts +21 -20
  223. package/dist/tabs/types.d.ts +6 -6
  224. package/dist/timepicker/README.md +3 -2
  225. package/dist/timepicker/input/README.md +1 -1
  226. package/dist/timepicker/input/time-picker-input.svelte +66 -5
  227. package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -1
  228. package/dist/timepicker/root/README.md +1 -1
  229. package/dist/timepicker/trigger/README.md +1 -1
  230. package/dist/toggle/README.md +1 -1
  231. package/dist/toggle/root/toggle-root.svelte +28 -0
  232. package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
  233. package/dist/toggle-group/README.md +8 -10
  234. package/dist/toggle-group/index.d.ts +2 -0
  235. package/dist/toggle-group/index.parts.d.ts +1 -0
  236. package/dist/toggle-group/index.parts.js +4 -0
  237. package/dist/toggle-group/types.d.ts +7 -6
  238. package/dist/transfer-list/README.md +6 -17
  239. package/dist/transfer-list/item/transfer-list-item.svelte +4 -4
  240. package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +4 -4
  241. package/dist/transfer-list/list/transfer-list-list.svelte +12 -12
  242. package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +12 -12
  243. package/dist/transfer-list/move/transfer-list-move-button.svelte +4 -4
  244. package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +4 -4
  245. package/dist/transfer-list/move/transfer-list-reorder-button.svelte +3 -3
  246. package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +3 -3
  247. package/dist/transfer-list/root/transfer-list-root.svelte +23 -20
  248. package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +23 -20
  249. package/dist/transfer-list/status/transfer-list-status.svelte +1 -1
  250. package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +1 -1
  251. package/dist/tree/README.md +3 -3
  252. package/dist/tree/checkbox-indicator/README.md +1 -1
  253. package/dist/tree/root/README.md +1 -1
  254. package/dist/tree/types.d.ts +19 -10
  255. package/package.json +11 -1
@@ -8,33 +8,38 @@ import { type PopoverOpenChangeDetails } from '../root/context';
8
8
  * Can be used inside Popover.Root (reads context) or standalone (props required).
9
9
  */
10
10
  type PopoverContentProps = {
11
- /** Offset along the main axis from the anchor element. */
11
+ /** The distance from the anchor element, on the main axis. */
12
12
  offset?: number;
13
- /** Placement relative to the anchor element. */
13
+ /** The position against the anchor element. */
14
14
  placement?: ExtendedPlacement;
15
- /** Whether to flip when there's insufficient space. */
15
+ /** Moves the panel to the opposite side when the space is not sufficient. */
16
16
  shouldFlip?: boolean;
17
- /** Boundary element for positioning constraints. */
17
+ /** The element that gives the limits of the position. */
18
18
  boundaryElement?: Element | null;
19
- /** Content of the popover. */
19
+ /** The content of the popover. */
20
20
  children?: Snippet;
21
- /** CSS class for the popover container. */
21
+ /** The CSS class names of the popover container. */
22
22
  class?: string;
23
- /** Whether the popover is non-modal (allows outside interaction, no focus trap, no scroll lock). */
23
+ /**
24
+ * Makes the popover non-modal. The user can then operate the page, the focus does not stay in
25
+ * the panel, and the page scrolls.
26
+ */
24
27
  nonModal?: boolean;
25
- /** Whether clicking outside the popover should close it. */
28
+ /** Closes the popover when the user clicks outside it. */
26
29
  shouldCloseOnInteractOutside?: boolean;
27
- /** Whether pressing Escape should close the popover. */
30
+ /** Closes the popover when the user pushes the `Escape` key. */
28
31
  shouldCloseOnEscape?: boolean;
29
- /** Whether losing focus (blur) should close the popover. Defaults to true for non-modal popovers. */
32
+ /**
33
+ * Closes the popover when the focus goes out of it. The default is true for a non-modal popover.
34
+ */
30
35
  shouldCloseOnBlur?: boolean;
31
- /** Element or selector to focus first when modal trap activates. */
36
+ /** The element, or the selector of the element, that gets the focus first in the modal mode. */
32
37
  initialFocus?: FocusTrapOptions['initialFocus'];
33
- /** Controlled open state (standalone mode). */
38
+ /** The open state, when you use the part alone. */
34
39
  open?: boolean;
35
- /** Reference to the trigger element (standalone mode). */
40
+ /** The reference to the trigger element, when you use the part alone. */
36
41
  triggerRef?: HTMLElement | null;
37
- /** Callback when open state changes (standalone mode). */
42
+ /** The component calls it when the open state changes, when you use the part alone. */
38
43
  onOpenChange?: (open: boolean, details: PopoverOpenChangeDetails) => void;
39
44
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
40
45
  declare const PopoverContent: import("svelte").Component<PopoverContentProps, {}, "">;
@@ -14,7 +14,7 @@
14
14
  * keeping it mounted through its exit animation so it fades in step with the panel.
15
15
  */
16
16
  type PopoverOverlayProps = {
17
- /** CSS class for the overlay. */
17
+ /** The CSS class names of the overlay. */
18
18
  class?: string;
19
19
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
20
20
 
@@ -8,7 +8,7 @@ import type { HTMLAttributes } from 'svelte/elements';
8
8
  * keeping it mounted through its exit animation so it fades in step with the panel.
9
9
  */
10
10
  type PopoverOverlayProps = {
11
- /** CSS class for the overlay. */
11
+ /** The CSS class names of the overlay. */
12
12
  class?: string;
13
13
  } & Omit<HTMLAttributes<HTMLDivElement>, 'class'>;
14
14
  declare const PopoverOverlay: import("svelte").Component<PopoverOverlayProps, {}, "">;
@@ -7,7 +7,7 @@
7
7
  Name: `Popover.Root`
8
8
  Description: Root state container that controls open state, trigger ref, and toggle/open/close actions.
9
9
 
10
- - `open`: `boolean` (default: `undefined`) — Controlled open state. Supports `bind:open`.
10
+ - `open`: `boolean` (default: `undefined`) — The open state. Supports `bind:open`.
11
11
  - `defaultOpen`: `boolean` (default: `false`) — Initial open state in uncontrolled mode.
12
12
  - `onOpenChange`: `(open: boolean, details) => void` (default: `undefined`) — Called whenever open state changes. `details` includes `reason`, optional `event`, `cancel()`, and `isCanceled`.
13
13
  - `triggerRef`: `HTMLElement | null` (default: `null`) — Trigger reference. Supports `bind:triggerRef`.
@@ -21,23 +21,26 @@
21
21
  * Provides context for Trigger and Content children.
22
22
  */
23
23
  type PopoverRootProps = {
24
- /** Open state. Two-way by default — use `bind:open`. */
24
+ /** The open state. By default it goes in the two directions: use `bind:open`. */
25
25
  open?: boolean;
26
- /** Initial open state, for when `open` is not supplied. */
26
+ /** The open state at the start, for when you give no `open`. */
27
27
  defaultOpen?: boolean;
28
28
  /**
29
- * Opt into fully controlled state: the component stops writing back to `open` and
30
- * only reports through `onOpenChange`, so the parent can reject a change by not
31
- * flowing the new value back down. Off by default, because `bind:open` — the
32
- * common case — needs the write-back to work at all. For one-off rejections
33
- * prefer `details.cancel()`, which works in either mode.
29
+ * Give your own code full control of the open state. The component stops to write back to
30
+ * `open`, and it reports only through `onOpenChange`. Thus the parent can refuse a change: the
31
+ * parent does not send the new value down. The default is off, because `bind:open` is the usual
32
+ * case and it needs the write-back.
33
+ *
34
+ * To refuse one change, use `details.cancel()`. That function works in the two modes.
34
35
  */
35
36
  controlledOpen?: boolean;
36
- /** Callback when open state changes. */
37
+ /** The component calls it when the open state changes. */
37
38
  onOpenChange?: (open: boolean, details: PopoverOpenChangeDetails) => void;
38
- /** Reference to the trigger element. Can be set manually or via Popover.Trigger. */
39
+ /**
40
+ * The reference to the trigger element. Set it in your own code, or let Popover.Trigger set it.
41
+ */
39
42
  triggerRef?: HTMLElement | null;
40
- /** Children (Trigger and Content) */
43
+ /** The children: the Trigger and the Content. */
41
44
  children?: Snippet;
42
45
  };
43
46
 
@@ -5,23 +5,26 @@ import { type PopoverOpenChangeDetails } from './context';
5
5
  * Provides context for Trigger and Content children.
6
6
  */
7
7
  type PopoverRootProps = {
8
- /** Open state. Two-way by default — use `bind:open`. */
8
+ /** The open state. By default it goes in the two directions: use `bind:open`. */
9
9
  open?: boolean;
10
- /** Initial open state, for when `open` is not supplied. */
10
+ /** The open state at the start, for when you give no `open`. */
11
11
  defaultOpen?: boolean;
12
12
  /**
13
- * Opt into fully controlled state: the component stops writing back to `open` and
14
- * only reports through `onOpenChange`, so the parent can reject a change by not
15
- * flowing the new value back down. Off by default, because `bind:open` — the
16
- * common case — needs the write-back to work at all. For one-off rejections
17
- * prefer `details.cancel()`, which works in either mode.
13
+ * Give your own code full control of the open state. The component stops to write back to
14
+ * `open`, and it reports only through `onOpenChange`. Thus the parent can refuse a change: the
15
+ * parent does not send the new value down. The default is off, because `bind:open` is the usual
16
+ * case and it needs the write-back.
17
+ *
18
+ * To refuse one change, use `details.cancel()`. That function works in the two modes.
18
19
  */
19
20
  controlledOpen?: boolean;
20
- /** Callback when open state changes. */
21
+ /** The component calls it when the open state changes. */
21
22
  onOpenChange?: (open: boolean, details: PopoverOpenChangeDetails) => void;
22
- /** Reference to the trigger element. Can be set manually or via Popover.Trigger. */
23
+ /**
24
+ * The reference to the trigger element. Set it in your own code, or let Popover.Trigger set it.
25
+ */
23
26
  triggerRef?: HTMLElement | null;
24
- /** Children (Trigger and Content) */
27
+ /** The children: the Trigger and the Content. */
25
28
  children?: Snippet;
26
29
  };
27
30
  declare const PopoverRoot: import("svelte").Component<PopoverRootProps, {}, "open" | "triggerRef">;
@@ -9,6 +9,6 @@ Description: Button trigger part that wires itself as the trigger and toggles th
9
9
 
10
10
  | Prop | Type | Default | Description |
11
11
  | -------------- | ---------------------- | ----------- | -------------------------------------------------------------------------- |
12
- | `children` | `Snippet` | `undefined` | Button content. |
12
+ | `children` | `Snippet` | `undefined` | The content of the button. |
13
13
  | `class` | `string` | `''` | CSS class names for the button. |
14
14
  | `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes, excluding reserved trigger semantics. |
@@ -42,11 +42,11 @@ export type ExtendedPlacement = Placement | 'bottom left' | 'bottom right' | 'to
42
42
  export type FloatingOptions = {
43
43
  /** Offset along the main axis from the anchor. */
44
44
  offset?: number;
45
- /** Placement relative to the anchor element. */
45
+ /** The position against the anchor element. */
46
46
  placement?: ExtendedPlacement;
47
- /** Whether to flip when there's insufficient space. */
47
+ /** Moves the panel to the opposite side when the space is not sufficient. */
48
48
  shouldFlip?: boolean;
49
- /** Boundary element for positioning constraints. */
49
+ /** The element that gives the limits of the position. */
50
50
  boundaryElement?: Element | null;
51
51
  /**
52
52
  * Minimum gap kept between the floating element and the boundary edges, in
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Keeps a `focusVisible` value honest while the element holds focus.
3
+ *
4
+ * `shouldShowFocusVisible` reads the modality at the moment it is called, so a component that
5
+ * only calls it from its focus handler holds a snapshot. A pointer press seeds `false`, and a
6
+ * key press after it flips the modality — and the `:focus-visible` of the browser — with nothing
7
+ * to tell the component. This subscribes for as long as the element has focus, and it re-reads
8
+ * on each change, which is what React Aria and Base UI do.
9
+ */
10
+ export declare function watchFocusVisible(options: {
11
+ isFocused: () => boolean;
12
+ element: () => HTMLElement | null;
13
+ set: (focusVisible: boolean) => void;
14
+ }): void;
@@ -0,0 +1,19 @@
1
+ import { shouldShowFocusVisible, subscribeInputModality } from './input-modality.js';
2
+ /**
3
+ * Keeps a `focusVisible` value honest while the element holds focus.
4
+ *
5
+ * `shouldShowFocusVisible` reads the modality at the moment it is called, so a component that
6
+ * only calls it from its focus handler holds a snapshot. A pointer press seeds `false`, and a
7
+ * key press after it flips the modality — and the `:focus-visible` of the browser — with nothing
8
+ * to tell the component. This subscribes for as long as the element has focus, and it re-reads
9
+ * on each change, which is what React Aria and Base UI do.
10
+ */
11
+ export function watchFocusVisible(options) {
12
+ $effect(() => {
13
+ if (!options.isFocused())
14
+ return;
15
+ return subscribeInputModality(() => {
16
+ options.set(shouldShowFocusVisible(options.element()));
17
+ });
18
+ });
19
+ }
@@ -6,5 +6,6 @@ export * from './scroll-lock.js';
6
6
  export * from './aria-hide-outside.js';
7
7
  export * from './click-outside.js';
8
8
  export * from './input-modality.js';
9
+ export * from './focus-visible.svelte.js';
9
10
  export * from './long-press.js';
10
11
  export * from './swipe-gesture.js';
@@ -7,5 +7,6 @@ export * from './scroll-lock.js';
7
7
  export * from './aria-hide-outside.js';
8
8
  export * from './click-outside.js';
9
9
  export * from './input-modality.js';
10
+ export * from './focus-visible.svelte.js';
10
11
  export * from './long-press.js';
11
12
  export * from './swipe-gesture.js';
@@ -2,6 +2,13 @@ export type InputModality = 'keyboard' | 'pointer' | 'virtual';
2
2
  export declare function initInputModality(target?: HTMLElement | null): void;
3
3
  export declare function trackInteractionModality(event?: Event, target?: HTMLElement | null): void;
4
4
  export declare function getInteractionModality(): InputModality;
5
+ /**
6
+ * Calls `listener` whenever the interaction modality changes, and returns the unsubscribe
7
+ * function. Components use it to re-read `shouldShowFocusVisible` for an element that already
8
+ * holds focus: the browser re-evaluates `:focus-visible` on its own, and this is what lets a
9
+ * component notice.
10
+ */
11
+ export declare function subscribeInputModality(listener: (modality: InputModality) => void): () => void;
5
12
  export declare function shouldShowFocusVisible(target: HTMLElement | null): boolean;
6
13
  export declare function focusWithModality(target: HTMLElement, modality: InputModality, options?: FocusOptions): void;
7
14
  export declare function resolveCloseInteractionModality(reason: string, event?: Event): InputModality;
@@ -8,6 +8,20 @@ let currentModality = 'virtual';
8
8
  const RECENT_INPUT_WINDOW_MS = 50;
9
9
  let lastInputEventTime = Number.NEGATIVE_INFINITY;
10
10
  const listenedWindows = new WeakSet();
11
+ /**
12
+ * Notified whenever the modality changes. `data-focus-visible` is otherwise a snapshot taken
13
+ * when the element took focus, so a pointer press followed by a key press left the ring off
14
+ * while the browser had already flipped `:focus-visible` back on.
15
+ */
16
+ const modalityListeners = new Set();
17
+ function setModality(next) {
18
+ if (currentModality === next)
19
+ return;
20
+ currentModality = next;
21
+ for (const listener of [...modalityListeners]) {
22
+ listener(next);
23
+ }
24
+ }
11
25
  let forcedFocusTarget = null;
12
26
  let forcedFocusModality = null;
13
27
  function isModifierOnlyKey(event) {
@@ -29,11 +43,11 @@ function ensureWindowListeners(win) {
29
43
  lastInputEventTime = Date.now();
30
44
  if (!isKeyboardModalityKey(event))
31
45
  return;
32
- currentModality = 'keyboard';
46
+ setModality('keyboard');
33
47
  };
34
48
  const onPointerDown = () => {
35
49
  lastInputEventTime = Date.now();
36
- currentModality = 'pointer';
50
+ setModality('pointer');
37
51
  };
38
52
  const onFocusIn = (event) => {
39
53
  // A programmatic focus with an explicit modality (`focusWithModality`) must keep it —
@@ -45,7 +59,7 @@ function ensureWindowListeners(win) {
45
59
  return;
46
60
  // No recent keyboard/pointer input: this focus move came from an assistive technology
47
61
  // (or a script), so focus rings must show again.
48
- currentModality = 'virtual';
62
+ setModality('virtual');
49
63
  };
50
64
  win.addEventListener('keydown', onKeyDown, true);
51
65
  win.addEventListener('pointerdown', onPointerDown, true);
@@ -90,12 +104,25 @@ export function trackInteractionModality(event, target) {
90
104
  initInputModality(target);
91
105
  const inferred = inferModalityFromEvent(event);
92
106
  if (inferred) {
93
- currentModality = inferred;
107
+ setModality(inferred);
94
108
  }
95
109
  }
96
110
  export function getInteractionModality() {
97
111
  return currentModality;
98
112
  }
113
+ /**
114
+ * Calls `listener` whenever the interaction modality changes, and returns the unsubscribe
115
+ * function. Components use it to re-read `shouldShowFocusVisible` for an element that already
116
+ * holds focus: the browser re-evaluates `:focus-visible` on its own, and this is what lets a
117
+ * component notice.
118
+ */
119
+ export function subscribeInputModality(listener) {
120
+ initInputModality();
121
+ modalityListeners.add(listener);
122
+ return () => {
123
+ modalityListeners.delete(listener);
124
+ };
125
+ }
99
126
  export function shouldShowFocusVisible(target) {
100
127
  if (!target)
101
128
  return false;
@@ -111,7 +138,7 @@ export function focusWithModality(target, modality, options) {
111
138
  // If it is consumed later, currentModality still preserves the same modality as fallback.
112
139
  forcedFocusTarget = target;
113
140
  forcedFocusModality = modality;
114
- currentModality = modality;
141
+ setModality(modality);
115
142
  if (modality === 'pointer') {
116
143
  const pointerFocusOptions = {
117
144
  ...(options ?? {}),
@@ -31,9 +31,27 @@ let originalRight = '';
31
31
  let savedScrollX = 0;
32
32
  let savedScrollY = 0;
33
33
  // The overlay nodes whose inner scroll regions stay live while the background is
34
- // frozen. A Set (rather than just the lock count) so the event handlers can tell
35
- // an overlay-targeted scroll from a background one.
36
- const overlayNodes = new Set();
34
+ // frozen, each with the number of registrations holding it there. The handlers
35
+ // need this list (rather than just the lock count) to tell an overlay-targeted
36
+ // scroll from a background one.
37
+ //
38
+ // Counted, not a plain Set, because one node can be registered twice: a modal
39
+ // `Popover.Content` carries `scrollLock` AND `allowScrollWithin`, and the second
40
+ // action's "off" state used to delete the entry the first one had just added —
41
+ // leaving the lock on with no live scroll region, so every wheel inside the
42
+ // panel was cancelled as if it were the background.
43
+ const overlayNodes = new Map();
44
+ function retainOverlay(node) {
45
+ overlayNodes.set(node, (overlayNodes.get(node) ?? 0) + 1);
46
+ }
47
+ function releaseOverlay(node) {
48
+ const remaining = (overlayNodes.get(node) ?? 0) - 1;
49
+ if (remaining > 0) {
50
+ overlayNodes.set(node, remaining);
51
+ return;
52
+ }
53
+ overlayNodes.delete(node);
54
+ }
37
55
  function getScrollbarWidth() {
38
56
  return window.innerWidth - document.documentElement.clientWidth;
39
57
  }
@@ -51,7 +69,7 @@ function reservesStableGutter() {
51
69
  function overlayContaining(target) {
52
70
  if (!(target instanceof Node))
53
71
  return null;
54
- for (const node of overlayNodes) {
72
+ for (const node of overlayNodes.keys()) {
55
73
  if (node.contains(target))
56
74
  return node;
57
75
  }
@@ -79,6 +97,10 @@ function scrollableWithin(target, root) {
79
97
  function onWheel(event) {
80
98
  if (!event.cancelable)
81
99
  return;
100
+ // A wheel with Ctrl held is the browser's zoom gesture, not a scroll. Cancelling
101
+ // it took page zoom away from the user for as long as any overlay was open.
102
+ if (event.ctrlKey)
103
+ return;
82
104
  const overlay = overlayContaining(event.target);
83
105
  if (!overlay) {
84
106
  // Background scroll — freeze it.
@@ -133,7 +155,7 @@ function removeEventBlockers() {
133
155
  document.removeEventListener('touchmove', onTouchMove, { capture: true });
134
156
  }
135
157
  function lock(node) {
136
- overlayNodes.add(node);
158
+ retainOverlay(node);
137
159
  if (lockCount === 0) {
138
160
  const body = document.body;
139
161
  originalOverflow = body.style.overflow;
@@ -162,7 +184,7 @@ function lock(node) {
162
184
  lockCount++;
163
185
  }
164
186
  function unlock(node) {
165
- overlayNodes.delete(node);
187
+ releaseOverlay(node);
166
188
  lockCount--;
167
189
  if (lockCount === 0) {
168
190
  const body = document.body;
@@ -232,12 +254,19 @@ export function scrollLock(node, enabled = true) {
232
254
  * ```
233
255
  */
234
256
  export function allowScrollWithin(node, enabled = true) {
257
+ // Only ever releases what it took. Registering is counted, so an action that
258
+ // is off must not release a registration it never made — on a modal popover
259
+ // that entry belongs to `scrollLock`, on the very same node.
260
+ let registered = false;
235
261
  const register = (on) => {
262
+ if (on === registered)
263
+ return;
264
+ registered = on;
236
265
  if (on) {
237
- overlayNodes.add(node);
266
+ retainOverlay(node);
238
267
  }
239
268
  else {
240
- overlayNodes.delete(node);
269
+ releaseOverlay(node);
241
270
  }
242
271
  };
243
272
  register(enabled);
@@ -0,0 +1,103 @@
1
+ # RadioGroup
2
+
3
+ ## Description
4
+
5
+ `RadioGroup` coordinates a set of `RadioGroup.Item` buttons as one field. It holds a single value, and
6
+ it shares a `name` for form submission. It also spreads group-wide disabled, read-only and required
7
+ state, and it controls the roving focus the pattern asks for.
8
+
9
+ ## Anatomy
10
+
11
+ - `RadioGroup.Root`
12
+ - `RadioGroup.Label`
13
+ - `RadioGroup.Item`
14
+ - `RadioGroup.Indicator`
15
+
16
+ ```svelte
17
+ <RadioGroup.Root name="size" defaultValue="medium">
18
+ <RadioGroup.Label>Size</RadioGroup.Label>
19
+ <RadioGroup.Item value="small">
20
+ <RadioGroup.Indicator>x</RadioGroup.Indicator>
21
+ Small
22
+ </RadioGroup.Item>
23
+ <RadioGroup.Item value="medium">
24
+ <RadioGroup.Indicator>x</RadioGroup.Indicator>
25
+ Medium
26
+ </RadioGroup.Item>
27
+ </RadioGroup.Root>
28
+ ```
29
+
30
+ ## Usage guidelines
31
+
32
+ - Use `bind:value` to hand the group your state, or plain `value` + `onChange` to own it yourself.
33
+ There is no flag to declare which: supplying `value` makes it the source of truth either way, and
34
+ `onChange` always reports.
35
+ - A parent that holds `value` and refuses a change — it sends no new value down — still sees the
36
+ group move. The group then goes back to the value of the parent at the next render.
37
+ - Give the group a `name` to submit the answer as one field.
38
+ - Every `RadioGroup.Item` must provide a unique `value`, and it must sit inside a `RadioGroup.Root`. A
39
+ radio on its own has nothing to answer, and the component reports that rather than guessing.
40
+
41
+ ## API reference
42
+
43
+ `RadioGroup.Root` supports:
44
+
45
+ - `value?: string | null`
46
+ - `defaultValue?: string | null`
47
+ - `onChange?: (value: string) => void`
48
+ - `name?: string`
49
+ - `form?: string`
50
+ - `disabled?: boolean`
51
+ - `readonly?: boolean`
52
+ - `required?: boolean`
53
+ - `orientation?: 'horizontal' | 'vertical'`
54
+ - `context?: RadioGroupContext`
55
+ - `children?: Snippet`
56
+ - `...restProps: HTMLAttributes<HTMLDivElement>`
57
+
58
+ `RadioGroup.Item` supports `value` (required), `disabled`, `children`, `class`, `element` and the
59
+ usual `HTMLAttributes<HTMLSpanElement>`. It makes a span with `role="radio"` and a hidden radio
60
+ input for the form.
61
+
62
+ `RadioGroup.Indicator` supports `forceMount`. It is in the DOM only while its radio is checked.
63
+
64
+ `RadioGroup.Label` supports `children`, `class`, `id` and the usual `HTMLAttributes<HTMLSpanElement>`.
65
+ It renders a span, and it registers its id with the group as `aria-labelledby`.
66
+
67
+ ## Accessibility
68
+
69
+ - `RadioGroup.Root` renders `role="radiogroup"`, with `aria-orientation`, `aria-required`,
70
+ `aria-disabled` and `aria-readonly`. That role supports all four, which the plain `group` role of
71
+ a checkbox group does not.
72
+ - Give the group an accessible name with `RadioGroup.Label`, or with `aria-label` on the root for a
73
+ name the user does not see. Two labels read as one name, in the order they appear. An
74
+ `aria-labelledby` that the caller gives stands, thus an element of your own wins.
75
+ - `RadioGroup.Label` renders a span, and not a `<label>`: a `<label>` names one control, thus it
76
+ cannot name a set.
77
+ - The id reaches the group through the context. The server cannot do that: the group tag is
78
+ already written when the label registers. Thus `aria-labelledby` appears at hydration. Give
79
+ `aria-label` as well when the name must be there on the first paint.
80
+ - The group holds **one** tab stop, on the checked radio, and on the first enabled radio while
81
+ nothing is checked. Thus Tab enters the group where the user left it, and Tab leaves the group
82
+ rather than walking through it.
83
+ - The arrow keys move the focus **and** the selection, and they wrap at both ends. `Home` and `End`
84
+ jump to the bounds. Both axes work in either orientation, the way a native radio group does.
85
+ - `Space` selects the focused radio. `Enter` does not: it submits the form of a native radio.
86
+ - `aria-readonly` and `aria-required` are on the group, and never on an item: the `radio` role
87
+ does not support them.
88
+ - Give each radio an accessible name with its content, `aria-label` or `aria-labelledby`.
89
+
90
+ ## Notes
91
+
92
+ - There is no unselecting. The platform gives the user no way to take a radio answer back, so a
93
+ second press on the selected radio reports nothing.
94
+ - A radio that leaves a mounted group keeps its value in the group. Its hidden input goes with it,
95
+ so the form stops submitting that answer, which is what a native radio group does. A parent
96
+ that holds the value keeps it. The group gives the tab stop to the first enabled radio.
97
+ - Values are strings only. A radio carries its value on a native `<input>`, which stores it as a
98
+ string. A number would thus let `value={1}` miss a radio declared as `value="1"`.
99
+ - Both parts show each visual state in `data-*` attributes: `data-checked`, `data-unchecked`,
100
+ `data-pressed`, `data-disabled`, `data-readonly`, `data-required`, `data-focused` and
101
+ `data-focus-visible`.
102
+ - The selection follows the focus. This is the rule that parts a radio group from every other group
103
+ in this library. In a `ToggleGroup` or a `CheckboxGroup` the arrows only move.
@@ -0,0 +1,18 @@
1
+ import type { ComponentProps } from 'svelte';
2
+ import type RadioGroupIndicatorComponent from './indicator/radio-group-indicator.svelte';
3
+ import type RadioGroupLabelComponent from './label/radio-group-label.svelte';
4
+ import type RadioGroupItemComponent from './item/radio-group-item.svelte';
5
+ import type RadioGroupRootComponent from './root/radio-group-root.svelte';
6
+ export * as RadioGroup from './index.parts.js';
7
+ export { default as RadioGroupRoot } from './root/radio-group-root.svelte';
8
+ export { default as RadioGroupLabel } from './label/radio-group-label.svelte';
9
+ export { default as RadioGroupItem } from './item/radio-group-item.svelte';
10
+ export { default as RadioGroupIndicator } from './indicator/radio-group-indicator.svelte';
11
+ export type RadioGroupRootProps = ComponentProps<typeof RadioGroupRootComponent>;
12
+ export type RadioGroupLabelProps = ComponentProps<typeof RadioGroupLabelComponent>;
13
+ export type RadioGroupItemProps = ComponentProps<typeof RadioGroupItemComponent>;
14
+ export type RadioGroupIndicatorProps = ComponentProps<typeof RadioGroupIndicatorComponent>;
15
+ export { createRadioGroupContext, getRadioGroupContext, setRadioGroupContext, useRadioGroupContext, type CreateRadioGroupContextOptions, type RadioGroupContext, type RadioGroupOrientation, type RadioGroupValue } from './root/context.svelte';
16
+ export { getRadioGroupItemContext, setRadioGroupItemContext, useRadioGroupItemContext, type RadioGroupItemContext, type RadioGroupItemState } from './item/context.js';
17
+ import * as RadioGroupParts from './index.parts.js';
18
+ export default RadioGroupParts;
@@ -0,0 +1,9 @@
1
+ export * as RadioGroup from './index.parts.js';
2
+ export { default as RadioGroupRoot } from './root/radio-group-root.svelte';
3
+ export { default as RadioGroupLabel } from './label/radio-group-label.svelte';
4
+ export { default as RadioGroupItem } from './item/radio-group-item.svelte';
5
+ export { default as RadioGroupIndicator } from './indicator/radio-group-indicator.svelte';
6
+ export { createRadioGroupContext, getRadioGroupContext, setRadioGroupContext, useRadioGroupContext } from './root/context.svelte';
7
+ export { getRadioGroupItemContext, setRadioGroupItemContext, useRadioGroupItemContext } from './item/context.js';
8
+ import * as RadioGroupParts from './index.parts.js';
9
+ export default RadioGroupParts;
@@ -0,0 +1,4 @@
1
+ export { default as Root } from './root/radio-group-root.svelte';
2
+ export { default as Label } from './label/radio-group-label.svelte';
3
+ export { default as Item } from './item/radio-group-item.svelte';
4
+ export { default as Indicator } from './indicator/radio-group-indicator.svelte';
@@ -0,0 +1,4 @@
1
+ export { default as Root } from './root/radio-group-root.svelte';
2
+ export { default as Label } from './label/radio-group-label.svelte';
3
+ export { default as Item } from './item/radio-group-item.svelte';
4
+ export { default as Indicator } from './indicator/radio-group-indicator.svelte';
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { Snippet } from 'svelte';
4
+ import { useRadioGroupItemContext } from '../item/context';
5
+
6
+ type RadioGroupIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'class'> & {
7
+ /** Keeps the indicator in the DOM while the radio is not checked, for exit animations. */
8
+ forceMount?: boolean;
9
+ /** The mark itself. */
10
+ children?: Snippet;
11
+ class?: string;
12
+ };
13
+
14
+ let {
15
+ forceMount = false,
16
+ children,
17
+ class: className = '',
18
+ ...restProps
19
+ }: RadioGroupIndicatorProps = $props();
20
+
21
+ const radio = useRadioGroupItemContext();
22
+ const visible = $derived(radio.isChecked);
23
+ </script>
24
+
25
+ {#if forceMount || visible}
26
+ <span
27
+ {...restProps}
28
+ data-radio-group-indicator="true"
29
+ data-checked={radio.isChecked || undefined}
30
+ data-unchecked={!radio.isChecked || undefined}
31
+ data-pressed={radio.pressed || undefined}
32
+ data-disabled={radio.isDisabled || undefined}
33
+ data-readonly={radio.isReadOnly || undefined}
34
+ data-required={radio.required || undefined}
35
+ data-focused={radio.focused || undefined}
36
+ data-focus-visible={radio.focusVisible || undefined}
37
+ hidden={forceMount && !visible}
38
+ aria-hidden={forceMount && !visible ? 'true' : undefined}
39
+ class={className}
40
+ >
41
+ {@render children?.()}
42
+ </span>
43
+ {/if}
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { Snippet } from 'svelte';
3
+ type RadioGroupIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'class'> & {
4
+ /** Keeps the indicator in the DOM while the radio is not checked, for exit animations. */
5
+ forceMount?: boolean;
6
+ /** The mark itself. */
7
+ children?: Snippet;
8
+ class?: string;
9
+ };
10
+ declare const RadioGroupIndicator: import("svelte").Component<RadioGroupIndicatorProps, {}, "">;
11
+ type RadioGroupIndicator = ReturnType<typeof RadioGroupIndicator>;
12
+ export default RadioGroupIndicator;