@krizaka/ui 2.3.0 → 2.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/README.md +16 -1
- package/dist/audio-player.d.ts +113 -0
- package/dist/audio-player.js +207 -0
- package/dist/audio-player.js.map +1 -0
- package/dist/chunk-2USC2YT6.js +17 -0
- package/dist/chunk-2USC2YT6.js.map +1 -0
- package/dist/chunk-EUPTXKH7.js +95 -0
- package/dist/chunk-EUPTXKH7.js.map +1 -0
- package/dist/chunk-RUPRYJ45.js +82 -0
- package/dist/chunk-RUPRYJ45.js.map +1 -0
- package/dist/chunk-XUMJA5ZI.js +283 -0
- package/dist/chunk-XUMJA5ZI.js.map +1 -0
- package/dist/chunk-YH4LMWRU.js +92 -0
- package/dist/chunk-YH4LMWRU.js.map +1 -0
- package/dist/chunk-YX6CNVJA.js +94 -0
- package/dist/chunk-YX6CNVJA.js.map +1 -0
- package/dist/chunk-ZIXB33X7.js +95 -0
- package/dist/chunk-ZIXB33X7.js.map +1 -0
- package/dist/combobox.d.ts +188 -0
- package/dist/combobox.js +16 -0
- package/dist/combobox.js.map +1 -0
- package/dist/data-table.d.ts +246 -0
- package/dist/data-table.js +290 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +288 -0
- package/dist/date-picker.js +364 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/file-upload.d.ts +238 -0
- package/dist/file-upload.js +437 -0
- package/dist/file-upload.js.map +1 -0
- package/dist/filter-bar.d.ts +139 -0
- package/dist/filter-bar.js +155 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/image-cropper.d.ts +115 -0
- package/dist/image-cropper.js +166 -0
- package/dist/image-cropper.js.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/media-capture.d.ts +155 -0
- package/dist/media-capture.js +242 -0
- package/dist/media-capture.js.map +1 -0
- package/dist/native/media-capture.d.ts +49 -0
- package/dist/native/media-capture.js +113 -0
- package/dist/native/media-capture.js.map +1 -0
- package/dist/native/video-player.d.ts +50 -0
- package/dist/native/video-player.js +69 -0
- package/dist/native/video-player.js.map +1 -0
- package/dist/native.d.ts +66 -2
- package/dist/native.js +166 -68
- package/dist/native.js.map +1 -1
- package/dist/pagination.d.ts +141 -0
- package/dist/pagination.js +165 -0
- package/dist/pagination.js.map +1 -0
- package/dist/search-field.d.ts +100 -0
- package/dist/search-field.js +167 -0
- package/dist/search-field.js.map +1 -0
- package/dist/tag-input.d.ts +44 -0
- package/dist/tag-input.js +67 -0
- package/dist/tag-input.js.map +1 -0
- package/dist/video-player.d.ts +204 -0
- package/dist/video-player.js +371 -0
- package/dist/video-player.js.map +1 -0
- package/dist/video-trimmer.d.ts +142 -0
- package/dist/video-trimmer.js +193 -0
- package/dist/video-trimmer.js.map +1 -0
- package/package.json +232 -4
- package/registry/alert.json +1 -1
- package/registry/audio-player.json +282 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/combobox.json +475 -0
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/data-table.json +500 -0
- package/registry/date-picker.json +978 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/audio-player/podcast.d.ts +4 -0
- package/registry/examples/audio-player/podcast.js +22 -0
- package/registry/examples/audio-player/podcast.tsx +19 -0
- package/registry/examples/audio-player/voice-note.d.ts +4 -0
- package/registry/examples/audio-player/voice-note.js +12 -0
- package/registry/examples/audio-player/voice-note.tsx +12 -0
- package/registry/examples/combobox/async.d.ts +4 -0
- package/registry/examples/combobox/async.js +23 -0
- package/registry/examples/combobox/async.tsx +22 -0
- package/registry/examples/combobox/creatable.d.ts +4 -0
- package/registry/examples/combobox/creatable.js +32 -0
- package/registry/examples/combobox/creatable.tsx +28 -0
- package/registry/examples/combobox/invalid.d.ts +4 -0
- package/registry/examples/combobox/invalid.js +23 -0
- package/registry/examples/combobox/invalid.tsx +17 -0
- package/registry/examples/combobox/multiple.d.ts +4 -0
- package/registry/examples/combobox/multiple.js +29 -0
- package/registry/examples/combobox/multiple.tsx +26 -0
- package/registry/examples/data-table/cards.d.ts +4 -0
- package/registry/examples/data-table/cards.js +21 -0
- package/registry/examples/data-table/cards.tsx +20 -0
- package/registry/examples/data-table/empty.d.ts +4 -0
- package/registry/examples/data-table/empty.js +26 -0
- package/registry/examples/data-table/empty.tsx +21 -0
- package/registry/examples/data-table/error.d.ts +4 -0
- package/registry/examples/data-table/error.js +28 -0
- package/registry/examples/data-table/error.tsx +29 -0
- package/registry/examples/data-table/jobs.d.ts +4 -0
- package/registry/examples/data-table/jobs.js +37 -0
- package/registry/examples/data-table/jobs.tsx +36 -0
- package/registry/examples/data-table/loading.d.ts +4 -0
- package/registry/examples/data-table/loading.js +16 -0
- package/registry/examples/data-table/loading.tsx +12 -0
- package/registry/examples/data-table/virtualized.d.ts +4 -0
- package/registry/examples/data-table/virtualized.js +21 -0
- package/registry/examples/data-table/virtualized.tsx +20 -0
- package/registry/examples/date-picker/calendar.d.ts +4 -0
- package/registry/examples/date-picker/calendar.js +14 -0
- package/registry/examples/date-picker/calendar.tsx +16 -0
- package/registry/examples/date-picker/french.d.ts +4 -0
- package/registry/examples/date-picker/french.js +20 -0
- package/registry/examples/date-picker/french.tsx +14 -0
- package/registry/examples/date-picker/open.d.ts +4 -0
- package/registry/examples/date-picker/open.js +11 -0
- package/registry/examples/date-picker/open.tsx +8 -0
- package/registry/examples/date-picker/range.d.ts +4 -0
- package/registry/examples/date-picker/range.js +29 -0
- package/registry/examples/date-picker/range.tsx +25 -0
- package/registry/examples/date-picker/schedule.d.ts +4 -0
- package/registry/examples/date-picker/schedule.js +26 -0
- package/registry/examples/date-picker/schedule.tsx +22 -0
- package/registry/examples/file-upload/images.d.ts +4 -0
- package/registry/examples/file-upload/images.js +32 -0
- package/registry/examples/file-upload/images.tsx +25 -0
- package/registry/examples/file-upload/states.d.ts +4 -0
- package/registry/examples/file-upload/states.js +28 -0
- package/registry/examples/file-upload/states.tsx +23 -0
- package/registry/examples/file-upload/tus.d.ts +4 -0
- package/registry/examples/file-upload/tus.js +23 -0
- package/registry/examples/file-upload/tus.tsx +26 -0
- package/registry/examples/file-upload/video.d.ts +4 -0
- package/registry/examples/file-upload/video.js +39 -0
- package/registry/examples/file-upload/video.tsx +36 -0
- package/registry/examples/filter-bar/address.d.ts +4 -0
- package/registry/examples/filter-bar/address.js +29 -0
- package/registry/examples/filter-bar/address.tsx +27 -0
- package/registry/examples/filter-bar/jobs.d.ts +4 -0
- package/registry/examples/filter-bar/jobs.js +37 -0
- package/registry/examples/filter-bar/jobs.tsx +37 -0
- package/registry/examples/filter-bar/menu.d.ts +4 -0
- package/registry/examples/filter-bar/menu.js +27 -0
- package/registry/examples/filter-bar/menu.tsx +23 -0
- package/registry/examples/image-cropper/avatar.d.ts +4 -0
- package/registry/examples/image-cropper/avatar.js +13 -0
- package/registry/examples/image-cropper/avatar.tsx +14 -0
- package/registry/examples/image-cropper/banner.d.ts +4 -0
- package/registry/examples/image-cropper/banner.js +11 -0
- package/registry/examples/image-cropper/banner.tsx +10 -0
- package/registry/examples/image-cropper/vertical-video.d.ts +4 -0
- package/registry/examples/image-cropper/vertical-video.js +12 -0
- package/registry/examples/image-cropper/vertical-video.tsx +16 -0
- package/registry/examples/media-capture/clip.d.ts +4 -0
- package/registry/examples/media-capture/clip.js +20 -0
- package/registry/examples/media-capture/clip.tsx +18 -0
- package/registry/examples/media-capture/native/photo.d.ts +4 -0
- package/registry/examples/media-capture/native/photo.dark.png +0 -0
- package/registry/examples/media-capture/native/photo.js +27 -0
- package/registry/examples/media-capture/native/photo.light.png +0 -0
- package/registry/examples/media-capture/native/photo.tsx +20 -0
- package/registry/examples/media-capture/profile-photo.d.ts +4 -0
- package/registry/examples/media-capture/profile-photo.js +24 -0
- package/registry/examples/media-capture/profile-photo.tsx +20 -0
- package/registry/examples/pagination/cursor.d.ts +4 -0
- package/registry/examples/pagination/cursor.js +24 -0
- package/registry/examples/pagination/cursor.tsx +20 -0
- package/registry/examples/pagination/links.d.ts +4 -0
- package/registry/examples/pagination/links.js +11 -0
- package/registry/examples/pagination/links.tsx +6 -0
- package/registry/examples/pagination/native/cursor.d.ts +4 -0
- package/registry/examples/pagination/native/cursor.dark.png +0 -0
- package/registry/examples/pagination/native/cursor.js +19 -0
- package/registry/examples/pagination/native/cursor.light.png +0 -0
- package/registry/examples/pagination/native/cursor.tsx +13 -0
- package/registry/examples/pagination/native/pages.d.ts +4 -0
- package/registry/examples/pagination/native/pages.dark.png +0 -0
- package/registry/examples/pagination/native/pages.js +21 -0
- package/registry/examples/pagination/native/pages.light.png +0 -0
- package/registry/examples/pagination/native/pages.tsx +14 -0
- package/registry/examples/pagination/results.d.ts +4 -0
- package/registry/examples/pagination/results.js +23 -0
- package/registry/examples/pagination/results.tsx +19 -0
- package/registry/examples/pagination/table-footer.d.ts +4 -0
- package/registry/examples/pagination/table-footer.js +31 -0
- package/registry/examples/pagination/table-footer.tsx +27 -0
- package/registry/examples/search-field/global.d.ts +4 -0
- package/registry/examples/search-field/global.js +19 -0
- package/registry/examples/search-field/global.tsx +15 -0
- package/registry/examples/search-field/native/default.d.ts +4 -0
- package/registry/examples/search-field/native/default.dark.png +0 -0
- package/registry/examples/search-field/native/default.js +13 -0
- package/registry/examples/search-field/native/default.light.png +0 -0
- package/registry/examples/search-field/native/default.tsx +7 -0
- package/registry/examples/search-field/suggestions.d.ts +4 -0
- package/registry/examples/search-field/suggestions.js +30 -0
- package/registry/examples/search-field/suggestions.tsx +27 -0
- package/registry/examples/search-field/toolbar.d.ts +4 -0
- package/registry/examples/search-field/toolbar.js +17 -0
- package/registry/examples/search-field/toolbar.tsx +21 -0
- package/registry/examples/tag-input/recipients.d.ts +4 -0
- package/registry/examples/tag-input/recipients.js +23 -0
- package/registry/examples/tag-input/recipients.tsx +20 -0
- package/registry/examples/tag-input/video-tags.d.ts +4 -0
- package/registry/examples/tag-input/video-tags.js +26 -0
- package/registry/examples/tag-input/video-tags.tsx +22 -0
- package/registry/examples/video-player/default.d.ts +4 -0
- package/registry/examples/video-player/default.js +12 -0
- package/registry/examples/video-player/default.tsx +8 -0
- package/registry/examples/video-player/gated.d.ts +4 -0
- package/registry/examples/video-player/gated.js +26 -0
- package/registry/examples/video-player/gated.tsx +23 -0
- package/registry/examples/video-player/native/default.d.ts +4 -0
- package/registry/examples/video-player/native/default.dark.png +0 -0
- package/registry/examples/video-player/native/default.js +18 -0
- package/registry/examples/video-player/native/default.light.png +0 -0
- package/registry/examples/video-player/native/default.tsx +12 -0
- package/registry/examples/video-player/signed-source.d.ts +4 -0
- package/registry/examples/video-player/signed-source.js +16 -0
- package/registry/examples/video-player/signed-source.tsx +15 -0
- package/registry/examples/video-player/vertical.d.ts +4 -0
- package/registry/examples/video-player/vertical.js +12 -0
- package/registry/examples/video-player/vertical.tsx +12 -0
- package/registry/examples/video-trimmer/custom.d.ts +4 -0
- package/registry/examples/video-trimmer/custom.js +24 -0
- package/registry/examples/video-trimmer/custom.tsx +26 -0
- package/registry/examples/video-trimmer/filmstrip.d.ts +4 -0
- package/registry/examples/video-trimmer/filmstrip.js +15 -0
- package/registry/examples/video-trimmer/filmstrip.tsx +13 -0
- package/registry/examples/video-trimmer/playhead.d.ts +4 -0
- package/registry/examples/video-trimmer/playhead.js +15 -0
- package/registry/examples/video-trimmer/playhead.tsx +13 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +471 -0
- package/registry/filter-bar.json +347 -0
- package/registry/glow-card.json +1 -1
- package/registry/image-cropper.json +313 -0
- package/registry/index.json +255 -1
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/media-capture.json +347 -0
- package/registry/meter.json +3 -3
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/pagination.json +475 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +5 -5
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +436 -0
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.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/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +363 -0
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +598 -0
- package/registry/video-trimmer.json +385 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/pagination/native/pages.tsx
|
|
4
|
+
import { Pagination } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativePaginationPages() {
|
|
8
|
+
const [page, setPage] = React.useState(3);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
Pagination,
|
|
11
|
+
{
|
|
12
|
+
page,
|
|
13
|
+
pageCount: 12,
|
|
14
|
+
onPageChange: setPage,
|
|
15
|
+
labels: { previous: "Previous page", next: "Next page", compact: (p, count) => `Page ${p} of ${count}` }
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
NativePaginationPages as default
|
|
21
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Pagination } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export default function NativePaginationPages() {
|
|
5
|
+
const [page, setPage] = React.useState(3);
|
|
6
|
+
return (
|
|
7
|
+
<Pagination
|
|
8
|
+
page={page}
|
|
9
|
+
pageCount={12}
|
|
10
|
+
onPageChange={setPage}
|
|
11
|
+
labels={{ previous: "Previous page", next: "Next page", compact: (p, count) => `Page ${p} of ${count}` }}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/pagination/results.tsx
|
|
4
|
+
import { Pagination } from "@krizaka/ui/pagination";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function PaginationResults() {
|
|
8
|
+
const [page, setPage] = React.useState(4);
|
|
9
|
+
const first = (page - 1) * 20 + 1;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Pagination,
|
|
12
|
+
{
|
|
13
|
+
page,
|
|
14
|
+
pageCount: 20,
|
|
15
|
+
onPageChange: setPage,
|
|
16
|
+
status: `${first}\u2013${Math.min(first + 19, 392)} of 392 videos`,
|
|
17
|
+
labels: { nav: "Pages of results" }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
PaginationResults as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Pagination } from "@krizaka/ui/pagination";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// The explore page of a video platform: 392 results, 20 per page.
|
|
7
|
+
export default function PaginationResults() {
|
|
8
|
+
const [page, setPage] = React.useState(4);
|
|
9
|
+
const first = (page - 1) * 20 + 1;
|
|
10
|
+
return (
|
|
11
|
+
<Pagination
|
|
12
|
+
page={page}
|
|
13
|
+
pageCount={20}
|
|
14
|
+
onPageChange={setPage}
|
|
15
|
+
status={`${first}–${Math.min(first + 19, 392)} of 392 videos`}
|
|
16
|
+
labels={{ nav: "Pages of results" }}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/pagination/table-footer.tsx
|
|
4
|
+
import { Pagination } from "@krizaka/ui/pagination";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function PaginationTableFooter() {
|
|
8
|
+
const [page, setPage] = React.useState(1);
|
|
9
|
+
const [size, setSize] = React.useState(20);
|
|
10
|
+
const total = 1284;
|
|
11
|
+
const count = Math.ceil(total / size);
|
|
12
|
+
const first = (page - 1) * size + 1;
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Pagination,
|
|
15
|
+
{
|
|
16
|
+
page,
|
|
17
|
+
pageCount: count,
|
|
18
|
+
onPageChange: setPage,
|
|
19
|
+
pageSize: size,
|
|
20
|
+
pageSizeOptions: [10, 20, 50],
|
|
21
|
+
onPageSizeChange: (next) => {
|
|
22
|
+
setSize(next);
|
|
23
|
+
setPage(1);
|
|
24
|
+
},
|
|
25
|
+
status: `${first.toLocaleString("en")}\u2013${Math.min(first + size - 1, total).toLocaleString("en")} of ${total.toLocaleString("en")}`
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
PaginationTableFooter as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Pagination } from "@krizaka/ui/pagination";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// Under an admin table: rows per page, the range shown, the pages.
|
|
7
|
+
export default function PaginationTableFooter() {
|
|
8
|
+
const [page, setPage] = React.useState(1);
|
|
9
|
+
const [size, setSize] = React.useState(20);
|
|
10
|
+
const total = 1284;
|
|
11
|
+
const count = Math.ceil(total / size);
|
|
12
|
+
const first = (page - 1) * size + 1;
|
|
13
|
+
return (
|
|
14
|
+
<Pagination
|
|
15
|
+
page={page}
|
|
16
|
+
pageCount={count}
|
|
17
|
+
onPageChange={setPage}
|
|
18
|
+
pageSize={size}
|
|
19
|
+
pageSizeOptions={[10, 20, 50]}
|
|
20
|
+
onPageSizeChange={(next) => {
|
|
21
|
+
setSize(next);
|
|
22
|
+
setPage(1);
|
|
23
|
+
}}
|
|
24
|
+
status={`${first.toLocaleString("en")}–${Math.min(first + size - 1, total).toLocaleString("en")} of ${total.toLocaleString("en")}`}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/search-field/global.tsx
|
|
4
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function SearchFieldGlobal() {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
SearchField,
|
|
9
|
+
{
|
|
10
|
+
label: "Search Orochia",
|
|
11
|
+
placeholder: "Search creators, videos, tags",
|
|
12
|
+
shortcut: "k",
|
|
13
|
+
onSubmit: (query) => window.location.assign(`/explore?q=${encodeURIComponent(query)}`)
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
SearchFieldGlobal as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
4
|
+
|
|
5
|
+
// The site's search: ⌘K (Ctrl+K) focuses it from anywhere, Enter goes to the results.
|
|
6
|
+
export default function SearchFieldGlobal() {
|
|
7
|
+
return (
|
|
8
|
+
<SearchField
|
|
9
|
+
label="Search Orochia"
|
|
10
|
+
placeholder="Search creators, videos, tags"
|
|
11
|
+
shortcut="k"
|
|
12
|
+
onSubmit={(query) => window.location.assign(`/explore?q=${encodeURIComponent(query)}`)}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/search-field/native/default.tsx
|
|
4
|
+
import { SearchField } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeSearchFieldDefault() {
|
|
8
|
+
const [query, setQuery] = React.useState("sunset");
|
|
9
|
+
return /* @__PURE__ */ jsx(SearchField, { label: "Search videos", placeholder: "Search videos", value: query, onValueChange: setQuery, clearLabel: "Clear search" });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
NativeSearchFieldDefault as default
|
|
13
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SearchField } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export default function NativeSearchFieldDefault() {
|
|
5
|
+
const [query, setQuery] = React.useState("sunset");
|
|
6
|
+
return <SearchField label="Search videos" placeholder="Search videos" value={query} onValueChange={setQuery} clearLabel="Clear search" />;
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/search-field/suggestions.tsx
|
|
4
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var RECENT = [
|
|
8
|
+
{ value: "sunset", label: "sunset timelapse", meta: "Tag" },
|
|
9
|
+
{ value: "eric", label: "Eric Tremblay", meta: "Creator" },
|
|
10
|
+
{ value: "studio", label: "studio lighting", meta: "2 days ago" }
|
|
11
|
+
];
|
|
12
|
+
function SearchFieldSuggestions() {
|
|
13
|
+
const [query, setQuery] = React.useState("");
|
|
14
|
+
const shown = RECENT.filter((s) => s.label.includes(query.toLowerCase()));
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
SearchField,
|
|
17
|
+
{
|
|
18
|
+
label: "Search videos",
|
|
19
|
+
placeholder: "Search videos",
|
|
20
|
+
value: query,
|
|
21
|
+
onValueChange: setQuery,
|
|
22
|
+
suggestions: shown,
|
|
23
|
+
suggestionsLabel: "Recent searches",
|
|
24
|
+
onSuggestionSelect: (s) => setQuery(s.label)
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
SearchFieldSuggestions as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const RECENT = [
|
|
7
|
+
{ value: "sunset", label: "sunset timelapse", meta: "Tag" },
|
|
8
|
+
{ value: "eric", label: "Eric Tremblay", meta: "Creator" },
|
|
9
|
+
{ value: "studio", label: "studio lighting", meta: "2 days ago" },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
// Recent searches under the field: the arrows walk them, Enter picks one.
|
|
13
|
+
export default function SearchFieldSuggestions() {
|
|
14
|
+
const [query, setQuery] = React.useState("");
|
|
15
|
+
const shown = RECENT.filter((s) => s.label.includes(query.toLowerCase()));
|
|
16
|
+
return (
|
|
17
|
+
<SearchField
|
|
18
|
+
label="Search videos"
|
|
19
|
+
placeholder="Search videos"
|
|
20
|
+
value={query}
|
|
21
|
+
onValueChange={setQuery}
|
|
22
|
+
suggestions={shown}
|
|
23
|
+
suggestionsLabel="Recent searches"
|
|
24
|
+
onSuggestionSelect={(s) => setQuery(s.label)}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/search-field/toolbar.tsx
|
|
4
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var MODELS = ["Flux 1.1", "Whisper large", "XTTS v2", "Llama 3.3", "Qwen 2.5"];
|
|
8
|
+
function SearchFieldToolbar() {
|
|
9
|
+
const [query, setQuery] = React.useState("");
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-72 flex-col gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(SearchField, { label: "Filter models", placeholder: "Filter models", size: "sm", landmark: false, onSearch: setQuery, debounce: 150 }),
|
|
12
|
+
/* @__PURE__ */ jsx("ul", { className: "text-sm text-fg-secondary", children: MODELS.filter((m) => m.toLowerCase().includes(query.toLowerCase())).map((m) => /* @__PURE__ */ jsx("li", { children: m }, m)) })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
SearchFieldToolbar as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SearchField } from "@krizaka/ui/search-field";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const MODELS = ["Flux 1.1", "Whisper large", "XTTS v2", "Llama 3.3", "Qwen 2.5"];
|
|
7
|
+
|
|
8
|
+
// A small field that filters a list as you type (debounced).
|
|
9
|
+
export default function SearchFieldToolbar() {
|
|
10
|
+
const [query, setQuery] = React.useState("");
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex w-72 flex-col gap-2">
|
|
13
|
+
<SearchField label="Filter models" placeholder="Filter models" size="sm" landmark={false} onSearch={setQuery} debounce={150} />
|
|
14
|
+
<ul className="text-sm text-fg-secondary">
|
|
15
|
+
{MODELS.filter((m) => m.toLowerCase().includes(query.toLowerCase())).map((m) => (
|
|
16
|
+
<li key={m}>{m}</li>
|
|
17
|
+
))}
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/tag-input/recipients.tsx
|
|
4
|
+
import { TagInput } from "@krizaka/ui/tag-input";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
7
|
+
function TagInputRecipients() {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
TagInput,
|
|
10
|
+
{
|
|
11
|
+
label: "Invite by e-mail",
|
|
12
|
+
placeholder: "name@example.com",
|
|
13
|
+
defaultValue: ["ines@krizaka.com"],
|
|
14
|
+
separators: [",", " "],
|
|
15
|
+
normalize: (value) => value.trim().toLowerCase(),
|
|
16
|
+
validate: (value) => EMAIL.test(value) ? null : `\u201C${value}\u201D is not an e-mail address.`,
|
|
17
|
+
labels: { create: (value) => `Invite ${value}` }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
TagInputRecipients as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { TagInput } from "@krizaka/ui/tag-input";
|
|
4
|
+
|
|
5
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
6
|
+
|
|
7
|
+
// Paste “a@x.com, b@y.org” and both are added; what is not an address is refused, with the reason.
|
|
8
|
+
export default function TagInputRecipients() {
|
|
9
|
+
return (
|
|
10
|
+
<TagInput
|
|
11
|
+
label="Invite by e-mail"
|
|
12
|
+
placeholder="name@example.com"
|
|
13
|
+
defaultValue={["ines@krizaka.com"]}
|
|
14
|
+
separators={[",", " "]}
|
|
15
|
+
normalize={(value) => value.trim().toLowerCase()}
|
|
16
|
+
validate={(value) => (EMAIL.test(value) ? null : `“${value}” is not an e-mail address.`)}
|
|
17
|
+
labels={{ create: (value) => `Invite ${value}` }}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/tag-input/video-tags.tsx
|
|
4
|
+
import { TagInput } from "@krizaka/ui/tag-input";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function TagInputVideoTags() {
|
|
8
|
+
const [tags, setTags] = React.useState(["montreal", "sunset"]);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
TagInput,
|
|
11
|
+
{
|
|
12
|
+
label: "Tags",
|
|
13
|
+
placeholder: "Add a tag",
|
|
14
|
+
value: tags,
|
|
15
|
+
onValueChange: setTags,
|
|
16
|
+
suggestions: ["timelapse", "travel", "skyline", "golden hour", "drone"],
|
|
17
|
+
normalize: (tag) => tag.trim().toLowerCase().replace(/^#/, ""),
|
|
18
|
+
max: 10,
|
|
19
|
+
hint: "Up to 10 tags, separated by commas.",
|
|
20
|
+
labels: { create: (tag) => `Add \u201C${tag}\u201D`, remove: (tag) => `Remove ${tag}` }
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
TagInputVideoTags as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { TagInput } from "@krizaka/ui/tag-input";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// Lower case, no “#”: “#Sunset” and “sunset” are one tag.
|
|
7
|
+
export default function TagInputVideoTags() {
|
|
8
|
+
const [tags, setTags] = React.useState(["montreal", "sunset"]);
|
|
9
|
+
return (
|
|
10
|
+
<TagInput
|
|
11
|
+
label="Tags"
|
|
12
|
+
placeholder="Add a tag"
|
|
13
|
+
value={tags}
|
|
14
|
+
onValueChange={setTags}
|
|
15
|
+
suggestions={["timelapse", "travel", "skyline", "golden hour", "drone"]}
|
|
16
|
+
normalize={(tag) => tag.trim().toLowerCase().replace(/^#/, "")}
|
|
17
|
+
max={10}
|
|
18
|
+
hint="Up to 10 tags, separated by commas."
|
|
19
|
+
labels={{ create: (tag) => `Add “${tag}”`, remove: (tag) => `Remove ${tag}` }}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/video-player/default.tsx
|
|
4
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
7
|
+
function VideoPlayerDefault() {
|
|
8
|
+
return /* @__PURE__ */ jsx(VideoPlayer, { title: "Video: an auction on Orochia", src: `${TOUR}/alex-bid.mp4`, poster: `${TOUR}/alex-bid.jpg` });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
VideoPlayerDefault as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
2
|
+
|
|
3
|
+
const TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
4
|
+
|
|
5
|
+
// For HLS, add `loadHls={() => import("hls.js")}`: only browsers without native HLS download it.
|
|
6
|
+
export default function VideoPlayerDefault() {
|
|
7
|
+
return <VideoPlayer title="Video: an auction on Orochia" src={`${TOUR}/alex-bid.mp4`} poster={`${TOUR}/alex-bid.jpg`} />;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/video-player/gated.tsx
|
|
4
|
+
import { Button } from "@krizaka/ui/button";
|
|
5
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
8
|
+
function VideoPlayerGated() {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
VideoPlayer,
|
|
11
|
+
{
|
|
12
|
+
title: "Video: unlocked for supporters",
|
|
13
|
+
src: `${TOUR}/alex-unlock.mp4`,
|
|
14
|
+
poster: `${TOUR}/alex-unlock.jpg`,
|
|
15
|
+
preload: "none",
|
|
16
|
+
overlay: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 bg-scrim-strong p-6 text-center backdrop-blur-md", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-fg-on-media", children: "Supporters only" }),
|
|
18
|
+
/* @__PURE__ */ jsx("p", { className: "max-w-xs text-sm text-fg-on-media", children: "Unlock this video with a tip of $5 or more." }),
|
|
19
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", children: "Unlock for $5" })
|
|
20
|
+
] })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
VideoPlayerGated as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button } from "@krizaka/ui/button";
|
|
2
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
3
|
+
|
|
4
|
+
const TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
5
|
+
|
|
6
|
+
// The app draws its gate over the video; the controls step aside until it opens.
|
|
7
|
+
export default function VideoPlayerGated() {
|
|
8
|
+
return (
|
|
9
|
+
<VideoPlayer
|
|
10
|
+
title="Video: unlocked for supporters"
|
|
11
|
+
src={`${TOUR}/alex-unlock.mp4`}
|
|
12
|
+
poster={`${TOUR}/alex-unlock.jpg`}
|
|
13
|
+
preload="none"
|
|
14
|
+
overlay={
|
|
15
|
+
<div className="flex h-full flex-col items-center justify-center gap-3 bg-scrim-strong p-6 text-center backdrop-blur-md">
|
|
16
|
+
<p className="text-base font-semibold text-fg-on-media">Supporters only</p>
|
|
17
|
+
<p className="max-w-xs text-sm text-fg-on-media">Unlock this video with a tip of $5 or more.</p>
|
|
18
|
+
<Button variant="primary">Unlock for $5</Button>
|
|
19
|
+
</div>
|
|
20
|
+
}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/video-player/native/default.tsx
|
|
4
|
+
import { VideoPlayer } from "@krizaka/ui/native/video-player";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function NativeVideoPlayerDefault() {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
VideoPlayer,
|
|
9
|
+
{
|
|
10
|
+
title: "Video: an auction on Orochia",
|
|
11
|
+
source: { uri: "https://www.krizaka.com/assets/orochia/tour/alex-bid.mp4" },
|
|
12
|
+
poster: { uri: "https://www.krizaka.com/assets/orochia/tour/alex-bid.jpg" }
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
NativeVideoPlayerDefault as default
|
|
18
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VideoPlayer } from "@krizaka/ui/native/video-player";
|
|
2
|
+
|
|
3
|
+
// expo-video plays HLS natively on iOS and Android; the poster stays until the first frame.
|
|
4
|
+
export default function NativeVideoPlayerDefault() {
|
|
5
|
+
return (
|
|
6
|
+
<VideoPlayer
|
|
7
|
+
title="Video: an auction on Orochia"
|
|
8
|
+
source={{ uri: "https://www.krizaka.com/assets/orochia/tour/alex-bid.mp4" }}
|
|
9
|
+
poster={{ uri: "https://www.krizaka.com/assets/orochia/tour/alex-bid.jpg" }}
|
|
10
|
+
/>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/video-player/signed-source.tsx
|
|
4
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
7
|
+
async function signedAddress() {
|
|
8
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
9
|
+
return `${TOUR}/elena-publish.mp4?token=demo&expires=300`;
|
|
10
|
+
}
|
|
11
|
+
function VideoPlayerSignedSource() {
|
|
12
|
+
return /* @__PURE__ */ jsx(VideoPlayer, { title: "Video: the creator studio", src: signedAddress, preload: "none", poster: `${TOUR}/elena-publish.jpg` });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
VideoPlayerSignedSource as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { VideoPlayer } from "@krizaka/ui/video-player";
|
|
4
|
+
|
|
5
|
+
const TOUR = "https://www.krizaka.com/assets/orochia/tour";
|
|
6
|
+
|
|
7
|
+
// Your server signs a short-lived address for this viewer; it is asked on the first play, and again after an error.
|
|
8
|
+
async function signedAddress() {
|
|
9
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
10
|
+
return `${TOUR}/elena-publish.mp4?token=demo&expires=300`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function VideoPlayerSignedSource() {
|
|
14
|
+
return <VideoPlayer title="Video: the creator studio" src={signedAddress} preload="none" poster={`${TOUR}/elena-publish.jpg`} />;
|
|
15
|
+
}
|