@krizaka/ui 2.3.0 → 2.5.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 +94 -3
- package/dist/native.js +195 -73
- 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 +233 -5
- 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
package/dist/native.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { ViewProps, PressableProps, StyleProp, ViewStyle, TextProps, ImageProps, DimensionValue, ActivityIndicatorProps } from 'react-native';
|
|
3
|
+
import { ViewProps, PressableProps, StyleProp, ViewStyle, TextProps, ImageProps, TextInputProps, DimensionValue, ActivityIndicatorProps } from 'react-native';
|
|
4
4
|
|
|
5
5
|
/** Milliseconds left until `target` (never negative), ticking every second. `skewMs` = server clock − this clock. */
|
|
6
6
|
declare function useCountdown(target: Date | string | number, skewMs?: number): number;
|
|
@@ -377,6 +377,44 @@ declare function OrazakaMark({ size, animated, title, neutral }: NativeMarkProps
|
|
|
377
377
|
*/
|
|
378
378
|
declare function OrochiaMark({ size, animated, title, neutral: neutralProp }: NativeMarkProps): React__default.JSX.Element;
|
|
379
379
|
|
|
380
|
+
type PaginationLabels = {
|
|
381
|
+
/** The previous-page button ("Previous page"). */
|
|
382
|
+
previous: string;
|
|
383
|
+
/** The next-page button ("Next page"). */
|
|
384
|
+
next: string;
|
|
385
|
+
/** Where the list stands: `(page, count) => "Page 3 of 12"`. */
|
|
386
|
+
compact: (page: number, pageCount: number) => string;
|
|
387
|
+
};
|
|
388
|
+
type PaginationProps = {
|
|
389
|
+
/** Pages mode: the current page, from 1. */
|
|
390
|
+
page?: number;
|
|
391
|
+
/** Pages mode: how many pages. Without it, the pagination is in cursor mode. */
|
|
392
|
+
pageCount?: number;
|
|
393
|
+
/** Pages mode: called with the page asked for. */
|
|
394
|
+
onPageChange?: (page: number) => void;
|
|
395
|
+
/** Cursor mode: whether there is a previous page. */
|
|
396
|
+
hasPrevious?: boolean;
|
|
397
|
+
/** Cursor mode: whether there is a next page. */
|
|
398
|
+
hasNext?: boolean;
|
|
399
|
+
/** Cursor mode: called by the previous button. */
|
|
400
|
+
onPrevious?: () => void;
|
|
401
|
+
/** Cursor mode: called by the next button. */
|
|
402
|
+
onNext?: () => void;
|
|
403
|
+
/** A text between the buttons in cursor mode ("41–60"), or instead of "Page 3 of 12". */
|
|
404
|
+
status?: string;
|
|
405
|
+
/** Disables both buttons (a page is loading). */
|
|
406
|
+
disabled?: boolean;
|
|
407
|
+
/** The words, passed translated. */
|
|
408
|
+
labels: PaginationLabels;
|
|
409
|
+
/** Styles merged last. */
|
|
410
|
+
style?: StyleProp<ViewStyle>;
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Previous / next with where the list stands ("Page 3 of 12"), or the two buttons of a cursor — the web
|
|
414
|
+
* `Pagination` folded, the form a phone's thumb reaches. On a feed, prefer loading more at the end of the list.
|
|
415
|
+
*/
|
|
416
|
+
declare function Pagination({ page, pageCount, onPageChange, hasPrevious, hasNext, onPrevious, onNext, status, disabled, labels, style }: PaginationProps): React.JSX.Element;
|
|
417
|
+
|
|
380
418
|
/** The mark of a Krizaka brand by id, for React Native — the counterpart of the web `ProductLogo`. */
|
|
381
419
|
declare function ProductMark({ id, ...props }: NativeMarkProps & {
|
|
382
420
|
id: BrandId;
|
|
@@ -406,6 +444,32 @@ type ProgressProps = {
|
|
|
406
444
|
*/
|
|
407
445
|
declare function Progress({ variant, size, value, max, label, valueText, children, style }: ProgressProps): React.JSX.Element;
|
|
408
446
|
|
|
447
|
+
type SearchFieldProps = Omit<TextInputProps, "value" | "defaultValue" | "onChangeText" | "style" | "onSubmitEditing"> & {
|
|
448
|
+
/** The accessible name of the input ("Search videos"), passed translated. */
|
|
449
|
+
label: string;
|
|
450
|
+
/** The query (controlled). */
|
|
451
|
+
value?: string;
|
|
452
|
+
/** The query at first, uncontrolled. */
|
|
453
|
+
defaultValue?: string;
|
|
454
|
+
/** Called on every key with the query. */
|
|
455
|
+
onValueChange?: (query: string) => void;
|
|
456
|
+
/** Called with the query once typing pauses (`debounce` ms): fetch the results here. */
|
|
457
|
+
onSearch?: (query: string) => void;
|
|
458
|
+
/** The pause, in ms, before `onSearch`. Default 300. */
|
|
459
|
+
debounce?: number;
|
|
460
|
+
/** Called when the keyboard's search key is pressed. */
|
|
461
|
+
onSubmit?: (query: string) => void;
|
|
462
|
+
/** The clear button's name ("Clear search"), passed translated. */
|
|
463
|
+
clearLabel: string;
|
|
464
|
+
/** Styles merged last, on the field's frame. */
|
|
465
|
+
style?: StyleProp<ViewStyle>;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* A search box: the glyph, the input with the keyboard's search key, a clear button, and a debounced `onSearch` —
|
|
469
|
+
* the web `SearchField` without the shortcut and the suggestions (a screen of results is the native idiom).
|
|
470
|
+
*/
|
|
471
|
+
declare function SearchField({ label, value, defaultValue, onValueChange, onSearch, debounce, onSubmit, clearLabel, style, placeholder, ...props }: SearchFieldProps): React.JSX.Element;
|
|
472
|
+
|
|
409
473
|
type SegmentedOption<T extends string> = {
|
|
410
474
|
value: T;
|
|
411
475
|
label: string;
|
|
@@ -491,18 +555,45 @@ type Theme = {
|
|
|
491
555
|
readonly scrim: string;
|
|
492
556
|
readonly scrimStrong: string;
|
|
493
557
|
readonly overlay: string;
|
|
558
|
+
/** Status tints (a badge, an alert): the primary text reads ≥ 4.5:1 on them. */
|
|
559
|
+
readonly successSoft: string;
|
|
560
|
+
readonly warningSoft: string;
|
|
561
|
+
readonly dangerSoft: string;
|
|
562
|
+
/** The material (BRAND.md §6): the top of a raised surface catches the light… */
|
|
563
|
+
readonly surfaceSheen: string;
|
|
564
|
+
/** …the bottom of a fill is shaded a little… */
|
|
565
|
+
readonly fillShade: string;
|
|
566
|
+
/** …and a 1-pt edge of light runs along the top of what is raised (`edgeOnFill` on an accent fill)… */
|
|
567
|
+
readonly edgeLight: string;
|
|
568
|
+
readonly edgeOnFill: string;
|
|
569
|
+
/** …what you fill (a field, a track) is a well. */
|
|
570
|
+
readonly edgeWell: string;
|
|
571
|
+
/** Frosted glass: what floats over the screen (a toast, a sheet). */
|
|
572
|
+
readonly glassBg: string;
|
|
573
|
+
readonly glassBorder: string;
|
|
494
574
|
};
|
|
495
575
|
/** Corner radii, in points. */
|
|
496
576
|
type Radius = {
|
|
577
|
+
readonly xs: number;
|
|
497
578
|
readonly sm: number;
|
|
498
579
|
readonly md: number;
|
|
499
580
|
readonly lg: number;
|
|
500
581
|
readonly xl: number;
|
|
582
|
+
readonly "2xl": number;
|
|
501
583
|
readonly full: number;
|
|
502
584
|
};
|
|
503
|
-
/**
|
|
585
|
+
/**
|
|
586
|
+
* Motion: the cubic-bezier control points of the platform's ease (`Easing.bezier(...motion.ease)`), the short spring of
|
|
587
|
+
* what answers the hand, and the micro-interaction durations in ms — `useTheme()` gives 0 ms when the system reduces motion.
|
|
588
|
+
*/
|
|
504
589
|
type Motion = {
|
|
505
590
|
readonly ease: readonly [number, number, number, number];
|
|
591
|
+
readonly spring: readonly [number, number, number, number];
|
|
592
|
+
readonly duration: {
|
|
593
|
+
readonly instant: number;
|
|
594
|
+
readonly fast: number;
|
|
595
|
+
readonly base: number;
|
|
596
|
+
};
|
|
506
597
|
};
|
|
507
598
|
type Mode = "dark" | "light" | "system";
|
|
508
599
|
/** A product's colour roles per theme (e.g. `nativeTheme` of a product design system): only the roles it changes. */
|
|
@@ -599,4 +690,4 @@ type ToasterProps = {
|
|
|
599
690
|
/** Mount once, at the root (inside `ThemeProvider`). Then call `toast()` from anywhere. */
|
|
600
691
|
declare function Toaster({ closeLabel, position, offset, duration, max }: ToasterProps): React.JSX.Element | null;
|
|
601
692
|
|
|
602
|
-
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, AvatarRoot, type AvatarSize, Badge, type BadgeProps, type BadgeTone, type BrandId, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, type CardBodyProps, CardDescription, CardFooter, CardImage, type CardImageProps, CardMedia, type CardMediaProps, CardOverlay, type CardOverlayProps, CardRoot, type CardRootProps, CardTitle, Chip, type ChipGroupProps, type ChipProps, type ChipSize, Countdown, type CountdownProps, type CountdownUnits, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, KrizakaMark, Mascot, type MascotProps, type Mode, type Motion, type NativeMarkProps, OrazakaMark, OrochiaMark, ProductMark, Progress, type ProgressProps, type Radius, Segmented, type SegmentedOption, type SegmentedProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type Theme, type ThemeContextValue, type ThemeFonts, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ToastItem, type ToastOptions, type ToastTone, Toaster, type ToasterProps, Txt, type TxtProps, type TxtTone, type TxtVariant, alpha, splitDuration, textStyles, toast, useCountdown, useReducedMotion, useTheme };
|
|
693
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, AvatarRoot, type AvatarSize, Badge, type BadgeProps, type BadgeTone, type BrandId, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, type CardBodyProps, CardDescription, CardFooter, CardImage, type CardImageProps, CardMedia, type CardMediaProps, CardOverlay, type CardOverlayProps, CardRoot, type CardRootProps, CardTitle, Chip, type ChipGroupProps, type ChipProps, type ChipSize, Countdown, type CountdownProps, type CountdownUnits, EmptyState, type EmptyStateProps, IconButton, type IconButtonProps, KrizakaMark, Mascot, type MascotProps, type Mode, type Motion, type NativeMarkProps, OrazakaMark, OrochiaMark, Pagination, type PaginationLabels, type PaginationProps, ProductMark, Progress, type ProgressProps, type Radius, SearchField, type SearchFieldProps, Segmented, type SegmentedOption, type SegmentedProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, type Theme, type ThemeContextValue, type ThemeFonts, type ThemeName, type ThemeOverrides, ThemeProvider, type ThemeProviderProps, type ToastItem, type ToastOptions, type ToastTone, Toaster, type ToasterProps, Txt, type TxtProps, type TxtTone, type TxtVariant, alpha, splitDuration, textStyles, toast, useCountdown, useReducedMotion, useTheme };
|
package/dist/native.js
CHANGED
|
@@ -58,15 +58,25 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
58
58
|
"brandGradientTo": "#0c0c0e",
|
|
59
59
|
"success": "#10b77f",
|
|
60
60
|
"successText": "#36d399",
|
|
61
|
+
"successSoft": "rgba(16,183,127,0.14)",
|
|
61
62
|
"warning": "#f59f0a",
|
|
62
63
|
"warningText": "#f6a823",
|
|
64
|
+
"warningSoft": "rgba(245,159,10,0.14)",
|
|
63
65
|
"danger": "#ef4343",
|
|
64
66
|
"dangerText": "#f87272",
|
|
67
|
+
"dangerSoft": "rgba(239,67,67,0.14)",
|
|
65
68
|
"info": "#196df5",
|
|
66
69
|
"infoText": "#629cf8",
|
|
67
70
|
"scrim": "rgba(0,0,0,0.6)",
|
|
68
71
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
69
|
-
"overlay": "rgba(0,0,0,0.7)"
|
|
72
|
+
"overlay": "rgba(0,0,0,0.7)",
|
|
73
|
+
"surfaceSheen": "rgba(255,255,255,0.045)",
|
|
74
|
+
"fillShade": "rgba(0,0,0,0.12)",
|
|
75
|
+
"edgeLight": "rgba(255,255,255,0.07)",
|
|
76
|
+
"edgeOnFill": "rgba(255,255,255,0.22)",
|
|
77
|
+
"edgeWell": "rgba(4,4,7,0.5)",
|
|
78
|
+
"glassBg": "rgba(29,29,32,0.88)",
|
|
79
|
+
"glassBorder": "rgba(255,255,255,0.1)"
|
|
70
80
|
}), light: /* @__PURE__ */ Object.freeze({
|
|
71
81
|
"surface0": "#fafafa",
|
|
72
82
|
"surface1": "#ffffff",
|
|
@@ -92,24 +102,36 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
92
102
|
"brandGradientTo": "#fafafa",
|
|
93
103
|
"success": "#10b77f",
|
|
94
104
|
"successText": "#0a714e",
|
|
105
|
+
"successSoft": "rgba(16,183,127,0.1)",
|
|
95
106
|
"warning": "#f59f0a",
|
|
96
107
|
"warningText": "#955104",
|
|
108
|
+
"warningSoft": "rgba(245,159,10,0.12)",
|
|
97
109
|
"danger": "#ef4343",
|
|
98
110
|
"dangerText": "#af1d1d",
|
|
111
|
+
"dangerSoft": "rgba(239,67,67,0.1)",
|
|
99
112
|
"info": "#0a64f5",
|
|
100
113
|
"infoText": "#0954ce",
|
|
101
114
|
"scrim": "rgba(0,0,0,0.6)",
|
|
102
115
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
103
|
-
"overlay": "rgba(0,0,0,0.7)"
|
|
116
|
+
"overlay": "rgba(0,0,0,0.7)",
|
|
117
|
+
"surfaceSheen": "rgba(255,255,255,0.7)",
|
|
118
|
+
"fillShade": "rgba(0,0,0,0.12)",
|
|
119
|
+
"edgeLight": "rgba(255,255,255,0.9)",
|
|
120
|
+
"edgeOnFill": "rgba(255,255,255,0.22)",
|
|
121
|
+
"edgeWell": "rgba(48,52,80,0.08)",
|
|
122
|
+
"glassBg": "rgba(255,255,255,0.88)",
|
|
123
|
+
"glassBorder": "rgba(0,0,0,0.08)"
|
|
104
124
|
}) });
|
|
105
125
|
var radius = /* @__PURE__ */ Object.freeze({
|
|
126
|
+
"xs": 6,
|
|
106
127
|
"sm": 8,
|
|
107
128
|
"md": 12,
|
|
108
129
|
"lg": 16,
|
|
109
130
|
"xl": 20,
|
|
131
|
+
"2xl": 28,
|
|
110
132
|
"full": 9999
|
|
111
133
|
});
|
|
112
|
-
var motion = /* @__PURE__ */ Object.freeze({ ease: /* @__PURE__ */ Object.freeze([0.16, 1, 0.3, 1]) });
|
|
134
|
+
var motion = /* @__PURE__ */ Object.freeze({ ease: /* @__PURE__ */ Object.freeze([0.16, 1, 0.3, 1]), spring: /* @__PURE__ */ Object.freeze([0.34, 1.36, 0.64, 1]), duration: /* @__PURE__ */ Object.freeze({ "instant": 90, "fast": 150, "base": 200 }) });
|
|
113
135
|
var marks = /* @__PURE__ */ Object.freeze({
|
|
114
136
|
"krizaka": [
|
|
115
137
|
[
|
|
@@ -154,6 +176,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
154
176
|
var themes2 = themes;
|
|
155
177
|
var radius2 = radius;
|
|
156
178
|
var motion2 = motion;
|
|
179
|
+
var stillMotion = { ...motion2, duration: { instant: 0, fast: 0, base: 0 } };
|
|
157
180
|
var ThemeContext = React.createContext(null);
|
|
158
181
|
function resolve(mode, system) {
|
|
159
182
|
if (mode === "system") return system === "light" ? "light" : "dark";
|
|
@@ -172,10 +195,11 @@ function ThemeProvider({ children, mode: controlled, defaultMode = "system", onM
|
|
|
172
195
|
);
|
|
173
196
|
const scheme = resolve(mode, system);
|
|
174
197
|
const override = overrides?.[scheme];
|
|
198
|
+
const reduce = useReducedMotion();
|
|
175
199
|
const theme = React.useMemo(() => override ? { ...themes2[scheme], ...override } : themes2[scheme], [scheme, override]);
|
|
176
200
|
const value = React.useMemo(
|
|
177
|
-
() => ({ mode, setMode, scheme, theme, radius: radius2, motion: motion2, fonts: fonts ?? {} }),
|
|
178
|
-
[mode, setMode, scheme, theme, fonts]
|
|
201
|
+
() => ({ mode, setMode, scheme, theme, radius: radius2, motion: reduce ? stillMotion : motion2, fonts: fonts ?? {} }),
|
|
202
|
+
[mode, setMode, scheme, theme, fonts, reduce]
|
|
179
203
|
);
|
|
180
204
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
181
205
|
}
|
|
@@ -1139,19 +1163,62 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
1139
1163
|
] });
|
|
1140
1164
|
}
|
|
1141
1165
|
|
|
1166
|
+
// src/native/pagination.tsx
|
|
1167
|
+
import { Pressable as Pressable4, StyleSheet as StyleSheet9, Text as Text6, View as View10 } from "react-native";
|
|
1168
|
+
import Svg6, { Path as Path5 } from "react-native-svg";
|
|
1169
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1170
|
+
function Chevron({ direction, color }) {
|
|
1171
|
+
return /* @__PURE__ */ jsx14(Svg6, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx14(Path5, { d: direction === "left" ? "m15 6-6 6 6 6" : "m9 6 6 6-6 6" }) });
|
|
1172
|
+
}
|
|
1173
|
+
function Pagination({ page = 1, pageCount, onPageChange, hasPrevious, hasNext, onPrevious, onNext, status, disabled, labels, style }) {
|
|
1174
|
+
const { theme, radius: radius3 } = useTheme();
|
|
1175
|
+
const paged = pageCount !== void 0;
|
|
1176
|
+
const count = Math.max(1, pageCount ?? 1);
|
|
1177
|
+
const current = Math.min(Math.max(1, page), count);
|
|
1178
|
+
const canPrevious = !disabled && (paged ? current > 1 : Boolean(hasPrevious));
|
|
1179
|
+
const canNext = !disabled && (paged ? current < count : Boolean(hasNext));
|
|
1180
|
+
const button = (direction, enabled, onPress, label) => /* @__PURE__ */ jsx14(
|
|
1181
|
+
Pressable4,
|
|
1182
|
+
{
|
|
1183
|
+
role: "button",
|
|
1184
|
+
"aria-label": label,
|
|
1185
|
+
"aria-disabled": !enabled,
|
|
1186
|
+
disabled: !enabled,
|
|
1187
|
+
hitSlop: 6,
|
|
1188
|
+
onPress,
|
|
1189
|
+
style: ({ pressed }) => [
|
|
1190
|
+
styles9.button,
|
|
1191
|
+
{ borderRadius: radius3.sm, borderColor: theme.borderDefault, backgroundColor: theme.surface1, opacity: enabled ? pressed ? 0.8 : 1 : 0.4 }
|
|
1192
|
+
],
|
|
1193
|
+
children: /* @__PURE__ */ jsx14(Chevron, { direction, color: theme.textPrimary })
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
1196
|
+
const text = status ?? (paged ? labels.compact(current, count) : null);
|
|
1197
|
+
return /* @__PURE__ */ jsxs11(View10, { role: "navigation", style: [styles9.row, style], children: [
|
|
1198
|
+
button("left", canPrevious, paged ? () => onPageChange?.(current - 1) : onPrevious, labels.previous),
|
|
1199
|
+
text ? /* @__PURE__ */ jsx14(Text6, { "aria-live": "polite", style: [styles9.status, { color: theme.textSecondary }], children: text }) : null,
|
|
1200
|
+
button("right", canNext, paged ? () => onPageChange?.(current + 1) : onNext, labels.next)
|
|
1201
|
+
] });
|
|
1202
|
+
}
|
|
1203
|
+
var styles9 = StyleSheet9.create({
|
|
1204
|
+
row: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 12 },
|
|
1205
|
+
button: { width: 44, height: 44, alignItems: "center", justifyContent: "center", borderWidth: StyleSheet9.hairlineWidth },
|
|
1206
|
+
status: { fontSize: 13, fontWeight: "600", fontVariant: ["tabular-nums"] }
|
|
1207
|
+
});
|
|
1208
|
+
|
|
1142
1209
|
// src/native/ProductMark.tsx
|
|
1143
|
-
import { jsx as
|
|
1210
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1144
1211
|
function ProductMark({ id, ...props }) {
|
|
1145
|
-
if (id === "krizaka") return /* @__PURE__ */
|
|
1146
|
-
if (id === "orazaka") return /* @__PURE__ */
|
|
1147
|
-
return /* @__PURE__ */
|
|
1212
|
+
if (id === "krizaka") return /* @__PURE__ */ jsx15(KrizakaMark, { ...props });
|
|
1213
|
+
if (id === "orazaka") return /* @__PURE__ */ jsx15(OrazakaMark, { ...props });
|
|
1214
|
+
return /* @__PURE__ */ jsx15(OrochiaMark, { ...props });
|
|
1148
1215
|
}
|
|
1149
1216
|
|
|
1150
1217
|
// src/native/progress.tsx
|
|
1151
1218
|
import * as React9 from "react";
|
|
1152
|
-
import { Animated as Animated6, Easing as Easing4, StyleSheet as
|
|
1153
|
-
import
|
|
1154
|
-
import { jsx as
|
|
1219
|
+
import { Animated as Animated6, Easing as Easing4, StyleSheet as StyleSheet10, View as View11 } from "react-native";
|
|
1220
|
+
import Svg7, { Circle as Circle5, Defs as Defs6, LinearGradient as LinearGradient6, Rect as Rect3, Stop as Stop6 } from "react-native-svg";
|
|
1221
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1155
1222
|
var AnimatedCircle = Animated6.createAnimatedComponent(Circle5);
|
|
1156
1223
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
1157
1224
|
var RING = { sm: 40, md: 80, lg: 144 };
|
|
@@ -1193,9 +1260,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1193
1260
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
1194
1261
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
1195
1262
|
};
|
|
1196
|
-
const gradient = /* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1263
|
+
const gradient = /* @__PURE__ */ jsx16(Defs6, { children: /* @__PURE__ */ jsxs12(LinearGradient6, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
1264
|
+
/* @__PURE__ */ jsx16(Stop6, { offset: "0", stopColor: theme.accent }),
|
|
1265
|
+
/* @__PURE__ */ jsx16(Stop6, { offset: "1", stopColor: theme.accent2 })
|
|
1199
1266
|
] }) });
|
|
1200
1267
|
if (variant === "ring") {
|
|
1201
1268
|
const side = RING[size];
|
|
@@ -1204,11 +1271,11 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1204
1271
|
const circumference = 2 * Math.PI * r;
|
|
1205
1272
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
1206
1273
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
1207
|
-
return /* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsxs12(View11, { ...a11y, style: [styles10.ring, { width: side, height: side }, style], children: [
|
|
1275
|
+
/* @__PURE__ */ jsx16(Animated6.View, { style: [StyleSheet10.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs12(Svg7, { width: side, height: side, viewBox: "0 0 100 100", children: [
|
|
1209
1276
|
gradient,
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ jsx16(Circle5, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
1278
|
+
/* @__PURE__ */ jsx16(
|
|
1212
1279
|
AnimatedCircle,
|
|
1213
1280
|
{
|
|
1214
1281
|
cx: 50,
|
|
@@ -1228,40 +1295,93 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1228
1295
|
}
|
|
1229
1296
|
const width = known ? progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) : "40%";
|
|
1230
1297
|
const translate = spin.interpolate({ inputRange: [0, 1], outputRange: [-0.4 * track, track] });
|
|
1231
|
-
return /* @__PURE__ */
|
|
1232
|
-
|
|
1298
|
+
return /* @__PURE__ */ jsx16(
|
|
1299
|
+
View11,
|
|
1233
1300
|
{
|
|
1234
1301
|
...a11y,
|
|
1235
1302
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
1236
|
-
style: [
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1303
|
+
style: [styles10.bar, { height: BAR[size], backgroundColor: theme.surface3 }, style],
|
|
1304
|
+
children: /* @__PURE__ */ jsx16(Animated6.View, { style: [styles10.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs12(Svg7, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
1238
1305
|
gradient,
|
|
1239
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ jsx16(Rect3, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
1240
1307
|
] }) })
|
|
1241
1308
|
}
|
|
1242
1309
|
);
|
|
1243
1310
|
}
|
|
1244
|
-
var
|
|
1311
|
+
var styles10 = StyleSheet10.create({
|
|
1245
1312
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
1246
1313
|
bar: { width: "100%", overflow: "hidden", borderRadius: 9999 },
|
|
1247
1314
|
fill: { height: "100%", overflow: "hidden", borderRadius: 9999 }
|
|
1248
1315
|
});
|
|
1249
1316
|
|
|
1317
|
+
// src/native/search-field.tsx
|
|
1318
|
+
import * as React10 from "react";
|
|
1319
|
+
import { Pressable as Pressable5, StyleSheet as StyleSheet11, TextInput, View as View12 } from "react-native";
|
|
1320
|
+
import Svg8, { Circle as Circle6, Path as Path6 } from "react-native-svg";
|
|
1321
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1322
|
+
function SearchField({ label, value, defaultValue = "", onValueChange, onSearch, debounce = 300, onSubmit, clearLabel, style, placeholder, ...props }) {
|
|
1323
|
+
const { theme, radius: radius3 } = useTheme();
|
|
1324
|
+
const [own, setOwn] = React10.useState(defaultValue);
|
|
1325
|
+
const query = value ?? own;
|
|
1326
|
+
const timer2 = React10.useRef(void 0);
|
|
1327
|
+
React10.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
1328
|
+
const change = (next) => {
|
|
1329
|
+
if (value === void 0) setOwn(next);
|
|
1330
|
+
onValueChange?.(next);
|
|
1331
|
+
clearTimeout(timer2.current);
|
|
1332
|
+
if (onSearch) timer2.current = setTimeout(() => onSearch(next), debounce);
|
|
1333
|
+
};
|
|
1334
|
+
return /* @__PURE__ */ jsxs13(View12, { style: [styles11.frame, { borderRadius: radius3.md, borderColor: theme.borderDefault, backgroundColor: theme.surface2 }, style], children: [
|
|
1335
|
+
/* @__PURE__ */ jsxs13(Svg8, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, children: [
|
|
1336
|
+
/* @__PURE__ */ jsx17(Circle6, { cx: 11, cy: 11, r: 7 }),
|
|
1337
|
+
/* @__PURE__ */ jsx17(Path6, { d: "m20 20-3.5-3.5" })
|
|
1338
|
+
] }),
|
|
1339
|
+
/* @__PURE__ */ jsx17(
|
|
1340
|
+
TextInput,
|
|
1341
|
+
{
|
|
1342
|
+
role: "searchbox",
|
|
1343
|
+
"aria-label": label,
|
|
1344
|
+
value: query,
|
|
1345
|
+
placeholder,
|
|
1346
|
+
placeholderTextColor: theme.textMuted,
|
|
1347
|
+
returnKeyType: "search",
|
|
1348
|
+
autoCorrect: false,
|
|
1349
|
+
autoCapitalize: "none",
|
|
1350
|
+
clearButtonMode: "never",
|
|
1351
|
+
onChangeText: change,
|
|
1352
|
+
onSubmitEditing: () => {
|
|
1353
|
+
clearTimeout(timer2.current);
|
|
1354
|
+
onSearch?.(query);
|
|
1355
|
+
onSubmit?.(query);
|
|
1356
|
+
},
|
|
1357
|
+
style: [styles11.input, { color: theme.textPrimary }],
|
|
1358
|
+
...props
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
query ? /* @__PURE__ */ jsx17(Pressable5, { role: "button", "aria-label": clearLabel, hitSlop: 10, onPress: () => change(""), style: styles11.clear, children: /* @__PURE__ */ jsx17(Svg8, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2.4, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx17(Path6, { d: "M18 6 6 18M6 6l12 12" }) }) }) : null
|
|
1362
|
+
] });
|
|
1363
|
+
}
|
|
1364
|
+
var styles11 = StyleSheet11.create({
|
|
1365
|
+
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth: StyleSheet11.hairlineWidth },
|
|
1366
|
+
input: { flex: 1, height: "100%", fontSize: 15, paddingVertical: 0 },
|
|
1367
|
+
clear: { width: 32, height: 32, alignItems: "center", justifyContent: "center" }
|
|
1368
|
+
});
|
|
1369
|
+
|
|
1250
1370
|
// src/native/segmented.tsx
|
|
1251
|
-
import { Pressable as
|
|
1252
|
-
import { jsx as
|
|
1371
|
+
import { Pressable as Pressable6, StyleSheet as StyleSheet12, Text as Text7, View as View13 } from "react-native";
|
|
1372
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1253
1373
|
function Segmented({ options, value, onValueChange, size = "md", "aria-label": label, style }) {
|
|
1254
1374
|
const { theme, radius: radius3 } = useTheme();
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
|
|
1375
|
+
return /* @__PURE__ */ jsx18(
|
|
1376
|
+
View13,
|
|
1257
1377
|
{
|
|
1258
1378
|
role: "tablist",
|
|
1259
1379
|
"aria-label": label,
|
|
1260
|
-
style: [
|
|
1380
|
+
style: [styles12.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md, height: size === "sm" ? 32 : 40 }, style],
|
|
1261
1381
|
children: options.map((option) => {
|
|
1262
1382
|
const selected = option.value === value;
|
|
1263
|
-
return /* @__PURE__ */
|
|
1264
|
-
|
|
1383
|
+
return /* @__PURE__ */ jsx18(
|
|
1384
|
+
Pressable6,
|
|
1265
1385
|
{
|
|
1266
1386
|
role: "tab",
|
|
1267
1387
|
"aria-selected": selected,
|
|
@@ -1271,12 +1391,12 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
1271
1391
|
if (!selected) onValueChange(option.value);
|
|
1272
1392
|
},
|
|
1273
1393
|
style: [
|
|
1274
|
-
|
|
1394
|
+
styles12.segment,
|
|
1275
1395
|
{ borderRadius: radius3.sm },
|
|
1276
1396
|
selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null,
|
|
1277
|
-
option.disabled ?
|
|
1397
|
+
option.disabled ? styles12.disabled : null
|
|
1278
1398
|
],
|
|
1279
|
-
children: /* @__PURE__ */
|
|
1399
|
+
children: /* @__PURE__ */ jsx18(Text7, { numberOfLines: 1, style: [styles12.label, { color: selected ? theme.textPrimary : theme.textSecondary, fontSize: size === "sm" ? 12 : 13 }], children: option.label })
|
|
1280
1400
|
},
|
|
1281
1401
|
option.value
|
|
1282
1402
|
);
|
|
@@ -1284,17 +1404,17 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
1284
1404
|
}
|
|
1285
1405
|
);
|
|
1286
1406
|
}
|
|
1287
|
-
var
|
|
1288
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
1289
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
1407
|
+
var styles12 = StyleSheet12.create({
|
|
1408
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet12.hairlineWidth },
|
|
1409
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet12.hairlineWidth, borderColor: "transparent" },
|
|
1290
1410
|
label: { fontWeight: "600" },
|
|
1291
1411
|
disabled: { opacity: 0.4 }
|
|
1292
1412
|
});
|
|
1293
1413
|
|
|
1294
1414
|
// src/native/skeleton.tsx
|
|
1295
|
-
import * as
|
|
1415
|
+
import * as React11 from "react";
|
|
1296
1416
|
import { Animated as Animated7 } from "react-native";
|
|
1297
|
-
import { jsx as
|
|
1417
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1298
1418
|
var SHAPE = {
|
|
1299
1419
|
text: { width: "100%", height: 12, radius: 4 },
|
|
1300
1420
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -1303,8 +1423,8 @@ var SHAPE = {
|
|
|
1303
1423
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
1304
1424
|
const { theme } = useTheme();
|
|
1305
1425
|
const reduce = useReducedMotion();
|
|
1306
|
-
const [opacity] =
|
|
1307
|
-
|
|
1426
|
+
const [opacity] = React11.useState(() => new Animated7.Value(1));
|
|
1427
|
+
React11.useEffect(() => {
|
|
1308
1428
|
if (reduce) return;
|
|
1309
1429
|
const loop = Animated7.loop(
|
|
1310
1430
|
Animated7.sequence([
|
|
@@ -1320,7 +1440,7 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1320
1440
|
}, [reduce, opacity]);
|
|
1321
1441
|
const s = SHAPE[shape];
|
|
1322
1442
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
1323
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ jsx19(
|
|
1324
1444
|
Animated7.View,
|
|
1325
1445
|
{
|
|
1326
1446
|
testID,
|
|
@@ -1335,10 +1455,10 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1335
1455
|
|
|
1336
1456
|
// src/native/spinner.tsx
|
|
1337
1457
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1338
|
-
import { jsx as
|
|
1458
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1339
1459
|
function Spinner({ label, size = "md", ...props }) {
|
|
1340
1460
|
const { theme } = useTheme();
|
|
1341
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsx20(
|
|
1342
1462
|
ActivityIndicator2,
|
|
1343
1463
|
{
|
|
1344
1464
|
accessible: true,
|
|
@@ -1353,9 +1473,9 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
1353
1473
|
}
|
|
1354
1474
|
|
|
1355
1475
|
// src/native/toast.tsx
|
|
1356
|
-
import * as
|
|
1357
|
-
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Pressable as
|
|
1358
|
-
import { Fragment as Fragment3, jsx as
|
|
1476
|
+
import * as React12 from "react";
|
|
1477
|
+
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Pressable as Pressable7, StyleSheet as StyleSheet13, Text as Text8, View as View14 } from "react-native";
|
|
1478
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1359
1479
|
var items = [];
|
|
1360
1480
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
1361
1481
|
var counter = 0;
|
|
@@ -1390,76 +1510,76 @@ var toast = Object.assign(show, {
|
|
|
1390
1510
|
function ToastView({ item, closeLabel, duration }) {
|
|
1391
1511
|
const { theme, radius: radius3 } = useTheme();
|
|
1392
1512
|
const reduce = useReducedMotion();
|
|
1393
|
-
const [enter] =
|
|
1394
|
-
|
|
1513
|
+
const [enter] = React12.useState(() => new Animated8.Value(reduce ? 1 : 0));
|
|
1514
|
+
React12.useEffect(() => {
|
|
1395
1515
|
if (reduce) enter.setValue(1);
|
|
1396
1516
|
else Animated8.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
1397
1517
|
}, [enter, reduce]);
|
|
1398
|
-
|
|
1518
|
+
React12.useEffect(() => {
|
|
1399
1519
|
AccessibilityInfo5.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
1400
1520
|
}, [item.title, item.description]);
|
|
1401
1521
|
const ms = item.duration ?? duration;
|
|
1402
|
-
|
|
1522
|
+
React12.useEffect(() => {
|
|
1403
1523
|
if (!Number.isFinite(ms)) return;
|
|
1404
1524
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
1405
1525
|
return () => clearTimeout(timer2);
|
|
1406
1526
|
}, [item.id, ms]);
|
|
1407
1527
|
const edge = { success: theme.success, warning: theme.warning, error: theme.danger, info: theme.info, default: theme.borderDefault }[item.tone ?? "default"];
|
|
1408
|
-
const text = /* @__PURE__ */
|
|
1409
|
-
item.icon ? /* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
item.description ? /* @__PURE__ */
|
|
1528
|
+
const text = /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1529
|
+
item.icon ? /* @__PURE__ */ jsx21(View14, { "aria-hidden": true, children: item.icon }) : null,
|
|
1530
|
+
/* @__PURE__ */ jsxs14(View14, { style: styles13.content, children: [
|
|
1531
|
+
/* @__PURE__ */ jsx21(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
1532
|
+
item.description ? /* @__PURE__ */ jsx21(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
1413
1533
|
] })
|
|
1414
1534
|
] });
|
|
1415
|
-
const body = /* @__PURE__ */
|
|
1416
|
-
item.onPress ? /* @__PURE__ */
|
|
1417
|
-
|
|
1535
|
+
const body = /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1536
|
+
item.onPress ? /* @__PURE__ */ jsx21(
|
|
1537
|
+
Pressable7,
|
|
1418
1538
|
{
|
|
1419
1539
|
role: "button",
|
|
1420
1540
|
onPress: () => {
|
|
1421
1541
|
item.onPress?.();
|
|
1422
1542
|
dismiss(item.id);
|
|
1423
1543
|
},
|
|
1424
|
-
style: ({ pressed }) => [
|
|
1544
|
+
style: ({ pressed }) => [styles13.main, { opacity: pressed ? 0.8 : 1 }],
|
|
1425
1545
|
children: text
|
|
1426
1546
|
}
|
|
1427
|
-
) : /* @__PURE__ */
|
|
1428
|
-
item.action ? /* @__PURE__ */
|
|
1429
|
-
|
|
1547
|
+
) : /* @__PURE__ */ jsx21(View14, { style: styles13.main, children: text }),
|
|
1548
|
+
item.action ? /* @__PURE__ */ jsx21(
|
|
1549
|
+
Pressable7,
|
|
1430
1550
|
{
|
|
1431
1551
|
role: "button",
|
|
1432
1552
|
onPress: () => {
|
|
1433
1553
|
item.action?.onPress();
|
|
1434
1554
|
dismiss(item.id);
|
|
1435
1555
|
},
|
|
1436
|
-
style: [
|
|
1437
|
-
children: /* @__PURE__ */
|
|
1556
|
+
style: [styles13.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
1557
|
+
children: /* @__PURE__ */ jsx21(Text8, { style: [styles13.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
1438
1558
|
}
|
|
1439
1559
|
) : null,
|
|
1440
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ jsx21(Pressable7, { role: "button", "aria-label": closeLabel, hitSlop: 10, onPress: () => dismiss(item.id), style: styles13.close, children: /* @__PURE__ */ jsx21(Text8, { style: [styles13.cross, { color: theme.textSecondary }], children: "\xD7" }) })
|
|
1441
1561
|
] });
|
|
1442
1562
|
const frame = [
|
|
1443
|
-
|
|
1563
|
+
styles13.toast,
|
|
1444
1564
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
1445
1565
|
];
|
|
1446
1566
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }] };
|
|
1447
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ jsx21(Animated8.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx21(View14, { style: frame, children: body }) });
|
|
1448
1568
|
}
|
|
1449
1569
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
1450
|
-
const all =
|
|
1570
|
+
const all = React12.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
1451
1571
|
const shown = all.slice(-max);
|
|
1452
1572
|
if (shown.length === 0) return null;
|
|
1453
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsx21(View14, { pointerEvents: "box-none", style: [styles13.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx21(ToastView, { item, closeLabel, duration }, item.id)) });
|
|
1454
1574
|
}
|
|
1455
|
-
var
|
|
1575
|
+
var styles13 = StyleSheet13.create({
|
|
1456
1576
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
1457
1577
|
toast: {
|
|
1458
1578
|
flexDirection: "row",
|
|
1459
1579
|
alignItems: "center",
|
|
1460
1580
|
gap: 10,
|
|
1461
1581
|
padding: 12,
|
|
1462
|
-
borderWidth:
|
|
1582
|
+
borderWidth: StyleSheet13.hairlineWidth,
|
|
1463
1583
|
borderLeftWidth: 4,
|
|
1464
1584
|
shadowOpacity: 0.3,
|
|
1465
1585
|
shadowRadius: 16,
|
|
@@ -1496,8 +1616,10 @@ export {
|
|
|
1496
1616
|
Mascot,
|
|
1497
1617
|
OrazakaMark,
|
|
1498
1618
|
OrochiaMark,
|
|
1619
|
+
Pagination,
|
|
1499
1620
|
ProductMark,
|
|
1500
1621
|
Progress,
|
|
1622
|
+
SearchField,
|
|
1501
1623
|
Segmented,
|
|
1502
1624
|
Skeleton,
|
|
1503
1625
|
Spinner,
|