@sublime-ui/library 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -0
  3. package/dist/components/AppBar/AppBar.d.ts +6 -0
  4. package/dist/components/AppBar/AppBar.js +55 -0
  5. package/dist/components/AppBar/AppBar.types.d.ts +11 -0
  6. package/dist/components/AppBar/AppBar.types.js +0 -0
  7. package/dist/components/AppBar/index.d.ts +3 -0
  8. package/dist/components/AppBar/index.js +4 -0
  9. package/dist/components/Avatar/Avatar.d.ts +7 -0
  10. package/dist/components/Avatar/Avatar.js +30 -0
  11. package/dist/components/Avatar/Avatar.types.d.ts +12 -0
  12. package/dist/components/Avatar/Avatar.types.js +0 -0
  13. package/dist/components/Avatar/index.d.ts +4 -0
  14. package/dist/components/Avatar/index.js +4 -0
  15. package/dist/components/Badge/Badge.d.ts +7 -0
  16. package/dist/components/Badge/Badge.js +75 -0
  17. package/dist/components/Badge/Badge.types.d.ts +12 -0
  18. package/dist/components/Badge/Badge.types.js +0 -0
  19. package/dist/components/Badge/index.d.ts +4 -0
  20. package/dist/components/Badge/index.js +4 -0
  21. package/dist/components/Banner/Banner.d.ts +7 -0
  22. package/dist/components/Banner/Banner.js +68 -0
  23. package/dist/components/Banner/Banner.types.d.ts +13 -0
  24. package/dist/components/Banner/Banner.types.js +0 -0
  25. package/dist/components/Banner/index.d.ts +4 -0
  26. package/dist/components/Banner/index.js +4 -0
  27. package/dist/components/BottomNav/BottomNav.d.ts +7 -0
  28. package/dist/components/BottomNav/BottomNav.js +9 -0
  29. package/dist/components/BottomNav/BottomNav.types.d.ts +10 -0
  30. package/dist/components/BottomNav/BottomNav.types.js +0 -0
  31. package/dist/components/BottomNav/index.d.ts +3 -0
  32. package/dist/components/BottomNav/index.js +4 -0
  33. package/dist/components/Button/Button.d.ts +7 -0
  34. package/dist/components/Button/Button.js +42 -0
  35. package/dist/components/Button/Button.types.d.ts +17 -0
  36. package/dist/components/Button/Button.types.js +0 -0
  37. package/dist/components/Button/index.d.ts +4 -0
  38. package/dist/components/Button/index.js +4 -0
  39. package/dist/components/Card/Card.d.ts +6 -0
  40. package/dist/components/Card/Card.js +26 -0
  41. package/dist/components/Card/Card.types.d.ts +10 -0
  42. package/dist/components/Card/Card.types.js +0 -0
  43. package/dist/components/Card/index.d.ts +3 -0
  44. package/dist/components/Card/index.js +4 -0
  45. package/dist/components/Checkbox/Checkbox.d.ts +7 -0
  46. package/dist/components/Checkbox/Checkbox.js +34 -0
  47. package/dist/components/Checkbox/Checkbox.types.d.ts +17 -0
  48. package/dist/components/Checkbox/Checkbox.types.js +0 -0
  49. package/dist/components/Checkbox/index.d.ts +4 -0
  50. package/dist/components/Checkbox/index.js +4 -0
  51. package/dist/components/Dialog/Dialog.d.ts +6 -0
  52. package/dist/components/Dialog/Dialog.js +51 -0
  53. package/dist/components/Dialog/Dialog.types.d.ts +12 -0
  54. package/dist/components/Dialog/Dialog.types.js +0 -0
  55. package/dist/components/Dialog/index.d.ts +3 -0
  56. package/dist/components/Dialog/index.js +4 -0
  57. package/dist/components/Divider/Divider.d.ts +6 -0
  58. package/dist/components/Divider/Divider.js +19 -0
  59. package/dist/components/Divider/Divider.types.d.ts +7 -0
  60. package/dist/components/Divider/Divider.types.js +0 -0
  61. package/dist/components/Divider/index.d.ts +3 -0
  62. package/dist/components/Divider/index.js +4 -0
  63. package/dist/components/Drawer/Drawer.d.ts +8 -0
  64. package/dist/components/Drawer/Drawer.js +9 -0
  65. package/dist/components/Drawer/Drawer.types.d.ts +13 -0
  66. package/dist/components/Drawer/Drawer.types.js +0 -0
  67. package/dist/components/Drawer/index.d.ts +4 -0
  68. package/dist/components/Drawer/index.js +4 -0
  69. package/dist/components/Fab/Fab.d.ts +7 -0
  70. package/dist/components/Fab/Fab.js +33 -0
  71. package/dist/components/Fab/Fab.types.d.ts +11 -0
  72. package/dist/components/Fab/Fab.types.js +0 -0
  73. package/dist/components/Fab/index.d.ts +4 -0
  74. package/dist/components/Fab/index.js +4 -0
  75. package/dist/components/GlassAppBar/GlassAppBar.d.ts +6 -0
  76. package/dist/components/GlassAppBar/GlassAppBar.js +57 -0
  77. package/dist/components/GlassAppBar/GlassAppBar.types.d.ts +12 -0
  78. package/dist/components/GlassAppBar/GlassAppBar.types.js +0 -0
  79. package/dist/components/GlassAppBar/index.d.ts +3 -0
  80. package/dist/components/GlassAppBar/index.js +4 -0
  81. package/dist/components/Icon/Icon.d.ts +8 -0
  82. package/dist/components/Icon/Icon.js +46 -0
  83. package/dist/components/Icon/Icon.types.d.ts +14 -0
  84. package/dist/components/Icon/Icon.types.js +0 -0
  85. package/dist/components/Icon/index.d.ts +5 -0
  86. package/dist/components/Icon/index.js +4 -0
  87. package/dist/components/Input/Input.d.ts +6 -0
  88. package/dist/components/Input/Input.js +43 -0
  89. package/dist/components/Input/Input.types.d.ts +13 -0
  90. package/dist/components/Input/Input.types.js +0 -0
  91. package/dist/components/Input/index.d.ts +3 -0
  92. package/dist/components/Input/index.js +4 -0
  93. package/dist/components/Select/Select.d.ts +6 -0
  94. package/dist/components/Select/Select.js +50 -0
  95. package/dist/components/Select/Select.types.d.ts +15 -0
  96. package/dist/components/Select/Select.types.js +0 -0
  97. package/dist/components/Select/index.d.ts +3 -0
  98. package/dist/components/Select/index.js +4 -0
  99. package/dist/components/Spinner/Spinner.d.ts +7 -0
  100. package/dist/components/Spinner/Spinner.js +35 -0
  101. package/dist/components/Spinner/Spinner.types.d.ts +9 -0
  102. package/dist/components/Spinner/Spinner.types.js +0 -0
  103. package/dist/components/Spinner/index.d.ts +4 -0
  104. package/dist/components/Spinner/index.js +4 -0
  105. package/dist/components/Surface/Surface.d.ts +6 -0
  106. package/dist/components/Surface/Surface.js +29 -0
  107. package/dist/components/Surface/Surface.types.d.ts +11 -0
  108. package/dist/components/Surface/Surface.types.js +0 -0
  109. package/dist/components/Surface/index.d.ts +3 -0
  110. package/dist/components/Surface/index.js +4 -0
  111. package/dist/components/Switch/Switch.d.ts +7 -0
  112. package/dist/components/Switch/Switch.js +34 -0
  113. package/dist/components/Switch/Switch.types.d.ts +17 -0
  114. package/dist/components/Switch/Switch.types.js +0 -0
  115. package/dist/components/Switch/index.d.ts +4 -0
  116. package/dist/components/Switch/index.js +4 -0
  117. package/dist/components/Text/Text.d.ts +7 -0
  118. package/dist/components/Text/Text.js +34 -0
  119. package/dist/components/Text/Text.types.d.ts +13 -0
  120. package/dist/components/Text/Text.types.js +0 -0
  121. package/dist/components/Text/index.d.ts +4 -0
  122. package/dist/components/Text/index.js +4 -0
  123. package/dist/components/Tooltip/Tooltip.d.ts +6 -0
  124. package/dist/components/Tooltip/Tooltip.js +8 -0
  125. package/dist/components/Tooltip/Tooltip.types.d.ts +11 -0
  126. package/dist/components/Tooltip/Tooltip.types.js +0 -0
  127. package/dist/components/Tooltip/index.d.ts +3 -0
  128. package/dist/components/Tooltip/index.js +4 -0
  129. package/dist/components/common.d.ts +11 -0
  130. package/dist/components/common.js +0 -0
  131. package/dist/index.d.ts +53 -0
  132. package/dist/index.js +54 -0
  133. package/dist/notifications/NotificationContext.d.ts +33 -0
  134. package/dist/notifications/NotificationContext.js +34 -0
  135. package/dist/notifications/NotificationHost.d.ts +5 -0
  136. package/dist/notifications/NotificationHost.js +22 -0
  137. package/dist/notifications/useNotify.d.ts +13 -0
  138. package/dist/notifications/useNotify.js +19 -0
  139. package/dist/provider/SublimeProvider.d.ts +12 -0
  140. package/dist/provider/SublimeProvider.js +23 -0
  141. package/dist/provider/TokenContext.d.ts +14 -0
  142. package/dist/provider/TokenContext.js +5 -0
  143. package/dist/provider/resolveTokens.d.ts +7 -0
  144. package/dist/provider/resolveTokens.js +13 -0
  145. package/dist/provider/useTokens.d.ts +7 -0
  146. package/dist/provider/useTokens.js +12 -0
  147. package/dist/tokens/generateThemes.d.ts +10 -0
  148. package/dist/tokens/generateThemes.js +44 -0
  149. package/dist/tokens/tokens.d.ts +74 -0
  150. package/dist/tokens/tokens.js +78 -0
  151. package/package.json +53 -0
  152. package/src/components/AppBar/AppBar.native.tsx +28 -0
  153. package/src/components/AppBar/AppBar.tsx +51 -0
  154. package/src/components/AppBar/AppBar.types.ts +9 -0
  155. package/src/components/AppBar/index.ts +2 -0
  156. package/src/components/Avatar/Avatar.native.tsx +38 -0
  157. package/src/components/Avatar/Avatar.tsx +38 -0
  158. package/src/components/Avatar/Avatar.types.ts +10 -0
  159. package/src/components/Avatar/index.ts +2 -0
  160. package/src/components/Badge/Badge.native.tsx +97 -0
  161. package/src/components/Badge/Badge.tsx +89 -0
  162. package/src/components/Badge/Badge.types.ts +11 -0
  163. package/src/components/Badge/index.ts +2 -0
  164. package/src/components/Banner/Banner.native.tsx +89 -0
  165. package/src/components/Banner/Banner.tsx +78 -0
  166. package/src/components/Banner/Banner.types.ts +11 -0
  167. package/src/components/Banner/index.ts +2 -0
  168. package/src/components/BottomNav/BottomNav.native.tsx +87 -0
  169. package/src/components/BottomNav/BottomNav.tsx +9 -0
  170. package/src/components/BottomNav/BottomNav.types.ts +8 -0
  171. package/src/components/BottomNav/index.ts +2 -0
  172. package/src/components/Button/Button.native.tsx +27 -0
  173. package/src/components/Button/Button.tsx +37 -0
  174. package/src/components/Button/Button.types.ts +17 -0
  175. package/src/components/Button/index.ts +2 -0
  176. package/src/components/Card/Card.native.tsx +24 -0
  177. package/src/components/Card/Card.tsx +30 -0
  178. package/src/components/Card/Card.types.ts +8 -0
  179. package/src/components/Card/index.ts +2 -0
  180. package/src/components/Checkbox/Checkbox.native.tsx +58 -0
  181. package/src/components/Checkbox/Checkbox.tsx +35 -0
  182. package/src/components/Checkbox/Checkbox.types.ts +15 -0
  183. package/src/components/Checkbox/index.ts +2 -0
  184. package/src/components/Dialog/Dialog.native.tsx +28 -0
  185. package/src/components/Dialog/Dialog.tsx +49 -0
  186. package/src/components/Dialog/Dialog.types.ts +10 -0
  187. package/src/components/Dialog/index.ts +2 -0
  188. package/src/components/Divider/Divider.native.tsx +30 -0
  189. package/src/components/Divider/Divider.tsx +16 -0
  190. package/src/components/Divider/Divider.types.ts +5 -0
  191. package/src/components/Divider/index.ts +2 -0
  192. package/src/components/Drawer/Drawer.native.tsx +113 -0
  193. package/src/components/Drawer/Drawer.tsx +9 -0
  194. package/src/components/Drawer/Drawer.types.ts +11 -0
  195. package/src/components/Drawer/index.ts +2 -0
  196. package/src/components/Fab/Fab.native.tsx +41 -0
  197. package/src/components/Fab/Fab.tsx +36 -0
  198. package/src/components/Fab/Fab.types.ts +9 -0
  199. package/src/components/Fab/index.ts +2 -0
  200. package/src/components/GlassAppBar/GlassAppBar.native.tsx +29 -0
  201. package/src/components/GlassAppBar/GlassAppBar.tsx +53 -0
  202. package/src/components/GlassAppBar/GlassAppBar.types.ts +10 -0
  203. package/src/components/GlassAppBar/index.ts +2 -0
  204. package/src/components/Icon/Icon.native.tsx +39 -0
  205. package/src/components/Icon/Icon.tsx +57 -0
  206. package/src/components/Icon/Icon.types.ts +13 -0
  207. package/src/components/Icon/index.ts +2 -0
  208. package/src/components/Input/Input.native.tsx +34 -0
  209. package/src/components/Input/Input.tsx +33 -0
  210. package/src/components/Input/Input.types.ts +11 -0
  211. package/src/components/Input/index.ts +2 -0
  212. package/src/components/Select/Select.native.tsx +63 -0
  213. package/src/components/Select/Select.tsx +48 -0
  214. package/src/components/Select/Select.types.ts +14 -0
  215. package/src/components/Select/index.ts +2 -0
  216. package/src/components/Spinner/Spinner.native.tsx +38 -0
  217. package/src/components/Spinner/Spinner.tsx +37 -0
  218. package/src/components/Spinner/Spinner.types.ts +7 -0
  219. package/src/components/Spinner/index.ts +2 -0
  220. package/src/components/Surface/Surface.native.tsx +32 -0
  221. package/src/components/Surface/Surface.tsx +31 -0
  222. package/src/components/Surface/Surface.types.ts +10 -0
  223. package/src/components/Surface/index.ts +2 -0
  224. package/src/components/Switch/Switch.native.tsx +58 -0
  225. package/src/components/Switch/Switch.tsx +35 -0
  226. package/src/components/Switch/Switch.types.ts +15 -0
  227. package/src/components/Switch/index.ts +2 -0
  228. package/src/components/Text/Text.native.tsx +31 -0
  229. package/src/components/Text/Text.tsx +34 -0
  230. package/src/components/Text/Text.types.ts +12 -0
  231. package/src/components/Text/index.ts +2 -0
  232. package/src/components/Tooltip/Tooltip.native.tsx +6 -0
  233. package/src/components/Tooltip/Tooltip.tsx +10 -0
  234. package/src/components/Tooltip/Tooltip.types.ts +9 -0
  235. package/src/components/Tooltip/index.ts +2 -0
  236. package/src/components/common.ts +10 -0
  237. package/src/index.ts +33 -0
  238. package/src/notifications/NotificationContext.tsx +57 -0
  239. package/src/notifications/NotificationHost.native.tsx +20 -0
  240. package/src/notifications/NotificationHost.tsx +27 -0
  241. package/src/notifications/useNotify.ts +18 -0
  242. package/src/provider/SublimeProvider.native.tsx +29 -0
  243. package/src/provider/SublimeProvider.tsx +30 -0
  244. package/src/provider/TokenContext.ts +13 -0
  245. package/src/provider/resolveTokens.ts +16 -0
  246. package/src/provider/useTokens.ts +10 -0
  247. package/src/test-utils/renderWeb.tsx +8 -0
  248. package/src/tokens/generateThemes.ts +49 -0
  249. package/src/tokens/tokens.ts +71 -0
@@ -0,0 +1,34 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Checkbox as MuiCheckbox, FormControlLabel } from "@mui/material";
3
+ const muiColor = (t) => t === "danger" ? "error" : t === "neutral" ? "default" : t;
4
+ function Checkbox({
5
+ checked,
6
+ onChange,
7
+ label,
8
+ disabled,
9
+ tone = "primary",
10
+ testID
11
+ }) {
12
+ const control = /* @__PURE__ */ jsx(
13
+ MuiCheckbox,
14
+ {
15
+ checked,
16
+ onChange: (e) => onChange(e.target.checked),
17
+ disabled,
18
+ color: muiColor(tone),
19
+ "data-testid": testID
20
+ }
21
+ );
22
+ if (label === void 0) return control;
23
+ return /* @__PURE__ */ jsx(
24
+ FormControlLabel,
25
+ {
26
+ control,
27
+ label,
28
+ ...disabled === void 0 ? {} : { disabled }
29
+ }
30
+ );
31
+ }
32
+ export {
33
+ Checkbox
34
+ };
@@ -0,0 +1,17 @@
1
+ import { Tone } from '../common.js';
2
+
3
+ interface CheckboxProps {
4
+ /** Whether the checkbox is checked. */
5
+ checked: boolean;
6
+ /** Called with the new checked value when toggled. */
7
+ onChange: (checked: boolean) => void;
8
+ /** Optional label rendered beside the checkbox. */
9
+ label?: string;
10
+ /** Disables interaction. */
11
+ disabled?: boolean;
12
+ /** Color tone applied to the checked state. */
13
+ tone?: Tone;
14
+ testID?: string;
15
+ }
16
+
17
+ export type { CheckboxProps };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Checkbox } from './Checkbox.js';
2
+ export { CheckboxProps } from './Checkbox.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Checkbox } from "./Checkbox.js";
2
+ export {
3
+ Checkbox
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { DialogProps } from './Dialog.types.js';
3
+
4
+ declare function Dialog({ open, onClose, title, children, actions, testID }: DialogProps): react.JSX.Element;
5
+
6
+ export { Dialog };
@@ -0,0 +1,51 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ Dialog as MuiDialog,
4
+ DialogTitle,
5
+ DialogContent,
6
+ DialogActions,
7
+ IconButton
8
+ } from "@mui/material";
9
+ import { useTokens } from "../../provider/useTokens.js";
10
+ function Dialog({ open, onClose, title, children, actions, testID }) {
11
+ const tokens = useTokens();
12
+ return /* @__PURE__ */ jsxs(
13
+ MuiDialog,
14
+ {
15
+ open,
16
+ onClose,
17
+ "data-testid": testID,
18
+ PaperProps: {
19
+ sx: {
20
+ backgroundColor: tokens.color.glassBg,
21
+ border: `1px solid ${tokens.color.glassBorder}`,
22
+ borderRadius: `${tokens.radii.lg}px`,
23
+ backgroundImage: "none"
24
+ }
25
+ },
26
+ children: [
27
+ title ? /* @__PURE__ */ jsxs(
28
+ DialogTitle,
29
+ {
30
+ sx: {
31
+ display: "flex",
32
+ alignItems: "center",
33
+ justifyContent: "space-between",
34
+ fontWeight: tokens.typography.weights.semibold,
35
+ color: tokens.color.foreground
36
+ },
37
+ children: [
38
+ title,
39
+ /* @__PURE__ */ jsx(IconButton, { "aria-label": "close", onClick: onClose, size: "small", edge: "end", children: /* @__PURE__ */ jsx("span", { className: "material-icons", "aria-hidden": true, children: "close" }) })
40
+ ]
41
+ }
42
+ ) : null,
43
+ /* @__PURE__ */ jsx(DialogContent, { sx: { color: tokens.color.foreground }, children }),
44
+ actions ? /* @__PURE__ */ jsx(DialogActions, { children: actions }) : null
45
+ ]
46
+ }
47
+ );
48
+ }
49
+ export {
50
+ Dialog
51
+ };
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface DialogProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ title?: string;
7
+ children: ReactNode;
8
+ actions?: ReactNode;
9
+ testID?: string;
10
+ }
11
+
12
+ export type { DialogProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { Dialog } from './Dialog.js';
2
+ export { DialogProps } from './Dialog.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { Dialog } from "./Dialog.js";
2
+ export {
3
+ Dialog
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { DividerProps } from './Divider.types.js';
3
+
4
+ declare function Divider({ vertical, inset, testID }: DividerProps): react.JSX.Element;
5
+
6
+ export { Divider };
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Divider as MuiDivider } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ function Divider({ vertical, inset, testID }) {
5
+ const tokens = useTokens();
6
+ return /* @__PURE__ */ jsx(
7
+ MuiDivider,
8
+ {
9
+ orientation: vertical ? "vertical" : "horizontal",
10
+ flexItem: vertical === true,
11
+ ...inset ? { variant: "inset" } : {},
12
+ "data-testid": testID,
13
+ sx: { borderColor: tokens.color.divider }
14
+ }
15
+ );
16
+ }
17
+ export {
18
+ Divider
19
+ };
@@ -0,0 +1,7 @@
1
+ interface DividerProps {
2
+ vertical?: boolean;
3
+ inset?: boolean;
4
+ testID?: string;
5
+ }
6
+
7
+ export type { DividerProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { Divider } from './Divider.js';
2
+ export { DividerProps } from './Divider.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { Divider } from "./Divider.js";
2
+ export {
3
+ Divider
4
+ };
@@ -0,0 +1,8 @@
1
+ import { DrawerProps } from './Drawer.types.js';
2
+ import 'react';
3
+ import '../common.js';
4
+
5
+ /** Web stub: Drawer is a mobile-only component. */
6
+ declare function Drawer(_props: DrawerProps): null;
7
+
8
+ export { Drawer };
@@ -0,0 +1,9 @@
1
+ function Drawer(_props) {
2
+ if (process.env.NODE_ENV !== "production") {
3
+ console.warn("Drawer is mobile-only");
4
+ }
5
+ return null;
6
+ }
7
+ export {
8
+ Drawer
9
+ };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { NavItem } from '../common.js';
3
+
4
+ interface DrawerProps {
5
+ items: NavItem[];
6
+ activeKey: string;
7
+ onSelect: (key: string) => void;
8
+ header?: ReactNode;
9
+ footer?: ReactNode;
10
+ testID?: string;
11
+ }
12
+
13
+ export type { DrawerProps };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Drawer } from './Drawer.js';
2
+ export { DrawerProps } from './Drawer.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Drawer } from "./Drawer.js";
2
+ export {
3
+ Drawer
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { FabProps } from './Fab.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Fab({ icon, onPress, tone, label, testID }: FabProps): react.JSX.Element;
6
+
7
+ export { Fab };
@@ -0,0 +1,33 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fab as MuiFab } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ const muiColor = (t) => t === "danger" ? "error" : t === "neutral" ? "inherit" : t;
5
+ function Fab({ icon, onPress, tone = "primary", label, testID }) {
6
+ const tokens = useTokens();
7
+ const extended = label !== void 0;
8
+ return /* @__PURE__ */ jsxs(
9
+ MuiFab,
10
+ {
11
+ color: muiColor(tone),
12
+ variant: extended ? "extended" : "circular",
13
+ onClick: onPress,
14
+ "data-testid": testID,
15
+ sx: {
16
+ backgroundColor: tokens.color.surface,
17
+ color: tokens.color.foreground,
18
+ border: `1px solid ${tokens.color.surfaceBorder}`,
19
+ backdropFilter: "blur(12px)",
20
+ textTransform: "none",
21
+ fontWeight: tokens.typography.weights.semibold,
22
+ "&:hover": { backgroundColor: tokens.color.surfaceHover }
23
+ },
24
+ children: [
25
+ /* @__PURE__ */ jsx("span", { className: "material-icons", "aria-hidden": true, ...extended ? { style: { marginRight: tokens.spacing.sm } } : {}, children: icon }),
26
+ label
27
+ ]
28
+ }
29
+ );
30
+ }
31
+ export {
32
+ Fab
33
+ };
@@ -0,0 +1,11 @@
1
+ import { Tone } from '../common.js';
2
+
3
+ interface FabProps {
4
+ icon: string;
5
+ onPress?: () => void;
6
+ tone?: Tone;
7
+ label?: string;
8
+ testID?: string;
9
+ }
10
+
11
+ export type { FabProps };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Fab } from './Fab.js';
2
+ export { FabProps } from './Fab.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Fab } from "./Fab.js";
2
+ export {
3
+ Fab
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { GlassAppBarProps } from './GlassAppBar.types.js';
3
+
4
+ declare function GlassAppBar({ title, subtitle, onBack, actions, transparent, testID }: GlassAppBarProps): react.JSX.Element;
5
+
6
+ export { GlassAppBar };
@@ -0,0 +1,57 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { AppBar as MuiAppBar, Toolbar, Typography, IconButton, Box } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ function GlassAppBar({ title, subtitle, onBack, actions, transparent, testID }) {
5
+ const tokens = useTokens();
6
+ return /* @__PURE__ */ jsx(
7
+ MuiAppBar,
8
+ {
9
+ position: "static",
10
+ elevation: 0,
11
+ "data-testid": testID,
12
+ sx: {
13
+ backgroundColor: transparent ? "transparent" : tokens.color.glassBg,
14
+ backdropFilter: "blur(12px)",
15
+ color: tokens.color.foreground,
16
+ borderBottom: `1px solid ${tokens.color.glassBorder}`,
17
+ boxShadow: "none"
18
+ },
19
+ children: /* @__PURE__ */ jsxs(Toolbar, { sx: { gap: `${tokens.spacing.sm}px` }, children: [
20
+ onBack ? /* @__PURE__ */ jsx(
21
+ IconButton,
22
+ {
23
+ edge: "start",
24
+ "aria-label": "back",
25
+ onClick: onBack,
26
+ sx: { color: tokens.color.foreground },
27
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" })
28
+ }
29
+ ) : null,
30
+ /* @__PURE__ */ jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [
31
+ /* @__PURE__ */ jsx(
32
+ Typography,
33
+ {
34
+ variant: "h6",
35
+ noWrap: true,
36
+ sx: { fontWeight: tokens.typography.weights.semibold },
37
+ children: title
38
+ }
39
+ ),
40
+ subtitle ? /* @__PURE__ */ jsx(
41
+ Typography,
42
+ {
43
+ variant: "caption",
44
+ noWrap: true,
45
+ sx: { display: "block", color: tokens.color.mutedFg },
46
+ children: subtitle
47
+ }
48
+ ) : null
49
+ ] }),
50
+ actions ?? null
51
+ ] })
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ GlassAppBar
57
+ };
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface GlassAppBarProps {
4
+ title: string;
5
+ subtitle?: string;
6
+ onBack?: () => void;
7
+ actions?: ReactNode;
8
+ transparent?: boolean;
9
+ testID?: string;
10
+ }
11
+
12
+ export type { GlassAppBarProps };
@@ -0,0 +1,3 @@
1
+ export { GlassAppBar } from './GlassAppBar.js';
2
+ export { GlassAppBarProps } from './GlassAppBar.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { GlassAppBar } from "./GlassAppBar.js";
2
+ export {
3
+ GlassAppBar
4
+ };
@@ -0,0 +1,8 @@
1
+ import * as react from 'react';
2
+ import { IconProps } from './Icon.types.js';
3
+ import '../common.js';
4
+ import '../../tokens/tokens.js';
5
+
6
+ declare function Icon({ name, node, size, color, testID }: IconProps): react.JSX.Element;
7
+
8
+ export { Icon };
@@ -0,0 +1,46 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useTokens } from "../../provider/useTokens.js";
3
+ const resolveSize = (t, size) => {
4
+ if (typeof size === "number") return size;
5
+ const key = size ?? "md";
6
+ return t.typography.sizes[key];
7
+ };
8
+ const resolveColor = (c, color) => {
9
+ if (color === void 0) return void 0;
10
+ if (color in c) return c[color];
11
+ return color;
12
+ };
13
+ function Icon({ name, node, size, color, testID }) {
14
+ const tokens = useTokens();
15
+ const px = resolveSize(tokens, size);
16
+ const resolved = resolveColor(tokens.color, color);
17
+ if (node !== void 0) {
18
+ return /* @__PURE__ */ jsx(
19
+ "span",
20
+ {
21
+ "data-testid": testID,
22
+ style: {
23
+ display: "inline-flex",
24
+ fontSize: `${px}px`,
25
+ ...resolved ? { color: resolved } : {}
26
+ },
27
+ children: node
28
+ }
29
+ );
30
+ }
31
+ return /* @__PURE__ */ jsx(
32
+ "span",
33
+ {
34
+ className: "material-icons",
35
+ "data-testid": testID,
36
+ style: {
37
+ fontSize: `${px}px`,
38
+ ...resolved ? { color: resolved } : {}
39
+ },
40
+ children: name
41
+ }
42
+ );
43
+ }
44
+ export {
45
+ Icon
46
+ };
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { Size } from '../common.js';
3
+ import { ColorTokens } from '../../tokens/tokens.js';
4
+
5
+ type IconColor = keyof ColorTokens | (string & {});
6
+ interface IconProps {
7
+ name: string;
8
+ node?: ReactNode;
9
+ size?: number | Size;
10
+ color?: IconColor;
11
+ testID?: string;
12
+ }
13
+
14
+ export type { IconColor, IconProps };
File without changes
@@ -0,0 +1,5 @@
1
+ export { Icon } from './Icon.js';
2
+ export { IconProps } from './Icon.types.js';
3
+ import 'react';
4
+ import '../common.js';
5
+ import '../../tokens/tokens.js';
@@ -0,0 +1,4 @@
1
+ import { Icon } from "./Icon.js";
2
+ export {
3
+ Icon
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { InputProps } from './Input.types.js';
3
+
4
+ declare function Input({ value, onChangeText, label, placeholder, error, disabled, secureTextEntry, multiline, testID, }: InputProps): react.JSX.Element;
5
+
6
+ export { Input };
@@ -0,0 +1,43 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TextField } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ function Input({
5
+ value,
6
+ onChangeText,
7
+ label,
8
+ placeholder,
9
+ error,
10
+ disabled,
11
+ secureTextEntry,
12
+ multiline,
13
+ testID
14
+ }) {
15
+ const tokens = useTokens();
16
+ return /* @__PURE__ */ jsx(
17
+ TextField,
18
+ {
19
+ value,
20
+ onChange: (e) => onChangeText(e.target.value),
21
+ ...label !== void 0 ? { label } : {},
22
+ ...placeholder !== void 0 ? { placeholder } : {},
23
+ ...error !== void 0 ? { helperText: error } : {},
24
+ ...testID !== void 0 ? { "data-testid": testID } : {},
25
+ error: !!error,
26
+ disabled: !!disabled,
27
+ type: secureTextEntry ? "password" : "text",
28
+ multiline: !!multiline,
29
+ fullWidth: true,
30
+ variant: "outlined",
31
+ size: "small",
32
+ sx: {
33
+ "& .MuiOutlinedInput-root": {
34
+ borderRadius: `${tokens.radii.md}px`,
35
+ "& fieldset": { borderColor: tokens.color.surfaceBorder }
36
+ }
37
+ }
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ Input
43
+ };
@@ -0,0 +1,13 @@
1
+ interface InputProps {
2
+ value: string;
3
+ onChangeText: (text: string) => void;
4
+ label?: string;
5
+ placeholder?: string;
6
+ error?: string;
7
+ disabled?: boolean;
8
+ secureTextEntry?: boolean;
9
+ multiline?: boolean;
10
+ testID?: string;
11
+ }
12
+
13
+ export type { InputProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { Input } from './Input.js';
2
+ export { InputProps } from './Input.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { Input } from "./Input.js";
2
+ export {
3
+ Input
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { SelectProps } from './Select.types.js';
3
+
4
+ declare function Select({ value, onChange, options, label, placeholder, disabled, testID, }: SelectProps): react.JSX.Element;
5
+
6
+ export { Select };
@@ -0,0 +1,50 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { FormControl, InputLabel, MenuItem, Select as MuiSelect } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ function Select({
5
+ value,
6
+ onChange,
7
+ options,
8
+ label,
9
+ placeholder,
10
+ disabled,
11
+ testID
12
+ }) {
13
+ const tokens = useTokens();
14
+ const labelId = label !== void 0 ? `${label}-select-label` : void 0;
15
+ return /* @__PURE__ */ jsxs(FormControl, { fullWidth: true, size: "small", disabled: !!disabled, children: [
16
+ label !== void 0 ? /* @__PURE__ */ jsx(InputLabel, { id: labelId, children: label }) : null,
17
+ /* @__PURE__ */ jsxs(
18
+ MuiSelect,
19
+ {
20
+ ...labelId !== void 0 ? { labelId } : {},
21
+ ...label !== void 0 ? { label } : {},
22
+ ...placeholder !== void 0 ? { displayEmpty: true } : {},
23
+ ...testID !== void 0 ? { "data-testid": testID } : {},
24
+ value,
25
+ onChange: (e) => onChange(e.target.value),
26
+ MenuProps: {
27
+ PaperProps: {
28
+ sx: {
29
+ backgroundColor: tokens.color.glassBg,
30
+ border: `1px solid ${tokens.color.glassBorder}`,
31
+ backdropFilter: "blur(12px)",
32
+ borderRadius: `${tokens.radii.md}px`
33
+ }
34
+ }
35
+ },
36
+ sx: {
37
+ borderRadius: `${tokens.radii.md}px`,
38
+ "& fieldset": { borderColor: tokens.color.surfaceBorder }
39
+ },
40
+ children: [
41
+ placeholder !== void 0 ? /* @__PURE__ */ jsx(MenuItem, { value: "", disabled: true, children: placeholder }) : null,
42
+ options.map((opt) => /* @__PURE__ */ jsx(MenuItem, { value: opt.value, children: opt.label }, opt.value))
43
+ ]
44
+ }
45
+ )
46
+ ] });
47
+ }
48
+ export {
49
+ Select
50
+ };
@@ -0,0 +1,15 @@
1
+ interface SelectOption {
2
+ value: string;
3
+ label: string;
4
+ }
5
+ interface SelectProps {
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ options: SelectOption[];
9
+ label?: string;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ testID?: string;
13
+ }
14
+
15
+ export type { SelectOption, SelectProps };