@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aaron Mkandawire and Sublime UI contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @sublime-ui/library
2
+
3
+ The cross-platform design system for [Sublime UI](https://sublime-ui.github.io/sublime-ui/).
4
+
5
+ It is **tokens-first**: a single serializable `SublimeTokens` object drives both
6
+ the web theme (Material UI) and the mobile theme (React Native Paper), and a
7
+ shared set of components renders idiomatically on each platform.
8
+
9
+ ```tsx
10
+ import { SublimeProvider } from '@sublime-ui/library';
11
+ import { tokens } from './theme/tokens';
12
+
13
+ export function App() {
14
+ return (
15
+ <SublimeProvider tokens={tokens}>
16
+ {/* navigation + screens */}
17
+ </SublimeProvider>
18
+ );
19
+ }
20
+ ```
21
+
22
+ `generateThemes` turns your tokens into the per-platform theme objects, and
23
+ `useTokens()` makes them available anywhere.
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ npm install @sublime-ui/library
29
+ ```
30
+
31
+ Web apps also need `@mui/material` + `@emotion/{react,styled}`; mobile apps need
32
+ `react-native-paper` + `react-native-safe-area-context` (declared as optional
33
+ peers).
34
+
35
+ ## Documentation
36
+
37
+ Core components and theming:
38
+ **https://sublime-ui.github.io/sublime-ui/docs/library/components/overview**
39
+
40
+ ## License
41
+
42
+ MIT
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { AppBarProps } from './AppBar.types.js';
3
+
4
+ declare function AppBar({ title, subtitle, onBack, actions, testID }: AppBarProps): react.JSX.Element;
5
+
6
+ export { AppBar };
@@ -0,0 +1,55 @@
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 AppBar({ title, subtitle, onBack, actions, 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: tokens.color.surface,
14
+ color: tokens.color.foreground,
15
+ borderBottom: `1px solid ${tokens.color.surfaceBorder}`
16
+ },
17
+ children: /* @__PURE__ */ jsxs(Toolbar, { sx: { gap: `${tokens.spacing.sm}px` }, children: [
18
+ onBack ? /* @__PURE__ */ jsx(
19
+ IconButton,
20
+ {
21
+ edge: "start",
22
+ "aria-label": "back",
23
+ onClick: onBack,
24
+ sx: { color: tokens.color.foreground },
25
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" })
26
+ }
27
+ ) : null,
28
+ /* @__PURE__ */ jsxs(Box, { sx: { flex: 1, minWidth: 0 }, children: [
29
+ /* @__PURE__ */ jsx(
30
+ Typography,
31
+ {
32
+ variant: "h6",
33
+ noWrap: true,
34
+ sx: { fontWeight: tokens.typography.weights.semibold },
35
+ children: title
36
+ }
37
+ ),
38
+ subtitle ? /* @__PURE__ */ jsx(
39
+ Typography,
40
+ {
41
+ variant: "caption",
42
+ noWrap: true,
43
+ sx: { display: "block", color: tokens.color.mutedFg },
44
+ children: subtitle
45
+ }
46
+ ) : null
47
+ ] }),
48
+ actions ?? null
49
+ ] })
50
+ }
51
+ );
52
+ }
53
+ export {
54
+ AppBar
55
+ };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface AppBarProps {
4
+ title: string;
5
+ subtitle?: string;
6
+ onBack?: () => void;
7
+ actions?: ReactNode;
8
+ testID?: string;
9
+ }
10
+
11
+ export type { AppBarProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { AppBar } from './AppBar.js';
2
+ export { AppBarProps } from './AppBar.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { AppBar } from "./AppBar.js";
2
+ export {
3
+ AppBar
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { AvatarProps } from './Avatar.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Avatar({ source, label, size, testID }: AvatarProps): react.JSX.Element;
6
+
7
+ export { Avatar };
@@ -0,0 +1,30 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Avatar as MuiAvatar } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ const pxFor = (size) => size === "sm" ? 28 : size === "lg" ? 56 : 40;
5
+ const initialsOf = (label) => label.trim().split(/\s+/).slice(0, 2).map((w) => w.charAt(0).toUpperCase()).join("");
6
+ function Avatar({ source, label, size = "md", testID }) {
7
+ const tokens = useTokens();
8
+ const dim = pxFor(size);
9
+ const initials = label ? initialsOf(label) : "";
10
+ return /* @__PURE__ */ jsx(
11
+ MuiAvatar,
12
+ {
13
+ "data-testid": testID,
14
+ ...source ? { src: source } : {},
15
+ ...label ? { alt: label } : {},
16
+ sx: {
17
+ width: dim,
18
+ height: dim,
19
+ backgroundColor: tokens.color.primarySoftBg,
20
+ color: tokens.color.primarySoftFg,
21
+ fontWeight: tokens.typography.weights.semibold,
22
+ fontSize: dim * 0.4
23
+ },
24
+ children: source ? null : initials
25
+ }
26
+ );
27
+ }
28
+ export {
29
+ Avatar
30
+ };
@@ -0,0 +1,12 @@
1
+ import { Size } from '../common.js';
2
+
3
+ interface AvatarProps {
4
+ /** Image URI; when present the avatar shows the image. */
5
+ source?: string;
6
+ /** Fallback text; initials are derived from it when no source is present. */
7
+ label?: string;
8
+ size?: Size;
9
+ testID?: string;
10
+ }
11
+
12
+ export type { AvatarProps };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Avatar } from './Avatar.js';
2
+ export { AvatarProps } from './Avatar.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Avatar } from "./Avatar.js";
2
+ export {
3
+ Avatar
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { BadgeProps } from './Badge.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Badge({ label, tone, variant, icon, testID, }: BadgeProps): react.JSX.Element;
6
+
7
+ export { Badge };
@@ -0,0 +1,75 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Chip } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ const solidPair = (c, tone) => {
5
+ switch (tone) {
6
+ case "primary":
7
+ return { bg: c.primary, fg: c.primaryFg };
8
+ case "success":
9
+ return { bg: c.success, fg: c.primaryFg };
10
+ case "danger":
11
+ return { bg: c.danger, fg: c.primaryFg };
12
+ case "warning":
13
+ return { bg: c.warning, fg: c.primaryFg };
14
+ case "info":
15
+ return { bg: c.info, fg: c.primaryFg };
16
+ case "neutral":
17
+ default:
18
+ return { bg: c.secondary, fg: c.secondaryFg };
19
+ }
20
+ };
21
+ const softPair = (c, tone) => {
22
+ switch (tone) {
23
+ case "primary":
24
+ return { bg: c.primarySoftBg, fg: c.primarySoftFg };
25
+ case "success":
26
+ return { bg: c.successSoftBg, fg: c.successSoftFg };
27
+ case "danger":
28
+ return { bg: c.dangerSoftBg, fg: c.dangerSoftFg };
29
+ case "warning":
30
+ return { bg: c.warningSoftBg, fg: c.warningSoftFg };
31
+ case "info":
32
+ return { bg: c.infoSoftBg, fg: c.infoSoftFg };
33
+ case "neutral":
34
+ default:
35
+ return { bg: c.surfaceHover, fg: c.mutedFg };
36
+ }
37
+ };
38
+ const mutedPair = (c) => ({
39
+ bg: c.surfaceHover,
40
+ fg: c.mutedFg
41
+ });
42
+ const pairFor = (c, tone, variant) => {
43
+ if (variant === "solid") return solidPair(c, tone);
44
+ if (variant === "muted") return mutedPair(c);
45
+ return softPair(c, tone);
46
+ };
47
+ function Badge({
48
+ label,
49
+ tone = "neutral",
50
+ variant = "soft",
51
+ icon,
52
+ testID
53
+ }) {
54
+ const tokens = useTokens();
55
+ const { bg, fg } = pairFor(tokens.color, tone, variant);
56
+ return /* @__PURE__ */ jsx(
57
+ Chip,
58
+ {
59
+ size: "small",
60
+ label,
61
+ "data-testid": testID,
62
+ sx: {
63
+ backgroundColor: bg,
64
+ color: fg,
65
+ borderRadius: `${tokens.radii.full}px`,
66
+ fontWeight: tokens.typography.weights.medium,
67
+ ...icon ? { "& .MuiChip-icon": { color: fg } } : {}
68
+ },
69
+ ...icon ? { icon: /* @__PURE__ */ jsx("span", { className: "material-icons", "aria-hidden": true, children: icon }) } : {}
70
+ }
71
+ );
72
+ }
73
+ export {
74
+ Badge
75
+ };
@@ -0,0 +1,12 @@
1
+ import { Tone } from '../common.js';
2
+
3
+ type BadgeVariant = 'solid' | 'soft' | 'muted';
4
+ interface BadgeProps {
5
+ label: string;
6
+ tone?: Tone;
7
+ variant?: BadgeVariant;
8
+ icon?: string;
9
+ testID?: string;
10
+ }
11
+
12
+ export type { BadgeProps, BadgeVariant };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Badge } from './Badge.js';
2
+ export { BadgeProps } from './Badge.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Badge } from "./Badge.js";
2
+ export {
3
+ Badge
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { BannerProps } from './Banner.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Banner({ tone, title, children, onClose, action, testID, }: BannerProps): react.JSX.Element;
6
+
7
+ export { Banner };
@@ -0,0 +1,68 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Alert, AlertTitle } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ const severityFor = (tone) => {
5
+ switch (tone) {
6
+ case "success":
7
+ return "success";
8
+ case "danger":
9
+ return "error";
10
+ case "warning":
11
+ return "warning";
12
+ case "primary":
13
+ case "info":
14
+ case "neutral":
15
+ default:
16
+ return "info";
17
+ }
18
+ };
19
+ const softPair = (c, tone) => {
20
+ switch (tone) {
21
+ case "success":
22
+ return { bg: c.successSoftBg, fg: c.successSoftFg };
23
+ case "danger":
24
+ return { bg: c.dangerSoftBg, fg: c.dangerSoftFg };
25
+ case "warning":
26
+ return { bg: c.warningSoftBg, fg: c.warningSoftFg };
27
+ case "info":
28
+ return { bg: c.infoSoftBg, fg: c.infoSoftFg };
29
+ case "primary":
30
+ case "neutral":
31
+ default:
32
+ return { bg: c.primarySoftBg, fg: c.primarySoftFg };
33
+ }
34
+ };
35
+ function Banner({
36
+ tone = "info",
37
+ title,
38
+ children,
39
+ onClose,
40
+ action,
41
+ testID
42
+ }) {
43
+ const tokens = useTokens();
44
+ const { bg, fg } = softPair(tokens.color, tone);
45
+ return /* @__PURE__ */ jsxs(
46
+ Alert,
47
+ {
48
+ severity: severityFor(tone),
49
+ "data-testid": testID,
50
+ ...onClose ? { onClose } : {},
51
+ ...action ? { action } : {},
52
+ sx: {
53
+ backgroundColor: bg,
54
+ color: fg,
55
+ borderRadius: `${tokens.radii.md}px`,
56
+ "& .MuiAlert-icon": { color: fg },
57
+ "& .MuiAlert-action": { color: fg }
58
+ },
59
+ children: [
60
+ title ? /* @__PURE__ */ jsx(AlertTitle, { sx: { fontWeight: tokens.typography.weights.semibold }, children: title }) : null,
61
+ children
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ export {
67
+ Banner
68
+ };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { Tone } from '../common.js';
3
+
4
+ interface BannerProps {
5
+ tone?: Tone;
6
+ title?: string;
7
+ children: ReactNode;
8
+ onClose?: () => void;
9
+ action?: ReactNode;
10
+ testID?: string;
11
+ }
12
+
13
+ export type { BannerProps };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Banner } from './Banner.js';
2
+ export { BannerProps } from './Banner.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Banner } from "./Banner.js";
2
+ export {
3
+ Banner
4
+ };
@@ -0,0 +1,7 @@
1
+ import { BottomNavProps } from './BottomNav.types.js';
2
+ import '../common.js';
3
+
4
+ /** Web stub: BottomNav is a mobile-only component. */
5
+ declare function BottomNav(_props: BottomNavProps): null;
6
+
7
+ export { BottomNav };
@@ -0,0 +1,9 @@
1
+ function BottomNav(_props) {
2
+ if (process.env.NODE_ENV !== "production") {
3
+ console.warn("BottomNav is mobile-only");
4
+ }
5
+ return null;
6
+ }
7
+ export {
8
+ BottomNav
9
+ };
@@ -0,0 +1,10 @@
1
+ import { NavItem } from '../common.js';
2
+
3
+ interface BottomNavProps {
4
+ items: NavItem[];
5
+ activeKey: string;
6
+ onSelect: (key: string) => void;
7
+ testID?: string;
8
+ }
9
+
10
+ export type { BottomNavProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { BottomNav } from './BottomNav.js';
2
+ export { BottomNavProps } from './BottomNav.types.js';
3
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { BottomNav } from "./BottomNav.js";
2
+ export {
3
+ BottomNav
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { ButtonProps } from './Button.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Button({ children, onPress, variant, tone, size, disabled, loading, fullWidth, testID, }: ButtonProps): react.JSX.Element;
6
+
7
+ export { Button };
@@ -0,0 +1,42 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button as MuiButton, CircularProgress } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ const muiVariant = (v) => v === "solid" ? "contained" : v === "outline" ? "outlined" : "text";
5
+ const muiColor = (t) => t === "danger" ? "error" : t === "neutral" ? "inherit" : t;
6
+ function Button({
7
+ children,
8
+ onPress,
9
+ variant = "solid",
10
+ tone = "primary",
11
+ size = "md",
12
+ disabled,
13
+ loading,
14
+ fullWidth,
15
+ testID
16
+ }) {
17
+ const tokens = useTokens();
18
+ const soft = variant === "soft";
19
+ return /* @__PURE__ */ jsx(
20
+ MuiButton,
21
+ {
22
+ variant: muiVariant(variant),
23
+ color: muiColor(tone),
24
+ size: size === "md" ? "medium" : size === "sm" ? "small" : "large",
25
+ disabled: Boolean(disabled || loading),
26
+ fullWidth: Boolean(fullWidth),
27
+ onClick: onPress,
28
+ "data-testid": testID,
29
+ sx: {
30
+ borderRadius: `${tokens.radii.md}px`,
31
+ textTransform: "none",
32
+ fontWeight: tokens.typography.weights.semibold,
33
+ ...soft ? { backgroundColor: tokens.color.primarySoftBg, color: tokens.color.primarySoftFg, "&:hover": { backgroundColor: tokens.color.primarySoftBg } } : {}
34
+ },
35
+ startIcon: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 16, color: "inherit" }) : void 0,
36
+ children
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ Button
42
+ };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { Variant, Tone, Size } from '../common.js';
3
+
4
+ interface ButtonProps {
5
+ children: ReactNode;
6
+ onPress?: () => void;
7
+ variant?: Variant;
8
+ tone?: Tone;
9
+ size?: Size;
10
+ disabled?: boolean;
11
+ loading?: boolean;
12
+ icon?: string;
13
+ fullWidth?: boolean;
14
+ testID?: string;
15
+ }
16
+
17
+ export { type ButtonProps, Size, Tone, Variant };
File without changes
@@ -0,0 +1,4 @@
1
+ export { Button } from './Button.js';
2
+ export { ButtonProps } from './Button.types.js';
3
+ import 'react';
4
+ import '../common.js';
@@ -0,0 +1,4 @@
1
+ import { Button } from "./Button.js";
2
+ export {
3
+ Button
4
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { CardProps } from './Card.types.js';
3
+
4
+ declare function Card({ children, onPress, padded, testID }: CardProps): react.JSX.Element;
5
+
6
+ export { Card };
@@ -0,0 +1,26 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Card as MuiCard, CardActionArea } from "@mui/material";
3
+ import { useTokens } from "../../provider/useTokens.js";
4
+ function Card({ children, onPress, padded = true, testID }) {
5
+ const tokens = useTokens();
6
+ const pad = padded ? `${tokens.spacing.lg}px` : 0;
7
+ const body = onPress ? /* @__PURE__ */ jsx(CardActionArea, { onClick: onPress, sx: { p: pad }, children }) : children;
8
+ return /* @__PURE__ */ jsx(
9
+ MuiCard,
10
+ {
11
+ elevation: 0,
12
+ "data-testid": testID,
13
+ sx: {
14
+ backgroundColor: tokens.color.glassBg,
15
+ border: `1px solid ${tokens.color.glassBorder}`,
16
+ borderRadius: `${tokens.radii.lg}px`,
17
+ boxShadow: tokens.shadows.sm,
18
+ ...onPress ? {} : { p: pad }
19
+ },
20
+ children: body
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ Card
26
+ };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface CardProps {
4
+ children: ReactNode;
5
+ onPress?: () => void;
6
+ padded?: boolean;
7
+ testID?: string;
8
+ }
9
+
10
+ export type { CardProps };
File without changes
@@ -0,0 +1,3 @@
1
+ export { Card } from './Card.js';
2
+ export { CardProps } from './Card.types.js';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { Card } from "./Card.js";
2
+ export {
3
+ Card
4
+ };
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { CheckboxProps } from './Checkbox.types.js';
3
+ import '../common.js';
4
+
5
+ declare function Checkbox({ checked, onChange, label, disabled, tone, testID, }: CheckboxProps): react.JSX.Element;
6
+
7
+ export { Checkbox };