macbetter 0.0.0-stage → 0.1.0-beta.1

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 (251) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +92 -2
  3. package/dist/components/accessory-tile.d.ts +50 -0
  4. package/dist/components/accessory-tile.js +46 -0
  5. package/dist/components/activity-indicator.d.ts +15 -0
  6. package/dist/components/activity-indicator.js +15 -0
  7. package/dist/components/alert.d.ts +29 -0
  8. package/dist/components/alert.js +30 -0
  9. package/dist/components/artwork.d.ts +44 -0
  10. package/dist/components/artwork.js +935 -0
  11. package/dist/components/automation-row.d.ts +24 -0
  12. package/dist/components/automation-row.js +12 -0
  13. package/dist/components/avatar.d.ts +33 -0
  14. package/dist/components/avatar.js +45 -0
  15. package/dist/components/badge.d.ts +24 -0
  16. package/dist/components/badge.js +19 -0
  17. package/dist/components/button.d.ts +20 -0
  18. package/dist/components/button.js +10 -0
  19. package/dist/components/calendar.d.ts +30 -0
  20. package/dist/components/calendar.js +47 -0
  21. package/dist/components/camera-view.d.ts +40 -0
  22. package/dist/components/camera-view.js +44 -0
  23. package/dist/components/card.d.ts +14 -0
  24. package/dist/components/card.js +21 -0
  25. package/dist/components/carousel.d.ts +18 -0
  26. package/dist/components/carousel.js +33 -0
  27. package/dist/components/checkbox.d.ts +13 -0
  28. package/dist/components/checkbox.js +16 -0
  29. package/dist/components/code-field.d.ts +16 -0
  30. package/dist/components/code-field.js +29 -0
  31. package/dist/components/color-well.d.ts +23 -0
  32. package/dist/components/color-well.js +27 -0
  33. package/dist/components/combo-box.d.ts +42 -0
  34. package/dist/components/combo-box.js +102 -0
  35. package/dist/components/command-palette.d.ts +33 -0
  36. package/dist/components/command-palette.js +55 -0
  37. package/dist/components/context-menu.d.ts +9 -0
  38. package/dist/components/context-menu.js +15 -0
  39. package/dist/components/date-picker.d.ts +53 -0
  40. package/dist/components/date-picker.js +86 -0
  41. package/dist/components/device-frame.d.ts +18 -0
  42. package/dist/components/device-frame.js +16 -0
  43. package/dist/components/dialog.d.ts +27 -0
  44. package/dist/components/dialog.js +35 -0
  45. package/dist/components/disclosure.d.ts +32 -0
  46. package/dist/components/disclosure.js +35 -0
  47. package/dist/components/dock.d.ts +28 -0
  48. package/dist/components/dock.js +80 -0
  49. package/dist/components/door-control.d.ts +20 -0
  50. package/dist/components/door-control.js +43 -0
  51. package/dist/components/energy-readout.d.ts +32 -0
  52. package/dist/components/energy-readout.js +27 -0
  53. package/dist/components/field.d.ts +28 -0
  54. package/dist/components/field.js +32 -0
  55. package/dist/components/gauge.d.ts +25 -0
  56. package/dist/components/gauge.js +42 -0
  57. package/dist/components/glass.d.ts +34 -0
  58. package/dist/components/glass.js +31 -0
  59. package/dist/components/home-backdrop.d.ts +23 -0
  60. package/dist/components/home-backdrop.js +12 -0
  61. package/dist/components/home-section.d.ts +19 -0
  62. package/dist/components/home-section.js +21 -0
  63. package/dist/components/home-status.d.ts +24 -0
  64. package/dist/components/home-status.js +14 -0
  65. package/dist/components/hover-card.d.ts +14 -0
  66. package/dist/components/hover-card.js +16 -0
  67. package/dist/components/level-control.d.ts +19 -0
  68. package/dist/components/level-control.js +13 -0
  69. package/dist/components/light-color-picker.d.ts +33 -0
  70. package/dist/components/light-color-picker.js +56 -0
  71. package/dist/components/list.d.ts +42 -0
  72. package/dist/components/list.js +42 -0
  73. package/dist/components/listbox.d.ts +16 -0
  74. package/dist/components/listbox.js +28 -0
  75. package/dist/components/lock-control.d.ts +20 -0
  76. package/dist/components/lock-control.js +35 -0
  77. package/dist/components/menu-bar.d.ts +14 -0
  78. package/dist/components/menu-bar.js +16 -0
  79. package/dist/components/menu.d.ts +40 -0
  80. package/dist/components/menu.js +54 -0
  81. package/dist/components/navigation-bar.d.ts +24 -0
  82. package/dist/components/navigation-bar.js +54 -0
  83. package/dist/components/outline.d.ts +21 -0
  84. package/dist/components/outline.js +40 -0
  85. package/dist/components/page-control.d.ts +10 -0
  86. package/dist/components/page-control.js +8 -0
  87. package/dist/components/popover.d.ts +16 -0
  88. package/dist/components/popover.js +24 -0
  89. package/dist/components/progress.d.ts +27 -0
  90. package/dist/components/progress.js +27 -0
  91. package/dist/components/radio.d.ts +16 -0
  92. package/dist/components/radio.js +13 -0
  93. package/dist/components/rating.d.ts +10 -0
  94. package/dist/components/rating.js +12 -0
  95. package/dist/components/scene-tile.d.ts +22 -0
  96. package/dist/components/scene-tile.js +13 -0
  97. package/dist/components/scroll-view.d.ts +21 -0
  98. package/dist/components/scroll-view.js +13 -0
  99. package/dist/components/search-field.d.ts +16 -0
  100. package/dist/components/search-field.js +12 -0
  101. package/dist/components/secure-field.d.ts +23 -0
  102. package/dist/components/secure-field.js +21 -0
  103. package/dist/components/segmented-control.d.ts +12 -0
  104. package/dist/components/segmented-control.js +10 -0
  105. package/dist/components/select.d.ts +45 -0
  106. package/dist/components/select.js +79 -0
  107. package/dist/components/sensor-readout.d.ts +29 -0
  108. package/dist/components/sensor-readout.js +12 -0
  109. package/dist/components/separator.d.ts +14 -0
  110. package/dist/components/separator.js +11 -0
  111. package/dist/components/setup-code.d.ts +29 -0
  112. package/dist/components/setup-code.js +47 -0
  113. package/dist/components/sheet.d.ts +31 -0
  114. package/dist/components/sheet.js +51 -0
  115. package/dist/components/sidebar.d.ts +30 -0
  116. package/dist/components/sidebar.js +26 -0
  117. package/dist/components/slider.d.ts +27 -0
  118. package/dist/components/slider.js +43 -0
  119. package/dist/components/split-view.d.ts +11 -0
  120. package/dist/components/split-view.js +13 -0
  121. package/dist/components/squircle.d.ts +41 -0
  122. package/dist/components/squircle.js +63 -0
  123. package/dist/components/stepper.d.ts +30 -0
  124. package/dist/components/stepper.js +28 -0
  125. package/dist/components/switch.d.ts +10 -0
  126. package/dist/components/switch.js +10 -0
  127. package/dist/components/tab-bar.d.ts +20 -0
  128. package/dist/components/tab-bar.js +17 -0
  129. package/dist/components/table.d.ts +49 -0
  130. package/dist/components/table.js +179 -0
  131. package/dist/components/tabs.d.ts +16 -0
  132. package/dist/components/tabs.js +19 -0
  133. package/dist/components/text-area.d.ts +14 -0
  134. package/dist/components/text-area.js +9 -0
  135. package/dist/components/text-field.d.ts +26 -0
  136. package/dist/components/text-field.js +23 -0
  137. package/dist/components/thermostat-control.d.ts +30 -0
  138. package/dist/components/thermostat-control.js +139 -0
  139. package/dist/components/toast.d.ts +30 -0
  140. package/dist/components/toast.js +114 -0
  141. package/dist/components/toggle.d.ts +21 -0
  142. package/dist/components/toggle.js +19 -0
  143. package/dist/components/token-field.d.ts +31 -0
  144. package/dist/components/token-field.js +78 -0
  145. package/dist/components/toolbar.d.ts +27 -0
  146. package/dist/components/toolbar.js +39 -0
  147. package/dist/components/tooltip.d.ts +11 -0
  148. package/dist/components/tooltip.js +18 -0
  149. package/dist/components/window.d.ts +56 -0
  150. package/dist/components/window.js +61 -0
  151. package/dist/index.d.ts +78 -0
  152. package/dist/index.js +79 -0
  153. package/dist/lib/cx.d.ts +9 -0
  154. package/dist/lib/cx.js +14 -0
  155. package/dist/lib/derive.d.ts +53 -0
  156. package/dist/lib/derive.js +255 -0
  157. package/dist/lib/field-glyphs.d.ts +13 -0
  158. package/dist/lib/field-glyphs.js +28 -0
  159. package/dist/lib/menu-glyphs.d.ts +6 -0
  160. package/dist/lib/menu-glyphs.js +15 -0
  161. package/dist/lib/platform.d.ts +18 -0
  162. package/dist/lib/platform.js +17 -0
  163. package/dist/lib/squircle.d.ts +23 -0
  164. package/dist/lib/squircle.js +69 -0
  165. package/dist/lib/theme.d.ts +42 -0
  166. package/dist/lib/theme.js +62 -0
  167. package/dist/styles/base.css +115 -0
  168. package/dist/styles/components/accessory-tile.css +461 -0
  169. package/dist/styles/components/activity-indicator.css +63 -0
  170. package/dist/styles/components/alert.css +433 -0
  171. package/dist/styles/components/artwork.css +380 -0
  172. package/dist/styles/components/automation-row.css +52 -0
  173. package/dist/styles/components/avatar.css +230 -0
  174. package/dist/styles/components/badge.css +204 -0
  175. package/dist/styles/components/button.css +298 -0
  176. package/dist/styles/components/calendar.css +287 -0
  177. package/dist/styles/components/camera-view.css +239 -0
  178. package/dist/styles/components/card.css +100 -0
  179. package/dist/styles/components/carousel.css +210 -0
  180. package/dist/styles/components/checkbox.css +212 -0
  181. package/dist/styles/components/code-field.css +163 -0
  182. package/dist/styles/components/color-well.css +452 -0
  183. package/dist/styles/components/combo-box.css +222 -0
  184. package/dist/styles/components/command-palette.css +379 -0
  185. package/dist/styles/components/context-menu.css +43 -0
  186. package/dist/styles/components/date-picker.css +356 -0
  187. package/dist/styles/components/device-frame.css +194 -0
  188. package/dist/styles/components/dialog.css +366 -0
  189. package/dist/styles/components/disclosure.css +197 -0
  190. package/dist/styles/components/dock.css +404 -0
  191. package/dist/styles/components/door-control.css +187 -0
  192. package/dist/styles/components/energy-readout.css +161 -0
  193. package/dist/styles/components/field.css +175 -0
  194. package/dist/styles/components/gauge.css +239 -0
  195. package/dist/styles/components/glass.css +113 -0
  196. package/dist/styles/components/home-backdrop.css +81 -0
  197. package/dist/styles/components/home-section.css +100 -0
  198. package/dist/styles/components/home-status.css +215 -0
  199. package/dist/styles/components/hover-card.css +145 -0
  200. package/dist/styles/components/index.css +75 -0
  201. package/dist/styles/components/level-control.css +247 -0
  202. package/dist/styles/components/light-color-picker.css +94 -0
  203. package/dist/styles/components/list.css +411 -0
  204. package/dist/styles/components/listbox.css +168 -0
  205. package/dist/styles/components/lock-control.css +164 -0
  206. package/dist/styles/components/menu-bar.css +94 -0
  207. package/dist/styles/components/menu.css +454 -0
  208. package/dist/styles/components/navigation-bar.css +248 -0
  209. package/dist/styles/components/outline.css +248 -0
  210. package/dist/styles/components/page-control.css +127 -0
  211. package/dist/styles/components/popover.css +186 -0
  212. package/dist/styles/components/progress.css +228 -0
  213. package/dist/styles/components/radio.css +281 -0
  214. package/dist/styles/components/rating.css +122 -0
  215. package/dist/styles/components/scene-tile.css +295 -0
  216. package/dist/styles/components/scroll-view.css +195 -0
  217. package/dist/styles/components/search-field.css +128 -0
  218. package/dist/styles/components/secure-field.css +189 -0
  219. package/dist/styles/components/segmented-control.css +183 -0
  220. package/dist/styles/components/select.css +290 -0
  221. package/dist/styles/components/sensor-readout.css +231 -0
  222. package/dist/styles/components/separator.css +62 -0
  223. package/dist/styles/components/setup-code.css +138 -0
  224. package/dist/styles/components/sheet.css +345 -0
  225. package/dist/styles/components/sidebar.css +261 -0
  226. package/dist/styles/components/slider.css +208 -0
  227. package/dist/styles/components/split-view.css +75 -0
  228. package/dist/styles/components/squircle.css +44 -0
  229. package/dist/styles/components/stepper.css +278 -0
  230. package/dist/styles/components/switch.css +115 -0
  231. package/dist/styles/components/tab-bar.css +223 -0
  232. package/dist/styles/components/table.css +313 -0
  233. package/dist/styles/components/tabs.css +262 -0
  234. package/dist/styles/components/text-area.css +94 -0
  235. package/dist/styles/components/text-field.css +294 -0
  236. package/dist/styles/components/thermostat-control.css +214 -0
  237. package/dist/styles/components/toast.css +418 -0
  238. package/dist/styles/components/toggle.css +312 -0
  239. package/dist/styles/components/token-field.css +193 -0
  240. package/dist/styles/components/toolbar.css +370 -0
  241. package/dist/styles/components/tooltip.css +69 -0
  242. package/dist/styles/components/window.css +428 -0
  243. package/dist/styles/index.css +17 -0
  244. package/dist/styles/materials.css +263 -0
  245. package/dist/styles/platforms.css +214 -0
  246. package/dist/styles/themes/ember.css +24 -0
  247. package/dist/styles/themes/graphite.css +16 -0
  248. package/dist/styles/themes/nebula.css +16 -0
  249. package/dist/styles/themes/system.css +28 -0
  250. package/dist/styles/tokens.css +299 -0
  251. package/package.json +82 -3
@@ -0,0 +1,16 @@
1
+ import { Popover as PopoverPrimitive, PopoverClose as PopoverClosePrimitive, PopoverContent as PopoverContentPrimitive, PopoverDescription as PopoverDescriptionPrimitive, PopoverTitle as PopoverTitlePrimitive, PopoverTrigger as PopoverTriggerPrimitive } from "@ui-sdk/react/popover";
2
+ import type * as React from "react";
3
+ type PopoverProps = React.ComponentProps<typeof PopoverPrimitive>;
4
+ declare function Popover(props: PopoverProps): React.JSX.Element;
5
+ declare function PopoverTrigger(props: React.ComponentProps<typeof PopoverTriggerPrimitive>): React.JSX.Element;
6
+ type PopoverContentProps<Payload = unknown> = React.ComponentProps<typeof PopoverContentPrimitive<Payload>> & {
7
+ /** Draws the arrow that points at the trigger. */
8
+ arrow?: boolean;
9
+ };
10
+ declare function PopoverContent<Payload = unknown>({ arrow, sideOffset, arrowPadding, className, children, ...props }: PopoverContentProps<Payload>): React.JSX.Element;
11
+ declare function PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverTitlePrimitive>): React.JSX.Element;
12
+ declare function PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverDescriptionPrimitive>): React.JSX.Element;
13
+ declare function PopoverClose({ className, ...props }: React.ComponentProps<typeof PopoverClosePrimitive>): React.JSX.Element;
14
+ export { createPopoverController } from "@ui-sdk/react/popover";
15
+ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
16
+ export type { PopoverContentProps, PopoverProps };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Popover as PopoverPrimitive, PopoverArrow, PopoverClose as PopoverClosePrimitive, PopoverContent as PopoverContentPrimitive, PopoverDescription as PopoverDescriptionPrimitive, PopoverTitle as PopoverTitlePrimitive, PopoverTrigger as PopoverTriggerPrimitive, } from "@ui-sdk/react/popover";
4
+ import { cx } from "../lib/cx.js";
5
+ function Popover(props) {
6
+ return _jsx(PopoverPrimitive, { ...props });
7
+ }
8
+ function PopoverTrigger(props) {
9
+ return _jsx(PopoverTriggerPrimitive, { ...props });
10
+ }
11
+ function PopoverContent({ arrow = true, sideOffset, arrowPadding = 14, className, children, ...props }) {
12
+ return (_jsx(PopoverContentPrimitive, { sideOffset: sideOffset ?? (arrow ? 12 : 6), arrowPadding: arrowPadding, "data-arrow": arrow ? "" : undefined, className: cx("mb-popover", className), ...props, children: (state) => (_jsxs(_Fragment, { children: [arrow ? _jsx(PopoverArrow, { className: "mb-popover-arrow" }) : null, typeof children === "function" ? children(state) : children] })) }));
13
+ }
14
+ function PopoverTitle({ className, ...props }) {
15
+ return _jsx(PopoverTitlePrimitive, { className: cx("mb-popover-title", className), ...props });
16
+ }
17
+ function PopoverDescription({ className, ...props }) {
18
+ return _jsx(PopoverDescriptionPrimitive, { className: cx("mb-popover-description", className), ...props });
19
+ }
20
+ function PopoverClose({ className, ...props }) {
21
+ return _jsx(PopoverClosePrimitive, { className: cx("mb-popover-close", className), ...props });
22
+ }
23
+ export { createPopoverController } from "@ui-sdk/react/popover";
24
+ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
@@ -0,0 +1,27 @@
1
+ import { ProgressLabel as ProgressLabelPrimitive, Progress as ProgressPrimitive, ProgressValue as ProgressValuePrimitive } from "@ui-sdk/react/progress";
2
+ import type * as React from "react";
3
+ type ProgressTone = "accent" | "neutral" | "destructive";
4
+ type ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive>, "children"> & {
5
+ children?: React.ReactNode;
6
+ size?: "sm" | "md" | "lg";
7
+ tone?: ProgressTone;
8
+ };
9
+ /**
10
+ * The thin linear bar. Put a ProgressLabel and a ProgressValue inside; the
11
+ * track and its fill are drawn for you, below them.
12
+ */
13
+ declare function Progress({ size, tone, className, children, ...props }: ProgressProps): React.JSX.Element;
14
+ declare function ProgressLabel({ className, ...props }: React.ComponentProps<typeof ProgressLabelPrimitive>): React.JSX.Element;
15
+ declare function ProgressValue({ className, ...props }: React.ComponentProps<typeof ProgressValuePrimitive>): React.JSX.Element;
16
+ type ProgressCircleProps = Omit<React.ComponentProps<typeof ProgressPrimitive>, "children"> & {
17
+ children?: React.ReactNode;
18
+ size?: "sm" | "md" | "lg";
19
+ tone?: ProgressTone;
20
+ };
21
+ /**
22
+ * The circular determinate ring, like a download in the App Store. Anything
23
+ * you put inside sits in the middle, such as a stop button's square.
24
+ */
25
+ declare function ProgressCircle({ size, tone, value, min, max, className, children, ...props }: ProgressCircleProps): React.JSX.Element;
26
+ export { Progress, ProgressCircle, ProgressLabel, ProgressValue };
27
+ export type { ProgressCircleProps, ProgressProps, ProgressTone };
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ProgressIndicator, ProgressLabel as ProgressLabelPrimitive, Progress as ProgressPrimitive, ProgressTrack, ProgressValue as ProgressValuePrimitive, } from "@ui-sdk/react/progress";
3
+ import { cx } from "../lib/cx.js";
4
+ /**
5
+ * The thin linear bar. Put a ProgressLabel and a ProgressValue inside; the
6
+ * track and its fill are drawn for you, below them.
7
+ */
8
+ function Progress({ size = "md", tone = "accent", className, children, ...props }) {
9
+ return (_jsxs(ProgressPrimitive, { "data-size": size, "data-tone": tone, className: cx("mb-progress", className), ...props, children: [children, _jsx(ProgressTrack, { className: "mb-progress-track", children: _jsx(ProgressIndicator, { className: "mb-progress-indicator" }) })] }));
10
+ }
11
+ function ProgressLabel({ className, ...props }) {
12
+ return _jsx(ProgressLabelPrimitive, { className: cx("mb-progress-label", className), ...props });
13
+ }
14
+ function ProgressValue({ className, ...props }) {
15
+ return _jsx(ProgressValuePrimitive, { className: cx("mb-progress-value", className), ...props });
16
+ }
17
+ /**
18
+ * The circular determinate ring, like a download in the App Store. Anything
19
+ * you put inside sits in the middle, such as a stop button's square.
20
+ */
21
+ function ProgressCircle({ size = "md", tone = "accent", value, min = 0, max = 100, className, children, ...props }) {
22
+ const percent = value === null || value === undefined
23
+ ? null
24
+ : Math.min(Math.max(((value - min) / (max - min || 1)) * 100, 0), 100);
25
+ return (_jsxs(ProgressPrimitive, { value: value, min: min, max: max, "data-size": size, "data-tone": tone, className: cx("mb-progress-circle", className), ...props, children: [_jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 36 36", className: "mb-progress-circle-ring", children: [_jsx("circle", { className: "mb-progress-circle-track", cx: "18", cy: "18", r: "15", pathLength: 100 }), _jsx("circle", { className: "mb-progress-circle-fill", cx: "18", cy: "18", r: "15", pathLength: 100, strokeDasharray: percent === null ? "28 100" : `${percent} 100` })] }), children] }));
26
+ }
27
+ export { Progress, ProgressCircle, ProgressLabel, ProgressValue };
@@ -0,0 +1,16 @@
1
+ import { Radio as RadioPrimitive, RadioGroup as RadioGroupPrimitive } from "@ui-sdk/react/radio";
2
+ import type * as React from "react";
3
+ type RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive> & {
4
+ /** `list` draws each choice as a row with a checkmark on the trailing edge, as iOS Settings does. */
5
+ variant?: "default" | "list";
6
+ };
7
+ declare function RadioGroup({ variant, className, ...props }: RadioGroupProps): React.JSX.Element;
8
+ type RadioProps = Omit<React.ComponentProps<typeof RadioPrimitive>, "children"> & {
9
+ /** The radio's title. With it, the button and its text are one label. */
10
+ children?: React.ReactNode;
11
+ /** A line of secondary text under the title. */
12
+ description?: React.ReactNode;
13
+ };
14
+ declare function Radio({ className, children, description, ...props }: RadioProps): React.JSX.Element;
15
+ export { Radio, RadioGroup };
16
+ export type { RadioGroupProps, RadioProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Radio as RadioPrimitive, RadioGroup as RadioGroupPrimitive, RadioIndicator as RadioIndicatorPrimitive, } from "@ui-sdk/react/radio";
3
+ import { cx } from "../lib/cx.js";
4
+ function RadioGroup({ variant = "default", className, ...props }) {
5
+ return (_jsx(RadioGroupPrimitive, { "data-variant": variant, className: cx("mb-radio-group", className), ...props }));
6
+ }
7
+ function Radio({ className, children, description, ...props }) {
8
+ const button = (_jsx(RadioPrimitive, { className: cx("mb-radio", className), ...props, children: _jsx(RadioIndicatorPrimitive, { keepMounted: true, className: "mb-radio-indicator", children: _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "mb-radio-check", children: _jsx("path", { d: "M3.5 8.6 6.6 11.6 12.5 4.6" }) }) }) }));
9
+ if (children == null && description == null)
10
+ return button;
11
+ return (_jsxs("label", { className: "mb-radio-label", children: [button, _jsxs("span", { className: "mb-radio-text", children: [_jsx("span", { className: "mb-radio-title", children: children }), description == null ? null : _jsx("span", { className: "mb-radio-description", children: description })] })] }));
12
+ }
13
+ export { Radio, RadioGroup };
@@ -0,0 +1,10 @@
1
+ import { Rating as RatingPrimitive, RatingItem as RatingItemPrimitive } from "@ui-sdk/react/rating";
2
+ import type * as React from "react";
3
+ type RatingProps = React.ComponentProps<typeof RatingPrimitive> & {
4
+ size?: "sm" | "md" | "lg";
5
+ };
6
+ declare function Rating({ size, className, children, ...props }: RatingProps): React.JSX.Element;
7
+ /** One star. Rating repeats it; pass children to draw a different symbol. */
8
+ declare function RatingItem({ className, children, ...props }: React.ComponentProps<typeof RatingItemPrimitive>): React.JSX.Element;
9
+ export { Rating, RatingItem };
10
+ export type { RatingProps };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Rating as RatingPrimitive, RatingItem as RatingItemPrimitive } from "@ui-sdk/react/rating";
3
+ import { cx } from "../lib/cx.js";
4
+ const star = "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z";
5
+ function Rating({ size = "md", className, children, ...props }) {
6
+ return (_jsx(RatingPrimitive, { "data-size": size, className: cx("mb-rating", className), ...props, children: children ?? _jsx(RatingItem, {}) }));
7
+ }
8
+ /** One star. Rating repeats it; pass children to draw a different symbol. */
9
+ function RatingItem({ className, children, ...props }) {
10
+ return (_jsx(RatingItemPrimitive, { className: cx("mb-rating-item", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "mb-rating-symbol", "data-part": "empty", children: _jsx("path", { d: star }) }), _jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "mb-rating-symbol", "data-part": "fill", children: _jsx("path", { d: star }) })] })) }));
11
+ }
12
+ export { Rating, RatingItem };
@@ -0,0 +1,22 @@
1
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
2
+ import type * as React from "react";
3
+ type SceneTileProps = React.ComponentProps<typeof ButtonPrimitive> & {
4
+ icon?: React.ReactNode;
5
+ /** The scene's name. Children work too. */
6
+ name?: React.ReactNode;
7
+ /** Every accessory in the scene is set the way the scene sets it. */
8
+ active?: boolean;
9
+ /** The scene is running: its accessories are still changing. */
10
+ running?: boolean;
11
+ size?: "sm" | "md";
12
+ /** What assistive tech hears for `active`, in the page's language. */
13
+ activeLabel?: string;
14
+ /** Art behind the tile for the scene's mood, like `<Artwork variant="horizon" time="dawn" />`. Decorative. */
15
+ background?: React.ReactNode;
16
+ };
17
+ /** Runs a scene: a group of actions, like Good Morning or Movie Time. */
18
+ declare function SceneTile({ icon, name, active, running, size, activeLabel, background, className, children, ...props }: SceneTileProps): React.JSX.Element;
19
+ /** The Home tab's row of scenes: it scrolls sideways on iPhone and wraps on iPad and Mac. Name it with `aria-label`. */
20
+ declare function SceneRow({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
21
+ export { SceneRow, SceneTile };
22
+ export type { SceneTileProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
3
+ import { cx, join } from "../lib/cx.js";
4
+ import { ActivityIndicator } from "./activity-indicator.js";
5
+ /** Runs a scene: a group of actions, like Good Morning or Movie Time. */
6
+ function SceneTile({ icon, name, active, running, size = "md", activeLabel = "On", background, className, children, ...props }) {
7
+ return (_jsxs(ButtonPrimitive, { "data-size": size, "data-active": active ? "" : undefined, "data-running": running ? "" : undefined, "data-background": background ? "" : undefined, "aria-busy": running ? true : undefined, className: cx("mb-scene-tile", className), ...props, children: [background ? (_jsx("span", { className: "mb-scene-tile-background", "aria-hidden": "true", children: background })) : null, _jsx("span", { className: "mb-scene-tile-icon", "aria-hidden": "true", children: running ? _jsx(ActivityIndicator, { size: "sm", "aria-hidden": "true", className: "mb-scene-tile-spinner" }) : icon }), _jsx("span", { className: "mb-scene-tile-name", children: name ?? children }), active ? _jsx("span", { className: "mb-visually-hidden", children: `, ${activeLabel}` }) : null] }));
8
+ }
9
+ /** The Home tab's row of scenes: it scrolls sideways on iPhone and wraps on iPad and Mac. Name it with `aria-label`. */
10
+ function SceneRow({ className, ...props }) {
11
+ return _jsx("div", { role: "group", className: join("mb-scene-row", className), ...props });
12
+ }
13
+ export { SceneRow, SceneTile };
@@ -0,0 +1,21 @@
1
+ import { ScrollArea, ScrollAreaViewport } from "@ui-sdk/react/scroll-area";
2
+ import type * as React from "react";
3
+ type ScrollViewOrientation = "vertical" | "horizontal" | "both";
4
+ type ScrollViewProps = Omit<React.ComponentProps<typeof ScrollArea>, "children"> & {
5
+ children?: React.ReactNode;
6
+ /** The axes that scroll. */
7
+ orientation?: ScrollViewOrientation;
8
+ /** Fades content out at an edge while there's more to scroll that way. */
9
+ fade?: boolean;
10
+ /** `bordered` frames the view with a hairline, like a macOS table or text view. */
11
+ variant?: "plain" | "bordered";
12
+ /** Props for the element that scrolls, like `tabIndex` or `onScroll`. */
13
+ viewportProps?: React.ComponentProps<typeof ScrollAreaViewport>;
14
+ };
15
+ /**
16
+ * A scrolling region with Apple's overlay scrollbars: a thin thumb that shows
17
+ * while you scroll or point at it, and widens under the pointer on macOS.
18
+ */
19
+ declare function ScrollView({ orientation, fade, variant, type, className, children, viewportProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: ScrollViewProps): React.JSX.Element;
20
+ export { ScrollView };
21
+ export type { ScrollViewOrientation, ScrollViewProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, } from "@ui-sdk/react/scroll-area";
3
+ import { cx } from "../lib/cx.js";
4
+ /**
5
+ * A scrolling region with Apple's overlay scrollbars: a thin thumb that shows
6
+ * while you scroll or point at it, and widens under the pointer on macOS.
7
+ */
8
+ function ScrollView({ orientation = "vertical", fade = true, variant = "plain", type = "hover", className, children, viewportProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }) {
9
+ const named = ariaLabel !== undefined || ariaLabelledby !== undefined;
10
+ const { className: viewportClassName, ...viewportRest } = viewportProps ?? {};
11
+ return (_jsxs(ScrollArea, { type: type, "data-orientation": orientation, "data-fade": fade ? "" : undefined, "data-variant": variant, className: cx("mb-scroll-view", className), ...props, children: [_jsx(ScrollAreaViewport, { role: named ? "region" : undefined, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className: cx("mb-scroll-view-viewport", viewportClassName), ...viewportRest, children: _jsx(ScrollAreaContent, { className: "mb-scroll-view-content", children: children }) }), orientation !== "horizontal" ? (_jsx(ScrollAreaScrollbar, { orientation: "vertical", className: "mb-scroll-view-scrollbar", children: _jsx(ScrollAreaThumb, { className: "mb-scroll-view-thumb" }) })) : null, orientation !== "vertical" ? (_jsx(ScrollAreaScrollbar, { orientation: "horizontal", className: "mb-scroll-view-scrollbar", children: _jsx(ScrollAreaThumb, { className: "mb-scroll-view-thumb" }) })) : null, orientation === "both" ? _jsx(ScrollAreaCorner, { className: "mb-scroll-view-corner" }) : null] }));
12
+ }
13
+ export { ScrollView };
@@ -0,0 +1,16 @@
1
+ import { Input } from "@ui-sdk/react/input";
2
+ import type * as React from "react";
3
+ type SearchFieldProps = Omit<React.ComponentProps<typeof Input>, "size"> & {
4
+ size?: "sm" | "md" | "lg";
5
+ /** The clear button's name. */
6
+ clearLabel?: string;
7
+ /** Class for the field's box, which holds the glyph, the input and the clear button. */
8
+ groupClassName?: string;
9
+ };
10
+ /**
11
+ * The Apple search field: a magnifier, a "Search" prompt and a clear button.
12
+ * A rounded rectangle on macOS, a gray capsule on touch. Props go to the input.
13
+ */
14
+ declare function SearchField({ size, clearLabel, placeholder, groupClassName, className, ...props }: SearchFieldProps): React.JSX.Element;
15
+ export { SearchField };
16
+ export type { SearchFieldProps };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Input, InputClear, InputGroup } from "@ui-sdk/react/input";
3
+ import { cx, join } from "../lib/cx.js";
4
+ import { ClearGlyph, MagnifierGlyph } from "../lib/field-glyphs.js";
5
+ /**
6
+ * The Apple search field: a magnifier, a "Search" prompt and a clear button.
7
+ * A rounded rectangle on macOS, a gray capsule on touch. Props go to the input.
8
+ */
9
+ function SearchField({ size = "md", clearLabel = "Clear search", placeholder = "Search", groupClassName, className, ...props }) {
10
+ return (_jsxs(InputGroup, { "data-size": size, className: join("mb-search-field", groupClassName), children: [_jsx(MagnifierGlyph, { className: "mb-search-field-glyph" }), _jsx(Input, { type: "search", placeholder: placeholder, enterKeyHint: "search", className: cx("mb-search-field-input", className), ...props }), _jsx(InputClear, { "aria-label": clearLabel, className: "mb-search-field-clear", children: _jsx(ClearGlyph, {}) })] }));
11
+ }
12
+ export { SearchField };
@@ -0,0 +1,23 @@
1
+ import { PasswordInput, PasswordInputControl, PasswordInputToggle } from "@ui-sdk/react/password-input";
2
+ import type * as React from "react";
3
+ type SecureFieldProps = React.ComponentProps<typeof PasswordInput> & {
4
+ size?: "sm" | "md" | "lg";
5
+ /** `auto` is bordered on macOS and filled on touch, like `TextField`. */
6
+ variant?: "auto" | "bordered" | "filled" | "plain";
7
+ placeholder?: string;
8
+ /** Shows the eye button that reveals the password. */
9
+ toggle?: boolean;
10
+ /** The toggle's name. */
11
+ toggleLabel?: string;
12
+ };
13
+ /**
14
+ * A password field with a show and hide button. Form options go on the root;
15
+ * `placeholder`, `id`, `autoFocus` and ARIA names go to the input. Pass
16
+ * children to compose `SecureFieldInput` and `SecureFieldToggle` yourself.
17
+ */
18
+ declare function SecureField({ size, variant, placeholder, toggle, toggleLabel, id, autoFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, children, ...props }: SecureFieldProps): React.JSX.Element;
19
+ declare function SecureFieldInput({ className, ...props }: React.ComponentProps<typeof PasswordInputControl>): React.JSX.Element;
20
+ /** The eye button. It shows eye.slash while the password is visible. */
21
+ declare function SecureFieldToggle({ className, children, "aria-label": label, ...props }: React.ComponentProps<typeof PasswordInputToggle>): React.JSX.Element;
22
+ export { SecureField, SecureFieldInput, SecureFieldToggle };
23
+ export type { SecureFieldProps };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PasswordInput, PasswordInputControl, PasswordInputToggle, } from "@ui-sdk/react/password-input";
4
+ import { cx } from "../lib/cx.js";
5
+ import { EyeGlyph, EyeSlashGlyph } from "../lib/field-glyphs.js";
6
+ /**
7
+ * A password field with a show and hide button. Form options go on the root;
8
+ * `placeholder`, `id`, `autoFocus` and ARIA names go to the input. Pass
9
+ * children to compose `SecureFieldInput` and `SecureFieldToggle` yourself.
10
+ */
11
+ function SecureField({ size = "md", variant = "auto", placeholder, toggle = true, toggleLabel = "Show password", id, autoFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, children, ...props }) {
12
+ return (_jsx(PasswordInput, { "data-size": size, "data-variant": variant, className: cx("mb-secure-field", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(SecureFieldInput, { id: id, autoFocus: autoFocus, placeholder: placeholder, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }), toggle ? _jsx(SecureFieldToggle, { "aria-label": toggleLabel }) : null] })) }));
13
+ }
14
+ function SecureFieldInput({ className, ...props }) {
15
+ return _jsx(PasswordInputControl, { className: cx("mb-secure-field-input", className), ...props });
16
+ }
17
+ /** The eye button. It shows eye.slash while the password is visible. */
18
+ function SecureFieldToggle({ className, children, "aria-label": label = "Show password", ...props }) {
19
+ return (_jsx(PasswordInputToggle, { "aria-label": label, className: cx("mb-secure-field-toggle", className), ...props, children: children ?? ((state) => (state.visible ? _jsx(EyeSlashGlyph, {}) : _jsx(EyeGlyph, {}))) }));
20
+ }
21
+ export { SecureField, SecureFieldInput, SecureFieldToggle };
@@ -0,0 +1,12 @@
1
+ import { SegmentedControl as SegmentedControlPrimitive, SegmentedControlItem as SegmentedControlItemPrimitive } from "@ui-sdk/react/segmented-control";
2
+ import type * as React from "react";
3
+ type SegmentedControlProps = Omit<React.ComponentProps<typeof SegmentedControlPrimitive>, "children"> & {
4
+ children?: React.ReactNode;
5
+ size?: "sm" | "md" | "lg";
6
+ /** Stretches across the container with equal-width segments. */
7
+ block?: boolean;
8
+ };
9
+ declare function SegmentedControl({ size, block, className, children, ...props }: SegmentedControlProps): React.JSX.Element;
10
+ declare function SegmentedControlItem({ className, ...props }: React.ComponentProps<typeof SegmentedControlItemPrimitive>): React.JSX.Element;
11
+ export { SegmentedControl, SegmentedControlItem };
12
+ export type { SegmentedControlProps };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SegmentedControl as SegmentedControlPrimitive, SegmentedControlIndicator, SegmentedControlItem as SegmentedControlItemPrimitive, } from "@ui-sdk/react/segmented-control";
3
+ import { cx } from "../lib/cx.js";
4
+ function SegmentedControl({ size = "md", block, className, children, ...props }) {
5
+ return (_jsxs(SegmentedControlPrimitive, { "data-size": size, "data-block": block ? "" : undefined, className: cx("mb-segmented-control", className), ...props, children: [_jsx(SegmentedControlIndicator, { className: "mb-segmented-control-indicator" }), children] }));
6
+ }
7
+ function SegmentedControlItem({ className, ...props }) {
8
+ return _jsx(SegmentedControlItemPrimitive, { className: cx("mb-segmented-control-item", className), ...props });
9
+ }
10
+ export { SegmentedControl, SegmentedControlItem };
@@ -0,0 +1,45 @@
1
+ import { createSelectController, SelectClear as SelectClearPrimitive, SelectContent as SelectContentPrimitive, SelectEmpty as SelectEmptyPrimitive, SelectGroup as SelectGroupPrimitive, SelectGroupLabel as SelectGroupLabelPrimitive, SelectInput as SelectInputPrimitive, SelectItem as SelectItemPrimitive, SelectItemIcon as SelectItemIconPrimitive, SelectItemIndicator as SelectItemIndicatorPrimitive, SelectItems, SelectItemText as SelectItemTextPrimitive, SelectLabel as SelectLabelPrimitive, SelectList as SelectListPrimitive, SelectSeparator as SelectSeparatorPrimitive, SelectStatus as SelectStatusPrimitive, SelectTrigger as SelectTriggerPrimitive, SelectValue as SelectValuePrimitive, SelectValueIcon as SelectValueIconPrimitive } from "@ui-sdk/react/select";
2
+ import type { ListData, SelectProps } from "@ui-sdk/react/select";
3
+ import * as React from "react";
4
+ declare function Select<T = string, Multiple extends boolean | undefined = false>(props: SelectProps<T, Multiple>): React.JSX.Element;
5
+ type SelectTriggerVariant = "auto" | "bezeled" | "plain";
6
+ type SelectTriggerProps = Omit<React.ComponentProps<typeof SelectTriggerPrimitive>, "children"> & {
7
+ children?: React.ReactNode;
8
+ /**
9
+ * `bezeled` is the Mac's pop-up button; `plain` is the iOS menu picker: accent text and an
10
+ * up-and-down chevron. `auto` picks the one that fits the platform.
11
+ */
12
+ variant?: SelectTriggerVariant;
13
+ size?: "sm" | "md" | "lg";
14
+ };
15
+ /** The pop-up button. Shows the value and renders its own chevron cap; put a `SelectValue` inside. */
16
+ declare function SelectTrigger({ variant, size, className, children, onPointerDown, onFocus, ...props }: SelectTriggerProps): React.JSX.Element;
17
+ declare function SelectValue({ className, ...props }: React.ComponentProps<typeof SelectValuePrimitive>): React.JSX.Element;
18
+ declare function SelectValueIcon({ className, ...props }: React.ComponentProps<typeof SelectValueIconPrimitive>): React.JSX.Element;
19
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectLabelPrimitive>): React.JSX.Element;
20
+ type SelectContentProps = Omit<React.ComponentProps<typeof SelectContentPrimitive>, "alignItemWithTrigger"> & {
21
+ /**
22
+ * Open over the trigger with the selected item on top of it. `auto` does that on the Mac only;
23
+ * iOS and iPadOS menus open from the button.
24
+ */
25
+ alignItemWithTrigger?: boolean | "auto";
26
+ };
27
+ /** The menu. On the Mac it opens over the trigger with the selected item on top of it. */
28
+ declare function SelectContent({ alignItemWithTrigger, sideOffset, className, ...props }: SelectContentProps): React.JSX.Element;
29
+ declare function SelectList({ className, ...props }: React.ComponentProps<typeof SelectListPrimitive>): React.JSX.Element;
30
+ /** An option. Renders its own checkmark in the leading column. */
31
+ declare function SelectItem<T = string>({ className, children, ...props }: Omit<React.ComponentProps<typeof SelectItemPrimitive<T>>, "children"> & {
32
+ children?: React.ReactNode;
33
+ }): React.JSX.Element;
34
+ declare function SelectItemIndicator({ keepMounted, className, children, ...props }: React.ComponentProps<typeof SelectItemIndicatorPrimitive>): React.JSX.Element;
35
+ declare function SelectItemIcon({ className, ...props }: React.ComponentProps<typeof SelectItemIconPrimitive>): React.JSX.Element;
36
+ declare function SelectItemText({ className, ...props }: React.ComponentProps<typeof SelectItemTextPrimitive>): React.JSX.Element;
37
+ declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectGroupPrimitive>): React.JSX.Element;
38
+ declare function SelectGroupLabel({ className, ...props }: React.ComponentProps<typeof SelectGroupLabelPrimitive>): React.JSX.Element;
39
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectSeparatorPrimitive>): React.JSX.Element;
40
+ declare function SelectInput({ className, ...props }: React.ComponentProps<typeof SelectInputPrimitive>): React.JSX.Element;
41
+ declare function SelectEmpty({ className, ...props }: React.ComponentProps<typeof SelectEmptyPrimitive>): React.JSX.Element;
42
+ declare function SelectStatus({ className, ...props }: React.ComponentProps<typeof SelectStatusPrimitive>): React.JSX.Element;
43
+ declare function SelectClear({ className, ...props }: React.ComponentProps<typeof SelectClearPrimitive>): React.JSX.Element;
44
+ export { createSelectController, Select, SelectClear, SelectContent, SelectEmpty, SelectGroup, SelectGroupLabel, SelectInput, SelectItem, SelectItemIcon, SelectItemIndicator, SelectItems, SelectItemText, SelectLabel, SelectList, SelectSeparator, SelectStatus, SelectTrigger, SelectValue, SelectValueIcon, };
45
+ export type { ListData, SelectContentProps, SelectProps, SelectTriggerProps, SelectTriggerVariant };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createSelectController, Select as SelectPrimitive, SelectClear as SelectClearPrimitive, SelectContent as SelectContentPrimitive, SelectEmpty as SelectEmptyPrimitive, SelectGroup as SelectGroupPrimitive, SelectGroupLabel as SelectGroupLabelPrimitive, SelectInput as SelectInputPrimitive, SelectItem as SelectItemPrimitive, SelectItemIcon as SelectItemIconPrimitive, SelectItemIndicator as SelectItemIndicatorPrimitive, SelectItems, SelectItemText as SelectItemTextPrimitive, SelectLabel as SelectLabelPrimitive, SelectList as SelectListPrimitive, SelectSeparator as SelectSeparatorPrimitive, SelectStatus as SelectStatusPrimitive, SelectTrigger as SelectTriggerPrimitive, SelectValue as SelectValuePrimitive, SelectValueIcon as SelectValueIconPrimitive, } from "@ui-sdk/react/select";
4
+ import * as React from "react";
5
+ import { cx } from "../lib/cx.js";
6
+ import { CheckGlyph, ChevronGlyph } from "../lib/menu-glyphs.js";
7
+ /** The platform the trigger sits in, read as it's pressed or focused, so the list opens the native way. */
8
+ const PlatformContext = React.createContext(null);
9
+ function Select(props) {
10
+ const [platform, setPlatform] = React.useState(null);
11
+ const slot = React.useMemo(() => ({ platform, setPlatform }), [platform]);
12
+ return (_jsx(PlatformContext.Provider, { value: slot, children: _jsx(SelectPrimitive, { ...props }) }));
13
+ }
14
+ function platformOf(element) {
15
+ return element.closest("[data-platform]")?.getAttribute("data-platform") ?? null;
16
+ }
17
+ /** The pop-up button. Shows the value and renders its own chevron cap; put a `SelectValue` inside. */
18
+ function SelectTrigger({ variant = "auto", size = "md", className, children, onPointerDown, onFocus, ...props }) {
19
+ const slot = React.useContext(PlatformContext);
20
+ return (_jsxs(SelectTriggerPrimitive, { onPointerDown: (event) => {
21
+ slot?.setPlatform(platformOf(event.currentTarget));
22
+ onPointerDown?.(event);
23
+ }, onFocus: (event) => {
24
+ slot?.setPlatform(platformOf(event.currentTarget));
25
+ onFocus?.(event);
26
+ }, "data-variant": variant, "data-size": size, className: cx("mb-select-trigger", className), ...props, children: [children ?? _jsx(SelectValue, {}), _jsx("span", { className: "mb-select-trigger-cap", "aria-hidden": "true", children: _jsx(ChevronGlyph, { direction: "up-down" }) })] }));
27
+ }
28
+ function SelectValue({ className, ...props }) {
29
+ return _jsx(SelectValuePrimitive, { className: cx("mb-select-value", className), ...props });
30
+ }
31
+ function SelectValueIcon({ className, ...props }) {
32
+ return _jsx(SelectValueIconPrimitive, { className: cx("mb-select-value-icon", className), ...props });
33
+ }
34
+ function SelectLabel({ className, ...props }) {
35
+ return _jsx(SelectLabelPrimitive, { className: cx("mb-select-label", className), ...props });
36
+ }
37
+ /** The menu. On the Mac it opens over the trigger with the selected item on top of it. */
38
+ function SelectContent({ alignItemWithTrigger = "auto", sideOffset = 4, className, ...props }) {
39
+ const platform = React.useContext(PlatformContext)?.platform ?? "macos";
40
+ return (_jsx(SelectContentPrimitive, { alignItemWithTrigger: alignItemWithTrigger === "auto" ? platform === "macos" : alignItemWithTrigger, sideOffset: sideOffset, className: cx("mb-menu-content mb-select-content", className), ...props }));
41
+ }
42
+ function SelectList({ className, ...props }) {
43
+ return _jsx(SelectListPrimitive, { className: cx("mb-select-list", className), ...props });
44
+ }
45
+ /** An option. Renders its own checkmark in the leading column. */
46
+ function SelectItem({ className, children, ...props }) {
47
+ return (_jsxs(SelectItemPrimitive, { className: cx("mb-menu-item mb-menu-checkable mb-select-item", className), ...props, children: [_jsx(SelectItemIndicator, {}), children] }));
48
+ }
49
+ function SelectItemIndicator({ keepMounted = true, className, children, ...props }) {
50
+ return (_jsx(SelectItemIndicatorPrimitive, { keepMounted: keepMounted, className: cx("mb-menu-item-indicator mb-select-item-indicator", className), ...props, children: children ?? _jsx(CheckGlyph, {}) }));
51
+ }
52
+ function SelectItemIcon({ className, ...props }) {
53
+ return _jsx(SelectItemIconPrimitive, { className: cx("mb-menu-item-icon", className), ...props });
54
+ }
55
+ function SelectItemText({ className, ...props }) {
56
+ return _jsx(SelectItemTextPrimitive, { className: cx("mb-select-item-text", className), ...props });
57
+ }
58
+ function SelectGroup({ className, ...props }) {
59
+ return _jsx(SelectGroupPrimitive, { className: cx("mb-menu-group", className), ...props });
60
+ }
61
+ function SelectGroupLabel({ className, ...props }) {
62
+ return _jsx(SelectGroupLabelPrimitive, { className: cx("mb-menu-group-label", className), ...props });
63
+ }
64
+ function SelectSeparator({ className, ...props }) {
65
+ return _jsx(SelectSeparatorPrimitive, { className: cx("mb-menu-separator", className), ...props });
66
+ }
67
+ function SelectInput({ className, ...props }) {
68
+ return _jsx(SelectInputPrimitive, { className: cx("mb-select-input", className), ...props });
69
+ }
70
+ function SelectEmpty({ className, ...props }) {
71
+ return _jsx(SelectEmptyPrimitive, { className: cx("mb-select-empty", className), ...props });
72
+ }
73
+ function SelectStatus({ className, ...props }) {
74
+ return _jsx(SelectStatusPrimitive, { className: cx("mb-select-status", className), ...props });
75
+ }
76
+ function SelectClear({ className, ...props }) {
77
+ return _jsx(SelectClearPrimitive, { className: cx("mb-select-clear", className), ...props });
78
+ }
79
+ export { createSelectController, Select, SelectClear, SelectContent, SelectEmpty, SelectGroup, SelectGroupLabel, SelectInput, SelectItem, SelectItemIcon, SelectItemIndicator, SelectItems, SelectItemText, SelectLabel, SelectList, SelectSeparator, SelectStatus, SelectTrigger, SelectValue, SelectValueIcon, };
@@ -0,0 +1,29 @@
1
+ import type * as React from "react";
2
+ type SensorLevel = "normal" | "warning" | "alert";
3
+ type SensorMeter = {
4
+ value: number;
5
+ min?: number;
6
+ max?: number;
7
+ /** Names the meter for assistive tech. Defaults to the readout's label. */
8
+ label?: string;
9
+ };
10
+ type SensorReadoutProps = Omit<React.ComponentProps<"div">, "children"> & {
11
+ icon?: React.ReactNode;
12
+ /** What's measured: "Humidity", "Air quality", "Battery". */
13
+ label: React.ReactNode;
14
+ /** The reading in words and units: "41%", "Good", "Leak Detected". */
15
+ value: React.ReactNode;
16
+ /** Where or when: "Kitchen", "Updated 2 min ago". */
17
+ detail?: React.ReactNode;
18
+ /** `warning` and `alert` color the icon and value. Put what's wrong in `value`, in words. */
19
+ level?: SensorLevel;
20
+ layout?: "row" | "tile";
21
+ /** A bar under the reading, for a level like battery charge or air quality. */
22
+ meter?: SensorMeter;
23
+ };
24
+ /** A sensor's reading: temperature, humidity, air quality, battery, contact, motion, leak or smoke. */
25
+ declare function SensorReadout({ icon, label, value, detail, level, layout, meter, className, ...props }: SensorReadoutProps): React.JSX.Element;
26
+ /** Sensor rows grouped on one rounded surface, like an accessory's details. */
27
+ declare function SensorGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
28
+ export { SensorGroup, SensorReadout };
29
+ export type { SensorLevel, SensorMeter, SensorReadoutProps };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Meter as MeterPrimitive, MeterIndicator as MeterIndicatorPrimitive, MeterTrack as MeterTrackPrimitive, } from "@ui-sdk/react/meter";
3
+ import { join } from "../lib/cx.js";
4
+ /** A sensor's reading: temperature, humidity, air quality, battery, contact, motion, leak or smoke. */
5
+ function SensorReadout({ icon, label, value, detail, level = "normal", layout = "row", meter, className, ...props }) {
6
+ return (_jsxs("div", { "data-level": level, "data-layout": layout, className: join("mb-sensor-readout", className), ...props, children: [icon ? (_jsx("span", { className: "mb-sensor-readout-icon", "aria-hidden": "true", children: icon })) : null, _jsxs("div", { className: "mb-sensor-readout-text", children: [_jsx("span", { className: "mb-sensor-readout-label", children: label }), detail ? _jsx("span", { className: "mb-sensor-readout-detail", children: detail }) : null] }), _jsx("span", { className: "mb-sensor-readout-value", children: value }), meter ? (_jsx(MeterPrimitive, { value: meter.value, min: meter.min ?? 0, max: meter.max ?? 100, "aria-label": meter.label ?? (typeof label === "string" ? label : undefined), className: "mb-sensor-readout-meter", children: _jsx(MeterTrackPrimitive, { className: "mb-sensor-readout-meter-track", children: _jsx(MeterIndicatorPrimitive, { className: "mb-sensor-readout-meter-indicator" }) }) })) : null] }));
7
+ }
8
+ /** Sensor rows grouped on one rounded surface, like an accessory's details. */
9
+ function SensorGroup({ className, ...props }) {
10
+ return _jsx("div", { className: join("mb-sensor-group", className), ...props });
11
+ }
12
+ export { SensorGroup, SensorReadout };
@@ -0,0 +1,14 @@
1
+ import { Separator as SeparatorPrimitive } from "@ui-sdk/react/separator";
2
+ import type * as React from "react";
3
+ type SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive> & {
4
+ /** `true` insets both ends by the row padding; `leading` only the start, like an iOS list. */
5
+ inset?: boolean | "leading";
6
+ };
7
+ declare function Separator({ inset, className, orientation, ...props }: SeparatorProps): React.JSX.Element;
8
+ type SeparatorLabelProps = React.ComponentProps<"div"> & {
9
+ inset?: boolean;
10
+ };
11
+ /** A horizontal rule with a centered label, like "or" between two ways to sign in. */
12
+ declare function SeparatorLabel({ inset, className, children, ...props }: SeparatorLabelProps): React.JSX.Element;
13
+ export { Separator, SeparatorLabel };
14
+ export type { SeparatorLabelProps, SeparatorProps };
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Separator as SeparatorPrimitive } from "@ui-sdk/react/separator";
3
+ import { cx, join } from "../lib/cx.js";
4
+ function Separator({ inset, className, orientation = "horizontal", ...props }) {
5
+ return (_jsx(SeparatorPrimitive, { orientation: orientation, "data-inset": inset === true ? "both" : inset || undefined, className: cx("mb-separator", className), ...props }));
6
+ }
7
+ /** A horizontal rule with a centered label, like "or" between two ways to sign in. */
8
+ function SeparatorLabel({ inset, className, children, ...props }) {
9
+ return (_jsxs("div", { "data-inset": inset ? "both" : undefined, className: join("mb-separator-labeled", className), ...props, children: [_jsx(SeparatorPrimitive, { decorative: true, className: "mb-separator" }), _jsx("span", { className: "mb-separator-label", children: children }), _jsx(SeparatorPrimitive, { decorative: true, className: "mb-separator" })] }));
10
+ }
11
+ export { Separator, SeparatorLabel };
@@ -0,0 +1,29 @@
1
+ import type * as React from "react";
2
+ import { type CodeFieldProps } from "./code-field.js";
3
+ type SetupCodeFormat = "homekit" | "matter";
4
+ type SetupCodeProps = Omit<React.ComponentProps<"div">, "children"> & {
5
+ /** The digits, with or without dashes or spaces. */
6
+ code: string;
7
+ /** `homekit` is the 8-digit setup code; `matter` the 11-digit pairing code. */
8
+ format?: SetupCodeFormat;
9
+ /** Names the code for assistive tech. */
10
+ label?: string;
11
+ };
12
+ /** An accessory's setup code, grouped the way it's printed on the accessory, in tabular digits. */
13
+ declare function SetupCode({ code, format, label, className, ...props }: SetupCodeProps): React.JSX.Element;
14
+ type SetupCodeScannerProps = React.ComponentProps<"div"> & {
15
+ /** The instruction under the frame. */
16
+ instruction?: React.ReactNode;
17
+ };
18
+ /**
19
+ * Where the camera's picture goes while someone scans an accessory's code. It draws the frame and
20
+ * the instruction; put a camera preview inside, or leave it empty as a placeholder.
21
+ */
22
+ declare function SetupCodeScanner({ instruction, className, children, ...props }: SetupCodeScannerProps): React.JSX.Element;
23
+ type SetupCodeFieldProps = Omit<CodeFieldProps, "length" | "groupSize" | "children"> & {
24
+ format?: SetupCodeFormat;
25
+ };
26
+ /** Type the setup code by hand: 8 cells in runs of 3, 2 and 3, or 11 in runs of 4, 3 and 4 for Matter. */
27
+ declare function SetupCodeField({ format, className, ...props }: SetupCodeFieldProps): React.JSX.Element;
28
+ export { SetupCode, SetupCodeField, SetupCodeScanner };
29
+ export type { SetupCodeFieldProps, SetupCodeFormat, SetupCodeProps, SetupCodeScannerProps };