@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.
- package/README.md +32 -2
- package/dist/theme.css +856 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/kit/Badge.d.ts +8 -0
- package/dist/ui/kit/Badge.d.ts.map +1 -0
- package/dist/ui/kit/Badge.js +6 -0
- package/dist/ui/kit/Badge.js.map +1 -0
- package/dist/ui/kit/Button.d.ts +9 -0
- package/dist/ui/kit/Button.d.ts.map +1 -0
- package/dist/ui/kit/Button.js +7 -0
- package/dist/ui/kit/Button.js.map +1 -0
- package/dist/ui/kit/Card.d.ts +10 -0
- package/dist/ui/kit/Card.d.ts.map +1 -0
- package/dist/ui/kit/Card.js +21 -0
- package/dist/ui/kit/Card.js.map +1 -0
- package/dist/ui/kit/Dock.d.ts +29 -0
- package/dist/ui/kit/Dock.d.ts.map +1 -0
- package/dist/ui/kit/Dock.js +34 -0
- package/dist/ui/kit/Dock.js.map +1 -0
- package/dist/ui/kit/Feedback.d.ts +37 -0
- package/dist/ui/kit/Feedback.d.ts.map +1 -0
- package/dist/ui/kit/Feedback.js +21 -0
- package/dist/ui/kit/Feedback.js.map +1 -0
- package/dist/ui/kit/Field.d.ts +8 -0
- package/dist/ui/kit/Field.d.ts.map +1 -0
- package/dist/ui/kit/Field.js +16 -0
- package/dist/ui/kit/Field.js.map +1 -0
- package/dist/ui/kit/Page.d.ts +33 -0
- package/dist/ui/kit/Page.d.ts.map +1 -0
- package/dist/ui/kit/Page.js +77 -0
- package/dist/ui/kit/Page.js.map +1 -0
- package/dist/ui/kit/Section.d.ts +17 -0
- package/dist/ui/kit/Section.d.ts.map +1 -0
- package/dist/ui/kit/Section.js +22 -0
- package/dist/ui/kit/Section.js.map +1 -0
- package/dist/ui/kit/SetupGuide.d.ts +45 -0
- package/dist/ui/kit/SetupGuide.d.ts.map +1 -0
- package/dist/ui/kit/SetupGuide.js +40 -0
- package/dist/ui/kit/SetupGuide.js.map +1 -0
- package/dist/ui/kit/Switch.d.ts +7 -0
- package/dist/ui/kit/Switch.d.ts.map +1 -0
- package/dist/ui/kit/Switch.js +11 -0
- package/dist/ui/kit/Switch.js.map +1 -0
- package/dist/ui/kit/Tabs.d.ts +20 -0
- package/dist/ui/kit/Tabs.d.ts.map +1 -0
- package/dist/ui/kit/Tabs.js +53 -0
- package/dist/ui/kit/Tabs.js.map +1 -0
- package/dist/ui/kit/cx.d.ts +2 -0
- package/dist/ui/kit/cx.d.ts.map +1 -0
- package/dist/ui/kit/cx.js +4 -0
- package/dist/ui/kit/cx.js.map +1 -0
- package/dist/ui/kit/hooks.d.ts +17 -0
- package/dist/ui/kit/hooks.d.ts.map +1 -0
- package/dist/ui/kit/hooks.js +34 -0
- package/dist/ui/kit/hooks.js.map +1 -0
- package/dist/ui/kit/index.d.ts +14 -0
- package/dist/ui/kit/index.d.ts.map +1 -0
- package/dist/ui/kit/index.js +14 -0
- package/dist/ui/kit/index.js.map +1 -0
- package/dist/ui/kit/useWide.d.ts +4 -0
- package/dist/ui/kit/useWide.d.ts.map +1 -0
- package/dist/ui/kit/useWide.js +18 -0
- package/dist/ui/kit/useWide.js.map +1 -0
- package/package.json +12 -5
- package/src/ui/index.ts +2 -0
- package/src/ui/kit/Badge.tsx +19 -0
- package/src/ui/kit/Button.tsx +27 -0
- package/src/ui/kit/Card.tsx +29 -0
- package/src/ui/kit/Dock.tsx +77 -0
- package/src/ui/kit/Feedback.tsx +101 -0
- package/src/ui/kit/Field.tsx +38 -0
- package/src/ui/kit/Page.tsx +154 -0
- package/src/ui/kit/Section.tsx +80 -0
- package/src/ui/kit/SetupGuide.tsx +153 -0
- package/src/ui/kit/Switch.tsx +28 -0
- package/src/ui/kit/Tabs.tsx +108 -0
- package/src/ui/kit/cx.ts +3 -0
- package/src/ui/kit/hooks.ts +53 -0
- package/src/ui/kit/index.ts +51 -0
- package/src/ui/kit/useWide.ts +19 -0
- 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
|
|