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,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cx, join } from "../lib/cx.js";
3
+ import { CodeField, CodeFieldGroup, CodeFieldSeparator, CodeFieldSlot } from "./code-field.js";
4
+ // The grouping printed on accessories: 3-2-3 for an 8-digit setup code, 4-3-4 for an 11-digit Matter pairing code.
5
+ const groupings = { homekit: [3, 2, 3], matter: [4, 3, 4] };
6
+ function groupDigits(digits, format) {
7
+ const groups = [];
8
+ let start = 0;
9
+ for (const size of groupings[format]) {
10
+ if (start >= digits.length)
11
+ break;
12
+ groups.push(digits.slice(start, start + size));
13
+ start += size;
14
+ }
15
+ if (start < digits.length)
16
+ groups.push(digits.slice(start));
17
+ return groups;
18
+ }
19
+ /** An accessory's setup code, grouped the way it's printed on the accessory, in tabular digits. */
20
+ function SetupCode({ code, format = "homekit", label = "Setup code", className, ...props }) {
21
+ const digits = code.replace(/\D/g, "");
22
+ const groups = groupDigits(digits, format);
23
+ return (_jsx("div", { role: "img", "aria-label": `${label}: ${digits.split("").join(" ")}`, "data-format": format, className: join("mb-setup-code", className), ...props, children: groups.map((group, index) => (_jsx("span", { className: "mb-setup-code-group", "aria-hidden": "true", children: group }, `${index}-${group}`))) }));
24
+ }
25
+ /**
26
+ * Where the camera's picture goes while someone scans an accessory's code. It draws the frame and
27
+ * the instruction; put a camera preview inside, or leave it empty as a placeholder.
28
+ */
29
+ function SetupCodeScanner({ instruction = "Position the code in the frame.", className, children, ...props }) {
30
+ return (_jsxs("div", { className: join("mb-setup-code-scanner", className), ...props, children: [_jsxs("div", { className: "mb-setup-code-scanner-view", children: [children, _jsx("svg", { className: "mb-setup-code-scanner-frame", viewBox: "0 0 100 100", "aria-hidden": "true", children: _jsx("path", { d: "M4 24V12a8 8 0 0 1 8-8h12M76 4h12a8 8 0 0 1 8 8v12M96 76v12a8 8 0 0 1-8 8H76M24 96H12a8 8 0 0 1-8-8V76" }) })] }), instruction ? _jsx("p", { className: "mb-setup-code-scanner-instruction", children: instruction }) : null] }));
31
+ }
32
+ /** 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. */
33
+ function SetupCodeField({ format = "homekit", className, ...props }) {
34
+ const sizes = groupings[format];
35
+ const length = sizes.reduce((sum, size) => sum + size, 0);
36
+ let start = 0;
37
+ const runs = sizes.map((size) => {
38
+ const run = Array.from({ length: size }, (_, i) => start + i);
39
+ start += size;
40
+ return run;
41
+ });
42
+ return (_jsx(CodeField, { length: length, pattern: "digits", inputMode: "numeric", "data-format": format, className: cx("mb-setup-code-field", className), ...props, children: runs.map((run, i) => (_jsx(SetupCodeFieldRun, { run: run, separated: i > 0 }, run[0]))) }));
43
+ }
44
+ function SetupCodeFieldRun({ run, separated }) {
45
+ return (_jsxs(_Fragment, { children: [separated ? _jsx(CodeFieldSeparator, {}) : null, _jsx(CodeFieldGroup, { children: run.map((index) => (_jsx(CodeFieldSlot, { index: index }, index))) })] }));
46
+ }
47
+ export { SetupCode, SetupCodeField, SetupCodeScanner };
@@ -0,0 +1,31 @@
1
+ import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOutlet, DrawerTitle, DrawerTrigger } from "@ui-sdk/react/drawer";
2
+ import * as React from "react";
3
+ type Detent = "medium" | "large";
4
+ type SheetProps = Omit<React.ComponentProps<typeof Drawer>, "side"> & {
5
+ /** `bottom` is the iOS sheet. `start` and `end` are inspectors on iPad and Mac. */
6
+ side?: "bottom" | "top" | "start" | "end";
7
+ /** iOS detents. `["medium", "large"]` rests at half height and drags to full. Ignored when `snapPoints` is set. */
8
+ detents?: Detent[];
9
+ };
10
+ declare function Sheet({ side, detents, snapPoints, modal, children, ...props }: SheetProps): React.JSX.Element;
11
+ declare function SheetTrigger(props: React.ComponentProps<typeof DrawerTrigger>): React.JSX.Element;
12
+ type SheetContentProps<Payload = unknown> = React.ComponentProps<typeof DrawerContent<Payload>> & {
13
+ /** Shows the grabber on a bottom sheet. With more than one detent it's a button that steps between them. */
14
+ grabber?: boolean;
15
+ };
16
+ declare function SheetContent<Payload = unknown>({ grabber, className, children, ...props }: SheetContentProps<Payload>): React.JSX.Element;
17
+ /** The bar across the top: a title with optional leading and trailing buttons. */
18
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
19
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof DrawerTitle>): React.JSX.Element;
20
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof DrawerDescription>): React.JSX.Element;
21
+ /** The scrolling area. Dragging it down past its top moves the sheet. */
22
+ declare function SheetBody({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
23
+ type SheetCloseProps = React.ComponentProps<typeof DrawerClose> & {
24
+ variant?: "default" | "primary";
25
+ };
26
+ declare function SheetClose({ variant, className, ...props }: SheetCloseProps): React.JSX.Element;
27
+ /** Wraps the page behind a sheet so it recedes as the sheet rises, as iOS does. */
28
+ declare function SheetOutlet({ keyframes, className, ...props }: React.ComponentProps<typeof DrawerOutlet>): React.JSX.Element;
29
+ export { createDrawerController as createSheetController } from "@ui-sdk/react/drawer";
30
+ export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetOutlet, SheetTitle, SheetTrigger, };
31
+ export type { Detent, SheetCloseProps, SheetContentProps, SheetProps };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerHandle, DrawerOutlet, DrawerTitle, DrawerTrigger, } from "@ui-sdk/react/drawer";
4
+ import * as React from "react";
5
+ import { cx, join } from "../lib/cx.js";
6
+ const detentPoints = { medium: 0.5, large: 1 };
7
+ const SheetContext = React.createContext({
8
+ resizable: false,
9
+ large: false,
10
+ blocking: true,
11
+ });
12
+ function Sheet({ side = "bottom", detents, snapPoints, modal = true, children, ...props }) {
13
+ const points = snapPoints ?? detents?.map((detent) => detentPoints[detent]);
14
+ const context = React.useMemo(() => ({
15
+ resizable: (points?.length ?? 0) > 1,
16
+ large: detents?.includes("large") ?? (points?.some((point) => point === 1) || false),
17
+ // A sheet that leaves the page usable draws no scrim: it would dim the page and swallow presses meant for it.
18
+ blocking: modal === true,
19
+ }), [points, detents, modal]);
20
+ return (_jsx(SheetContext.Provider, { value: context, children: _jsx(Drawer, { side: side, snapPoints: points, modal: modal, ...props, children: children }) }));
21
+ }
22
+ function SheetTrigger(props) {
23
+ return _jsx(DrawerTrigger, { ...props });
24
+ }
25
+ function SheetContent({ grabber = true, className, children, ...props }) {
26
+ const { resizable, large, blocking } = React.useContext(SheetContext);
27
+ return (_jsxs(_Fragment, { children: [blocking ? _jsx(DrawerBackdrop, { className: "mb-sheet-backdrop" }) : null, _jsx(DrawerContent, { "data-large": large ? "" : undefined, className: cx("mb-sheet", className), ...props, children: (state) => (_jsxs(_Fragment, { children: [typeof children === "function" ? children(state) : children, grabber && state.side === "bottom" ? (resizable ? (_jsx(DrawerHandle, { "aria-label": "Resize sheet", className: "mb-sheet-grabber" })) : (_jsx("span", { "aria-hidden": "true", className: "mb-sheet-grabber" }))) : null] })) })] }));
28
+ }
29
+ /** The bar across the top: a title with optional leading and trailing buttons. */
30
+ function SheetHeader({ className, ...props }) {
31
+ return _jsx("div", { className: join("mb-sheet-header", className), ...props });
32
+ }
33
+ function SheetTitle({ className, ...props }) {
34
+ return _jsx(DrawerTitle, { className: cx("mb-sheet-title", className), ...props });
35
+ }
36
+ function SheetDescription({ className, ...props }) {
37
+ return _jsx(DrawerDescription, { className: cx("mb-sheet-description", className), ...props });
38
+ }
39
+ /** The scrolling area. Dragging it down past its top moves the sheet. */
40
+ function SheetBody({ className, ...props }) {
41
+ return _jsx("div", { className: join("mb-sheet-body", className), ...props });
42
+ }
43
+ function SheetClose({ variant = "default", className, ...props }) {
44
+ return _jsx(DrawerClose, { "data-variant": variant, className: cx("mb-sheet-close", className), ...props });
45
+ }
46
+ /** Wraps the page behind a sheet so it recedes as the sheet rises, as iOS does. */
47
+ function SheetOutlet({ keyframes = { scale: [1, 0.94], borderRadius: ["0px", "12px"] }, className, ...props }) {
48
+ return _jsx(DrawerOutlet, { keyframes: keyframes, className: cx("mb-sheet-outlet", className), ...props });
49
+ }
50
+ export { createDrawerController as createSheetController } from "@ui-sdk/react/drawer";
51
+ export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetOutlet, SheetTitle, SheetTrigger, };
@@ -0,0 +1,30 @@
1
+ import { Collapsible } from "@ui-sdk/react/collapsible";
2
+ import type * as React from "react";
3
+ type SidebarProps = React.ComponentProps<"nav"> & {
4
+ /** `accent` fills the selected row with the accent color, as macOS does in the key window; `gray` uses a neutral fill. */
5
+ selection?: "accent" | "gray";
6
+ };
7
+ declare function Sidebar({ selection, className, ...props }: SidebarProps): React.JSX.Element;
8
+ type SidebarSectionProps = Omit<React.ComponentProps<"div">, "title"> & {
9
+ /** The section header. Also names the list for assistive technology. */
10
+ title?: React.ReactNode;
11
+ /** Lets people hide the section with a disclosure chevron in its header. */
12
+ collapsible?: boolean;
13
+ defaultOpen?: boolean;
14
+ open?: boolean;
15
+ onOpenChange?: React.ComponentProps<typeof Collapsible>["onOpenChange"];
16
+ };
17
+ declare function SidebarSection({ title, collapsible, defaultOpen, open, onOpenChange, className, children, ...props }: SidebarSectionProps): React.JSX.Element;
18
+ type SidebarItemProps = Omit<React.ComponentProps<"a">, "ref" | "onClick"> & {
19
+ onClick?: React.MouseEventHandler<HTMLElement>;
20
+ icon?: React.ReactNode;
21
+ /** A trailing count or status, like unread messages. */
22
+ badge?: React.ReactNode;
23
+ /** Marks the row as the place on screen now. Sets `aria-current="page"`. */
24
+ current?: boolean;
25
+ /** Tints this row's icon, like a colored tag or a folder. */
26
+ tint?: string;
27
+ };
28
+ declare function SidebarItem({ icon, badge, current, tint, href, onClick, className, children, style, ...props }: SidebarItemProps): React.JSX.Element;
29
+ export { Sidebar, SidebarItem, SidebarSection };
30
+ export type { SidebarItemProps, SidebarProps, SidebarSectionProps };
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
3
+ import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "@ui-sdk/react/collapsible";
4
+ import { join } from "../lib/cx.js";
5
+ function Sidebar({ selection = "accent", className, ...props }) {
6
+ return _jsx("nav", { "data-selection": selection, className: join("mb-sidebar", className), ...props });
7
+ }
8
+ function SidebarSection({ title, collapsible, defaultOpen = true, open, onOpenChange, className, children, ...props }) {
9
+ const label = typeof title === "string" ? title : undefined;
10
+ const list = (_jsx("ul", { "aria-label": label, className: "mb-sidebar-list", children: children }));
11
+ if (!collapsible) {
12
+ return (_jsxs("div", { className: join("mb-sidebar-section", className), ...props, children: [title ? (_jsx("div", { "aria-hidden": label ? true : undefined, className: "mb-sidebar-section-header", children: title })) : null, list] }));
13
+ }
14
+ return (_jsxs(Collapsible, { defaultOpen: defaultOpen, open: open, onOpenChange: onOpenChange, className: join("mb-sidebar-section", className), ...props, children: [_jsxs(CollapsibleTrigger, { className: "mb-sidebar-section-header", children: [_jsx("span", { className: "mb-sidebar-section-title", children: title }), _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "mb-sidebar-section-chevron", children: _jsx("path", { d: "M6 3.5 10.5 8 6 12.5" }) })] }), _jsx(CollapsiblePanel, { className: "mb-sidebar-section-panel", children: list })] }));
15
+ }
16
+ function SidebarItem({ icon, badge, current, tint, href, onClick, className, children, style, ...props }) {
17
+ const content = (_jsxs(_Fragment, { children: [icon ? (_jsx("span", { "aria-hidden": "true", className: "mb-sidebar-item-icon", children: icon })) : null, _jsx("span", { className: "mb-sidebar-item-label", children: children }), badge != null ? _jsx("span", { className: "mb-sidebar-item-badge", children: badge }) : null] }));
18
+ const shared = {
19
+ "aria-current": current ? "page" : undefined,
20
+ "data-current": current ? "" : undefined,
21
+ className: join("mb-sidebar-item", className),
22
+ style: tint ? { "--mb-sidebar-icon-color": tint, ...style } : style,
23
+ };
24
+ return (_jsx("li", { className: "mb-sidebar-list-item", children: href ? (_jsx("a", { href: href, onClick: onClick, ...shared, ...props, children: content })) : (_jsx(ButtonPrimitive, { ...props, ...shared, onClick: onClick, children: content })) }));
25
+ }
26
+ export { Sidebar, SidebarItem, SidebarSection };
@@ -0,0 +1,27 @@
1
+ import { Slider as SliderPrimitive, SliderControl as SliderControlPrimitive, SliderIndicator as SliderIndicatorPrimitive, SliderThumb as SliderThumbPrimitive, SliderTrack as SliderTrackPrimitive, SliderValue as SliderValuePrimitive } from "@ui-sdk/react/slider";
2
+ import type * as React from "react";
3
+ type SliderProps = React.ComponentProps<typeof SliderPrimitive> & {
4
+ /** `sm` is the small slider for inspectors and dense toolbars. */
5
+ size?: "sm" | "md";
6
+ /** Tick marks along the track: a count, or `true` for one at every step. */
7
+ ticks?: number | boolean;
8
+ /** Names the thumbs of the slider's own control: one name, or one per thumb of a range. */
9
+ thumbLabel?: string | string[];
10
+ };
11
+ declare function Slider({ size, ticks, thumbLabel, className, children, ...props }: SliderProps): React.JSX.Element;
12
+ type SliderControlProps = React.ComponentProps<typeof SliderControlPrimitive> & {
13
+ /** How many tick marks to draw under the track, when the control composes its own track. */
14
+ ticks?: number;
15
+ thumbLabel?: string | string[];
16
+ };
17
+ declare function SliderControl({ ticks, thumbLabel, className, children, ...props }: SliderControlProps): React.JSX.Element;
18
+ declare function SliderTrack({ className, ...props }: React.ComponentProps<typeof SliderTrackPrimitive>): React.JSX.Element;
19
+ declare function SliderIndicator({ className, ...props }: React.ComponentProps<typeof SliderIndicatorPrimitive>): React.JSX.Element;
20
+ declare function SliderThumb({ className, ...props }: React.ComponentProps<typeof SliderThumbPrimitive>): React.JSX.Element;
21
+ declare function SliderValue({ className, ...props }: React.ComponentProps<typeof SliderValuePrimitive>): React.JSX.Element;
22
+ /** Evenly spaced tick marks, from the minimum to the maximum. Decorative. */
23
+ declare function SliderTicks({ count, className, ...props }: React.ComponentProps<"div"> & {
24
+ count: number;
25
+ }): React.JSX.Element;
26
+ export { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTicks, SliderTrack, SliderValue };
27
+ export type { SliderControlProps, SliderProps };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // Client-only because the default control renders its thumbs from a function of the slider's state.
4
+ import { Slider as SliderPrimitive, SliderControl as SliderControlPrimitive, SliderIndicator as SliderIndicatorPrimitive, SliderThumb as SliderThumbPrimitive, SliderTrack as SliderTrackPrimitive, SliderValue as SliderValuePrimitive, } from "@ui-sdk/react/slider";
5
+ import { cx } from "../lib/cx.js";
6
+ function tickCount(ticks, min = 0, max = 100, step = 1) {
7
+ if (typeof ticks === "number")
8
+ return ticks;
9
+ if (!ticks)
10
+ return 0;
11
+ const count = Math.floor((max - min) / step + 1e-9) + 1;
12
+ return count <= 101 ? count : 0;
13
+ }
14
+ function Slider({ size = "md", ticks, thumbLabel, className, children, ...props }) {
15
+ const count = tickCount(ticks, props.min, props.max, props.step);
16
+ return (_jsx(SliderPrimitive, { "data-size": size, className: cx("mb-slider", className), ...props, children: children ?? _jsx(SliderControl, { ticks: count, thumbLabel: thumbLabel }) }));
17
+ }
18
+ function SliderControl({ ticks = 0, thumbLabel, className, children, ...props }) {
19
+ return (_jsx(SliderControlPrimitive, { className: cx("mb-slider-control", className), ...props, children: children ??
20
+ ((state) => {
21
+ const values = Array.isArray(state.value) ? state.value : [state.value];
22
+ return (_jsxs(_Fragment, { children: [_jsxs(SliderTrack, { children: [_jsx(SliderIndicator, {}), values.map((_, index) => (_jsx(SliderThumb
23
+ // Thumbs are identified by their position in the value; there's no other key.
24
+ , { index: index, "aria-label": Array.isArray(thumbLabel) ? thumbLabel[index] : thumbLabel }, index)))] }), ticks > 0 ? _jsx(SliderTicks, { count: ticks }) : null] }));
25
+ }) }));
26
+ }
27
+ function SliderTrack({ className, ...props }) {
28
+ return _jsx(SliderTrackPrimitive, { className: cx("mb-slider-track", className), ...props });
29
+ }
30
+ function SliderIndicator({ className, ...props }) {
31
+ return _jsx(SliderIndicatorPrimitive, { className: cx("mb-slider-indicator", className), ...props });
32
+ }
33
+ function SliderThumb({ className, ...props }) {
34
+ return _jsx(SliderThumbPrimitive, { className: cx("mb-slider-thumb", className), ...props });
35
+ }
36
+ function SliderValue({ className, ...props }) {
37
+ return _jsx(SliderValuePrimitive, { className: cx("mb-slider-value", className), ...props });
38
+ }
39
+ /** Evenly spaced tick marks, from the minimum to the maximum. Decorative. */
40
+ function SliderTicks({ count, className, ...props }) {
41
+ return (_jsx("div", { "aria-hidden": "true", className: ["mb-slider-ticks", className].filter(Boolean).join(" "), ...props, children: Array.from({ length: count }, (_, index) => (_jsx("span", { className: "mb-slider-tick" }, index))) }));
42
+ }
43
+ export { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTicks, SliderTrack, SliderValue };
@@ -0,0 +1,11 @@
1
+ import { Resizable, ResizableHandle, ResizablePanel } from "@ui-sdk/react/resizable";
2
+ import type * as React from "react";
3
+ declare function SplitView({ className, ...props }: React.ComponentProps<typeof Resizable>): React.JSX.Element;
4
+ type SplitViewPaneProps = React.ComponentProps<typeof ResizablePanel> & {
5
+ /** `sidebar` takes the translucent sidebar material, `inspector` the secondary background. */
6
+ variant?: "sidebar" | "content" | "inspector";
7
+ };
8
+ declare function SplitViewPane({ variant, className, ...props }: SplitViewPaneProps): React.JSX.Element;
9
+ declare function SplitViewDivider({ className, ...props }: React.ComponentProps<typeof ResizableHandle>): React.JSX.Element;
10
+ export { SplitView, SplitViewDivider, SplitViewPane };
11
+ export type { SplitViewPaneProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Resizable, ResizableHandle, ResizablePanel, } from "@ui-sdk/react/resizable";
3
+ import { cx } from "../lib/cx.js";
4
+ function SplitView({ className, ...props }) {
5
+ return _jsx(Resizable, { className: cx("mb-split-view", className), ...props });
6
+ }
7
+ function SplitViewPane({ variant = "content", className, ...props }) {
8
+ return _jsx(ResizablePanel, { "data-variant": variant, className: cx("mb-split-view-pane", className), ...props });
9
+ }
10
+ function SplitViewDivider({ className, ...props }) {
11
+ return _jsx(ResizableHandle, { className: cx("mb-split-view-divider", className), ...props });
12
+ }
13
+ export { SplitView, SplitViewDivider, SplitViewPane };
@@ -0,0 +1,41 @@
1
+ import { type RenderProp } from "@ui-sdk/react/primitive";
2
+ import type * as React from "react";
3
+ import { squirclePath } from "../lib/squircle.js";
4
+ type SquircleRadius = number | string | "icon";
5
+ type SquircleProps = Omit<React.ComponentProps<"div">, "style"> & {
6
+ style?: React.CSSProperties;
7
+ /** A number is pixels, a string any CSS length or percentage. `icon` is an app icon's proportion. */
8
+ radius?: SquircleRadius;
9
+ /** How far the corner eases into the edge, 0 (a circular arc) to 1. Defaults to iOS's. */
10
+ smoothing?: number;
11
+ /** Width and height in pixels, for a square. Needed for `exact`. */
12
+ size?: number;
13
+ width?: number;
14
+ height?: number;
15
+ /**
16
+ * Draws the true shape with a `clip-path` computed on the server, so it looks
17
+ * the same in every browser. Needs a known size; without one it falls back to
18
+ * `corner-shape`.
19
+ */
20
+ exact?: boolean;
21
+ /** A drop shadow that follows the shape. In `exact` mode it's drawn by a wrapper, since a clip-path cuts shadows off. */
22
+ shadow?: boolean;
23
+ render?: RenderProp;
24
+ };
25
+ /**
26
+ * A box with Apple's continuous corners: app icons, artwork, tiles. Uses
27
+ * `corner-shape` where the browser has it and a plain radius elsewhere, or with
28
+ * `exact` and a known size, the true outline in every browser.
29
+ */
30
+ declare function Squircle({ radius, smoothing, size, width, height, exact, shadow, className, style, render, ...props }: SquircleProps): React.JSX.Element;
31
+ type SquircleShadowProps = React.ComponentProps<"div"> & {
32
+ render?: RenderProp;
33
+ };
34
+ /**
35
+ * Draws a shadow around whatever shape its child is clipped to, with
36
+ * `filter: drop-shadow()`. Wrap a clipped element in it; set
37
+ * `--mb-squircle-shadow` to change the shadow.
38
+ */
39
+ declare function SquircleShadow({ className, render, ...props }: SquircleShadowProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
40
+ export { Squircle, SquircleShadow, squirclePath };
41
+ export type { SquircleProps, SquircleRadius, SquircleShadowProps };
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { renderElement } from "@ui-sdk/react/primitive";
3
+ import { join } from "../lib/cx.js";
4
+ import { SQUIRCLE_ICON_RATIO, SQUIRCLE_SMOOTHING, squirclePath } from "../lib/squircle.js";
5
+ // superellipse(k) at m × the radius best matches a smoothing s: fitted against
6
+ // the same outlines as the tokens (s 0.77 ↔ k 1.7, m 1.5; s 0 is a plain arc).
7
+ function cssFit(smoothing) {
8
+ const s = Math.min(Math.max(smoothing, 0), 1);
9
+ return { k: 1 + s * (0.7 / SQUIRCLE_SMOOTHING), m: 1 + s * (0.5 / SQUIRCLE_SMOOTHING) };
10
+ }
11
+ function cssRadius(radius) {
12
+ if (radius === "icon")
13
+ return "var(--mb-squircle-radius-icon)";
14
+ return typeof radius === "number" ? `${radius}px` : radius;
15
+ }
16
+ /** The radius in pixels for a box of the given size, or null when CSS has to resolve it. */
17
+ function pixelRadius(radius, width, height) {
18
+ if (radius === "icon")
19
+ return SQUIRCLE_ICON_RATIO * Math.min(width, height);
20
+ if (typeof radius === "number")
21
+ return radius;
22
+ const match = /^\s*(-?[\d.]+)\s*(px|%)?\s*$/.exec(radius);
23
+ if (!match)
24
+ return null;
25
+ const value = Number.parseFloat(match[1]);
26
+ return match[2] === "%" ? (value / 100) * Math.min(width, height) : value;
27
+ }
28
+ /**
29
+ * A box with Apple's continuous corners: app icons, artwork, tiles. Uses
30
+ * `corner-shape` where the browser has it and a plain radius elsewhere, or with
31
+ * `exact` and a known size, the true outline in every browser.
32
+ */
33
+ function Squircle({ radius = "icon", smoothing, size, width = size, height = size, exact, shadow, className, style, render, ...props }) {
34
+ const sized = width !== undefined && height !== undefined && width > 0 && height > 0;
35
+ const px = sized ? pixelRadius(radius, width, height) : null;
36
+ const path = exact && sized && px !== null ? squirclePath(width, height, px, smoothing ?? SQUIRCLE_SMOOTHING) : null;
37
+ const fit = smoothing === undefined ? null : cssFit(smoothing);
38
+ const element = renderElement("div", {
39
+ ...props,
40
+ "data-exact": path ? "" : undefined,
41
+ "data-shadow": shadow && !path ? "" : undefined,
42
+ "data-smoothing": fit ? "" : undefined,
43
+ className: join("mb-squircle", className),
44
+ style: {
45
+ "--mb-squircle-radius": cssRadius(radius),
46
+ ...(fit && { "--mb-squircle-k": fit.k.toFixed(3), "--mb-squircle-m": fit.m.toFixed(3) }),
47
+ ...style,
48
+ ...(width !== undefined && { width }),
49
+ ...(height !== undefined && { height }),
50
+ ...(path && { clipPath: `path("${path}")` }),
51
+ },
52
+ }, render);
53
+ return path && shadow ? _jsx(SquircleShadow, { children: element }) : element;
54
+ }
55
+ /**
56
+ * Draws a shadow around whatever shape its child is clipped to, with
57
+ * `filter: drop-shadow()`. Wrap a clipped element in it; set
58
+ * `--mb-squircle-shadow` to change the shadow.
59
+ */
60
+ function SquircleShadow({ className, render, ...props }) {
61
+ return renderElement("div", { ...props, className: join("mb-squircle-shadow", className) }, render);
62
+ }
63
+ export { Squircle, SquircleShadow, squirclePath };
@@ -0,0 +1,30 @@
1
+ import { NumberInput } from "@ui-sdk/react/number-input";
2
+ import type * as React from "react";
3
+ type NumberInputRootProps = Omit<React.ComponentProps<typeof NumberInput>, "children"> & {
4
+ /** Content before the field, like a scrub area. */
5
+ children?: React.ReactNode;
6
+ size?: "sm" | "md";
7
+ };
8
+ type StepperButtonsProps = {
9
+ /** Names the decrement button. */
10
+ decrementLabel?: string;
11
+ /** Names the increment button. */
12
+ incrementLabel?: string;
13
+ };
14
+ type NumberFieldProps = NumberInputRootProps & StepperButtonsProps & {
15
+ /** Placeholder for the empty field. */
16
+ placeholder?: string;
17
+ };
18
+ /**
19
+ * A number in a text field with a stepper beside it: up and down arrows on macOS,
20
+ * a − / + capsule on iPadOS and iOS. `aria-label` and `aria-labelledby` name the text field.
21
+ */
22
+ declare function NumberField({ size, decrementLabel, incrementLabel, placeholder, "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }: NumberFieldProps): React.JSX.Element;
23
+ type StepperProps = NumberInputRootProps & StepperButtonsProps;
24
+ /**
25
+ * The stepper alone, for a value shown elsewhere, like a quantity in a row's title.
26
+ * Its number field is visually hidden but still takes focus, so the arrow keys and screen readers work.
27
+ */
28
+ declare function Stepper({ size, decrementLabel, incrementLabel, "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }: StepperProps): React.JSX.Element;
29
+ export { NumberField, Stepper };
30
+ export type { NumberFieldProps, StepperProps };
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { NumberInput, NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement, } from "@ui-sdk/react/number-input";
3
+ import { cx } from "../lib/cx.js";
4
+ // Both glyph sets are drawn; the stylesheet shows chevrons on macOS and − / + on touch.
5
+ function DecrementGlyphs() {
6
+ return (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 10 6", "aria-hidden": "true", className: "mb-stepper-glyph", "data-glyph": "chevron", children: _jsx("path", { d: "M2 1.5 5 4.5 8 1.5" }) }), _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "mb-stepper-glyph", "data-glyph": "sign", children: _jsx("path", { d: "M3 8h10" }) })] }));
7
+ }
8
+ function IncrementGlyphs() {
9
+ return (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 10 6", "aria-hidden": "true", className: "mb-stepper-glyph", "data-glyph": "chevron", children: _jsx("path", { d: "M2 4.5 5 1.5 8 4.5" }) }), _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "mb-stepper-glyph", "data-glyph": "sign", children: _jsx("path", { d: "M3 8h10M8 3v10" }) })] }));
10
+ }
11
+ function StepperButtons({ decrementLabel = "Decrease", incrementLabel = "Increase" }) {
12
+ return (_jsxs(_Fragment, { children: [_jsx(NumberInputDecrement, { "aria-label": decrementLabel, className: "mb-stepper-button", "data-step": "decrement", children: _jsx(DecrementGlyphs, {}) }), _jsx(NumberInputIncrement, { "aria-label": incrementLabel, className: "mb-stepper-button", "data-step": "increment", children: _jsx(IncrementGlyphs, {}) })] }));
13
+ }
14
+ /**
15
+ * A number in a text field with a stepper beside it: up and down arrows on macOS,
16
+ * a − / + capsule on iPadOS and iOS. `aria-label` and `aria-labelledby` name the text field.
17
+ */
18
+ function NumberField({ size = "md", decrementLabel, incrementLabel, placeholder, "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }) {
19
+ return (_jsxs(NumberInput, { "data-size": size, className: cx("mb-number-field", className), ...props, children: [children, _jsxs(NumberInputGroup, { className: "mb-number-field-group", children: [_jsx(NumberInputControl, { "aria-label": label, "aria-labelledby": labelledBy, placeholder: placeholder, className: "mb-number-field-input" }), _jsx("span", { className: "mb-stepper-buttons", children: _jsx(StepperButtons, { decrementLabel: decrementLabel, incrementLabel: incrementLabel }) })] })] }));
20
+ }
21
+ /**
22
+ * The stepper alone, for a value shown elsewhere, like a quantity in a row's title.
23
+ * Its number field is visually hidden but still takes focus, so the arrow keys and screen readers work.
24
+ */
25
+ function Stepper({ size = "md", decrementLabel, incrementLabel, "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }) {
26
+ return (_jsxs(NumberInput, { "data-size": size, className: cx("mb-stepper", className), ...props, children: [children, _jsxs(NumberInputGroup, { className: "mb-stepper-buttons", children: [_jsx(NumberInputControl, { "aria-label": label, "aria-labelledby": labelledBy, className: "mb-stepper-input" }), _jsx(StepperButtons, { decrementLabel: decrementLabel, incrementLabel: incrementLabel })] })] }));
27
+ }
28
+ export { NumberField, Stepper };
@@ -0,0 +1,10 @@
1
+ import { Switch as SwitchPrimitive, SwitchThumb as SwitchThumbPrimitive } from "@ui-sdk/react/switch";
2
+ import type * as React from "react";
3
+ type SwitchProps = React.ComponentProps<typeof SwitchPrimitive> & {
4
+ /** `sm` is macOS's mini switch for dense inspectors. */
5
+ size?: "sm" | "md";
6
+ };
7
+ declare function SwitchThumb({ className, ...props }: React.ComponentProps<typeof SwitchThumbPrimitive>): React.JSX.Element;
8
+ declare function Switch({ size, className, children, ...props }: SwitchProps): React.JSX.Element;
9
+ export { Switch, SwitchThumb };
10
+ export type { SwitchProps };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Switch as SwitchPrimitive, SwitchThumb as SwitchThumbPrimitive } from "@ui-sdk/react/switch";
3
+ import { cx } from "../lib/cx.js";
4
+ function SwitchThumb({ className, ...props }) {
5
+ return _jsx(SwitchThumbPrimitive, { className: cx("mb-switch-thumb", className), ...props });
6
+ }
7
+ function Switch({ size = "md", className, children, ...props }) {
8
+ return (_jsx(SwitchPrimitive, { "data-size": size, className: cx("mb-switch", className), ...props, children: children ?? _jsx(SwitchThumb, {}) }));
9
+ }
10
+ export { Switch, SwitchThumb };
@@ -0,0 +1,20 @@
1
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/react/tabs";
2
+ import type * as React from "react";
3
+ type TabBarProps = React.ComponentProps<typeof Tabs>;
4
+ /** The app's top-level sections: the panels, with the tab bar floating over them. */
5
+ declare function TabBar({ className, ...props }: TabBarProps): React.JSX.Element;
6
+ declare function TabBarPanel({ className, ...props }: React.ComponentProps<typeof TabsPanel>): React.JSX.Element;
7
+ type TabBarListProps = Omit<React.ComponentProps<typeof TabsList>, "children"> & {
8
+ children?: React.ReactNode;
9
+ /** `floating` is the glass capsule of iOS 26; `classic` is the full-width translucent bar. */
10
+ variant?: "floating" | "classic";
11
+ };
12
+ declare function TabBarList({ variant, className, children, ...props }: TabBarListProps): React.JSX.Element;
13
+ type TabBarItemProps = Omit<React.ComponentProps<typeof TabsTab>, "children"> & {
14
+ children?: React.ReactNode;
15
+ /** The tab's symbol, drawn above its label. Decorative: the label names the tab. */
16
+ icon?: React.ReactNode;
17
+ };
18
+ declare function TabBarItem({ icon, className, children, ...props }: TabBarItemProps): React.JSX.Element;
19
+ export { TabBar, TabBarItem, TabBarList, TabBarPanel };
20
+ export type { TabBarItemProps, TabBarListProps, TabBarProps };
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Tabs, TabsIndicator, TabsList, TabsPanel, TabsTab, TabsTabIcon, } from "@ui-sdk/react/tabs";
3
+ import { cx } from "../lib/cx.js";
4
+ /** The app's top-level sections: the panels, with the tab bar floating over them. */
5
+ function TabBar({ className, ...props }) {
6
+ return _jsx(Tabs, { className: cx("mb-tab-bar", className), ...props });
7
+ }
8
+ function TabBarPanel({ className, ...props }) {
9
+ return _jsx(TabsPanel, { className: cx("mb-tab-bar-panel", className), ...props });
10
+ }
11
+ function TabBarList({ variant = "floating", className, children, ...props }) {
12
+ return (_jsxs(TabsList, { "data-variant": variant, className: cx(variant === "floating" ? "mb-tab-bar-list mb-glass" : "mb-tab-bar-list", className), ...props, children: [variant === "floating" ? _jsx(TabsIndicator, { className: "mb-tab-bar-indicator" }) : null, children] }));
13
+ }
14
+ function TabBarItem({ icon, className, children, ...props }) {
15
+ return (_jsxs(TabsTab, { className: cx("mb-tab-bar-item", className), ...props, children: [icon ? _jsx(TabsTabIcon, { className: "mb-tab-bar-item-icon", children: icon }) : null, _jsx("span", { className: "mb-tab-bar-item-label", children: children })] }));
16
+ }
17
+ export { TabBar, TabBarItem, TabBarList, TabBarPanel };
@@ -0,0 +1,49 @@
1
+ import { type ChangeDetails } from "@ui-sdk/core";
2
+ import { type PartProps } from "@ui-sdk/react/primitive";
3
+ import type * as React from "react";
4
+ type TableSelectionMode = "none" | "single" | "multiple";
5
+ type TableSortDirection = "ascending" | "descending";
6
+ type TableSort = {
7
+ column: string;
8
+ direction: TableSortDirection;
9
+ };
10
+ type TableSelectionReason = "item-press" | "list-navigation";
11
+ type TableOptions = {
12
+ selectionMode?: TableSelectionMode;
13
+ value?: string[];
14
+ defaultValue?: string[];
15
+ onValueChange?: (value: string[], details: ChangeDetails<TableSelectionReason>) => void;
16
+ sort?: TableSort | null;
17
+ defaultSort?: TableSort | null;
18
+ onSortChange?: (sort: TableSort, details: ChangeDetails<"item-press">) => void;
19
+ onAction?: (value: string) => void;
20
+ };
21
+ type TableProps = PartProps<"table"> & TableOptions & {
22
+ /** Shades every other row, like Finder's list view. */
23
+ alternating?: boolean;
24
+ };
25
+ declare function Table({ alternating, className, ...props }: TableProps): React.JSX.Element;
26
+ declare function TableHeader({ className, children, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
27
+ type TableColumnProps = Omit<PartProps<"th">, "align" | "children"> & {
28
+ children?: React.ReactNode;
29
+ /** Identifies the column in the table's `sort`. Set it to make the column sortable. */
30
+ value?: string;
31
+ align?: "start" | "center" | "end";
32
+ };
33
+ declare function TableColumn({ value, align, className, children, ...props }: TableColumnProps): React.JSX.Element;
34
+ declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
35
+ type TableRowProps = PartProps<"tr", {
36
+ selected: boolean;
37
+ }> & {
38
+ /** Identifies the row in the table's `value`. */
39
+ value: string;
40
+ };
41
+ declare function TableRow({ className, ...props }: TableRowProps): React.JSX.Element;
42
+ type TableCellProps = Omit<React.ComponentProps<"td">, "align"> & {
43
+ align?: "start" | "center" | "end";
44
+ /** Secondary text, like a file's size or kind. */
45
+ secondary?: boolean;
46
+ };
47
+ declare function TableCell({ align, secondary, className, ...props }: TableCellProps): React.JSX.Element;
48
+ export { Table, TableBody, TableCell, TableColumn, TableHeader, TableRow };
49
+ export type { TableCellProps, TableColumnProps, TableOptions, TableProps, TableRowProps, TableSelectionMode, TableSort, TableSortDirection, };