@devalok/shilp-sutra 0.56.0 → 0.59.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/MIGRATION.md +198 -0
- package/dist/_chunks/badge-group.js +75 -174
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +270 -253
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +1 -1
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/emoji-suggestion.js +1 -1
- package/dist/_chunks/emoji-suggestion.js.map +1 -1
- package/dist/_chunks/image-preview.js +71 -70
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +2 -2
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/motion-preference.js +15 -0
- package/dist/_chunks/motion-preference.js.map +1 -0
- package/dist/_chunks/motion-provider.js +1 -1
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/oauth-button.js +1 -1
- package/dist/_chunks/oauth-button.js.map +1 -1
- package/dist/_chunks/popover.js +50 -49
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives-internal.js +29 -29
- package/dist/_chunks/primitives-internal.js.map +1 -1
- package/dist/_chunks/shared.js +48 -47
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +36 -36
- package/dist/_chunks/success.js.map +1 -1
- package/dist/_chunks/tree-view.js +1 -1
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/_chunks/use-calendar.js +4 -4
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/ai/block-renderer.js +8 -8
- package/dist/ai/blocks/text.js +1 -1
- package/dist/ai/blocks/text.js.map +1 -1
- package/dist/ai/command-bar.js +67 -67
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +35 -35
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/index.js +4 -4
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +109 -108
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/avatar-group.d.ts +7 -2
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +3 -3
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/command-palette.js +137 -137
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.js +2 -2
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/index.js +9 -9
- package/dist/composed/date-picker/index.js.map +1 -1
- package/dist/composed/diff.d.ts +23 -2
- package/dist/composed/diff.d.ts.map +1 -1
- package/dist/composed/diff.js +341 -260
- package/dist/composed/diff.js.map +1 -1
- package/dist/composed/emoji-picker.js +3 -3
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.js +4 -4
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +152 -151
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +53 -52
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +38 -37
- package/dist/composed/form-section.js.map +1 -1
- package/dist/composed/inline-edit.js +1 -1
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/composed/loading-skeleton.js +3 -3
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +1 -1
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/member-picker.js +1 -1
- package/dist/composed/member-picker.js.map +1 -1
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +109 -108
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/page-skeletons.js +4 -4
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/responsive-modal.js +1 -1
- package/dist/composed/responsive-modal.js.map +1 -1
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +473 -472
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.js +6 -6
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.js +5 -5
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +29 -28
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -3
- package/dist/hooks/use-container-size.d.ts +18 -0
- package/dist/hooks/use-container-size.d.ts.map +1 -0
- package/dist/hooks/use-container-size.js +28 -0
- package/dist/hooks/use-container-size.js.map +1 -0
- package/dist/motion/index.d.ts +1 -0
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +2 -15
- package/dist/motion/motion-preference.d.ts +36 -0
- package/dist/motion/motion-preference.d.ts.map +1 -0
- package/dist/motion/motion-provider.d.ts +2 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/motion/primitives-index.js +103 -102
- package/dist/motion/primitives-index.js.map +1 -1
- package/dist/motion/primitives.d.ts.map +1 -1
- package/dist/shell/app-shell.d.ts +101 -0
- package/dist/shell/app-shell.d.ts.map +1 -0
- package/dist/shell/app-shell.js +76 -0
- package/dist/shell/app-shell.js.map +1 -0
- package/dist/shell/bottom-navbar.js +21 -21
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +6 -5
- package/dist/shell/notification-center.d.ts +17 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +110 -105
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.js +1 -1
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/top-bar.js +7 -7
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/generate-scale.d.ts +49 -0
- package/dist/tokens/generate-scale.d.ts.map +1 -1
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/palettes.css +292 -0
- package/dist/tokens/primitives.css +29 -26
- package/dist/tokens/semantic.css +170 -47
- package/dist/tokens/shilp-sutra.css +1 -0
- package/dist/tokens/utilities.css +10 -7
- package/dist/tokens/variants.css +1 -1
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +27 -26
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +60 -59
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +55 -113
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/autocomplete.js +80 -80
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +71 -70
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.d.ts +4 -8
- package/dist/ui/badge-indicator.d.ts.map +1 -1
- package/dist/ui/badge-indicator.js +3 -8
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +55 -34
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +43 -41
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +3 -23
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +10 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +79 -212
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +78 -75
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.js +1 -1
- package/dist/ui/charts/radar-chart.js.map +1 -1
- package/dist/ui/chat/date-separator.d.ts +8 -1
- package/dist/ui/chat/date-separator.d.ts.map +1 -1
- package/dist/ui/chat/message-list.d.ts.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.js +2 -2
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +151 -150
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/combobox.d.ts +14 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +156 -152
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +70 -69
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.d.ts +3 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +93 -92
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.d.ts +7 -1
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -1
- package/dist/ui/data-table-bulk-actions.js +14 -8
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +66 -47
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +4 -0
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js +2 -2
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.map +1 -1
- package/dist/ui/data-table-header.js +50 -46
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js +3 -3
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/data-table-toolbar.d.ts +11 -1
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +7 -7
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/data-table.d.ts +52 -5
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +181 -169
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +62 -61
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dot.d.ts.map +1 -1
- package/dist/ui/dot.js +10 -41
- package/dist/ui/dot.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +79 -78
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +117 -116
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +27 -26
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +26 -25
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon.js +7 -7
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.js +8 -8
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +73 -72
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +80 -79
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-input.js +3 -3
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +2 -2
- package/dist/ui/progress-ring.js.map +1 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +82 -74
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +32 -31
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +28 -27
- package/dist/ui/search-input.js.map +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +67 -66
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +14 -14
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/slider.d.ts +63 -9
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +75 -33
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/split-button.d.ts +8 -2
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +49 -95
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +89 -88
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/stat-flash.js +16 -16
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +63 -62
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/surface.d.ts.map +1 -1
- package/dist/ui/surface.js +2 -2
- package/dist/ui/surface.js.map +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.js +3 -3
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +68 -67
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.js +5 -5
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +196 -195
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +26 -24
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +37 -36
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/docs/components/composed/avatar-group.md +4 -4
- package/docs/components/composed/diff.md +10 -2
- package/docs/components/composed/schedule-view.md +1 -1
- package/docs/components/shell/app-shell.md +132 -0
- package/docs/components/ui/avatar.md +1 -1
- package/docs/components/ui/button.md +1 -1
- package/docs/components/ui/chat.md +7 -1
- package/docs/components/ui/color-swatch.md +1 -1
- package/docs/components/ui/data-table-toolbar.md +6 -2
- package/docs/components/ui/data-table.md +41 -7
- package/docs/components/ui/dot.md +1 -1
- package/docs/components/ui/progress.md +1 -0
- package/docs/components/ui/surface.md +3 -3
- package/docs/components/ui/table.md +2 -2
- package/docs/recipes/customize-brand.md +58 -0
- package/docs/recipes/install-astro.md +1 -0
- package/docs/recipes/install-next-app-router.md +1 -0
- package/docs/recipes/install-next-pages.md +22 -1
- package/docs/recipes/install-remix.md +1 -0
- package/docs/recipes/install-tanstack-start.md +1 -0
- package/docs/recipes/install-vite.md +2 -0
- package/docs/recipes/server-components.md +7 -4
- package/docs/recipes/troubleshoot.md +1 -0
- package/llms.txt +2 -1
- package/make-kit/Guidelines.md +2 -2
- package/make-kit/components/button.md +1 -1
- package/make-kit/components/card.md +6 -6
- package/make-kit/components/surface.md +4 -4
- package/make-kit/foundations/color.md +4 -4
- package/make-kit/foundations/dark-mode.md +1 -1
- package/make-kit/foundations/radius.md +1 -1
- package/make-kit/foundations/surfaces.md +9 -9
- package/mcp-manifest.json +358 -35
- package/package.json +8 -4
- package/skill/SKILL.md +12 -6
- package/skill/references/components.md +2 -1
- package/skill/references/customize-brand.md +58 -0
- package/skill/references/server-components.md +7 -4
- package/skill/references/setup-astro.md +1 -0
- package/skill/references/setup-next-app-router.md +1 -0
- package/skill/references/setup-next-pages.md +22 -1
- package/skill/references/setup-remix.md +1 -0
- package/skill/references/setup-tanstack-start.md +1 -0
- package/skill/references/setup-vite.md +2 -0
- package/skill/references/troubleshoot.md +1 -0
- package/dist/motion/check-motion-provider.d.ts +0 -2
- package/dist/motion/check-motion-provider.d.ts.map +0 -1
- package/dist/motion/index.js.map +0 -1
- package/dist/primitives/react-toast.d.ts +0 -120
- package/dist/ui/charts/_internal/scales.d.ts +0 -5
- package/dist/ui/charts/_internal/scales.d.ts.map +0 -1
- package/dist/ui/lib/slot.d.ts +0 -8
- package/dist/ui/lib/slot.d.ts.map +0 -1
package/dist/ui/toast.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { springs as e, tweens as t } from "./lib/motion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { MotionPreference as n } from "../_chunks/motion-preference.js";
|
|
4
|
+
import { cn as r } from "./lib/utils.js";
|
|
5
|
+
import { Spinner as i } from "./spinner.js";
|
|
6
|
+
import { Icon as a } from "./icon.js";
|
|
7
|
+
import { Progress as o } from "./progress.js";
|
|
8
|
+
import { assertToasterMounted as s } from "./toast-registry.js";
|
|
9
|
+
import * as c from "react";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
import { IconAlertCircle as d, IconAlertTriangle as f, IconCheck as p, IconCircleCheck as m, IconCircleX as h, IconFile as g, IconInfoCircle as _, IconPhoto as v, IconRefresh as y, IconUpload as b, IconX as x } from "@tabler/icons-react";
|
|
12
|
+
import { AnimatePresence as S, motion as C } from "framer-motion";
|
|
13
|
+
import { toast as w } from "sonner";
|
|
13
14
|
//#region src/ui/toast.tsx
|
|
14
|
-
var
|
|
15
|
+
var T = 5e3, E = 8e3, D = 3e3, O = {
|
|
15
16
|
message: {
|
|
16
17
|
accentClass: "",
|
|
17
18
|
iconClass: "",
|
|
@@ -21,25 +22,25 @@ var w = 5e3, T = 8e3, E = 3e3, D = {
|
|
|
21
22
|
success: {
|
|
22
23
|
accentClass: "bg-success-9",
|
|
23
24
|
iconClass: "text-success-11",
|
|
24
|
-
icon:
|
|
25
|
+
icon: m,
|
|
25
26
|
timerBarClass: "bg-success-9"
|
|
26
27
|
},
|
|
27
28
|
error: {
|
|
28
29
|
accentClass: "bg-error-9",
|
|
29
30
|
iconClass: "text-error-11",
|
|
30
|
-
icon:
|
|
31
|
+
icon: h,
|
|
31
32
|
timerBarClass: "bg-error-9"
|
|
32
33
|
},
|
|
33
34
|
warning: {
|
|
34
35
|
accentClass: "bg-warning-9",
|
|
35
36
|
iconClass: "text-warning-11",
|
|
36
|
-
icon:
|
|
37
|
+
icon: f,
|
|
37
38
|
timerBarClass: "bg-warning-9"
|
|
38
39
|
},
|
|
39
40
|
info: {
|
|
40
41
|
accentClass: "bg-info-9",
|
|
41
42
|
iconClass: "text-info-11",
|
|
42
|
-
icon:
|
|
43
|
+
icon: _,
|
|
43
44
|
timerBarClass: "bg-info-9"
|
|
44
45
|
},
|
|
45
46
|
loading: {
|
|
@@ -49,57 +50,57 @@ var w = 5e3, T = 8e3, E = 3e3, D = {
|
|
|
49
50
|
timerBarClass: "bg-accent-9"
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
function
|
|
53
|
-
let i =
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
function k({ duration: e, type: t, paused: n }) {
|
|
54
|
+
let i = O[t];
|
|
55
|
+
return /* @__PURE__ */ l("div", {
|
|
55
56
|
className: "absolute bottom-0 left-0 right-0 h-ds-01 overflow-hidden",
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
-
className:
|
|
57
|
+
children: /* @__PURE__ */ l("div", {
|
|
58
|
+
className: r("h-full w-full origin-left opacity-30", i.timerBarClass, "motion-safe:animate-timer-bar"),
|
|
58
59
|
style: {
|
|
59
60
|
animationDuration: `${e}ms`,
|
|
60
|
-
animationPlayState:
|
|
61
|
+
animationPlayState: n ? "paused" : "running"
|
|
61
62
|
}
|
|
62
63
|
})
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
let [
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
let e = Date.now() -
|
|
71
|
-
|
|
66
|
+
function A({ type: o, title: s, description: d, action: f, cancel: p, duration: m = T, showTimerBar: h = !0, showAccent: g = !1, selfDismissId: _ }) {
|
|
67
|
+
let [v, y] = c.useState(!1), [b, x] = c.useState(!1), E = v || b, D = O[o], A = D.icon, j = c.useRef(m), M = c.useRef(0);
|
|
68
|
+
c.useEffect(() => {
|
|
69
|
+
if (_ == null || m === Infinity) return;
|
|
70
|
+
if (E) {
|
|
71
|
+
let e = Date.now() - M.current;
|
|
72
|
+
j.current = Math.max(0, j.current - e);
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
M.current = Date.now();
|
|
75
76
|
let e = setTimeout(() => {
|
|
76
|
-
|
|
77
|
-
},
|
|
77
|
+
w.dismiss(_);
|
|
78
|
+
}, j.current);
|
|
78
79
|
return () => clearTimeout(e);
|
|
79
80
|
}, [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
_,
|
|
82
|
+
m,
|
|
83
|
+
E
|
|
83
84
|
]);
|
|
84
|
-
let
|
|
85
|
-
return /* @__PURE__ */ l(
|
|
85
|
+
let N = o === "error";
|
|
86
|
+
return /* @__PURE__ */ l(n, { children: /* @__PURE__ */ u(C.div, {
|
|
86
87
|
layout: "position",
|
|
87
|
-
role:
|
|
88
|
-
"aria-live":
|
|
88
|
+
role: N ? "alert" : "status",
|
|
89
|
+
"aria-live": N ? "assertive" : "polite",
|
|
89
90
|
"aria-atomic": "true",
|
|
90
|
-
className:
|
|
91
|
-
onMouseEnter: () =>
|
|
92
|
-
onMouseLeave: () =>
|
|
93
|
-
onFocusCapture: () =>
|
|
94
|
-
onBlurCapture: () =>
|
|
91
|
+
className: r("group relative flex w-full overflow-hidden rounded-overlay-sm bg-surface-overlay shadow-floating", o === "error" && "bg-error-2"),
|
|
92
|
+
onMouseEnter: () => y(!0),
|
|
93
|
+
onMouseLeave: () => y(!1),
|
|
94
|
+
onFocusCapture: () => x(!0),
|
|
95
|
+
onBlurCapture: () => x(!1),
|
|
95
96
|
transition: e.smooth,
|
|
96
97
|
children: [
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
g && D.accentClass && /* @__PURE__ */ l("div", { className: r("w-1 shrink-0 rounded-l-overlay-sm", D.accentClass) }),
|
|
99
|
+
/* @__PURE__ */ u("div", {
|
|
99
100
|
className: "flex min-w-0 flex-1 items-start gap-ds-03 p-ds-04",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ l(S, {
|
|
101
102
|
mode: "wait",
|
|
102
|
-
children:
|
|
103
|
+
children: o === "loading" ? /* @__PURE__ */ l(C.div, {
|
|
103
104
|
initial: {
|
|
104
105
|
opacity: 0,
|
|
105
106
|
scale: .5
|
|
@@ -114,11 +115,11 @@ function k({ type: a, title: o, description: u, action: d, cancel: f, duration:
|
|
|
114
115
|
},
|
|
115
116
|
transition: t.fade,
|
|
116
117
|
className: "mt-0.5 shrink-0",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ l(i, {
|
|
118
119
|
size: "sm",
|
|
119
120
|
className: "h-4 w-4"
|
|
120
121
|
})
|
|
121
|
-
}, "loading") :
|
|
122
|
+
}, "loading") : A ? /* @__PURE__ */ l(C.div, {
|
|
122
123
|
initial: {
|
|
123
124
|
opacity: 0,
|
|
124
125
|
scale: .5
|
|
@@ -133,49 +134,49 @@ function k({ type: a, title: o, description: u, action: d, cancel: f, duration:
|
|
|
133
134
|
},
|
|
134
135
|
transition: e.bouncy,
|
|
135
136
|
className: "mt-0.5 shrink-0",
|
|
136
|
-
children: /* @__PURE__ */
|
|
137
|
-
icon:
|
|
137
|
+
children: /* @__PURE__ */ l(a, {
|
|
138
|
+
icon: A,
|
|
138
139
|
size: "sm",
|
|
139
|
-
className:
|
|
140
|
+
className: D.iconClass
|
|
140
141
|
})
|
|
141
|
-
},
|
|
142
|
-
}), /* @__PURE__ */
|
|
142
|
+
}, o) : null
|
|
143
|
+
}), /* @__PURE__ */ u("div", {
|
|
143
144
|
className: "min-w-0 flex-1",
|
|
144
145
|
children: [
|
|
145
|
-
|
|
146
|
+
s && /* @__PURE__ */ l("p", {
|
|
146
147
|
className: "text-body-md font-semibold text-surface-fg",
|
|
147
|
-
children:
|
|
148
|
+
children: s
|
|
148
149
|
}),
|
|
149
|
-
|
|
150
|
-
className:
|
|
151
|
-
children:
|
|
150
|
+
d && /* @__PURE__ */ l("p", {
|
|
151
|
+
className: r("text-body-sm text-surface-fg-muted", s && "mt-0.5"),
|
|
152
|
+
children: d
|
|
152
153
|
}),
|
|
153
|
-
(
|
|
154
|
+
(f || p) && /* @__PURE__ */ u("div", {
|
|
154
155
|
className: "mt-ds-03 flex items-center gap-ds-03",
|
|
155
|
-
children: [
|
|
156
|
-
type: "button",
|
|
157
|
-
onClick: d.onClick,
|
|
158
|
-
className: "text-body-sm font-medium text-accent-11 underline-offset-2 hover:underline hover:bg-surface-raised-hover rounded-control-inner px-ds-02 py-ds-01 transition-[color,background-color] duration-fast-01 ease-productive-standard focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-control-inner",
|
|
159
|
-
children: d.label
|
|
160
|
-
}), f && /* @__PURE__ */ c("button", {
|
|
156
|
+
children: [f && /* @__PURE__ */ l("button", {
|
|
161
157
|
type: "button",
|
|
162
158
|
onClick: f.onClick,
|
|
163
|
-
className: "text-body-sm text-
|
|
159
|
+
className: "text-body-sm font-medium text-accent-11 underline-offset-2 hover:underline hover:bg-surface-panel-hover rounded-control-inner px-ds-02 py-ds-01 transition-[color,background-color] duration-fast-01 ease-productive-standard focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-control-inner",
|
|
164
160
|
children: f.label
|
|
161
|
+
}), p && /* @__PURE__ */ l("button", {
|
|
162
|
+
type: "button",
|
|
163
|
+
onClick: p.onClick,
|
|
164
|
+
className: "text-body-sm text-surface-fg-muted hover:text-surface-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:rounded-control-inner",
|
|
165
|
+
children: p.label
|
|
165
166
|
})]
|
|
166
167
|
})
|
|
167
168
|
]
|
|
168
169
|
})]
|
|
169
170
|
}),
|
|
170
|
-
|
|
171
|
-
duration:
|
|
172
|
-
type:
|
|
173
|
-
paused:
|
|
171
|
+
h && o !== "loading" && /* @__PURE__ */ l(k, {
|
|
172
|
+
duration: m,
|
|
173
|
+
type: o,
|
|
174
|
+
paused: E
|
|
174
175
|
})
|
|
175
176
|
]
|
|
176
|
-
});
|
|
177
|
+
}) });
|
|
177
178
|
}
|
|
178
|
-
var
|
|
179
|
+
var j = /* @__PURE__ */ new Set([
|
|
179
180
|
"jpg",
|
|
180
181
|
"jpeg",
|
|
181
182
|
"png",
|
|
@@ -186,19 +187,19 @@ var A = /* @__PURE__ */ new Set([
|
|
|
186
187
|
"ico",
|
|
187
188
|
"avif"
|
|
188
189
|
]);
|
|
189
|
-
function
|
|
190
|
+
function M(e) {
|
|
190
191
|
if (e.previewUrl) return !0;
|
|
191
192
|
let t = e.name.split(".").pop()?.toLowerCase() ?? "";
|
|
192
|
-
return
|
|
193
|
+
return j.has(t);
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function N(e) {
|
|
195
196
|
switch (e) {
|
|
196
197
|
case "complete": return "success";
|
|
197
198
|
case "error": return "error";
|
|
198
199
|
default: return "accent";
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
+
function P(e) {
|
|
202
203
|
switch (e.status) {
|
|
203
204
|
case "pending": return 0;
|
|
204
205
|
case "uploading": return e.progress ?? 0;
|
|
@@ -207,12 +208,12 @@ function N(e) {
|
|
|
207
208
|
case "error": return e.progress ?? 0;
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
+
function F(e) {
|
|
211
212
|
return !e || e < 0 || !Number.isFinite(e) ? "0 B" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
212
213
|
}
|
|
213
|
-
function
|
|
214
|
-
let
|
|
215
|
-
return /* @__PURE__ */ l(
|
|
214
|
+
function I({ file: r, onRetry: s, onRemove: c }) {
|
|
215
|
+
let f = r.status === "complete" || r.status === "error", m = r.status === "uploading" || r.status === "processing";
|
|
216
|
+
return /* @__PURE__ */ l(n, { children: /* @__PURE__ */ u(C.div, {
|
|
216
217
|
layout: !0,
|
|
217
218
|
className: "flex items-center gap-ds-02 py-1",
|
|
218
219
|
initial: !1,
|
|
@@ -227,11 +228,11 @@ function F({ file: n, onRetry: o, onRemove: s }) {
|
|
|
227
228
|
},
|
|
228
229
|
transition: e.snappy,
|
|
229
230
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ l("div", {
|
|
231
232
|
className: "flex h-5 w-5 shrink-0 items-center justify-center",
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ l(S, {
|
|
233
234
|
mode: "wait",
|
|
234
|
-
children:
|
|
235
|
+
children: r.status === "complete" ? /* @__PURE__ */ l(C.div, {
|
|
235
236
|
initial: {
|
|
236
237
|
opacity: 0,
|
|
237
238
|
scale: .5
|
|
@@ -245,12 +246,12 @@ function F({ file: n, onRetry: o, onRemove: s }) {
|
|
|
245
246
|
scale: .5
|
|
246
247
|
},
|
|
247
248
|
transition: e.bouncy,
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
icon:
|
|
249
|
+
children: /* @__PURE__ */ l(a, {
|
|
250
|
+
icon: p,
|
|
250
251
|
size: "xs",
|
|
251
252
|
className: "text-success-11"
|
|
252
253
|
})
|
|
253
|
-
}, "complete") :
|
|
254
|
+
}, "complete") : r.status === "error" ? /* @__PURE__ */ l(C.div, {
|
|
254
255
|
initial: {
|
|
255
256
|
opacity: 0,
|
|
256
257
|
scale: .5
|
|
@@ -264,128 +265,128 @@ function F({ file: n, onRetry: o, onRemove: s }) {
|
|
|
264
265
|
scale: .5
|
|
265
266
|
},
|
|
266
267
|
transition: t.fade,
|
|
267
|
-
children: /* @__PURE__ */
|
|
268
|
-
icon:
|
|
268
|
+
children: /* @__PURE__ */ l(a, {
|
|
269
|
+
icon: d,
|
|
269
270
|
size: "xs",
|
|
270
271
|
className: "text-error-11"
|
|
271
272
|
})
|
|
272
|
-
}, "error") :
|
|
273
|
+
}, "error") : r.status === "processing" ? /* @__PURE__ */ l(C.div, {
|
|
273
274
|
initial: { opacity: 0 },
|
|
274
275
|
animate: { opacity: 1 },
|
|
275
276
|
exit: { opacity: 0 },
|
|
276
277
|
transition: t.fade,
|
|
277
|
-
children: /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ l(i, {
|
|
278
279
|
size: "sm",
|
|
279
280
|
className: "h-3.5 w-3.5"
|
|
280
281
|
})
|
|
281
|
-
}, "processing") :
|
|
282
|
+
}, "processing") : M(r) ? /* @__PURE__ */ l(C.div, {
|
|
282
283
|
initial: { opacity: 0 },
|
|
283
284
|
animate: { opacity: 1 },
|
|
284
285
|
exit: { opacity: 0 },
|
|
285
286
|
transition: t.fade,
|
|
286
|
-
children: /* @__PURE__ */
|
|
287
|
-
icon:
|
|
287
|
+
children: /* @__PURE__ */ l(a, {
|
|
288
|
+
icon: v,
|
|
288
289
|
size: "xs",
|
|
289
290
|
className: "text-surface-fg-muted"
|
|
290
291
|
})
|
|
291
|
-
}, "image") : /* @__PURE__ */
|
|
292
|
+
}, "image") : /* @__PURE__ */ l(C.div, {
|
|
292
293
|
initial: { opacity: 0 },
|
|
293
294
|
animate: { opacity: 1 },
|
|
294
295
|
exit: { opacity: 0 },
|
|
295
296
|
transition: t.fade,
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
icon:
|
|
297
|
+
children: /* @__PURE__ */ l(a, {
|
|
298
|
+
icon: g,
|
|
298
299
|
size: "xs",
|
|
299
300
|
className: "text-surface-fg-muted"
|
|
300
301
|
})
|
|
301
302
|
}, "file")
|
|
302
303
|
})
|
|
303
304
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ l("span", {
|
|
305
306
|
className: "min-w-0 flex-1 truncate text-body-xs text-surface-fg",
|
|
306
|
-
children:
|
|
307
|
+
children: r.name
|
|
307
308
|
}),
|
|
308
|
-
|
|
309
|
+
m ? /* @__PURE__ */ u("div", {
|
|
309
310
|
className: "flex w-16 items-center gap-1",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ l(o, {
|
|
311
312
|
size: "sm",
|
|
312
|
-
color:
|
|
313
|
-
value:
|
|
313
|
+
color: N(r.status),
|
|
314
|
+
value: P(r),
|
|
314
315
|
className: "flex-1"
|
|
315
|
-
}),
|
|
316
|
+
}), r.progress !== void 0 && /* @__PURE__ */ u("span", {
|
|
316
317
|
className: "shrink-0 text-caption tabular-nums text-surface-fg-muted",
|
|
317
|
-
children: [
|
|
318
|
+
children: [r.progress, "%"]
|
|
318
319
|
})]
|
|
319
|
-
}) :
|
|
320
|
+
}) : r.status === "complete" ? /* @__PURE__ */ l("span", {
|
|
320
321
|
className: "text-body-xs text-success-11",
|
|
321
322
|
children: "Done"
|
|
322
|
-
}) :
|
|
323
|
+
}) : r.status === "error" ? /* @__PURE__ */ l("span", {
|
|
323
324
|
className: "max-w-[60px] truncate text-body-xs text-error-11",
|
|
324
|
-
children:
|
|
325
|
-
}) : /* @__PURE__ */
|
|
325
|
+
children: r.error || "Failed"
|
|
326
|
+
}) : /* @__PURE__ */ l("span", {
|
|
326
327
|
className: "text-caption text-surface-fg-muted",
|
|
327
|
-
children:
|
|
328
|
+
children: F(r.size)
|
|
328
329
|
}),
|
|
329
|
-
|
|
330
|
+
r.status === "error" && s && /* @__PURE__ */ l("button", {
|
|
330
331
|
type: "button",
|
|
331
|
-
onClick: () =>
|
|
332
|
+
onClick: () => s(r.id),
|
|
332
333
|
className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-control-inner text-surface-fg-muted hover:text-surface-fg",
|
|
333
|
-
"aria-label": `Retry ${
|
|
334
|
+
"aria-label": `Retry ${r.name}`,
|
|
334
335
|
title: "Retry",
|
|
335
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ l(y, { className: "h-3.5 w-3.5" })
|
|
336
337
|
}),
|
|
337
|
-
!
|
|
338
|
+
!f && c && /* @__PURE__ */ l("button", {
|
|
338
339
|
type: "button",
|
|
339
|
-
onClick: () =>
|
|
340
|
+
onClick: () => c(r.id),
|
|
340
341
|
className: "touch-target flex min-h-6 min-w-6 items-center justify-center rounded-control-inner text-surface-fg-muted hover:text-surface-fg",
|
|
341
|
-
"aria-label": `Cancel ${
|
|
342
|
+
"aria-label": `Cancel ${r.name}`,
|
|
342
343
|
title: "Remove",
|
|
343
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ l(x, { className: "h-3.5 w-3.5" })
|
|
344
345
|
})
|
|
345
346
|
]
|
|
346
|
-
});
|
|
347
|
+
}) });
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
-
let [
|
|
350
|
-
|
|
351
|
-
if (
|
|
352
|
-
if (
|
|
353
|
-
let e = Date.now() -
|
|
354
|
-
|
|
349
|
+
function L({ files: i, onRetry: o, onRemove: s, selfDismissId: f, showAccent: m = !1 }) {
|
|
350
|
+
let [h, g] = c.useState(!1), [_, v] = c.useState(!1), y = h || _, x = i.filter((e) => e.status === "complete").length, T = i.filter((e) => e.status === "error").length, E = i.every((e) => e.status === "complete" || e.status === "error"), O = c.useRef(D), A = c.useRef(0);
|
|
351
|
+
c.useEffect(() => {
|
|
352
|
+
if (f == null || !E) return;
|
|
353
|
+
if (y) {
|
|
354
|
+
let e = Date.now() - A.current;
|
|
355
|
+
O.current = Math.max(0, O.current - e);
|
|
355
356
|
return;
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
+
A.current = Date.now();
|
|
358
359
|
let e = setTimeout(() => {
|
|
359
|
-
|
|
360
|
-
},
|
|
360
|
+
w.dismiss(f);
|
|
361
|
+
}, O.current);
|
|
361
362
|
return () => clearTimeout(e);
|
|
362
363
|
}, [
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
f,
|
|
365
|
+
E,
|
|
366
|
+
y
|
|
366
367
|
]);
|
|
367
|
-
let
|
|
368
|
-
return /* @__PURE__ */ l(
|
|
368
|
+
let j = E ? T > 0 ? "bg-error-7" : "bg-success-7" : "bg-accent-9", M = E ? T > 0 ? "error" : "success" : "loading", N = E && T > 0;
|
|
369
|
+
return /* @__PURE__ */ l(n, { children: /* @__PURE__ */ u(C.div, {
|
|
369
370
|
layout: !0,
|
|
370
|
-
role:
|
|
371
|
-
"aria-live":
|
|
371
|
+
role: N ? "alert" : "status",
|
|
372
|
+
"aria-live": N ? "assertive" : "polite",
|
|
372
373
|
"aria-label": "File uploads",
|
|
373
|
-
className:
|
|
374
|
-
onMouseEnter: () =>
|
|
375
|
-
onMouseLeave: () =>
|
|
376
|
-
onFocusCapture: () =>
|
|
377
|
-
onBlurCapture: () =>
|
|
374
|
+
className: r("group relative flex w-full overflow-hidden rounded-overlay-sm bg-surface-overlay shadow-floating", N && "bg-error-2"),
|
|
375
|
+
onMouseEnter: () => g(!0),
|
|
376
|
+
onMouseLeave: () => g(!1),
|
|
377
|
+
onFocusCapture: () => v(!0),
|
|
378
|
+
onBlurCapture: () => v(!1),
|
|
378
379
|
transition: e.smooth,
|
|
379
380
|
children: [
|
|
380
|
-
|
|
381
|
-
/* @__PURE__ */
|
|
381
|
+
m && /* @__PURE__ */ l("div", { className: r("w-1 shrink-0 rounded-l-overlay-sm", j) }),
|
|
382
|
+
/* @__PURE__ */ u("div", {
|
|
382
383
|
className: "min-w-0 flex-1 p-ds-04",
|
|
383
384
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ u("div", {
|
|
385
386
|
className: "flex items-center gap-ds-02",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ l(S, {
|
|
387
388
|
mode: "wait",
|
|
388
|
-
children:
|
|
389
|
+
children: E ? T > 0 ? /* @__PURE__ */ l(C.div, {
|
|
389
390
|
initial: {
|
|
390
391
|
opacity: 0,
|
|
391
392
|
scale: .5
|
|
@@ -399,12 +400,12 @@ function I({ files: r, onRetry: a, onRemove: o, selfDismissId: d, showAccent: p
|
|
|
399
400
|
scale: .5
|
|
400
401
|
},
|
|
401
402
|
transition: e.bouncy,
|
|
402
|
-
children: /* @__PURE__ */
|
|
403
|
-
icon:
|
|
403
|
+
children: /* @__PURE__ */ l(a, {
|
|
404
|
+
icon: d,
|
|
404
405
|
size: "sm",
|
|
405
406
|
className: "shrink-0 text-error-11"
|
|
406
407
|
})
|
|
407
|
-
}, "error-icon") : /* @__PURE__ */
|
|
408
|
+
}, "error-icon") : /* @__PURE__ */ l(C.div, {
|
|
408
409
|
initial: {
|
|
409
410
|
opacity: 0,
|
|
410
411
|
scale: .5
|
|
@@ -418,78 +419,78 @@ function I({ files: r, onRetry: a, onRemove: o, selfDismissId: d, showAccent: p
|
|
|
418
419
|
scale: .5
|
|
419
420
|
},
|
|
420
421
|
transition: e.bouncy,
|
|
421
|
-
children: /* @__PURE__ */
|
|
422
|
-
icon:
|
|
422
|
+
children: /* @__PURE__ */ l(a, {
|
|
423
|
+
icon: p,
|
|
423
424
|
size: "sm",
|
|
424
425
|
className: "shrink-0 text-success-11"
|
|
425
426
|
})
|
|
426
|
-
}, "success-icon") : /* @__PURE__ */
|
|
427
|
+
}, "success-icon") : /* @__PURE__ */ l(C.div, {
|
|
427
428
|
initial: { opacity: 0 },
|
|
428
429
|
animate: { opacity: 1 },
|
|
429
430
|
exit: { opacity: 0 },
|
|
430
431
|
transition: t.fade,
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
icon:
|
|
432
|
+
children: /* @__PURE__ */ l(a, {
|
|
433
|
+
icon: b,
|
|
433
434
|
size: "sm",
|
|
434
435
|
className: "shrink-0 text-surface-fg-muted"
|
|
435
436
|
})
|
|
436
437
|
}, "upload-icon")
|
|
437
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ l("p", {
|
|
438
439
|
className: "text-body-md font-semibold text-surface-fg",
|
|
439
|
-
children:
|
|
440
|
+
children: E ? T > 0 ? `${x} of ${i.length} uploaded` : `${i.length} file${i.length > 1 ? "s" : ""} uploaded` : `Uploading ${i.length} file${i.length > 1 ? "s" : ""}`
|
|
440
441
|
})]
|
|
441
442
|
}),
|
|
442
|
-
!
|
|
443
|
+
!E && /* @__PURE__ */ u("p", {
|
|
443
444
|
className: "mt-0.5 text-caption text-surface-fg-muted",
|
|
444
445
|
children: [
|
|
445
|
-
|
|
446
|
+
x,
|
|
446
447
|
" of ",
|
|
447
|
-
|
|
448
|
+
i.length,
|
|
448
449
|
" complete",
|
|
449
|
-
|
|
450
|
+
T > 0 && ` · ${T} failed`
|
|
450
451
|
]
|
|
451
452
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ l("div", {
|
|
453
454
|
className: "mt-ds-02 max-h-[140px] overflow-y-auto",
|
|
454
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ l(S, { children: i.map((e) => /* @__PURE__ */ l(I, {
|
|
455
456
|
file: e,
|
|
456
|
-
onRetry:
|
|
457
|
-
onRemove:
|
|
457
|
+
onRetry: o,
|
|
458
|
+
onRemove: s
|
|
458
459
|
}, e.id)) })
|
|
459
460
|
}),
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ u("div", {
|
|
461
462
|
className: "sr-only",
|
|
462
463
|
"aria-live": "polite",
|
|
463
464
|
children: [
|
|
464
|
-
|
|
465
|
+
x,
|
|
465
466
|
" of ",
|
|
466
|
-
|
|
467
|
+
i.length,
|
|
467
468
|
" files uploaded",
|
|
468
|
-
|
|
469
|
+
T > 0 && `, ${T} failed`
|
|
469
470
|
]
|
|
470
471
|
})
|
|
471
472
|
]
|
|
472
473
|
}),
|
|
473
|
-
|
|
474
|
-
duration:
|
|
475
|
-
type:
|
|
474
|
+
E && /* @__PURE__ */ l(k, {
|
|
475
|
+
duration: D,
|
|
476
|
+
type: M,
|
|
476
477
|
paused: !1
|
|
477
478
|
})
|
|
478
479
|
]
|
|
479
|
-
});
|
|
480
|
+
}) });
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
+
function R(e, t) {
|
|
482
483
|
return {
|
|
483
484
|
id: e?.id,
|
|
484
|
-
duration: e?.duration ?? t ??
|
|
485
|
+
duration: e?.duration ?? t ?? T,
|
|
485
486
|
unstyled: !0,
|
|
486
487
|
classNames: { toast: "w-full" }
|
|
487
488
|
};
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
-
|
|
491
|
-
let r = n?.duration ??
|
|
492
|
-
return
|
|
490
|
+
function z(e, t, n) {
|
|
491
|
+
s();
|
|
492
|
+
let r = n?.duration ?? T;
|
|
493
|
+
return w.custom(() => /* @__PURE__ */ l(A, {
|
|
493
494
|
type: e,
|
|
494
495
|
title: t,
|
|
495
496
|
description: n?.description,
|
|
@@ -497,16 +498,16 @@ function R(e, t, n) {
|
|
|
497
498
|
cancel: n?.cancel,
|
|
498
499
|
duration: r,
|
|
499
500
|
showAccent: n?.showAccent
|
|
500
|
-
}),
|
|
501
|
+
}), R(n, r));
|
|
501
502
|
}
|
|
502
|
-
function
|
|
503
|
-
return
|
|
503
|
+
function B(e, t) {
|
|
504
|
+
return z("message", e, t);
|
|
504
505
|
}
|
|
505
|
-
|
|
506
|
+
B.message = (e, t) => z("message", e, t), B.success = (e, t) => z("success", e, t), B.error = (e, t) => z("error", e, t), B.warning = (e, t) => z("warning", e, t), B.info = (e, t) => z("info", e, t), B.loading = (e, t) => z("loading", e, {
|
|
506
507
|
...t,
|
|
507
508
|
duration: t?.duration ?? Infinity
|
|
508
|
-
}),
|
|
509
|
-
let n =
|
|
509
|
+
}), B.promise = (e, t) => {
|
|
510
|
+
let n = w.custom(() => /* @__PURE__ */ l(A, {
|
|
510
511
|
type: "loading",
|
|
511
512
|
title: t.loading,
|
|
512
513
|
showTimerBar: !1
|
|
@@ -515,10 +516,10 @@ z.message = (e, t) => R("message", e, t), z.success = (e, t) => R("success", e,
|
|
|
515
516
|
unstyled: !0,
|
|
516
517
|
classNames: { toast: "w-full" }
|
|
517
518
|
}), r = (e, t) => {
|
|
518
|
-
|
|
519
|
+
w.custom(() => /* @__PURE__ */ l(A, {
|
|
519
520
|
type: e,
|
|
520
521
|
title: t,
|
|
521
|
-
duration:
|
|
522
|
+
duration: T,
|
|
522
523
|
selfDismissId: n
|
|
523
524
|
}), {
|
|
524
525
|
id: n,
|
|
@@ -534,9 +535,9 @@ z.message = (e, t) => R("message", e, t), z.success = (e, t) => R("success", e,
|
|
|
534
535
|
let n = typeof t.error == "function" ? t.error(e) : t.error;
|
|
535
536
|
r("error", n);
|
|
536
537
|
}), n;
|
|
537
|
-
},
|
|
538
|
-
let n = t.duration ??
|
|
539
|
-
return
|
|
538
|
+
}, B.undo = (e, t) => {
|
|
539
|
+
let n = t.duration ?? E;
|
|
540
|
+
return w.custom(() => /* @__PURE__ */ l(A, {
|
|
540
541
|
type: "message",
|
|
541
542
|
title: e,
|
|
542
543
|
description: t.description,
|
|
@@ -550,9 +551,9 @@ z.message = (e, t) => R("message", e, t), z.success = (e, t) => R("success", e,
|
|
|
550
551
|
unstyled: !0,
|
|
551
552
|
classNames: { toast: "w-full" }
|
|
552
553
|
});
|
|
553
|
-
},
|
|
554
|
+
}, B.upload = (e) => {
|
|
554
555
|
let t = e.id ?? String(Date.now());
|
|
555
|
-
return
|
|
556
|
+
return w.custom(() => /* @__PURE__ */ l(L, {
|
|
556
557
|
files: e.files,
|
|
557
558
|
onRetry: e.onRetry,
|
|
558
559
|
onRemove: e.onRemove,
|
|
@@ -564,15 +565,15 @@ z.message = (e, t) => R("message", e, t), z.success = (e, t) => R("success", e,
|
|
|
564
565
|
unstyled: !0,
|
|
565
566
|
classNames: { toast: "w-full" }
|
|
566
567
|
}), t;
|
|
567
|
-
},
|
|
568
|
+
}, B.custom = (e, t) => w.custom(e, {
|
|
568
569
|
...t,
|
|
569
570
|
unstyled: !0,
|
|
570
571
|
classNames: {
|
|
571
572
|
toast: "w-full",
|
|
572
573
|
...t?.classNames
|
|
573
574
|
}
|
|
574
|
-
}),
|
|
575
|
-
e === void 0 ?
|
|
575
|
+
}), B.dismiss = (e) => {
|
|
576
|
+
e === void 0 ? w.dismiss() : w.dismiss(e);
|
|
576
577
|
};
|
|
577
578
|
//#endregion
|
|
578
|
-
export {
|
|
579
|
+
export { k as TimerBar, A as ToastContent, I as UploadFileRow, L as UploadToastContent, F as formatFileSize, B as toast };
|