@krizaka/ui 3.3.0 → 3.4.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/dist/activity-feed.d.ts +199 -0
- package/dist/activity-feed.js +155 -0
- package/dist/activity-feed.js.map +1 -0
- package/dist/argument-card.js +3 -3
- package/dist/chunk-7Z4KHPFC.js +42 -0
- package/dist/chunk-7Z4KHPFC.js.map +1 -0
- package/dist/data-table.js +98 -131
- package/dist/data-table.js.map +1 -1
- package/dist/description-list.d.ts +105 -0
- package/dist/description-list.js +49 -0
- package/dist/description-list.js.map +1 -0
- package/dist/index.js +13 -66
- package/dist/index.js.map +1 -1
- package/dist/kanban.d.ts +132 -0
- package/dist/kanban.js +187 -0
- package/dist/kanban.js.map +1 -0
- package/dist/list.d.ts +153 -0
- package/dist/list.js +130 -0
- package/dist/list.js.map +1 -0
- package/dist/map.d.ts +463 -0
- package/dist/map.js +952 -0
- package/dist/map.js.map +1 -0
- package/dist/motion.css +12 -1
- package/dist/native/map.d.ts +200 -0
- package/dist/native/map.js +673 -0
- package/dist/native/map.js.map +1 -0
- package/dist/native/media-picker.d.ts +58 -0
- package/dist/native/media-picker.js +63 -0
- package/dist/native/media-picker.js.map +1 -0
- package/dist/native.d.ts +568 -6
- package/dist/native.js +1989 -868
- package/dist/native.js.map +1 -1
- package/dist/page-hero.js +3 -3
- package/dist/stat.d.ts +31 -2
- package/dist/stat.js +21 -4
- package/dist/stat.js.map +1 -1
- package/dist/tree-view.d.ts +111 -0
- package/dist/tree-view.js +154 -0
- package/dist/tree-view.js.map +1 -0
- package/package.json +147 -10
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/action-sheet.json +121 -0
- package/registry/activity-feed.json +468 -0
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +58 -3
- package/registry/badge.json +1 -1
- package/registry/button.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/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.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/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +2 -2
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +232 -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 +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/action-sheet/native/video-actions.d.ts +4 -0
- package/registry/examples/action-sheet/native/video-actions.dark.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.js +30 -0
- package/registry/examples/action-sheet/native/video-actions.light.png +0 -0
- package/registry/examples/action-sheet/native/video-actions.tsx +24 -0
- package/registry/examples/activity-feed/job-activity.d.ts +4 -0
- package/registry/examples/activity-feed/job-activity.js +21 -0
- package/registry/examples/activity-feed/job-activity.tsx +17 -0
- package/registry/examples/activity-feed/live.d.ts +4 -0
- package/registry/examples/activity-feed/live.js +23 -0
- package/registry/examples/activity-feed/live.tsx +24 -0
- package/registry/examples/activity-feed/native/notifications.d.ts +4 -0
- package/registry/examples/activity-feed/native/notifications.dark.png +0 -0
- package/registry/examples/activity-feed/native/notifications.js +18 -0
- package/registry/examples/activity-feed/native/notifications.light.png +0 -0
- package/registry/examples/activity-feed/native/notifications.tsx +18 -0
- package/registry/examples/activity-feed/timeline.d.ts +4 -0
- package/registry/examples/activity-feed/timeline.js +25 -0
- package/registry/examples/activity-feed/timeline.tsx +19 -0
- package/registry/examples/avatar/native/presence.d.ts +4 -0
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.js +18 -0
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/avatar/native/presence.tsx +15 -0
- package/registry/examples/description-list/job-details.d.ts +4 -0
- package/registry/examples/description-list/job-details.js +23 -0
- package/registry/examples/description-list/job-details.tsx +17 -0
- package/registry/examples/description-list/key-value-grid.d.ts +4 -0
- package/registry/examples/description-list/key-value-grid.js +22 -0
- package/registry/examples/description-list/key-value-grid.tsx +16 -0
- package/registry/examples/description-list/native/job-details.d.ts +4 -0
- package/registry/examples/description-list/native/job-details.dark.png +0 -0
- package/registry/examples/description-list/native/job-details.js +33 -0
- package/registry/examples/description-list/native/job-details.light.png +0 -0
- package/registry/examples/description-list/native/job-details.tsx +24 -0
- package/registry/examples/description-list/receipt.d.ts +4 -0
- package/registry/examples/description-list/receipt.js +23 -0
- package/registry/examples/description-list/receipt.tsx +17 -0
- package/registry/examples/fab/native/extended.d.ts +4 -0
- package/registry/examples/fab/native/extended.dark.png +0 -0
- package/registry/examples/fab/native/extended.js +18 -0
- package/registry/examples/fab/native/extended.light.png +0 -0
- package/registry/examples/fab/native/extended.tsx +23 -0
- package/registry/examples/header/native/large-title.d.ts +4 -0
- package/registry/examples/header/native/large-title.dark.png +0 -0
- package/registry/examples/header/native/large-title.js +23 -0
- package/registry/examples/header/native/large-title.light.png +0 -0
- package/registry/examples/header/native/large-title.tsx +31 -0
- package/registry/examples/image-viewer/native/gallery.d.ts +4 -0
- package/registry/examples/image-viewer/native/gallery.dark.png +0 -0
- package/registry/examples/image-viewer/native/gallery.js +22 -0
- package/registry/examples/image-viewer/native/gallery.light.png +0 -0
- package/registry/examples/image-viewer/native/gallery.tsx +21 -0
- package/registry/examples/kanban/moderation.d.ts +4 -0
- package/registry/examples/kanban/moderation.js +35 -0
- package/registry/examples/kanban/moderation.tsx +37 -0
- package/registry/examples/list/jobs.d.ts +4 -0
- package/registry/examples/list/jobs.js +35 -0
- package/registry/examples/list/jobs.tsx +33 -0
- package/registry/examples/list/selectable.d.ts +4 -0
- package/registry/examples/list/selectable.js +33 -0
- package/registry/examples/list/selectable.tsx +30 -0
- package/registry/examples/list/virtualized.d.ts +4 -0
- package/registry/examples/list/virtualized.js +22 -0
- package/registry/examples/list/virtualized.tsx +17 -0
- package/registry/examples/loader/native/block.d.ts +4 -0
- package/registry/examples/loader/native/block.dark.png +0 -0
- package/registry/examples/loader/native/block.js +12 -0
- package/registry/examples/loader/native/block.light.png +0 -0
- package/registry/examples/loader/native/block.tsx +11 -0
- package/registry/examples/loader/native/job-wait.d.ts +4 -0
- package/registry/examples/loader/native/job-wait.dark.png +0 -0
- package/registry/examples/loader/native/job-wait.js +17 -0
- package/registry/examples/loader/native/job-wait.light.png +0 -0
- package/registry/examples/loader/native/job-wait.tsx +14 -0
- package/registry/examples/map/cluster.d.ts +4 -0
- package/registry/examples/map/cluster.js +16 -0
- package/registry/examples/map/cluster.tsx +18 -0
- package/registry/examples/map/location-picker.d.ts +4 -0
- package/registry/examples/map/location-picker.js +24 -0
- package/registry/examples/map/location-picker.tsx +22 -0
- package/registry/examples/map/native/location-picker.d.ts +4 -0
- package/registry/examples/map/native/location-picker.dark.png +0 -0
- package/registry/examples/map/native/location-picker.js +14 -0
- package/registry/examples/map/native/location-picker.light.png +0 -0
- package/registry/examples/map/native/location-picker.tsx +13 -0
- package/registry/examples/map/native/places.d.ts +4 -0
- package/registry/examples/map/native/places.dark.png +0 -0
- package/registry/examples/map/native/places.js +25 -0
- package/registry/examples/map/native/places.light.png +0 -0
- package/registry/examples/map/native/places.tsx +27 -0
- package/registry/examples/map/places.d.ts +4 -0
- package/registry/examples/map/places.js +28 -0
- package/registry/examples/map/places.tsx +28 -0
- package/registry/examples/map/static.d.ts +4 -0
- package/registry/examples/map/static.js +22 -0
- package/registry/examples/map/static.tsx +18 -0
- package/registry/examples/media-picker/native/story.d.ts +4 -0
- package/registry/examples/media-picker/native/story.dark.png +0 -0
- package/registry/examples/media-picker/native/story.js +30 -0
- package/registry/examples/media-picker/native/story.light.png +0 -0
- package/registry/examples/media-picker/native/story.tsx +26 -0
- package/registry/examples/meter/native/credits.d.ts +4 -0
- package/registry/examples/meter/native/credits.dark.png +0 -0
- package/registry/examples/meter/native/credits.js +15 -0
- package/registry/examples/meter/native/credits.light.png +0 -0
- package/registry/examples/meter/native/credits.tsx +12 -0
- package/registry/examples/meter/native/split-ring.d.ts +4 -0
- package/registry/examples/meter/native/split-ring.dark.png +0 -0
- package/registry/examples/meter/native/split-ring.js +24 -0
- package/registry/examples/meter/native/split-ring.light.png +0 -0
- package/registry/examples/meter/native/split-ring.tsx +19 -0
- package/registry/examples/number-ticker/native/balance.d.ts +4 -0
- package/registry/examples/number-ticker/native/balance.dark.png +0 -0
- package/registry/examples/number-ticker/native/balance.js +18 -0
- package/registry/examples/number-ticker/native/balance.light.png +0 -0
- package/registry/examples/number-ticker/native/balance.tsx +17 -0
- package/registry/examples/onboarding/native/first-launch.d.ts +4 -0
- package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
- package/registry/examples/onboarding/native/first-launch.js +23 -0
- package/registry/examples/onboarding/native/first-launch.light.png +0 -0
- package/registry/examples/onboarding/native/first-launch.tsx +19 -0
- package/registry/examples/otp-input/native/invalid.d.ts +4 -0
- package/registry/examples/otp-input/native/invalid.dark.png +0 -0
- package/registry/examples/otp-input/native/invalid.js +15 -0
- package/registry/examples/otp-input/native/invalid.light.png +0 -0
- package/registry/examples/otp-input/native/invalid.tsx +14 -0
- package/registry/examples/otp-input/native/verify.d.ts +4 -0
- package/registry/examples/otp-input/native/verify.dark.png +0 -0
- package/registry/examples/otp-input/native/verify.js +17 -0
- package/registry/examples/otp-input/native/verify.light.png +0 -0
- package/registry/examples/otp-input/native/verify.tsx +14 -0
- package/registry/examples/permission-prompt/native/blocked.d.ts +4 -0
- package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.js +25 -0
- package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.tsx +21 -0
- package/registry/examples/permission-prompt/native/camera.d.ts +4 -0
- package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
- package/registry/examples/permission-prompt/native/camera.js +25 -0
- package/registry/examples/permission-prompt/native/camera.light.png +0 -0
- package/registry/examples/permission-prompt/native/camera.tsx +21 -0
- package/registry/examples/pull-to-refresh/native/feed.d.ts +4 -0
- package/registry/examples/pull-to-refresh/native/feed.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.js +14 -0
- package/registry/examples/pull-to-refresh/native/feed.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/feed.tsx +19 -0
- package/registry/examples/search-field/native/cancel.d.ts +4 -0
- package/registry/examples/search-field/native/cancel.dark.png +0 -0
- package/registry/examples/search-field/native/cancel.js +14 -0
- package/registry/examples/search-field/native/cancel.light.png +0 -0
- package/registry/examples/search-field/native/cancel.tsx +13 -0
- package/registry/examples/stat/grid.d.ts +4 -0
- package/registry/examples/stat/grid.js +17 -0
- package/registry/examples/stat/grid.tsx +14 -0
- package/registry/examples/stepper/native/run.d.ts +4 -0
- package/registry/examples/stepper/native/run.dark.png +0 -0
- package/registry/examples/stepper/native/run.js +24 -0
- package/registry/examples/stepper/native/run.light.png +0 -0
- package/registry/examples/stepper/native/run.tsx +20 -0
- package/registry/examples/swipeable-row/native/conversation.d.ts +4 -0
- package/registry/examples/swipeable-row/native/conversation.dark.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.js +30 -0
- package/registry/examples/swipeable-row/native/conversation.light.png +0 -0
- package/registry/examples/swipeable-row/native/conversation.tsx +27 -0
- package/registry/examples/tab-bar/native/main-sections.d.ts +4 -0
- package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.js +29 -0
- package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.tsx +30 -0
- package/registry/examples/tabs/native/sections.d.ts +4 -0
- package/registry/examples/tabs/native/sections.dark.png +0 -0
- package/registry/examples/tabs/native/sections.js +23 -0
- package/registry/examples/tabs/native/sections.light.png +0 -0
- package/registry/examples/tabs/native/sections.tsx +19 -0
- package/registry/examples/tabs/native/segmented.d.ts +4 -0
- package/registry/examples/tabs/native/segmented.dark.png +0 -0
- package/registry/examples/tabs/native/segmented.js +22 -0
- package/registry/examples/tabs/native/segmented.light.png +0 -0
- package/registry/examples/tabs/native/segmented.tsx +18 -0
- package/registry/examples/toast/native/snackbar.d.ts +4 -0
- package/registry/examples/toast/native/snackbar.dark.png +0 -0
- package/registry/examples/toast/native/snackbar.js +23 -0
- package/registry/examples/toast/native/snackbar.light.png +0 -0
- package/registry/examples/toast/native/snackbar.tsx +21 -0
- package/registry/examples/tree-view/docs.d.ts +4 -0
- package/registry/examples/tree-view/docs.js +24 -0
- package/registry/examples/tree-view/docs.tsx +22 -0
- package/registry/examples/tree-view/lazy.d.ts +4 -0
- package/registry/examples/tree-view/lazy.js +21 -0
- package/registry/examples/tree-view/lazy.tsx +19 -0
- package/registry/fab.json +122 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +2 -2
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +2 -2
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/header.json +137 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/image-viewer.json +107 -0
- package/registry/index.json +299 -25
- package/registry/iso.json +1 -1
- package/registry/kanban.json +253 -0
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +367 -30
- package/registry/loader.json +157 -4
- package/registry/longform-page.json +1 -1
- package/registry/map.json +1368 -0
- 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/media-capture.json +1 -1
- package/registry/media-picker.json +129 -0
- package/registry/meter.json +136 -4
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +96 -4
- package/registry/onboarding.json +95 -0
- package/registry/otp-input.json +150 -0
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/permission-prompt.json +172 -0
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +2 -2
- package/registry/promise-card.json +1 -1
- package/registry/pull-to-refresh.json +74 -0
- package/registry/radio-group.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +30 -3
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.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 +68 -5
- package/registry/status-page.json +1 -1
- package/registry/stepper.json +75 -4
- package/registry/swipeable-row.json +124 -0
- package/registry/switch.json +1 -1
- package/registry/tab-bar.json +115 -0
- package/registry/tabs.json +94 -4
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +8 -1
- package/registry/toast.json +17 -3
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +291 -0
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/skills/map/SKILL.md +35 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/map/location-picker.tsx
|
|
4
|
+
import { LocationPicker, StaticMap } from "@krizaka/ui/map";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function MapLocationPicker() {
|
|
8
|
+
const [point, setPoint] = React.useState([-73.5673, 45.5017]);
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-xl", children: /* @__PURE__ */ jsx(
|
|
10
|
+
LocationPicker,
|
|
11
|
+
{
|
|
12
|
+
label: "Meeting point",
|
|
13
|
+
locale: "en-CA",
|
|
14
|
+
value: point,
|
|
15
|
+
onValueChange: setPoint,
|
|
16
|
+
origin: [-73.5794, 45.5048],
|
|
17
|
+
radius: 1e3,
|
|
18
|
+
fallback: /* @__PURE__ */ jsx(StaticMap, { label: "Meeting point", center: point, zoom: 14, places: [{ position: point, label: "Meeting point" }] })
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
MapLocationPicker as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type LngLat, LocationPicker, StaticMap } from "@krizaka/ui/map";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// A meeting point picked by moving the map under the pin: its distance from the person, a 1-km zone, "Near me" on request.
|
|
7
|
+
export default function MapLocationPicker() {
|
|
8
|
+
const [point, setPoint] = React.useState<LngLat>([-73.5673, 45.5017]);
|
|
9
|
+
return (
|
|
10
|
+
<div className="w-full max-w-xl">
|
|
11
|
+
<LocationPicker
|
|
12
|
+
label="Meeting point"
|
|
13
|
+
locale="en-CA"
|
|
14
|
+
value={point}
|
|
15
|
+
onValueChange={setPoint}
|
|
16
|
+
origin={[-73.5794, 45.5048]}
|
|
17
|
+
radius={1000}
|
|
18
|
+
fallback={<StaticMap label="Meeting point" center={point} zoom={14} places={[{ position: point, label: "Meeting point" }]} />}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/map/native/location-picker.tsx
|
|
4
|
+
import { LocationPicker } from "@krizaka/ui/native/map";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function NativeMapLocationPicker() {
|
|
9
|
+
const [point, setPoint] = React.useState([-73.5673, 45.5017]);
|
|
10
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 340 }, children: /* @__PURE__ */ jsx(LocationPicker, { label: "Meeting point", locale: "en-CA", value: point, onValueChange: setPoint, origin: [-73.5794, 45.5048], radius: 1e3 }) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
NativeMapLocationPicker as default
|
|
14
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type LngLat, LocationPicker } from "@krizaka/ui/native/map";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// A meeting point under the pin; "Near me" asks for the location only when pressed, the distance follows.
|
|
6
|
+
export default function NativeMapLocationPicker() {
|
|
7
|
+
const [point, setPoint] = React.useState<LngLat>([-73.5673, 45.5017]);
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ width: 340 }}>
|
|
10
|
+
<LocationPicker label="Meeting point" locale="en-CA" value={point} onValueChange={setPoint} origin={[-73.5794, 45.5048]} radius={1000} />
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/map/native/places.tsx
|
|
4
|
+
import { Button, Sheet, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { Map, Marker } from "@krizaka/ui/native/map";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { View } from "react-native";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var SPOTS = [
|
|
10
|
+
{ id: "olimpico", label: "Caf\xE9 Olimpico", address: "124 Rue Saint-Viateur O", position: [-73.6005, 45.5229] },
|
|
11
|
+
{ id: "parc", label: "Parc La Fontaine", address: "3933 Av. du Parc-La Fontaine", position: [-73.5695, 45.5268] }
|
|
12
|
+
];
|
|
13
|
+
function NativeMapPlaces() {
|
|
14
|
+
const [open, setOpen] = React.useState(null);
|
|
15
|
+
return /* @__PURE__ */ jsxs(View, { style: { width: 340 }, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(Map, { label: "Pick-up points in Montr\xE9al", center: [-73.585, 45.524], zoom: 12.5, children: SPOTS.map((s) => /* @__PURE__ */ jsx(Marker, { position: s.position, label: s.label, selected: open?.id === s.id, onPress: () => setOpen(s) }, s.id)) }),
|
|
17
|
+
/* @__PURE__ */ jsxs(Sheet, { open: Boolean(open), onOpenChange: (o) => !o && setOpen(null), title: open?.label, children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Txt, { tone: "secondary", children: open?.address }),
|
|
19
|
+
/* @__PURE__ */ jsx(Button, { label: "Choose this point", variant: "primary", onPress: () => setOpen(null) })
|
|
20
|
+
] })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
NativeMapPlaces as default
|
|
25
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Button, Sheet, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import { Map, Marker } from "@krizaka/ui/native/map";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
|
|
6
|
+
const SPOTS = [
|
|
7
|
+
{ id: "olimpico", label: "Café Olimpico", address: "124 Rue Saint-Viateur O", position: [-73.6005, 45.5229] as const },
|
|
8
|
+
{ id: "parc", label: "Parc La Fontaine", address: "3933 Av. du Parc-La Fontaine", position: [-73.5695, 45.5268] as const },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// Pick-up points: a marker pressed opens its details in a bottom sheet.
|
|
12
|
+
export default function NativeMapPlaces() {
|
|
13
|
+
const [open, setOpen] = React.useState<(typeof SPOTS)[number] | null>(null);
|
|
14
|
+
return (
|
|
15
|
+
<View style={{ width: 340 }}>
|
|
16
|
+
<Map label="Pick-up points in Montréal" center={[-73.585, 45.524]} zoom={12.5}>
|
|
17
|
+
{SPOTS.map((s) => (
|
|
18
|
+
<Marker key={s.id} position={s.position} label={s.label} selected={open?.id === s.id} onPress={() => setOpen(s)} />
|
|
19
|
+
))}
|
|
20
|
+
</Map>
|
|
21
|
+
<Sheet open={Boolean(open)} onOpenChange={(o) => !o && setOpen(null)} title={open?.label}>
|
|
22
|
+
<Txt tone="secondary">{open?.address}</Txt>
|
|
23
|
+
<Button label="Choose this point" variant="primary" onPress={() => setOpen(null)} />
|
|
24
|
+
</Sheet>
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/map/places.tsx
|
|
4
|
+
import { Map, Marker, StaticMap } from "@krizaka/ui/map";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var SPOTS = [
|
|
8
|
+
{ id: "olimpico", label: "Caf\xE9 Olimpico, Mile End", position: [-73.6005, 45.5229] },
|
|
9
|
+
{ id: "jean-talon", label: "March\xE9 Jean-Talon", position: [-73.6147, 45.5363] },
|
|
10
|
+
{ id: "parc", label: "Parc La Fontaine", position: [-73.5695, 45.5268] }
|
|
11
|
+
];
|
|
12
|
+
function MapPlaces() {
|
|
13
|
+
const [chosen, setChosen] = React.useState("olimpico");
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Map,
|
|
16
|
+
{
|
|
17
|
+
label: "Pick-up points in Montr\xE9al",
|
|
18
|
+
center: [-73.592, 45.528],
|
|
19
|
+
zoom: 12.5,
|
|
20
|
+
className: "h-80 w-full max-w-xl",
|
|
21
|
+
fallback: /* @__PURE__ */ jsx(StaticMap, { label: "Pick-up points in Montr\xE9al", center: [-73.592, 45.528], zoom: 12.5, places: SPOTS }),
|
|
22
|
+
children: SPOTS.map((s) => /* @__PURE__ */ jsx(Marker, { position: s.position, label: s.label, selected: s.id === chosen, onPress: () => setChosen(s.id) }, s.id))
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
MapPlaces as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Map, Marker, StaticMap } from "@krizaka/ui/map";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const SPOTS = [
|
|
7
|
+
{ id: "olimpico", label: "Café Olimpico, Mile End", position: [-73.6005, 45.5229] as const },
|
|
8
|
+
{ id: "jean-talon", label: "Marché Jean-Talon", position: [-73.6147, 45.5363] as const },
|
|
9
|
+
{ id: "parc", label: "Parc La Fontaine", position: [-73.5695, 45.5268] as const },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
// Pick-up points in Montréal: markers are buttons, the chosen one shows its name; the places are a list for screen readers.
|
|
13
|
+
export default function MapPlaces() {
|
|
14
|
+
const [chosen, setChosen] = React.useState("olimpico");
|
|
15
|
+
return (
|
|
16
|
+
<Map
|
|
17
|
+
label="Pick-up points in Montréal"
|
|
18
|
+
center={[-73.592, 45.528]}
|
|
19
|
+
zoom={12.5}
|
|
20
|
+
className="h-80 w-full max-w-xl"
|
|
21
|
+
fallback={<StaticMap label="Pick-up points in Montréal" center={[-73.592, 45.528]} zoom={12.5} places={SPOTS} />}
|
|
22
|
+
>
|
|
23
|
+
{SPOTS.map((s) => (
|
|
24
|
+
<Marker key={s.id} position={s.position} label={s.label} selected={s.id === chosen} onPress={() => setChosen(s.id)} />
|
|
25
|
+
))}
|
|
26
|
+
</Map>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/map/static.tsx
|
|
4
|
+
import { StaticMap } from "@krizaka/ui/map";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function MapStatic() {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: "h-56 w-full max-w-md overflow-hidden rounded-2xl border border-border-default", children: /* @__PURE__ */ jsx(
|
|
8
|
+
StaticMap,
|
|
9
|
+
{
|
|
10
|
+
label: "Your two pick-up points",
|
|
11
|
+
center: [-73.585, 45.524],
|
|
12
|
+
zoom: 13,
|
|
13
|
+
places: [
|
|
14
|
+
{ position: [-73.6005, 45.5229], label: "Caf\xE9 Olimpico" },
|
|
15
|
+
{ position: [-73.5695, 45.5268], label: "Parc La Fontaine" }
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
MapStatic as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StaticMap } from "@krizaka/ui/map";
|
|
2
|
+
|
|
3
|
+
// A still map without an engine: the places projected on the map's paper — a card, a list item, the fallback of a Map.
|
|
4
|
+
export default function MapStatic() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="h-56 w-full max-w-md overflow-hidden rounded-2xl border border-border-default">
|
|
7
|
+
<StaticMap
|
|
8
|
+
label="Your two pick-up points"
|
|
9
|
+
center={[-73.585, 45.524]}
|
|
10
|
+
zoom={13}
|
|
11
|
+
places={[
|
|
12
|
+
{ position: [-73.6005, 45.5229], label: "Café Olimpico" },
|
|
13
|
+
{ position: [-73.5695, 45.5268], label: "Parc La Fontaine" },
|
|
14
|
+
]}
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/media-picker/native/story.tsx
|
|
4
|
+
import { MediaPicker } from "@krizaka/ui/native/media-picker";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function NativeMediaPickerStory() {
|
|
9
|
+
const [media, setMedia] = useState([]);
|
|
10
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 340 }, children: /* @__PURE__ */ jsx(
|
|
11
|
+
MediaPicker,
|
|
12
|
+
{
|
|
13
|
+
value: media,
|
|
14
|
+
onValueChange: setMedia,
|
|
15
|
+
max: 4,
|
|
16
|
+
labels: {
|
|
17
|
+
add: "Add",
|
|
18
|
+
source: "Add from",
|
|
19
|
+
library: "Photo library",
|
|
20
|
+
camera: "Take a photo",
|
|
21
|
+
cancel: "Cancel",
|
|
22
|
+
remove: (n) => `Remove photo ${n}`,
|
|
23
|
+
count: (n, max) => `${n} of ${max}`
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
) });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
NativeMediaPickerStory as default
|
|
30
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MediaPicker,type PickedMedia } from "@krizaka/ui/native/media-picker";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// Up to four photos for a story: from the library or the camera, removed with the cross.
|
|
6
|
+
export default function NativeMediaPickerStory() {
|
|
7
|
+
const [media, setMedia] = useState<PickedMedia[]>([]);
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ width: 340 }}>
|
|
10
|
+
<MediaPicker
|
|
11
|
+
value={media}
|
|
12
|
+
onValueChange={setMedia}
|
|
13
|
+
max={4}
|
|
14
|
+
labels={{
|
|
15
|
+
add: "Add",
|
|
16
|
+
source: "Add from",
|
|
17
|
+
library: "Photo library",
|
|
18
|
+
camera: "Take a photo",
|
|
19
|
+
cancel: "Cancel",
|
|
20
|
+
remove: (n) => `Remove photo ${n}`,
|
|
21
|
+
count: (n, max) => `${n} of ${max}`,
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/meter/native/credits.tsx
|
|
4
|
+
import { Meter } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function NativeMeterCredits() {
|
|
8
|
+
return /* @__PURE__ */ jsxs(View, { style: { width: 320, gap: 20 }, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Meter, { label: "Credits this month", value: 4120, max: 5e3, valueText: "4,120 of 5,000", thresholds: { low: 0.8, high: 0.95 }, showLabel: true }),
|
|
10
|
+
/* @__PURE__ */ jsx(Meter, { label: "Storage", value: 18, max: 50, valueText: "18 GB of 50 GB", showLabel: true, size: "sm" })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
NativeMeterCredits as default
|
|
15
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meter } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Credits used this month: warning past 80 %, danger past 95 %.
|
|
5
|
+
export default function NativeMeterCredits() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 320, gap: 20 }}>
|
|
8
|
+
<Meter label="Credits this month" value={4_120} max={5_000} valueText="4,120 of 5,000" thresholds={{ low: 0.8, high: 0.95 }} showLabel />
|
|
9
|
+
<Meter label="Storage" value={18} max={50} valueText="18 GB of 50 GB" showLabel size="sm" />
|
|
10
|
+
</View>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/meter/native/split-ring.tsx
|
|
4
|
+
import { Meter, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function NativeMeterSplitRing() {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Meter,
|
|
9
|
+
{
|
|
10
|
+
label: "Split of a tip",
|
|
11
|
+
variant: "ring",
|
|
12
|
+
max: 1e3,
|
|
13
|
+
parts: [
|
|
14
|
+
{ label: "To the creator", value: 850, valueText: "$8.50" },
|
|
15
|
+
{ label: "Platform", value: 100, valueText: "$1.00" },
|
|
16
|
+
{ label: "Payment fees", value: 50, valueText: "$0.50" }
|
|
17
|
+
],
|
|
18
|
+
children: /* @__PURE__ */ jsx(Txt, { variant: "title", children: "$10" })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
NativeMeterSplitRing as default
|
|
24
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Meter, Txt } from "@krizaka/ui/native";
|
|
2
|
+
|
|
3
|
+
// Where a $10 tip goes: a ring split into parts, with its legend.
|
|
4
|
+
export default function NativeMeterSplitRing() {
|
|
5
|
+
return (
|
|
6
|
+
<Meter
|
|
7
|
+
label="Split of a tip"
|
|
8
|
+
variant="ring"
|
|
9
|
+
max={1000}
|
|
10
|
+
parts={[
|
|
11
|
+
{ label: "To the creator", value: 850, valueText: "$8.50" },
|
|
12
|
+
{ label: "Platform", value: 100, valueText: "$1.00" },
|
|
13
|
+
{ label: "Payment fees", value: 50, valueText: "$0.50" },
|
|
14
|
+
]}
|
|
15
|
+
>
|
|
16
|
+
<Txt variant="title">$10</Txt>
|
|
17
|
+
</Meter>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/number-ticker/native/balance.tsx
|
|
4
|
+
import { Button, NumberTicker, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function NativeNumberTickerBalance() {
|
|
9
|
+
const [cents, setCents] = useState(12840);
|
|
10
|
+
return /* @__PURE__ */ jsxs(View, { style: { gap: 8, alignItems: "flex-start" }, children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Txt, { variant: "caption", tone: "secondary", children: "Balance" }),
|
|
12
|
+
/* @__PURE__ */ jsx(NumberTicker, { value: cents / 100, locale: "en-US", format: { style: "currency", currency: "USD" }, trigger: "change", announce: true }),
|
|
13
|
+
/* @__PURE__ */ jsx(Button, { label: "Receive a $5 tip", size: "sm", onPress: () => setCents((c) => c + 500) })
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
NativeNumberTickerBalance as default
|
|
18
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button, NumberTicker, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// A wallet's balance: it climbs at first, then rolls on every tip received — and says it.
|
|
6
|
+
export default function NativeNumberTickerBalance() {
|
|
7
|
+
const [cents, setCents] = useState(12_840);
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ gap: 8, alignItems: "flex-start" }}>
|
|
10
|
+
<Txt variant="caption" tone="secondary">
|
|
11
|
+
Balance
|
|
12
|
+
</Txt>
|
|
13
|
+
<NumberTicker value={cents / 100} locale="en-US" format={{ style: "currency", currency: "USD" }} trigger="change" announce />
|
|
14
|
+
<Button label="Receive a $5 tip" size="sm" onPress={() => setCents((c) => c + 500)} />
|
|
15
|
+
</View>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/onboarding/native/first-launch.tsx
|
|
4
|
+
import { Mascot, Onboarding } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeOnboardingFirstLaunch() {
|
|
8
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 360, height: 560 }, children: /* @__PURE__ */ jsx(
|
|
9
|
+
Onboarding,
|
|
10
|
+
{
|
|
11
|
+
slides: [
|
|
12
|
+
{ visual: /* @__PURE__ */ jsx(Mascot, { bird: "flamingo", mood: "welcome", size: 140 }), title: "Get paid for what you love", description: "Tips, auctions and dares from your fans \u2014 paid out every week." },
|
|
13
|
+
{ visual: /* @__PURE__ */ jsx(Mascot, { bird: "falcon", mood: "thinking", size: 140 }), title: "Your money, watched over", description: "Pledges wait in escrow until the challenge is done." },
|
|
14
|
+
{ visual: /* @__PURE__ */ jsx(Mascot, { bird: "pigeon", mood: "success", size: 140 }), title: "Never miss a bid", description: "Hear when you are outbid, wherever you are." }
|
|
15
|
+
],
|
|
16
|
+
labels: { next: "Next", done: "Get started", skip: "Skip", position: (n, total) => `Step ${n} of ${total}` },
|
|
17
|
+
onDone: () => void 0
|
|
18
|
+
}
|
|
19
|
+
) });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
NativeOnboardingFirstLaunch as default
|
|
23
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Mascot, Onboarding } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Three promises, a bird each; Skip at any time, Get started on the last.
|
|
5
|
+
export default function NativeOnboardingFirstLaunch() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 360, height: 560 }}>
|
|
8
|
+
<Onboarding
|
|
9
|
+
slides={[
|
|
10
|
+
{ visual: <Mascot bird="flamingo" mood="welcome" size={140} />, title: "Get paid for what you love", description: "Tips, auctions and dares from your fans — paid out every week." },
|
|
11
|
+
{ visual: <Mascot bird="falcon" mood="thinking" size={140} />, title: "Your money, watched over", description: "Pledges wait in escrow until the challenge is done." },
|
|
12
|
+
{ visual: <Mascot bird="pigeon" mood="success" size={140} />, title: "Never miss a bid", description: "Hear when you are outbid, wherever you are." },
|
|
13
|
+
]}
|
|
14
|
+
labels={{ next: "Next", done: "Get started", skip: "Skip", position: (n, total) => `Step ${n} of ${total}` }}
|
|
15
|
+
onDone={() => undefined}
|
|
16
|
+
/>
|
|
17
|
+
</View>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/otp-input/native/invalid.tsx
|
|
4
|
+
import { OtpInput, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function NativeOtpInputInvalid() {
|
|
8
|
+
return /* @__PURE__ */ jsxs(View, { style: { gap: 8 }, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(OtpInput, { label: "Verification code", value: "AB12C9", mode: "text", invalid: true }),
|
|
10
|
+
/* @__PURE__ */ jsx(Txt, { variant: "caption", tone: "danger", children: "This code has expired. We sent you a new one." })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
NativeOtpInputInvalid as default
|
|
15
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OtpInput, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// A refused code: the boxes in danger, the words under them, an error tick.
|
|
5
|
+
export default function NativeOtpInputInvalid() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ gap: 8 }}>
|
|
8
|
+
<OtpInput label="Verification code" value="AB12C9" mode="text" invalid />
|
|
9
|
+
<Txt variant="caption" tone="danger">
|
|
10
|
+
This code has expired. We sent you a new one.
|
|
11
|
+
</Txt>
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/otp-input/native/verify.tsx
|
|
4
|
+
import { OtpInput, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function NativeOtpInputVerify() {
|
|
9
|
+
const [code, setCode] = useState("4821");
|
|
10
|
+
return /* @__PURE__ */ jsxs(View, { style: { gap: 12 }, children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Txt, { tone: "secondary", children: "Enter the code sent to +33 6 \u2022\u2022 \u2022\u2022 42 18" }),
|
|
12
|
+
/* @__PURE__ */ jsx(OtpInput, { label: "Verification code", value: code, onValueChange: setCode, onComplete: () => void 0 })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
NativeOtpInputVerify as default
|
|
17
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OtpInput, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// The code sent by text message: the keyboard suggests it, one tap fills every box.
|
|
6
|
+
export default function NativeOtpInputVerify() {
|
|
7
|
+
const [code, setCode] = useState("4821");
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ gap: 12 }}>
|
|
10
|
+
<Txt tone="secondary">Enter the code sent to +33 6 •• •• 42 18</Txt>
|
|
11
|
+
<OtpInput label="Verification code" value={code} onValueChange={setCode} onComplete={() => undefined} />
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
}
|