@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
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;
|
|
@@ -599,4 +663,4 @@ type ToasterProps = {
|
|
|
599
663
|
/** Mount once, at the root (inside `ThemeProvider`). Then call `toast()` from anywhere. */
|
|
600
664
|
declare function Toaster({ closeLabel, position, offset, duration, max }: ToasterProps): React.JSX.Element | null;
|
|
601
665
|
|
|
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 };
|
|
666
|
+
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
|
@@ -1139,19 +1139,62 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
1139
1139
|
] });
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
|
+
// src/native/pagination.tsx
|
|
1143
|
+
import { Pressable as Pressable4, StyleSheet as StyleSheet9, Text as Text6, View as View10 } from "react-native";
|
|
1144
|
+
import Svg6, { Path as Path5 } from "react-native-svg";
|
|
1145
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1146
|
+
function Chevron({ direction, color }) {
|
|
1147
|
+
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" }) });
|
|
1148
|
+
}
|
|
1149
|
+
function Pagination({ page = 1, pageCount, onPageChange, hasPrevious, hasNext, onPrevious, onNext, status, disabled, labels, style }) {
|
|
1150
|
+
const { theme, radius: radius3 } = useTheme();
|
|
1151
|
+
const paged = pageCount !== void 0;
|
|
1152
|
+
const count = Math.max(1, pageCount ?? 1);
|
|
1153
|
+
const current = Math.min(Math.max(1, page), count);
|
|
1154
|
+
const canPrevious = !disabled && (paged ? current > 1 : Boolean(hasPrevious));
|
|
1155
|
+
const canNext = !disabled && (paged ? current < count : Boolean(hasNext));
|
|
1156
|
+
const button = (direction, enabled, onPress, label) => /* @__PURE__ */ jsx14(
|
|
1157
|
+
Pressable4,
|
|
1158
|
+
{
|
|
1159
|
+
role: "button",
|
|
1160
|
+
"aria-label": label,
|
|
1161
|
+
"aria-disabled": !enabled,
|
|
1162
|
+
disabled: !enabled,
|
|
1163
|
+
hitSlop: 6,
|
|
1164
|
+
onPress,
|
|
1165
|
+
style: ({ pressed }) => [
|
|
1166
|
+
styles9.button,
|
|
1167
|
+
{ borderRadius: radius3.sm, borderColor: theme.borderDefault, backgroundColor: theme.surface1, opacity: enabled ? pressed ? 0.8 : 1 : 0.4 }
|
|
1168
|
+
],
|
|
1169
|
+
children: /* @__PURE__ */ jsx14(Chevron, { direction, color: theme.textPrimary })
|
|
1170
|
+
}
|
|
1171
|
+
);
|
|
1172
|
+
const text = status ?? (paged ? labels.compact(current, count) : null);
|
|
1173
|
+
return /* @__PURE__ */ jsxs11(View10, { role: "navigation", style: [styles9.row, style], children: [
|
|
1174
|
+
button("left", canPrevious, paged ? () => onPageChange?.(current - 1) : onPrevious, labels.previous),
|
|
1175
|
+
text ? /* @__PURE__ */ jsx14(Text6, { "aria-live": "polite", style: [styles9.status, { color: theme.textSecondary }], children: text }) : null,
|
|
1176
|
+
button("right", canNext, paged ? () => onPageChange?.(current + 1) : onNext, labels.next)
|
|
1177
|
+
] });
|
|
1178
|
+
}
|
|
1179
|
+
var styles9 = StyleSheet9.create({
|
|
1180
|
+
row: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 12 },
|
|
1181
|
+
button: { width: 44, height: 44, alignItems: "center", justifyContent: "center", borderWidth: StyleSheet9.hairlineWidth },
|
|
1182
|
+
status: { fontSize: 13, fontWeight: "600", fontVariant: ["tabular-nums"] }
|
|
1183
|
+
});
|
|
1184
|
+
|
|
1142
1185
|
// src/native/ProductMark.tsx
|
|
1143
|
-
import { jsx as
|
|
1186
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1144
1187
|
function ProductMark({ id, ...props }) {
|
|
1145
|
-
if (id === "krizaka") return /* @__PURE__ */
|
|
1146
|
-
if (id === "orazaka") return /* @__PURE__ */
|
|
1147
|
-
return /* @__PURE__ */
|
|
1188
|
+
if (id === "krizaka") return /* @__PURE__ */ jsx15(KrizakaMark, { ...props });
|
|
1189
|
+
if (id === "orazaka") return /* @__PURE__ */ jsx15(OrazakaMark, { ...props });
|
|
1190
|
+
return /* @__PURE__ */ jsx15(OrochiaMark, { ...props });
|
|
1148
1191
|
}
|
|
1149
1192
|
|
|
1150
1193
|
// src/native/progress.tsx
|
|
1151
1194
|
import * as React9 from "react";
|
|
1152
|
-
import { Animated as Animated6, Easing as Easing4, StyleSheet as
|
|
1153
|
-
import
|
|
1154
|
-
import { jsx as
|
|
1195
|
+
import { Animated as Animated6, Easing as Easing4, StyleSheet as StyleSheet10, View as View11 } from "react-native";
|
|
1196
|
+
import Svg7, { Circle as Circle5, Defs as Defs6, LinearGradient as LinearGradient6, Rect as Rect3, Stop as Stop6 } from "react-native-svg";
|
|
1197
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1155
1198
|
var AnimatedCircle = Animated6.createAnimatedComponent(Circle5);
|
|
1156
1199
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
1157
1200
|
var RING = { sm: 40, md: 80, lg: 144 };
|
|
@@ -1193,9 +1236,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1193
1236
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
1194
1237
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
1195
1238
|
};
|
|
1196
|
-
const gradient = /* @__PURE__ */
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1239
|
+
const gradient = /* @__PURE__ */ jsx16(Defs6, { children: /* @__PURE__ */ jsxs12(LinearGradient6, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
1240
|
+
/* @__PURE__ */ jsx16(Stop6, { offset: "0", stopColor: theme.accent }),
|
|
1241
|
+
/* @__PURE__ */ jsx16(Stop6, { offset: "1", stopColor: theme.accent2 })
|
|
1199
1242
|
] }) });
|
|
1200
1243
|
if (variant === "ring") {
|
|
1201
1244
|
const side = RING[size];
|
|
@@ -1204,11 +1247,11 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1204
1247
|
const circumference = 2 * Math.PI * r;
|
|
1205
1248
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
1206
1249
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
1207
|
-
return /* @__PURE__ */
|
|
1208
|
-
/* @__PURE__ */
|
|
1250
|
+
return /* @__PURE__ */ jsxs12(View11, { ...a11y, style: [styles10.ring, { width: side, height: side }, style], children: [
|
|
1251
|
+
/* @__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
1252
|
gradient,
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ jsx16(Circle5, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
1254
|
+
/* @__PURE__ */ jsx16(
|
|
1212
1255
|
AnimatedCircle,
|
|
1213
1256
|
{
|
|
1214
1257
|
cx: 50,
|
|
@@ -1228,40 +1271,93 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1228
1271
|
}
|
|
1229
1272
|
const width = known ? progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) : "40%";
|
|
1230
1273
|
const translate = spin.interpolate({ inputRange: [0, 1], outputRange: [-0.4 * track, track] });
|
|
1231
|
-
return /* @__PURE__ */
|
|
1232
|
-
|
|
1274
|
+
return /* @__PURE__ */ jsx16(
|
|
1275
|
+
View11,
|
|
1233
1276
|
{
|
|
1234
1277
|
...a11y,
|
|
1235
1278
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
1236
|
-
style: [
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1279
|
+
style: [styles10.bar, { height: BAR[size], backgroundColor: theme.surface3 }, style],
|
|
1280
|
+
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
1281
|
gradient,
|
|
1239
|
-
/* @__PURE__ */
|
|
1282
|
+
/* @__PURE__ */ jsx16(Rect3, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
1240
1283
|
] }) })
|
|
1241
1284
|
}
|
|
1242
1285
|
);
|
|
1243
1286
|
}
|
|
1244
|
-
var
|
|
1287
|
+
var styles10 = StyleSheet10.create({
|
|
1245
1288
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
1246
1289
|
bar: { width: "100%", overflow: "hidden", borderRadius: 9999 },
|
|
1247
1290
|
fill: { height: "100%", overflow: "hidden", borderRadius: 9999 }
|
|
1248
1291
|
});
|
|
1249
1292
|
|
|
1293
|
+
// src/native/search-field.tsx
|
|
1294
|
+
import * as React10 from "react";
|
|
1295
|
+
import { Pressable as Pressable5, StyleSheet as StyleSheet11, TextInput, View as View12 } from "react-native";
|
|
1296
|
+
import Svg8, { Circle as Circle6, Path as Path6 } from "react-native-svg";
|
|
1297
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1298
|
+
function SearchField({ label, value, defaultValue = "", onValueChange, onSearch, debounce = 300, onSubmit, clearLabel, style, placeholder, ...props }) {
|
|
1299
|
+
const { theme, radius: radius3 } = useTheme();
|
|
1300
|
+
const [own, setOwn] = React10.useState(defaultValue);
|
|
1301
|
+
const query = value ?? own;
|
|
1302
|
+
const timer2 = React10.useRef(void 0);
|
|
1303
|
+
React10.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
1304
|
+
const change = (next) => {
|
|
1305
|
+
if (value === void 0) setOwn(next);
|
|
1306
|
+
onValueChange?.(next);
|
|
1307
|
+
clearTimeout(timer2.current);
|
|
1308
|
+
if (onSearch) timer2.current = setTimeout(() => onSearch(next), debounce);
|
|
1309
|
+
};
|
|
1310
|
+
return /* @__PURE__ */ jsxs13(View12, { style: [styles11.frame, { borderRadius: radius3.md, borderColor: theme.borderDefault, backgroundColor: theme.surface2 }, style], children: [
|
|
1311
|
+
/* @__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: [
|
|
1312
|
+
/* @__PURE__ */ jsx17(Circle6, { cx: 11, cy: 11, r: 7 }),
|
|
1313
|
+
/* @__PURE__ */ jsx17(Path6, { d: "m20 20-3.5-3.5" })
|
|
1314
|
+
] }),
|
|
1315
|
+
/* @__PURE__ */ jsx17(
|
|
1316
|
+
TextInput,
|
|
1317
|
+
{
|
|
1318
|
+
role: "searchbox",
|
|
1319
|
+
"aria-label": label,
|
|
1320
|
+
value: query,
|
|
1321
|
+
placeholder,
|
|
1322
|
+
placeholderTextColor: theme.textMuted,
|
|
1323
|
+
returnKeyType: "search",
|
|
1324
|
+
autoCorrect: false,
|
|
1325
|
+
autoCapitalize: "none",
|
|
1326
|
+
clearButtonMode: "never",
|
|
1327
|
+
onChangeText: change,
|
|
1328
|
+
onSubmitEditing: () => {
|
|
1329
|
+
clearTimeout(timer2.current);
|
|
1330
|
+
onSearch?.(query);
|
|
1331
|
+
onSubmit?.(query);
|
|
1332
|
+
},
|
|
1333
|
+
style: [styles11.input, { color: theme.textPrimary }],
|
|
1334
|
+
...props
|
|
1335
|
+
}
|
|
1336
|
+
),
|
|
1337
|
+
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
|
|
1338
|
+
] });
|
|
1339
|
+
}
|
|
1340
|
+
var styles11 = StyleSheet11.create({
|
|
1341
|
+
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth: StyleSheet11.hairlineWidth },
|
|
1342
|
+
input: { flex: 1, height: "100%", fontSize: 15, paddingVertical: 0 },
|
|
1343
|
+
clear: { width: 32, height: 32, alignItems: "center", justifyContent: "center" }
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1250
1346
|
// src/native/segmented.tsx
|
|
1251
|
-
import { Pressable as
|
|
1252
|
-
import { jsx as
|
|
1347
|
+
import { Pressable as Pressable6, StyleSheet as StyleSheet12, Text as Text7, View as View13 } from "react-native";
|
|
1348
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1253
1349
|
function Segmented({ options, value, onValueChange, size = "md", "aria-label": label, style }) {
|
|
1254
1350
|
const { theme, radius: radius3 } = useTheme();
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
|
|
1351
|
+
return /* @__PURE__ */ jsx18(
|
|
1352
|
+
View13,
|
|
1257
1353
|
{
|
|
1258
1354
|
role: "tablist",
|
|
1259
1355
|
"aria-label": label,
|
|
1260
|
-
style: [
|
|
1356
|
+
style: [styles12.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md, height: size === "sm" ? 32 : 40 }, style],
|
|
1261
1357
|
children: options.map((option) => {
|
|
1262
1358
|
const selected = option.value === value;
|
|
1263
|
-
return /* @__PURE__ */
|
|
1264
|
-
|
|
1359
|
+
return /* @__PURE__ */ jsx18(
|
|
1360
|
+
Pressable6,
|
|
1265
1361
|
{
|
|
1266
1362
|
role: "tab",
|
|
1267
1363
|
"aria-selected": selected,
|
|
@@ -1271,12 +1367,12 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
1271
1367
|
if (!selected) onValueChange(option.value);
|
|
1272
1368
|
},
|
|
1273
1369
|
style: [
|
|
1274
|
-
|
|
1370
|
+
styles12.segment,
|
|
1275
1371
|
{ borderRadius: radius3.sm },
|
|
1276
1372
|
selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null,
|
|
1277
|
-
option.disabled ?
|
|
1373
|
+
option.disabled ? styles12.disabled : null
|
|
1278
1374
|
],
|
|
1279
|
-
children: /* @__PURE__ */
|
|
1375
|
+
children: /* @__PURE__ */ jsx18(Text7, { numberOfLines: 1, style: [styles12.label, { color: selected ? theme.textPrimary : theme.textSecondary, fontSize: size === "sm" ? 12 : 13 }], children: option.label })
|
|
1280
1376
|
},
|
|
1281
1377
|
option.value
|
|
1282
1378
|
);
|
|
@@ -1284,17 +1380,17 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
1284
1380
|
}
|
|
1285
1381
|
);
|
|
1286
1382
|
}
|
|
1287
|
-
var
|
|
1288
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
1289
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
1383
|
+
var styles12 = StyleSheet12.create({
|
|
1384
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet12.hairlineWidth },
|
|
1385
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet12.hairlineWidth, borderColor: "transparent" },
|
|
1290
1386
|
label: { fontWeight: "600" },
|
|
1291
1387
|
disabled: { opacity: 0.4 }
|
|
1292
1388
|
});
|
|
1293
1389
|
|
|
1294
1390
|
// src/native/skeleton.tsx
|
|
1295
|
-
import * as
|
|
1391
|
+
import * as React11 from "react";
|
|
1296
1392
|
import { Animated as Animated7 } from "react-native";
|
|
1297
|
-
import { jsx as
|
|
1393
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1298
1394
|
var SHAPE = {
|
|
1299
1395
|
text: { width: "100%", height: 12, radius: 4 },
|
|
1300
1396
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -1303,8 +1399,8 @@ var SHAPE = {
|
|
|
1303
1399
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
1304
1400
|
const { theme } = useTheme();
|
|
1305
1401
|
const reduce = useReducedMotion();
|
|
1306
|
-
const [opacity] =
|
|
1307
|
-
|
|
1402
|
+
const [opacity] = React11.useState(() => new Animated7.Value(1));
|
|
1403
|
+
React11.useEffect(() => {
|
|
1308
1404
|
if (reduce) return;
|
|
1309
1405
|
const loop = Animated7.loop(
|
|
1310
1406
|
Animated7.sequence([
|
|
@@ -1320,7 +1416,7 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1320
1416
|
}, [reduce, opacity]);
|
|
1321
1417
|
const s = SHAPE[shape];
|
|
1322
1418
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
1323
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ jsx19(
|
|
1324
1420
|
Animated7.View,
|
|
1325
1421
|
{
|
|
1326
1422
|
testID,
|
|
@@ -1335,10 +1431,10 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1335
1431
|
|
|
1336
1432
|
// src/native/spinner.tsx
|
|
1337
1433
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1338
|
-
import { jsx as
|
|
1434
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1339
1435
|
function Spinner({ label, size = "md", ...props }) {
|
|
1340
1436
|
const { theme } = useTheme();
|
|
1341
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ jsx20(
|
|
1342
1438
|
ActivityIndicator2,
|
|
1343
1439
|
{
|
|
1344
1440
|
accessible: true,
|
|
@@ -1353,9 +1449,9 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
1353
1449
|
}
|
|
1354
1450
|
|
|
1355
1451
|
// src/native/toast.tsx
|
|
1356
|
-
import * as
|
|
1357
|
-
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Pressable as
|
|
1358
|
-
import { Fragment as Fragment3, jsx as
|
|
1452
|
+
import * as React12 from "react";
|
|
1453
|
+
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Pressable as Pressable7, StyleSheet as StyleSheet13, Text as Text8, View as View14 } from "react-native";
|
|
1454
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1359
1455
|
var items = [];
|
|
1360
1456
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
1361
1457
|
var counter = 0;
|
|
@@ -1390,76 +1486,76 @@ var toast = Object.assign(show, {
|
|
|
1390
1486
|
function ToastView({ item, closeLabel, duration }) {
|
|
1391
1487
|
const { theme, radius: radius3 } = useTheme();
|
|
1392
1488
|
const reduce = useReducedMotion();
|
|
1393
|
-
const [enter] =
|
|
1394
|
-
|
|
1489
|
+
const [enter] = React12.useState(() => new Animated8.Value(reduce ? 1 : 0));
|
|
1490
|
+
React12.useEffect(() => {
|
|
1395
1491
|
if (reduce) enter.setValue(1);
|
|
1396
1492
|
else Animated8.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
1397
1493
|
}, [enter, reduce]);
|
|
1398
|
-
|
|
1494
|
+
React12.useEffect(() => {
|
|
1399
1495
|
AccessibilityInfo5.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
1400
1496
|
}, [item.title, item.description]);
|
|
1401
1497
|
const ms = item.duration ?? duration;
|
|
1402
|
-
|
|
1498
|
+
React12.useEffect(() => {
|
|
1403
1499
|
if (!Number.isFinite(ms)) return;
|
|
1404
1500
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
1405
1501
|
return () => clearTimeout(timer2);
|
|
1406
1502
|
}, [item.id, ms]);
|
|
1407
1503
|
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__ */
|
|
1504
|
+
const text = /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1505
|
+
item.icon ? /* @__PURE__ */ jsx21(View14, { "aria-hidden": true, children: item.icon }) : null,
|
|
1506
|
+
/* @__PURE__ */ jsxs14(View14, { style: styles13.content, children: [
|
|
1507
|
+
/* @__PURE__ */ jsx21(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
1508
|
+
item.description ? /* @__PURE__ */ jsx21(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
1413
1509
|
] })
|
|
1414
1510
|
] });
|
|
1415
|
-
const body = /* @__PURE__ */
|
|
1416
|
-
item.onPress ? /* @__PURE__ */
|
|
1417
|
-
|
|
1511
|
+
const body = /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1512
|
+
item.onPress ? /* @__PURE__ */ jsx21(
|
|
1513
|
+
Pressable7,
|
|
1418
1514
|
{
|
|
1419
1515
|
role: "button",
|
|
1420
1516
|
onPress: () => {
|
|
1421
1517
|
item.onPress?.();
|
|
1422
1518
|
dismiss(item.id);
|
|
1423
1519
|
},
|
|
1424
|
-
style: ({ pressed }) => [
|
|
1520
|
+
style: ({ pressed }) => [styles13.main, { opacity: pressed ? 0.8 : 1 }],
|
|
1425
1521
|
children: text
|
|
1426
1522
|
}
|
|
1427
|
-
) : /* @__PURE__ */
|
|
1428
|
-
item.action ? /* @__PURE__ */
|
|
1429
|
-
|
|
1523
|
+
) : /* @__PURE__ */ jsx21(View14, { style: styles13.main, children: text }),
|
|
1524
|
+
item.action ? /* @__PURE__ */ jsx21(
|
|
1525
|
+
Pressable7,
|
|
1430
1526
|
{
|
|
1431
1527
|
role: "button",
|
|
1432
1528
|
onPress: () => {
|
|
1433
1529
|
item.action?.onPress();
|
|
1434
1530
|
dismiss(item.id);
|
|
1435
1531
|
},
|
|
1436
|
-
style: [
|
|
1437
|
-
children: /* @__PURE__ */
|
|
1532
|
+
style: [styles13.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
1533
|
+
children: /* @__PURE__ */ jsx21(Text8, { style: [styles13.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
1438
1534
|
}
|
|
1439
1535
|
) : null,
|
|
1440
|
-
/* @__PURE__ */
|
|
1536
|
+
/* @__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
1537
|
] });
|
|
1442
1538
|
const frame = [
|
|
1443
|
-
|
|
1539
|
+
styles13.toast,
|
|
1444
1540
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
1445
1541
|
];
|
|
1446
1542
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }] };
|
|
1447
|
-
return /* @__PURE__ */
|
|
1543
|
+
return /* @__PURE__ */ jsx21(Animated8.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx21(View14, { style: frame, children: body }) });
|
|
1448
1544
|
}
|
|
1449
1545
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
1450
|
-
const all =
|
|
1546
|
+
const all = React12.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
1451
1547
|
const shown = all.slice(-max);
|
|
1452
1548
|
if (shown.length === 0) return null;
|
|
1453
|
-
return /* @__PURE__ */
|
|
1549
|
+
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
1550
|
}
|
|
1455
|
-
var
|
|
1551
|
+
var styles13 = StyleSheet13.create({
|
|
1456
1552
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
1457
1553
|
toast: {
|
|
1458
1554
|
flexDirection: "row",
|
|
1459
1555
|
alignItems: "center",
|
|
1460
1556
|
gap: 10,
|
|
1461
1557
|
padding: 12,
|
|
1462
|
-
borderWidth:
|
|
1558
|
+
borderWidth: StyleSheet13.hairlineWidth,
|
|
1463
1559
|
borderLeftWidth: 4,
|
|
1464
1560
|
shadowOpacity: 0.3,
|
|
1465
1561
|
shadowRadius: 16,
|
|
@@ -1496,8 +1592,10 @@ export {
|
|
|
1496
1592
|
Mascot,
|
|
1497
1593
|
OrazakaMark,
|
|
1498
1594
|
OrochiaMark,
|
|
1595
|
+
Pagination,
|
|
1499
1596
|
ProductMark,
|
|
1500
1597
|
Progress,
|
|
1598
|
+
SearchField,
|
|
1501
1599
|
Segmented,
|
|
1502
1600
|
Skeleton,
|
|
1503
1601
|
Spinner,
|