@glassly/miniapp 0.4.3-dev.1242 → 0.4.3-dev.1258

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 (84) hide show
  1. package/README.md +32 -2
  2. package/dist/theme.css +856 -0
  3. package/dist/ui/index.d.ts +1 -0
  4. package/dist/ui/index.d.ts.map +1 -1
  5. package/dist/ui/index.js +1 -0
  6. package/dist/ui/index.js.map +1 -1
  7. package/dist/ui/kit/Badge.d.ts +8 -0
  8. package/dist/ui/kit/Badge.d.ts.map +1 -0
  9. package/dist/ui/kit/Badge.js +6 -0
  10. package/dist/ui/kit/Badge.js.map +1 -0
  11. package/dist/ui/kit/Button.d.ts +9 -0
  12. package/dist/ui/kit/Button.d.ts.map +1 -0
  13. package/dist/ui/kit/Button.js +7 -0
  14. package/dist/ui/kit/Button.js.map +1 -0
  15. package/dist/ui/kit/Card.d.ts +10 -0
  16. package/dist/ui/kit/Card.d.ts.map +1 -0
  17. package/dist/ui/kit/Card.js +21 -0
  18. package/dist/ui/kit/Card.js.map +1 -0
  19. package/dist/ui/kit/Dock.d.ts +29 -0
  20. package/dist/ui/kit/Dock.d.ts.map +1 -0
  21. package/dist/ui/kit/Dock.js +34 -0
  22. package/dist/ui/kit/Dock.js.map +1 -0
  23. package/dist/ui/kit/Feedback.d.ts +37 -0
  24. package/dist/ui/kit/Feedback.d.ts.map +1 -0
  25. package/dist/ui/kit/Feedback.js +21 -0
  26. package/dist/ui/kit/Feedback.js.map +1 -0
  27. package/dist/ui/kit/Field.d.ts +8 -0
  28. package/dist/ui/kit/Field.d.ts.map +1 -0
  29. package/dist/ui/kit/Field.js +16 -0
  30. package/dist/ui/kit/Field.js.map +1 -0
  31. package/dist/ui/kit/Page.d.ts +33 -0
  32. package/dist/ui/kit/Page.d.ts.map +1 -0
  33. package/dist/ui/kit/Page.js +77 -0
  34. package/dist/ui/kit/Page.js.map +1 -0
  35. package/dist/ui/kit/Section.d.ts +17 -0
  36. package/dist/ui/kit/Section.d.ts.map +1 -0
  37. package/dist/ui/kit/Section.js +22 -0
  38. package/dist/ui/kit/Section.js.map +1 -0
  39. package/dist/ui/kit/SetupGuide.d.ts +45 -0
  40. package/dist/ui/kit/SetupGuide.d.ts.map +1 -0
  41. package/dist/ui/kit/SetupGuide.js +40 -0
  42. package/dist/ui/kit/SetupGuide.js.map +1 -0
  43. package/dist/ui/kit/Switch.d.ts +7 -0
  44. package/dist/ui/kit/Switch.d.ts.map +1 -0
  45. package/dist/ui/kit/Switch.js +11 -0
  46. package/dist/ui/kit/Switch.js.map +1 -0
  47. package/dist/ui/kit/Tabs.d.ts +20 -0
  48. package/dist/ui/kit/Tabs.d.ts.map +1 -0
  49. package/dist/ui/kit/Tabs.js +53 -0
  50. package/dist/ui/kit/Tabs.js.map +1 -0
  51. package/dist/ui/kit/cx.d.ts +2 -0
  52. package/dist/ui/kit/cx.d.ts.map +1 -0
  53. package/dist/ui/kit/cx.js +4 -0
  54. package/dist/ui/kit/cx.js.map +1 -0
  55. package/dist/ui/kit/hooks.d.ts +17 -0
  56. package/dist/ui/kit/hooks.d.ts.map +1 -0
  57. package/dist/ui/kit/hooks.js +34 -0
  58. package/dist/ui/kit/hooks.js.map +1 -0
  59. package/dist/ui/kit/index.d.ts +14 -0
  60. package/dist/ui/kit/index.d.ts.map +1 -0
  61. package/dist/ui/kit/index.js +14 -0
  62. package/dist/ui/kit/index.js.map +1 -0
  63. package/dist/ui/kit/useWide.d.ts +4 -0
  64. package/dist/ui/kit/useWide.d.ts.map +1 -0
  65. package/dist/ui/kit/useWide.js +18 -0
  66. package/dist/ui/kit/useWide.js.map +1 -0
  67. package/package.json +12 -5
  68. package/src/ui/index.ts +2 -0
  69. package/src/ui/kit/Badge.tsx +19 -0
  70. package/src/ui/kit/Button.tsx +27 -0
  71. package/src/ui/kit/Card.tsx +29 -0
  72. package/src/ui/kit/Dock.tsx +77 -0
  73. package/src/ui/kit/Feedback.tsx +101 -0
  74. package/src/ui/kit/Field.tsx +38 -0
  75. package/src/ui/kit/Page.tsx +154 -0
  76. package/src/ui/kit/Section.tsx +80 -0
  77. package/src/ui/kit/SetupGuide.tsx +153 -0
  78. package/src/ui/kit/Switch.tsx +28 -0
  79. package/src/ui/kit/Tabs.tsx +108 -0
  80. package/src/ui/kit/cx.ts +3 -0
  81. package/src/ui/kit/hooks.ts +53 -0
  82. package/src/ui/kit/index.ts +51 -0
  83. package/src/ui/kit/useWide.ts +19 -0
  84. package/src/ui/theme.css +856 -0
package/README.md CHANGED
@@ -25,7 +25,8 @@ npm install @glassly/miniapp
25
25
  | ---------------------------- | ------------------------------------------------------------------------------------------------- |
26
26
  | `@glassly/miniapp` | `MiniappSession`, `NotConnectedError`, transports, manifest-types re-exports, module type exports |
27
27
  | `@glassly/miniapp/background` | `MiniappSession`, `registerMiniapp`, the always-on session layer (see two-layer note below) |
28
- | `@glassly/miniapp/ui` | The WebView-side `glassly` channel bridge + React adapters (`<MiniappProvider>`, `<MiniappHeader>`, hooks) |
28
+ | `@glassly/miniapp/ui` | The WebView-side `glassly` channel bridge + React adapters (`<MiniappProvider>`, `<MiniappHeader>`, hooks) and the UI kit |
29
+ | `@glassly/miniapp/theme.css` | The UI kit's theme sheet: the Glassly App's Light/Dark colours and the kit's look |
29
30
  | `@glassly/miniapp/react` | React hooks + `<MiniappProvider>` + `<MiniappHeader>` (also re-exported from `/ui`) |
30
31
  | `@glassly/miniapp/protocol` | `MiniappRequestType`, `MiniappResponseType`, `MiniappStreamType`, `MiniappErrorCode` |
31
32
  | `@glassly/miniapp/hardware` | `HardwareType`, `HardwareRequirementLevel`, `HardwareRequirement` (manifest hardware-requirement types) |
@@ -241,7 +242,36 @@ from `@glassly/miniapp/react` for backwards-compat.
241
242
  Components:
242
243
 
243
244
  - `<MiniappProvider>`: root provider. Keeps `<html class="dark">` in sync with the host color scheme during render (no FOUC).
244
- - `<MiniappHeader title="…" left={…} right={…} onBack={…} />`: drop-in header that respects the safe area and leaves room for the capsule menu.
245
+ - `<MiniappHeader title="…" left={…} right={…} onBack={…} />`: drop-in header that respects the safe area and leaves room for the capsule menu. New pages use the kit's `<PageHeader>`.
246
+
247
+ ### UI kit
248
+
249
+ Phone-page pieces with shadcn/ui's names and compact look, on native elements, exported from
250
+ `@glassly/miniapp/ui` (not `/react`). Import `@glassly/miniapp/theme.css` once from the page's CSS,
251
+ after Tailwind if used, and set `--accent` / `--accent-foreground` on `:root` for the app's colour.
252
+ The theme follows the host's Light/Dark through `<html class="dark">` (`<MiniappProvider>`); its rules
253
+ sit in the `base` and `components` cascade layers so app CSS and Tailwind utilities override them.
254
+
255
+ | Export | What it is |
256
+ | --- | --- |
257
+ | `<Page header aside footer fill maxWidth bottom>` | The screen: safe-area and Duo rail padding, the native background colour, two columns in a wide window |
258
+ | `<PageHeader title onBack>` | Header row aligned with the capsule menu; its trailing children stop short of it |
259
+ | `<Footer version>` | Bottom line for the version label |
260
+ | `<Button variant size>` | `default` / `secondary` / `outline` / `ghost` / `destructive`; `default` / `sm` / `lg` / `icon` |
261
+ | `<Switch checked onCheckedChange>` | `role="switch"` button |
262
+ | `<Section title description>`, `<SettingsRow label description icon control onClick>` | Grouped settings rows |
263
+ | `<Card>` (+ `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter`), `<Badge variant dot>` | Panels and status pills |
264
+ | `<Tabs>`, `TabsList`, `TabsTrigger`, `TabsContent` | Tabs, or a segmented control |
265
+ | `<Dock items value onValueChange>`, `useDockClearance()`, `railSide`, `dockClearance` | Floating tab bar; an icon column in the Duo rail |
266
+ | `<Input>`, `<Textarea>`, `<Select onValueChange>` | Native fields in the kit's look |
267
+ | `<Banner variant title action>`, `<EmptyState>`, `<Spinner>`, `<Stat>`, `<Separator>` | Notices and states |
268
+ | `<SetupGuide appName steps onFinish onSkip>`, `<LensPreview lines status>` | First-run guide; a phone-side preview of the lens |
269
+ | `useWide()` | True in a landscape window at least 700 px wide |
270
+ | `useChannel(channel, initial)` | Latest payload on a background channel |
271
+ | `useDeveloperMode(holdMs)` | Hidden developer mode on a long hold |
272
+
273
+ Docs with examples: the Components section of
274
+ [The UI layer](https://docs.glasslyos.com/app-devs/core-concepts/webviews/react-webviews#components).
245
275
 
246
276
  ## Manifest (`miniapp.json`)
247
277