@krizaka/ui 3.64.1 → 3.66.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.
- package/README.md +3 -0
- package/dist/account-menu.d.ts +7 -3
- package/dist/account-menu.js +14 -10
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/app-frame/server.d.ts +123 -0
- package/dist/app-frame/server.js +109 -0
- package/dist/app-frame/server.js.map +1 -0
- package/dist/app-frame.d.ts +210 -0
- package/dist/app-frame.js +220 -0
- package/dist/app-frame.js.map +1 -0
- package/dist/app-header/search.js +1 -1
- package/dist/app-header.d.ts +3 -3
- package/dist/app-shell.js +1 -1
- package/dist/argument-card.js +2 -2
- package/dist/audio-player.js +1 -1
- package/dist/{chunk-5QEXOGO2.js → chunk-6BMKLAZ7.js} +1 -1
- package/dist/{chunk-XCBVFMNV.js.map → chunk-6BMKLAZ7.js.map} +1 -1
- package/dist/{chunk-SHBYNQFS.js → chunk-7DYZTEE3.js} +1 -1
- package/dist/{chunk-SHBYNQFS.js.map → chunk-7DYZTEE3.js.map} +1 -1
- package/dist/{chunk-YCZ7N6Q6.js → chunk-7MQNG35Q.js} +2 -2
- package/dist/{chunk-XCBVFMNV.js → chunk-C57KK5VB.js} +7 -2
- package/dist/chunk-C57KK5VB.js.map +1 -0
- package/dist/{chunk-VB7MWE2N.js → chunk-DSDFXPL6.js} +2 -2
- package/dist/{chunk-P7GZR5CU.js → chunk-GFRUTPGG.js} +1 -1
- package/dist/{chunk-P7GZR5CU.js.map → chunk-GFRUTPGG.js.map} +1 -1
- package/dist/{chunk-4GQH27IT.js → chunk-GW5EI7MI.js} +2 -2
- package/dist/{chunk-F6JTHPHE.js → chunk-I6EOLPSH.js} +2 -2
- package/dist/chunk-NG6G6V5E.js +33 -0
- package/dist/{chunk-5QEXOGO2.js.map → chunk-NG6G6V5E.js.map} +1 -1
- package/dist/{chunk-CPA5CF35.js → chunk-PGBF3UBX.js} +1 -1
- package/dist/{chunk-CPA5CF35.js.map → chunk-PGBF3UBX.js.map} +1 -1
- package/dist/{chunk-BG5APGX6.js → chunk-Q5DYWQ6S.js} +4 -4
- package/dist/{chunk-RCKXJEDQ.js → chunk-ST5P5HNI.js} +2 -2
- package/dist/code-block.js +1 -1
- package/dist/collection-switcher.d.ts +68 -0
- package/dist/collection-switcher.js +131 -0
- package/dist/collection-switcher.js.map +1 -0
- package/dist/combobox.js +2 -2
- package/dist/cover-hero.js +1 -1
- package/dist/data-table.js +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/decision-list.js +1 -1
- package/dist/default-avatar-D9kiSFNB.d.ts +26 -0
- package/dist/desktop-window.d.ts +223 -0
- package/dist/desktop-window.js +261 -0
- package/dist/desktop-window.js.map +1 -0
- package/dist/docs-layout.js +1 -1
- package/dist/entity-header.d.ts +92 -0
- package/dist/entity-header.js +165 -0
- package/dist/entity-header.js.map +1 -0
- package/dist/file-upload.d.ts +2 -2
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/genui.js +4 -4
- package/dist/language-switch.d.ts +9 -9
- package/dist/link-card.js +2 -2
- package/dist/list.js +1 -1
- package/dist/media-capture.js +1 -1
- package/dist/native.d.ts +337 -4
- package/dist/native.js +2841 -2111
- package/dist/native.js.map +1 -1
- package/dist/opening-hours.js +1 -1
- package/dist/page-hero.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/photo-grid.js +1 -1
- package/dist/pricing-page.js.map +1 -1
- package/dist/qr-code.d.ts +42 -0
- package/dist/qr-code.js +350 -0
- package/dist/qr-code.js.map +1 -0
- package/dist/radio-group.js +1 -1
- package/dist/rail-nav.js +1 -1
- package/dist/retro-tv.js +2 -2
- package/dist/search-field.js +2 -2
- package/dist/service-card.js +1 -1
- package/dist/shop-composer.js +1 -1
- package/dist/shop-composer.js.map +1 -1
- package/dist/site-cahier.js +1 -1
- package/dist/status-chip.js +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/terminal-replay.js +1 -1
- package/dist/theme.d.ts +3 -1
- package/dist/theme.js +4 -0
- package/dist/theme.js.map +1 -1
- package/dist/tree-view.js +1 -1
- package/dist/video-player.js +2 -2
- package/dist/virtual.d.ts +3 -3
- package/package.json +91 -6
- package/registry/account-menu.json +22 -8
- package/registry/account-settings.json +2 -2
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +2 -2
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +564 -0
- package/registry/app-header.json +2 -2
- package/registry/app-shell.json +2 -2
- package/registry/argument-card.json +2 -2
- package/registry/audio-player.json +2 -2
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +2 -2
- package/registry/collection-switcher.json +436 -0
- package/registry/combobox.json +2 -2
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +2 -2
- package/registry/date-picker.json +4 -4
- package/registry/decision-list.json +2 -2
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +407 -0
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +2 -2
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +502 -0
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/app-frame/admin.d.ts +4 -0
- package/registry/examples/app-frame/admin.js +32 -0
- package/registry/examples/app-frame/admin.tsx +33 -0
- package/registry/examples/app-frame/app.d.ts +4 -0
- package/registry/examples/app-frame/app.js +53 -0
- package/registry/examples/app-frame/app.tsx +56 -0
- package/registry/examples/collection-switcher/entity.d.ts +4 -0
- package/registry/examples/collection-switcher/entity.js +17 -0
- package/registry/examples/collection-switcher/entity.tsx +13 -0
- package/registry/examples/collection-switcher/list.d.ts +4 -0
- package/registry/examples/collection-switcher/list.js +32 -0
- package/registry/examples/collection-switcher/list.tsx +27 -0
- package/registry/examples/collection-switcher/native/list.d.ts +4 -0
- package/registry/examples/collection-switcher/native/list.dark.png +0 -0
- package/registry/examples/collection-switcher/native/list.js +18 -0
- package/registry/examples/collection-switcher/native/list.light.png +0 -0
- package/registry/examples/collection-switcher/native/list.tsx +14 -0
- package/registry/examples/collection-switcher/tree.d.ts +4 -0
- package/registry/examples/collection-switcher/tree.js +19 -0
- package/registry/examples/collection-switcher/tree.tsx +15 -0
- package/registry/examples/desktop-window/library.d.ts +4 -0
- package/registry/examples/desktop-window/library.js +49 -0
- package/registry/examples/desktop-window/library.tsx +58 -0
- package/registry/examples/entity-header/basic.d.ts +4 -0
- package/registry/examples/entity-header/basic.js +31 -0
- package/registry/examples/entity-header/basic.tsx +25 -0
- package/registry/examples/entity-header/native/basic.d.ts +4 -0
- package/registry/examples/entity-header/native/basic.dark.png +0 -0
- package/registry/examples/entity-header/native/basic.js +17 -0
- package/registry/examples/entity-header/native/basic.light.png +0 -0
- package/registry/examples/entity-header/native/basic.tsx +12 -0
- package/registry/examples/form-flow/native/signup.d.ts +4 -0
- package/registry/examples/form-flow/native/signup.dark.png +0 -0
- package/registry/examples/form-flow/native/signup.js +26 -0
- package/registry/examples/form-flow/native/signup.light.png +0 -0
- package/registry/examples/form-flow/native/signup.tsx +23 -0
- package/registry/examples/grid/native/columns.d.ts +4 -0
- package/registry/examples/grid/native/columns.dark.png +0 -0
- package/registry/examples/grid/native/columns.js +23 -0
- package/registry/examples/grid/native/columns.light.png +0 -0
- package/registry/examples/grid/native/columns.tsx +20 -0
- package/registry/examples/grid/native/photos.d.ts +4 -0
- package/registry/examples/grid/native/photos.dark.png +0 -0
- package/registry/examples/grid/native/photos.js +14 -0
- package/registry/examples/grid/native/photos.light.png +0 -0
- package/registry/examples/grid/native/photos.tsx +18 -0
- package/registry/examples/grid/native/stats.d.ts +4 -0
- package/registry/examples/grid/native/stats.dark.png +0 -0
- package/registry/examples/grid/native/stats.js +22 -0
- package/registry/examples/grid/native/stats.light.png +0 -0
- package/registry/examples/grid/native/stats.tsx +24 -0
- package/registry/examples/list-detail/native/inbox.d.ts +4 -0
- package/registry/examples/list-detail/native/inbox.dark.png +0 -0
- package/registry/examples/list-detail/native/inbox.js +35 -0
- package/registry/examples/list-detail/native/inbox.light.png +0 -0
- package/registry/examples/list-detail/native/inbox.tsx +35 -0
- package/registry/examples/qr-code/basic.d.ts +4 -0
- package/registry/examples/qr-code/basic.js +11 -0
- package/registry/examples/qr-code/basic.tsx +6 -0
- package/registry/examples/qr-code/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/calendar-feed.js +24 -0
- package/registry/examples/qr-code/calendar-feed.tsx +18 -0
- package/registry/examples/qr-code/native/calendar-feed.d.ts +4 -0
- package/registry/examples/qr-code/native/calendar-feed.dark.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.js +25 -0
- package/registry/examples/qr-code/native/calendar-feed.light.png +0 -0
- package/registry/examples/qr-code/native/calendar-feed.tsx +19 -0
- package/registry/examples/screen/native/dashboard.d.ts +4 -0
- package/registry/examples/screen/native/dashboard.dark.png +0 -0
- package/registry/examples/screen/native/dashboard.js +48 -0
- package/registry/examples/screen/native/dashboard.light.png +0 -0
- package/registry/examples/screen/native/dashboard.tsx +52 -0
- package/registry/examples/screen/native/settings-home.d.ts +4 -0
- package/registry/examples/screen/native/settings-home.dark.png +0 -0
- package/registry/examples/screen/native/settings-home.js +26 -0
- package/registry/examples/screen/native/settings-home.light.png +0 -0
- package/registry/examples/screen/native/settings-home.tsx +25 -0
- package/registry/examples/shop/hero-tv.js +1 -1
- package/registry/examples/shop/hero-tv.tsx +1 -1
- package/registry/examples/state-screen/native/empty.d.ts +4 -0
- package/registry/examples/state-screen/native/empty.dark.png +0 -0
- package/registry/examples/state-screen/native/empty.js +12 -0
- package/registry/examples/state-screen/native/empty.light.png +0 -0
- package/registry/examples/state-screen/native/empty.tsx +11 -0
- package/registry/examples/state-screen/native/error.d.ts +4 -0
- package/registry/examples/state-screen/native/error.dark.png +0 -0
- package/registry/examples/state-screen/native/error.js +21 -0
- package/registry/examples/state-screen/native/error.light.png +0 -0
- package/registry/examples/state-screen/native/error.tsx +17 -0
- package/registry/examples/state-screen/native/offline.d.ts +4 -0
- package/registry/examples/state-screen/native/offline.dark.png +0 -0
- package/registry/examples/state-screen/native/offline.js +15 -0
- package/registry/examples/state-screen/native/offline.light.png +0 -0
- package/registry/examples/state-screen/native/offline.tsx +12 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +2 -2
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form-flow.json +152 -0
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/grid.json +262 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +408 -12
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +2 -2
- package/registry/list-detail.json +188 -0
- package/registry/list.json +2 -2
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +2 -2
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/onboarding.json +3 -0
- package/registry/opening-hours.json +2 -2
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +2 -2
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +2 -2
- package/registry/photo-grid.json +2 -2
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +2 -2
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/qr-code.json +343 -0
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/screen.json +68 -4
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +2 -2
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +2 -2
- package/registry/settings-layout.json +5 -2
- package/registry/shop-composer.json +2 -2
- package/registry/shop.json +3 -3
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +4 -4
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/state-screen.json +224 -0
- package/registry/status-chip.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +2 -2
- package/registry/text-style.json +1 -1
- package/registry/theme.json +3 -3
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +2 -2
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +2 -2
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +1 -1
- package/registry/waveform.json +1 -1
- /package/dist/{chunk-YCZ7N6Q6.js.map → chunk-7MQNG35Q.js.map} +0 -0
- /package/dist/{chunk-VB7MWE2N.js.map → chunk-DSDFXPL6.js.map} +0 -0
- /package/dist/{chunk-4GQH27IT.js.map → chunk-GW5EI7MI.js.map} +0 -0
- /package/dist/{chunk-F6JTHPHE.js.map → chunk-I6EOLPSH.js.map} +0 -0
- /package/dist/{chunk-BG5APGX6.js.map → chunk-Q5DYWQ6S.js.map} +0 -0
- /package/dist/{chunk-RCKXJEDQ.js.map → chunk-ST5P5HNI.js.map} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ProductLogo } from "@krizaka/ui";
|
|
4
|
+
import { Badge } from "@krizaka/ui/badge";
|
|
5
|
+
import { Button } from "@krizaka/ui/button";
|
|
6
|
+
import { DesktopWindow, useDesktopCommands } from "@krizaka/ui/desktop-window";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
|
|
9
|
+
const FILES = ["Lease — 12 rue Fleury", "Payslips — Ada Roy", "ID — Noor Khan", "Lease — 8 av. du Parc"];
|
|
10
|
+
|
|
11
|
+
// TEMPLATE — The window of a Mac app: sidebar · content · inspector, resizable (drag a divider, or focus it and use the
|
|
12
|
+
// arrows) and collapsible (⌘B, ⌘I, the toolbar). The commands are written once: the menu bar gets them from `menus` and
|
|
13
|
+
// `handlers` (`setNativeMenu(bridge, { labels, menus }, handlers)` of @krizaka/app-desktop), the page answers the same keys.
|
|
14
|
+
export default function DesktopWindowLibrary() {
|
|
15
|
+
const [sidebar, setSidebar] = useState(true);
|
|
16
|
+
const [inspector, setInspector] = useState(true);
|
|
17
|
+
const [current, setCurrent] = useState(0);
|
|
18
|
+
useDesktopCommands([
|
|
19
|
+
{ id: "view.sidebar", menu: "View", label: sidebar ? "Hide sidebar" : "Show sidebar", shortcut: "mod+b", run: () => setSidebar(!sidebar) },
|
|
20
|
+
{ id: "view.inspector", menu: "View", label: inspector ? "Hide inspector" : "Show inspector", shortcut: "mod+i", run: () => setInspector(!inspector) },
|
|
21
|
+
]);
|
|
22
|
+
return (
|
|
23
|
+
<DesktopWindow
|
|
24
|
+
className="[--kz-window-height:34rem]"
|
|
25
|
+
shortcuts={{ sidebar: false, inspector: false }}
|
|
26
|
+
sidebarOpen={sidebar}
|
|
27
|
+
onSidebarOpenChange={setSidebar}
|
|
28
|
+
inspectorOpen={inspector}
|
|
29
|
+
onInspectorOpenChange={setInspector}
|
|
30
|
+
labels={{ sidebar: "Library", inspector: "Details", resizeSidebar: "Resize the sidebar", resizeInspector: "Resize the inspector", toggleSidebar: "Show or hide the sidebar", toggleInspector: "Show or hide the inspector" }}
|
|
31
|
+
title="Applicant files"
|
|
32
|
+
toolbarEnd={<Button size="sm" variant="primary">New file</Button>}
|
|
33
|
+
sidebar={
|
|
34
|
+
<div className="flex flex-col gap-0.5 p-2">
|
|
35
|
+
<div className="flex items-center gap-2 px-2 py-1.5 font-semibold"><ProductLogo id="yomizaka" size={18} animated={false} /> Yomizaka</div>
|
|
36
|
+
{["All files", "To decide", "Verified"].map((name, i) => (
|
|
37
|
+
<button key={name} type="button" aria-current={i === 0 ? "page" : undefined} className="h-8 cursor-default rounded-md px-2 text-start hover:bg-surface-2 aria-[current=page]:bg-accent-soft">{name}</button>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
}
|
|
41
|
+
inspector={
|
|
42
|
+
<div className="space-y-2 p-4">
|
|
43
|
+
<p className="text-xs font-semibold text-fg-secondary">Details</p>
|
|
44
|
+
<p className="font-semibold">{FILES[current]}</p>
|
|
45
|
+
<Badge tone="success" dot>Verified</Badge>
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
48
|
+
>
|
|
49
|
+
<ul className="divide-y divide-border-subtle">
|
|
50
|
+
{FILES.map((file, i) => (
|
|
51
|
+
<li key={file}>
|
|
52
|
+
<button type="button" aria-pressed={i === current} onClick={() => setCurrent(i)} className="block h-9 w-full cursor-default truncate px-4 text-start hover:bg-surface-2 aria-pressed:bg-accent-soft">{file}</button>
|
|
53
|
+
</li>
|
|
54
|
+
))}
|
|
55
|
+
</ul>
|
|
56
|
+
</DesktopWindow>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/entity-header/basic.tsx
|
|
4
|
+
import { EntityHeader } from "@krizaka/ui/entity-header";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function EntityHeaderBasic() {
|
|
8
|
+
const [name, setName] = React.useState("Spring bookings");
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
EntityHeader,
|
|
11
|
+
{
|
|
12
|
+
name,
|
|
13
|
+
nameLabel: "Rename the collection",
|
|
14
|
+
onNameChange: async (next) => {
|
|
15
|
+
if (next === "Archive") throw Object.assign(new Error("taken"), { code: "NAME_TAKEN" });
|
|
16
|
+
setName(next);
|
|
17
|
+
},
|
|
18
|
+
description: "Everything booked from March to May.",
|
|
19
|
+
avatar: { defaultAvatar: { brand: "krizaka", kind: "folder", tone: 3 } },
|
|
20
|
+
tags: [
|
|
21
|
+
{ id: "1", label: "Seasonal", marker: "blue" },
|
|
22
|
+
{ id: "2", label: "Priority", marker: "amber" }
|
|
23
|
+
],
|
|
24
|
+
tagsLabel: "Tags",
|
|
25
|
+
refusals: { NAME_TAKEN: "Another collection already has this name." }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
EntityHeaderBasic as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EntityHeader } from "@krizaka/ui/entity-header";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// A collection's head: rename it in place (Enter saves, Escape gives it back). A taken name comes back as a code, and the page says it in its words.
|
|
5
|
+
export default function EntityHeaderBasic() {
|
|
6
|
+
const [name, setName] = React.useState("Spring bookings");
|
|
7
|
+
return (
|
|
8
|
+
<EntityHeader
|
|
9
|
+
name={name}
|
|
10
|
+
nameLabel="Rename the collection"
|
|
11
|
+
onNameChange={async (next) => {
|
|
12
|
+
if (next === "Archive") throw Object.assign(new Error("taken"), { code: "NAME_TAKEN" });
|
|
13
|
+
setName(next);
|
|
14
|
+
}}
|
|
15
|
+
description="Everything booked from March to May."
|
|
16
|
+
avatar={{ defaultAvatar: { brand: "krizaka", kind: "folder", tone: 3 } }}
|
|
17
|
+
tags={[
|
|
18
|
+
{ id: "1", label: "Seasonal", marker: "blue" },
|
|
19
|
+
{ id: "2", label: "Priority", marker: "amber" },
|
|
20
|
+
]}
|
|
21
|
+
tagsLabel="Tags"
|
|
22
|
+
refusals={{ NAME_TAKEN: "Another collection already has this name." }}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/entity-header/native/basic.tsx
|
|
4
|
+
import { EntityHeader } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeEntityHeaderBasic() {
|
|
8
|
+
const [name, setName] = React.useState("Weddings");
|
|
9
|
+
const rename = async (next) => {
|
|
10
|
+
if (next === "Archive") throw Object.assign(new Error("taken"), { code: "NAME_TAKEN" });
|
|
11
|
+
setName(next);
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ jsx(EntityHeader, { name, nameLabel: "Rename", onNameChange: rename, description: "Ceremonies and receptions.", refusals: { NAME_TAKEN: "This name is taken." } });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
NativeEntityHeaderBasic as default
|
|
17
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntityHeader } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// Tap the name to rename it; the same refusal codes as the web, said in the page's words.
|
|
5
|
+
export default function NativeEntityHeaderBasic() {
|
|
6
|
+
const [name, setName] = React.useState("Weddings");
|
|
7
|
+
const rename = async (next: string) => {
|
|
8
|
+
if (next === "Archive") throw Object.assign(new Error("taken"), { code: "NAME_TAKEN" });
|
|
9
|
+
setName(next);
|
|
10
|
+
};
|
|
11
|
+
return <EntityHeader name={name} nameLabel="Rename" onNameChange={rename} description="Ceremonies and receptions." refusals={{ NAME_TAKEN: "This name is taken." }} />;
|
|
12
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/form-flow/native/signup.tsx
|
|
4
|
+
import { FormFlow, TextField } from "@krizaka/ui/native";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function NativeFormFlowSignup() {
|
|
9
|
+
const [name, setName] = useState("");
|
|
10
|
+
const [email, setEmail] = useState("");
|
|
11
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 360, height: 640 }, children: /* @__PURE__ */ jsx(
|
|
12
|
+
FormFlow,
|
|
13
|
+
{
|
|
14
|
+
labels: { next: "Next", done: "Create my account", back: "Back", position: (n, total) => `Step ${n} of ${total}` },
|
|
15
|
+
onDone: () => void 0,
|
|
16
|
+
onExit: () => void 0,
|
|
17
|
+
steps: [
|
|
18
|
+
{ id: "name", title: "What should we call you?", description: "Your first name is enough.", valid: name.trim().length > 0, content: /* @__PURE__ */ jsx(TextField, { label: "First name", value: name, onValueChange: setName }) },
|
|
19
|
+
{ id: "email", title: "Where do we send your results?", valid: email.includes("@"), content: /* @__PURE__ */ jsx(TextField, { label: "Email", value: email, onValueChange: setEmail, keyboardType: "email-address", autoCapitalize: "none" }) }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
NativeFormFlowSignup as default
|
|
26
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FormFlow, TextField } from "@krizaka/ui/native";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// TEMPLATE — A form in steps: one question per step, the position in words, the main action pinned above the keyboard (it
|
|
6
|
+
// rises with it) and clear of the home indicator. The action stays dimmed until the step is valid.
|
|
7
|
+
export default function NativeFormFlowSignup() {
|
|
8
|
+
const [name, setName] = useState("");
|
|
9
|
+
const [email, setEmail] = useState("");
|
|
10
|
+
return (
|
|
11
|
+
<View style={{ width: 360, height: 640 }}>
|
|
12
|
+
<FormFlow
|
|
13
|
+
labels={{ next: "Next", done: "Create my account", back: "Back", position: (n, total) => `Step ${n} of ${total}` }}
|
|
14
|
+
onDone={() => undefined}
|
|
15
|
+
onExit={() => undefined}
|
|
16
|
+
steps={[
|
|
17
|
+
{ id: "name", title: "What should we call you?", description: "Your first name is enough.", valid: name.trim().length > 0, content: <TextField label="First name" value={name} onValueChange={setName} /> },
|
|
18
|
+
{ id: "email", title: "Where do we send your results?", valid: email.includes("@"), content: <TextField label="Email" value={email} onValueChange={setEmail} keyboardType="email-address" autoCapitalize="none" /> },
|
|
19
|
+
]}
|
|
20
|
+
/>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/grid/native/columns.tsx
|
|
4
|
+
import { Columns, Txt, useTheme } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function NativeGridColumns() {
|
|
8
|
+
const { theme } = useTheme();
|
|
9
|
+
const box = { gap: 6, padding: 14, borderRadius: 12, backgroundColor: theme.surface1, borderWidth: 1, borderColor: theme.borderSubtle };
|
|
10
|
+
return /* @__PURE__ */ jsxs(Columns, { weights: [1, 2], minColumnWidth: 220, children: [
|
|
11
|
+
/* @__PURE__ */ jsxs(View, { style: box, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(Txt, { variant: "label", children: "Summary" }),
|
|
13
|
+
/* @__PURE__ */ jsx(Txt, { variant: "caption", tone: "secondary", children: "3 files \xB7 42 checks" })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ jsxs(View, { style: box, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Txt, { variant: "label", children: "The file" }),
|
|
17
|
+
/* @__PURE__ */ jsx(Txt, { tone: "secondary", children: "Side by side from 2 \xD7 220 pt plus the gap; one above the other below." })
|
|
18
|
+
] })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
NativeGridColumns as default
|
|
23
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Columns, Txt, useTheme } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Two columns that stack when the room cannot hold them: a form and its summary, a third and two thirds.
|
|
5
|
+
export default function NativeGridColumns() {
|
|
6
|
+
const { theme } = useTheme();
|
|
7
|
+
const box = { gap: 6, padding: 14, borderRadius: 12, backgroundColor: theme.surface1, borderWidth: 1, borderColor: theme.borderSubtle } as const;
|
|
8
|
+
return (
|
|
9
|
+
<Columns weights={[1, 2]} minColumnWidth={220}>
|
|
10
|
+
<View style={box}>
|
|
11
|
+
<Txt variant="label">Summary</Txt>
|
|
12
|
+
<Txt variant="caption" tone="secondary">3 files · 42 checks</Txt>
|
|
13
|
+
</View>
|
|
14
|
+
<View style={box}>
|
|
15
|
+
<Txt variant="label">The file</Txt>
|
|
16
|
+
<Txt tone="secondary">Side by side from 2 × 220 pt plus the gap; one above the other below.</Txt>
|
|
17
|
+
</View>
|
|
18
|
+
</Columns>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/grid/native/photos.tsx
|
|
4
|
+
import { Grid, Txt, useTheme } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var PLACES = ["Old Port", "Mount Royal", "Plateau", "Lachine canal", "Jean-Talon", "Atwater", "Verdun", "Mile End"];
|
|
8
|
+
function NativeGridPhotos() {
|
|
9
|
+
const { theme } = useTheme();
|
|
10
|
+
return /* @__PURE__ */ jsx(Grid, { columns: { compact: 2, regular: 3, expanded: 4 }, minItemWidth: 120, gap: "sm", "aria-label": "Photos", children: PLACES.map((place) => /* @__PURE__ */ jsx(View, { style: { aspectRatio: 1, justifyContent: "flex-end", padding: 10, borderRadius: 12, borderWidth: 1, borderColor: theme.borderSubtle, backgroundColor: theme.surface2 }, children: /* @__PURE__ */ jsx(Txt, { variant: "caption", numberOfLines: 2, children: place }) }, place)) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
NativeGridPhotos as default
|
|
14
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Grid, Txt, useTheme } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
const PLACES = ["Old Port", "Mount Royal", "Plateau", "Lachine canal", "Jean-Talon", "Atwater", "Verdun", "Mile End"];
|
|
5
|
+
|
|
6
|
+
// Photos: two columns on a compact room, three on a regular one, four on an expanded one — and never a tile narrower than 120 pt.
|
|
7
|
+
export default function NativeGridPhotos() {
|
|
8
|
+
const { theme } = useTheme();
|
|
9
|
+
return (
|
|
10
|
+
<Grid columns={{ compact: 2, regular: 3, expanded: 4 }} minItemWidth={120} gap="sm" aria-label="Photos">
|
|
11
|
+
{PLACES.map((place) => (
|
|
12
|
+
<View key={place} style={{ aspectRatio: 1, justifyContent: "flex-end", padding: 10, borderRadius: 12, borderWidth: 1, borderColor: theme.borderSubtle, backgroundColor: theme.surface2 }}>
|
|
13
|
+
<Txt variant="caption" numberOfLines={2}>{place}</Txt>
|
|
14
|
+
</View>
|
|
15
|
+
))}
|
|
16
|
+
</Grid>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/grid/native/stats.tsx
|
|
4
|
+
import { Grid, Txt, useTheme } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var STATS = [
|
|
8
|
+
{ label: "Files to decide", value: "3" },
|
|
9
|
+
{ label: "Checks this month", value: "42" },
|
|
10
|
+
{ label: "Credits left", value: "58" },
|
|
11
|
+
{ label: "Average time", value: "1 min 12 s" }
|
|
12
|
+
];
|
|
13
|
+
function NativeGridStats() {
|
|
14
|
+
const { theme } = useTheme();
|
|
15
|
+
return /* @__PURE__ */ jsx(Grid, { columns: { compact: 2, expanded: 4 }, minItemWidth: 140, "aria-label": "This month", children: STATS.map((stat) => /* @__PURE__ */ jsxs(View, { style: { gap: 4, padding: 14, borderRadius: 12, borderWidth: 1, borderColor: theme.borderSubtle, backgroundColor: theme.surface1 }, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Txt, { variant: "caption", tone: "secondary", children: stat.label }),
|
|
17
|
+
/* @__PURE__ */ jsx(Txt, { variant: "title", children: stat.value })
|
|
18
|
+
] }, stat.label)) });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
NativeGridStats as default
|
|
22
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Grid, Txt, useTheme } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
const STATS = [
|
|
5
|
+
{ label: "Files to decide", value: "3" },
|
|
6
|
+
{ label: "Checks this month", value: "42" },
|
|
7
|
+
{ label: "Credits left", value: "58" },
|
|
8
|
+
{ label: "Average time", value: "1 min 12 s" },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// A stat strip: cards of equal height, two per row on a phone and four on a tablet; at 200 % text they stack, so no number is cut.
|
|
12
|
+
export default function NativeGridStats() {
|
|
13
|
+
const { theme } = useTheme();
|
|
14
|
+
return (
|
|
15
|
+
<Grid columns={{ compact: 2, expanded: 4 }} minItemWidth={140} aria-label="This month">
|
|
16
|
+
{STATS.map((stat) => (
|
|
17
|
+
<View key={stat.label} style={{ gap: 4, padding: 14, borderRadius: 12, borderWidth: 1, borderColor: theme.borderSubtle, backgroundColor: theme.surface1 }}>
|
|
18
|
+
<Txt variant="caption" tone="secondary">{stat.label}</Txt>
|
|
19
|
+
<Txt variant="title">{stat.value}</Txt>
|
|
20
|
+
</View>
|
|
21
|
+
))}
|
|
22
|
+
</Grid>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/list-detail/native/inbox.tsx
|
|
4
|
+
import { ListDetail, Txt, useTheme } from "@krizaka/ui/native";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Pressable, View } from "react-native";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var MESSAGES = [
|
|
9
|
+
{ id: "1", from: "Camille", subject: "Lease for 12 rue Fleury", body: "I attached the signed lease. Can you check the page 4 stamp?" },
|
|
10
|
+
{ id: "2", from: "Noor", subject: "Payslips, March to May", body: "Here are the three payslips you asked for." },
|
|
11
|
+
{ id: "3", from: "Ada", subject: "Thanks", body: "Verified in a minute, thank you." }
|
|
12
|
+
];
|
|
13
|
+
function NativeListDetailInbox() {
|
|
14
|
+
const { theme } = useTheme();
|
|
15
|
+
const [open, setOpen] = useState(null);
|
|
16
|
+
const message = MESSAGES.find((m) => m.id === open);
|
|
17
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 360, height: 640 }, children: /* @__PURE__ */ jsx(
|
|
18
|
+
ListDetail,
|
|
19
|
+
{
|
|
20
|
+
listTitle: "Messages",
|
|
21
|
+
list: MESSAGES.map((m) => /* @__PURE__ */ jsxs(Pressable, { role: "button", onPress: () => setOpen(m.id), style: { padding: 16, gap: 2, borderBottomWidth: 1, borderBottomColor: theme.borderSubtle }, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Txt, { variant: "label", children: m.from }),
|
|
23
|
+
/* @__PURE__ */ jsx(Txt, { tone: "secondary", numberOfLines: 1, children: m.subject })
|
|
24
|
+
] }, m.id)),
|
|
25
|
+
detailTitle: message?.from,
|
|
26
|
+
detail: message ? /* @__PURE__ */ jsx(Txt, { variant: "body", children: message.body }) : void 0,
|
|
27
|
+
empty: "Select a message",
|
|
28
|
+
backLabel: "Messages",
|
|
29
|
+
onBack: () => setOpen(null)
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
NativeListDetailInbox as default
|
|
35
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ListDetail, Txt, useTheme } from "@krizaka/ui/native";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const MESSAGES = [
|
|
6
|
+
{ id: "1", from: "Camille", subject: "Lease for 12 rue Fleury", body: "I attached the signed lease. Can you check the page 4 stamp?" },
|
|
7
|
+
{ id: "2", from: "Noor", subject: "Payslips, March to May", body: "Here are the three payslips you asked for." },
|
|
8
|
+
{ id: "3", from: "Ada", subject: "Thanks", body: "Verified in a minute, thank you." },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// TEMPLATE — List to detail: one pane at a time on a phone (the list, then the message with the way back), both side by
|
|
12
|
+
// side when the room holds them — the room decides, so a rotation or a split view just works.
|
|
13
|
+
export default function NativeListDetailInbox() {
|
|
14
|
+
const { theme } = useTheme();
|
|
15
|
+
const [open, setOpen] = useState<string | null>(null);
|
|
16
|
+
const message = MESSAGES.find((m) => m.id === open);
|
|
17
|
+
return (
|
|
18
|
+
<View style={{ width: 360, height: 640 }}>
|
|
19
|
+
<ListDetail
|
|
20
|
+
listTitle="Messages"
|
|
21
|
+
list={MESSAGES.map((m) => (
|
|
22
|
+
<Pressable key={m.id} role="button" onPress={() => setOpen(m.id)} style={{ padding: 16, gap: 2, borderBottomWidth: 1, borderBottomColor: theme.borderSubtle }}>
|
|
23
|
+
<Txt variant="label">{m.from}</Txt>
|
|
24
|
+
<Txt tone="secondary" numberOfLines={1}>{m.subject}</Txt>
|
|
25
|
+
</Pressable>
|
|
26
|
+
))}
|
|
27
|
+
detailTitle={message?.from}
|
|
28
|
+
detail={message ? <Txt variant="body">{message.body}</Txt> : undefined}
|
|
29
|
+
empty="Select a message"
|
|
30
|
+
backLabel="Messages"
|
|
31
|
+
onBack={() => setOpen(null)}
|
|
32
|
+
/>
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/qr-code/basic.tsx
|
|
4
|
+
import { QrCode } from "@krizaka/ui/qr-code";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function QrCodeBasic() {
|
|
7
|
+
return /* @__PURE__ */ jsx(QrCode, { value: "https://www.krizaka.com", label: "Krizaka \u2014 scan to open the site", size: 160 });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
QrCodeBasic as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QrCode } from "@krizaka/ui/qr-code";
|
|
2
|
+
|
|
3
|
+
// The text becomes a code in the browser: dark modules on a light tile, in dark and light themes alike.
|
|
4
|
+
export default function QrCodeBasic() {
|
|
5
|
+
return <QrCode value="https://www.krizaka.com" label="Krizaka — scan to open the site" size={160} />;
|
|
6
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/qr-code/calendar-feed.tsx
|
|
4
|
+
import { QrCode } from "@krizaka/ui/qr-code";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function QrCodeCalendarFeed() {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
8
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-fg", children: "Your calendar on your phone" }),
|
|
9
|
+
/* @__PURE__ */ jsx("p", { className: "max-w-xs text-xs text-fg-secondary", children: "Scan this code with the camera, or copy the link. Anyone with it can read your bookings: keep it private." }),
|
|
10
|
+
/* @__PURE__ */ jsx(
|
|
11
|
+
QrCode,
|
|
12
|
+
{
|
|
13
|
+
value: "https://example.com/ical/7f3c9a1e-4b2d-4c8e-9a51-0d6f2b8e3c17.ics",
|
|
14
|
+
label: "Calendar feed: scan to subscribe",
|
|
15
|
+
copyLabel: "Copy the link",
|
|
16
|
+
copiedLabel: "Link copied",
|
|
17
|
+
level: "Q"
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
QrCodeCalendarFeed as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QrCode } from "@krizaka/ui/qr-code";
|
|
2
|
+
|
|
3
|
+
// A private calendar feed: scan it from the phone to subscribe, or copy the link. The words arrive translated.
|
|
4
|
+
export default function QrCodeCalendarFeed() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-col gap-2">
|
|
7
|
+
<p className="text-sm font-semibold text-fg">Your calendar on your phone</p>
|
|
8
|
+
<p className="max-w-xs text-xs text-fg-secondary">Scan this code with the camera, or copy the link. Anyone with it can read your bookings: keep it private.</p>
|
|
9
|
+
<QrCode
|
|
10
|
+
value="https://example.com/ical/7f3c9a1e-4b2d-4c8e-9a51-0d6f2b8e3c17.ics"
|
|
11
|
+
label="Calendar feed: scan to subscribe"
|
|
12
|
+
copyLabel="Copy the link"
|
|
13
|
+
copiedLabel="Link copied"
|
|
14
|
+
level="Q"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/qr-code/native/calendar-feed.tsx
|
|
4
|
+
import { QrCode, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function NativeQrCodeCalendarFeed() {
|
|
8
|
+
return /* @__PURE__ */ jsxs(View, { style: { rowGap: 8, padding: 16 }, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Txt, { variant: "label", children: "Your calendar on your phone" }),
|
|
10
|
+
/* @__PURE__ */ jsx(Txt, { variant: "caption", tone: "secondary", children: "Scan this code, or copy the link. Keep it private." }),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
QrCode,
|
|
13
|
+
{
|
|
14
|
+
value: "https://example.com/ical/7f3c9a1e-4b2d-4c8e-9a51-0d6f2b8e3c17.ics",
|
|
15
|
+
label: "Calendar feed: scan to subscribe",
|
|
16
|
+
copyLabel: "Copy the link",
|
|
17
|
+
onCopy: () => void 0,
|
|
18
|
+
level: "Q"
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
NativeQrCodeCalendarFeed as default
|
|
25
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QrCode, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// A private calendar feed: scan it from another phone, or copy the link (the app puts it on the clipboard).
|
|
5
|
+
export default function NativeQrCodeCalendarFeed() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ rowGap: 8, padding: 16 }}>
|
|
8
|
+
<Txt variant="label">Your calendar on your phone</Txt>
|
|
9
|
+
<Txt variant="caption" tone="secondary">Scan this code, or copy the link. Keep it private.</Txt>
|
|
10
|
+
<QrCode
|
|
11
|
+
value="https://example.com/ical/7f3c9a1e-4b2d-4c8e-9a51-0d6f2b8e3c17.ics"
|
|
12
|
+
label="Calendar feed: scan to subscribe"
|
|
13
|
+
copyLabel="Copy the link"
|
|
14
|
+
onCopy={() => undefined}
|
|
15
|
+
level="Q"
|
|
16
|
+
/>
|
|
17
|
+
</View>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
Binary file
|