@devalok/shilp-sutra 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/badge-group.js +123 -172
- package/dist/_chunks/document-preview.js +92 -0
- package/dist/_chunks/file-preview.js +511 -0
- package/dist/_chunks/image-preview.js +90 -0
- package/dist/_chunks/primitives.js +109 -109
- package/dist/_chunks/stat-row.js +144 -124
- package/dist/_chunks/use-calendar.js +558 -490
- package/dist/ai/block-renderer.d.ts +2 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +30 -29
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +18 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +126 -125
- package/dist/ai/conversation.d.ts +13 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +78 -78
- package/dist/ai/types.d.ts +0 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +0 -1
- package/dist/composed/bulk-action-bar.d.ts +6 -4
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +102 -58
- package/dist/composed/command-palette.d.ts +9 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +68 -68
- package/dist/composed/confirm-dialog.d.ts +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +10 -10
- package/dist/composed/date-picker/date-picker.d.ts +11 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +39 -36
- package/dist/composed/emoji-picker.d.ts +6 -0
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +22 -20
- package/dist/composed/error-boundary.d.ts +21 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +47 -32
- package/dist/composed/file-preview/audio-preview.d.ts +7 -0
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/document-preview.d.ts +7 -0
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/embed-preview.d.ts +7 -0
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/image-preview.d.ts +7 -0
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/shared.d.ts +20 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -0
- package/dist/composed/file-preview/video-preview.d.ts +6 -0
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +10 -662
- package/dist/composed/filter-bar.d.ts +10 -2
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +42 -43
- package/dist/composed/form-section.d.ts +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +22 -21
- package/dist/composed/index.d.ts +2 -2
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +58 -57
- package/dist/composed/inline-edit.d.ts +1 -1
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +33 -32
- package/dist/composed/markdown-viewer.d.ts +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +60 -59
- package/dist/composed/master-detail.d.ts +11 -7
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +123 -84
- package/dist/composed/responsive-overlay.d.ts +8 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.d.ts +11 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +21 -20
- package/dist/composed/schedule-view.d.ts +9 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/use-touch-device.d.ts +12 -0
- package/dist/hooks/use-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-touch-device.js +13 -0
- package/dist/hooks/use-viewport-height.d.ts +11 -0
- package/dist/hooks/use-viewport-height.d.ts.map +1 -0
- package/dist/hooks/use-viewport-height.js +16 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +72 -63
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +77 -77
- package/dist/shell/top-bar.d.ts +2 -2
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +61 -60
- package/dist/tailwind/index.cjs +51 -7
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +51 -7
- package/dist/tokens/primitives.css +3 -1
- package/dist/tokens/semantic.css +16 -13
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +38 -39
- package/dist/ui/badge.d.ts +104 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +8 -7
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +54 -74
- package/dist/ui/card.js +24 -24
- package/dist/ui/charts/area-chart.d.ts +2 -0
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +2 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +583 -577
- package/dist/ui/charts/line-chart.d.ts +2 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -0
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +2 -0
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +36 -27
- package/dist/ui/color-input.js +5 -5
- package/dist/ui/combobox.d.ts +6 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/data-table-body.d.ts +12 -0
- package/dist/ui/data-table-body.d.ts.map +1 -0
- package/dist/ui/data-table-body.js +219 -0
- package/dist/ui/data-table-bulk-actions.d.ts +19 -0
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +61 -0
- package/dist/ui/data-table-card.d.ts +9 -0
- package/dist/ui/data-table-card.d.ts.map +1 -0
- package/dist/ui/data-table-card.js +73 -0
- package/dist/ui/data-table-context.d.ts +62 -0
- package/dist/ui/data-table-context.d.ts.map +1 -0
- package/dist/ui/data-table-context.js +48 -0
- package/dist/ui/data-table-header.d.ts +10 -0
- package/dist/ui/data-table-header.d.ts.map +1 -0
- package/dist/ui/data-table-header.js +141 -0
- package/dist/ui/data-table-pagination.d.ts +13 -0
- package/dist/ui/data-table-pagination.d.ts.map +1 -0
- package/dist/ui/data-table-pagination.js +84 -0
- package/dist/ui/data-table.d.ts +11 -9
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +258 -573
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +84 -82
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +3 -3
- package/dist/ui/icon-group.d.ts +2 -4
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +22 -23
- package/dist/ui/index.d.ts +1 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +94 -99
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +16 -0
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -73
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +40 -44
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +19 -17
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +107 -32
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +80 -80
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.d.ts +5 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +29 -20
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +13 -12
- package/dist/ui/segmented-control.d.ts +6 -108
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +86 -272
- package/dist/ui/select.js +5 -5
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +2 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +102 -84
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +200 -175
- package/dist/ui/slider.js +14 -14
- package/dist/ui/status-dot.js +8 -8
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +33 -31
- package/dist/ui/switch.js +3 -3
- package/dist/ui/tabs.js +6 -6
- package/dist/ui/toast-types.d.ts +0 -1
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +156 -150
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.js +3 -3
- package/docs/components/ui/data-table-body.md +13 -0
- package/docs/components/ui/data-table-bulk-actions.md +13 -0
- package/docs/components/ui/data-table-card.md +13 -0
- package/docs/components/ui/data-table-context.md +13 -0
- package/docs/components/ui/data-table-header.md +13 -0
- package/docs/components/ui/data-table-pagination.md +13 -0
- package/llms-full.txt +79 -48
- package/llms.txt +32 -0
- package/package.json +1 -6
- package/dist/ui/chip.d.ts +0 -19
- package/dist/ui/chip.d.ts.map +0 -1
- package/dist/ui/chip.js +0 -14
- package/dist/ui/lib/use-ripple.d.ts +0 -14
- package/dist/ui/lib/use-ripple.d.ts.map +0 -1
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { IconCheck as
|
|
6
|
-
import { a as
|
|
7
|
-
import { springs as
|
|
8
|
-
import { S as
|
|
9
|
-
import { Icon as
|
|
10
|
-
import { BadgeIndicator as
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
2
|
+
import { jsxs as v, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import * as R from "react";
|
|
4
|
+
import { cn as a } from "../ui/lib/utils.js";
|
|
5
|
+
import { IconCheck as D, IconX as E } from "@tabler/icons-react";
|
|
6
|
+
import { a as I } from "./vendor-utils.js";
|
|
7
|
+
import { springs as O } from "../ui/lib/motion.js";
|
|
8
|
+
import { S as T } from "./primitives.js";
|
|
9
|
+
import { Icon as N } from "../ui/icon.js";
|
|
10
|
+
import { BadgeIndicator as q } from "../ui/badge-indicator.js";
|
|
11
|
+
import { u as X, A as _, m as F } from "./framer.js";
|
|
12
|
+
const $ = {
|
|
13
|
+
default: { bg: "bg-surface-raised-hover", fg: "text-surface-fg-muted", border: "border-surface-border-strong", solid: "bg-neutral-5", solidFg: "text-surface-fg" },
|
|
14
|
+
accent: { bg: "bg-accent-3", fg: "text-accent-11", border: "border-accent-7", solid: "bg-accent-9", solidFg: "text-accent-fg" },
|
|
15
|
+
error: { bg: "bg-error-3", fg: "text-error-11", border: "border-error-7", solid: "bg-error-9", solidFg: "text-error-fg" },
|
|
16
|
+
success: { bg: "bg-success-3", fg: "text-success-11", border: "border-success-7", solid: "bg-success-9", solidFg: "text-success-fg" },
|
|
17
|
+
warning: { bg: "bg-warning-3", fg: "text-warning-11", border: "border-warning-7", solid: "bg-warning-9", solidFg: "text-warning-fg" },
|
|
18
|
+
info: { bg: "bg-info-3", fg: "text-info-11", border: "border-info-7", solid: "bg-info-9", solidFg: "text-info-fg" },
|
|
19
|
+
neutral: { bg: "bg-surface-raised-hover", fg: "text-surface-fg-muted", border: "border-surface-border-strong", solid: "bg-neutral-5", solidFg: "text-surface-fg" },
|
|
20
|
+
teal: { bg: "bg-category-teal-3", fg: "text-category-teal-11", border: "border-category-teal-7", solid: "bg-category-teal-9", solidFg: "text-white" },
|
|
21
|
+
amber: { bg: "bg-category-amber-3", fg: "text-category-amber-11", border: "border-category-amber-7", solid: "bg-category-amber-9", solidFg: "text-white" },
|
|
22
|
+
slate: { bg: "bg-category-slate-3", fg: "text-category-slate-11", border: "border-category-slate-7", solid: "bg-category-slate-9", solidFg: "text-white" },
|
|
23
|
+
indigo: { bg: "bg-category-indigo-3", fg: "text-category-indigo-11", border: "border-category-indigo-7", solid: "bg-category-indigo-9", solidFg: "text-white" },
|
|
24
|
+
cyan: { bg: "bg-category-cyan-3", fg: "text-category-cyan-11", border: "border-category-cyan-7", solid: "bg-category-cyan-9", solidFg: "text-white" },
|
|
25
|
+
orange: { bg: "bg-category-orange-3", fg: "text-category-orange-11", border: "border-category-orange-7", solid: "bg-category-orange-9", solidFg: "text-white" },
|
|
26
|
+
emerald: { bg: "bg-category-emerald-3", fg: "text-category-emerald-11", border: "border-category-emerald-7", solid: "bg-category-emerald-9", solidFg: "text-white" }
|
|
27
|
+
};
|
|
28
|
+
function H(n, d) {
|
|
29
|
+
if (d === "custom") return "";
|
|
30
|
+
const e = $[d];
|
|
31
|
+
switch (n) {
|
|
32
|
+
case "subtle":
|
|
33
|
+
return a(e.bg, e.fg, e.border);
|
|
34
|
+
case "solid":
|
|
35
|
+
return a(e.solid, e.solidFg, "border-transparent");
|
|
36
|
+
case "outline":
|
|
37
|
+
return a("bg-transparent", e.fg, e.border);
|
|
38
|
+
case "soft":
|
|
39
|
+
return a(e.bg, e.fg, "border-transparent");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const J = I(
|
|
13
43
|
"relative inline-flex items-center rounded-full font-sans font-medium overflow-hidden isolate transition-[color,background-color,border-color,padding] duration-fast-02 ease-productive-standard select-none [&>span:not([data-grain])]:relative [&>span:not([data-grain])]:z-[2]",
|
|
14
44
|
{
|
|
15
45
|
variants: {
|
|
@@ -19,23 +49,6 @@ const _ = O(
|
|
|
19
49
|
outline: "border",
|
|
20
50
|
soft: "border border-transparent"
|
|
21
51
|
},
|
|
22
|
-
color: {
|
|
23
|
-
default: "",
|
|
24
|
-
accent: "",
|
|
25
|
-
error: "",
|
|
26
|
-
success: "",
|
|
27
|
-
warning: "",
|
|
28
|
-
info: "",
|
|
29
|
-
neutral: "",
|
|
30
|
-
teal: "",
|
|
31
|
-
amber: "",
|
|
32
|
-
slate: "",
|
|
33
|
-
indigo: "",
|
|
34
|
-
cyan: "",
|
|
35
|
-
orange: "",
|
|
36
|
-
emerald: "",
|
|
37
|
-
custom: ""
|
|
38
|
-
},
|
|
39
52
|
size: {
|
|
40
53
|
xs: "h-4 px-1.5 text-[10px] gap-1",
|
|
41
54
|
sm: "h-5 px-2 text-ds-xs gap-1",
|
|
@@ -43,71 +56,8 @@ const _ = O(
|
|
|
43
56
|
lg: "h-7 px-3 text-ds-sm gap-1.5"
|
|
44
57
|
}
|
|
45
58
|
},
|
|
46
|
-
compoundVariants: [
|
|
47
|
-
// ── subtle × colors ──────────────────────────────────────────
|
|
48
|
-
{ variant: "subtle", color: "default", className: "bg-surface-raised-hover text-surface-fg-muted border-surface-border-strong" },
|
|
49
|
-
{ variant: "subtle", color: "accent", className: "bg-accent-3 text-accent-11 border-accent-7" },
|
|
50
|
-
{ variant: "subtle", color: "error", className: "bg-error-3 text-error-11 border-error-7" },
|
|
51
|
-
{ variant: "subtle", color: "success", className: "bg-success-3 text-success-11 border-success-7" },
|
|
52
|
-
{ variant: "subtle", color: "warning", className: "bg-warning-3 text-warning-11 border-warning-7" },
|
|
53
|
-
{ variant: "subtle", color: "info", className: "bg-info-3 text-info-11 border-info-7" },
|
|
54
|
-
{ variant: "subtle", color: "neutral", className: "bg-surface-raised-hover text-surface-fg-muted border-surface-border-strong" },
|
|
55
|
-
{ variant: "subtle", color: "teal", className: "bg-category-teal-3 text-category-teal-11 border-category-teal-7" },
|
|
56
|
-
{ variant: "subtle", color: "amber", className: "bg-category-amber-3 text-category-amber-11 border-category-amber-7" },
|
|
57
|
-
{ variant: "subtle", color: "slate", className: "bg-category-slate-3 text-category-slate-11 border-category-slate-7" },
|
|
58
|
-
{ variant: "subtle", color: "indigo", className: "bg-category-indigo-3 text-category-indigo-11 border-category-indigo-7" },
|
|
59
|
-
{ variant: "subtle", color: "cyan", className: "bg-category-cyan-3 text-category-cyan-11 border-category-cyan-7" },
|
|
60
|
-
{ variant: "subtle", color: "orange", className: "bg-category-orange-3 text-category-orange-11 border-category-orange-7" },
|
|
61
|
-
{ variant: "subtle", color: "emerald", className: "bg-category-emerald-3 text-category-emerald-11 border-category-emerald-7" },
|
|
62
|
-
// ── solid × colors ───────────────────────────────────────────
|
|
63
|
-
{ variant: "solid", color: "default", className: "bg-neutral-5 text-surface-fg border-transparent" },
|
|
64
|
-
{ variant: "solid", color: "accent", className: "bg-accent-9 text-accent-fg border-transparent" },
|
|
65
|
-
{ variant: "solid", color: "error", className: "bg-error-9 text-error-fg border-transparent" },
|
|
66
|
-
{ variant: "solid", color: "success", className: "bg-success-9 text-success-fg border-transparent" },
|
|
67
|
-
{ variant: "solid", color: "warning", className: "bg-warning-9 text-warning-fg border-transparent" },
|
|
68
|
-
{ variant: "solid", color: "info", className: "bg-info-9 text-info-fg border-transparent" },
|
|
69
|
-
{ variant: "solid", color: "neutral", className: "bg-neutral-5 text-surface-fg border-transparent" },
|
|
70
|
-
{ variant: "solid", color: "teal", className: "bg-category-teal-9 text-white border-transparent" },
|
|
71
|
-
{ variant: "solid", color: "amber", className: "bg-category-amber-9 text-white border-transparent" },
|
|
72
|
-
{ variant: "solid", color: "slate", className: "bg-category-slate-9 text-white border-transparent" },
|
|
73
|
-
{ variant: "solid", color: "indigo", className: "bg-category-indigo-9 text-white border-transparent" },
|
|
74
|
-
{ variant: "solid", color: "cyan", className: "bg-category-cyan-9 text-white border-transparent" },
|
|
75
|
-
{ variant: "solid", color: "orange", className: "bg-category-orange-9 text-white border-transparent" },
|
|
76
|
-
{ variant: "solid", color: "emerald", className: "bg-category-emerald-9 text-white border-transparent" },
|
|
77
|
-
// ── outline × colors ─────────────────────────────────────────
|
|
78
|
-
{ variant: "outline", color: "default", className: "bg-transparent text-surface-fg-muted border-surface-border-strong" },
|
|
79
|
-
{ variant: "outline", color: "accent", className: "bg-transparent text-accent-11 border-accent-7" },
|
|
80
|
-
{ variant: "outline", color: "error", className: "bg-transparent text-error-11 border-error-7" },
|
|
81
|
-
{ variant: "outline", color: "success", className: "bg-transparent text-success-11 border-success-7" },
|
|
82
|
-
{ variant: "outline", color: "warning", className: "bg-transparent text-warning-11 border-warning-7" },
|
|
83
|
-
{ variant: "outline", color: "info", className: "bg-transparent text-info-11 border-info-7" },
|
|
84
|
-
{ variant: "outline", color: "neutral", className: "bg-transparent text-surface-fg-muted border-surface-border-strong" },
|
|
85
|
-
{ variant: "outline", color: "teal", className: "bg-transparent text-category-teal-11 border-category-teal-7" },
|
|
86
|
-
{ variant: "outline", color: "amber", className: "bg-transparent text-category-amber-11 border-category-amber-7" },
|
|
87
|
-
{ variant: "outline", color: "slate", className: "bg-transparent text-category-slate-11 border-category-slate-7" },
|
|
88
|
-
{ variant: "outline", color: "indigo", className: "bg-transparent text-category-indigo-11 border-category-indigo-7" },
|
|
89
|
-
{ variant: "outline", color: "cyan", className: "bg-transparent text-category-cyan-11 border-category-cyan-7" },
|
|
90
|
-
{ variant: "outline", color: "orange", className: "bg-transparent text-category-orange-11 border-category-orange-7" },
|
|
91
|
-
{ variant: "outline", color: "emerald", className: "bg-transparent text-category-emerald-11 border-category-emerald-7" },
|
|
92
|
-
// ── soft × colors ────────────────────────────────────────────
|
|
93
|
-
{ variant: "soft", color: "default", className: "bg-surface-raised-hover text-surface-fg-muted border-transparent" },
|
|
94
|
-
{ variant: "soft", color: "accent", className: "bg-accent-3 text-accent-11 border-transparent" },
|
|
95
|
-
{ variant: "soft", color: "error", className: "bg-error-3 text-error-11 border-transparent" },
|
|
96
|
-
{ variant: "soft", color: "success", className: "bg-success-3 text-success-11 border-transparent" },
|
|
97
|
-
{ variant: "soft", color: "warning", className: "bg-warning-3 text-warning-11 border-transparent" },
|
|
98
|
-
{ variant: "soft", color: "info", className: "bg-info-3 text-info-11 border-transparent" },
|
|
99
|
-
{ variant: "soft", color: "neutral", className: "bg-surface-raised-hover text-surface-fg-muted border-transparent" },
|
|
100
|
-
{ variant: "soft", color: "teal", className: "bg-category-teal-3 text-category-teal-11 border-transparent" },
|
|
101
|
-
{ variant: "soft", color: "amber", className: "bg-category-amber-3 text-category-amber-11 border-transparent" },
|
|
102
|
-
{ variant: "soft", color: "slate", className: "bg-category-slate-3 text-category-slate-11 border-transparent" },
|
|
103
|
-
{ variant: "soft", color: "indigo", className: "bg-category-indigo-3 text-category-indigo-11 border-transparent" },
|
|
104
|
-
{ variant: "soft", color: "cyan", className: "bg-category-cyan-3 text-category-cyan-11 border-transparent" },
|
|
105
|
-
{ variant: "soft", color: "orange", className: "bg-category-orange-3 text-category-orange-11 border-transparent" },
|
|
106
|
-
{ variant: "soft", color: "emerald", className: "bg-category-emerald-3 text-category-emerald-11 border-transparent" }
|
|
107
|
-
],
|
|
108
59
|
defaultVariants: {
|
|
109
60
|
variant: "subtle",
|
|
110
|
-
color: "default",
|
|
111
61
|
size: "md"
|
|
112
62
|
}
|
|
113
63
|
}
|
|
@@ -116,140 +66,141 @@ const _ = O(
|
|
|
116
66
|
sm: "[&>svg]:h-3 [&>svg]:w-3",
|
|
117
67
|
md: "[&>svg]:h-3 [&>svg]:w-3",
|
|
118
68
|
lg: "[&>svg]:h-3.5 [&>svg]:w-3.5"
|
|
119
|
-
},
|
|
69
|
+
}, Q = {
|
|
120
70
|
xs: "pl-1",
|
|
121
71
|
sm: "pl-1.5",
|
|
122
72
|
md: "pl-2",
|
|
123
73
|
lg: "pl-2.5"
|
|
124
|
-
},
|
|
74
|
+
}, U = {
|
|
125
75
|
xs: "pr-0.5",
|
|
126
76
|
sm: "pr-1",
|
|
127
77
|
md: "pr-1",
|
|
128
78
|
lg: "pr-1.5"
|
|
129
|
-
},
|
|
79
|
+
}, S = R.forwardRef(
|
|
130
80
|
({
|
|
131
|
-
className:
|
|
132
|
-
variant:
|
|
133
|
-
color:
|
|
134
|
-
size:
|
|
135
|
-
asChild:
|
|
136
|
-
startIcon:
|
|
137
|
-
endIcon:
|
|
138
|
-
dot:
|
|
139
|
-
onDismiss:
|
|
81
|
+
className: n,
|
|
82
|
+
variant: d,
|
|
83
|
+
color: e,
|
|
84
|
+
size: x,
|
|
85
|
+
asChild: h,
|
|
86
|
+
startIcon: s,
|
|
87
|
+
endIcon: i,
|
|
88
|
+
dot: g,
|
|
89
|
+
onDismiss: t,
|
|
140
90
|
onClick: r,
|
|
141
91
|
selected: l,
|
|
142
|
-
disabled:
|
|
143
|
-
maxWidth:
|
|
92
|
+
disabled: p,
|
|
93
|
+
maxWidth: y,
|
|
144
94
|
truncate: A,
|
|
145
95
|
circle: j,
|
|
146
|
-
children:
|
|
96
|
+
children: b,
|
|
147
97
|
style: G,
|
|
148
|
-
...
|
|
98
|
+
...w
|
|
149
99
|
}, K) => {
|
|
150
|
-
const
|
|
151
|
-
...
|
|
100
|
+
const k = X(), u = d ?? "subtle", C = e ?? "default", f = x ?? "md", m = h ? T : r && t ? "div" : r ? "button" : "span", M = C === "custom" ? {
|
|
101
|
+
...u === "subtle" && {
|
|
152
102
|
backgroundColor: "color-mix(in oklch, var(--badge-color) 15%, transparent)",
|
|
153
103
|
color: "var(--badge-color)",
|
|
154
104
|
borderColor: "color-mix(in oklch, var(--badge-color) 40%, transparent)"
|
|
155
105
|
},
|
|
156
|
-
...
|
|
106
|
+
...u === "solid" && {
|
|
157
107
|
backgroundColor: "var(--badge-color)",
|
|
158
108
|
color: "var(--badge-fg-color, white)",
|
|
159
109
|
borderColor: "transparent"
|
|
160
110
|
},
|
|
161
|
-
...
|
|
111
|
+
...u === "outline" && {
|
|
162
112
|
backgroundColor: "transparent",
|
|
163
113
|
color: "var(--badge-color)",
|
|
164
114
|
borderColor: "color-mix(in oklch, var(--badge-color) 50%, transparent)"
|
|
165
115
|
},
|
|
166
|
-
...
|
|
116
|
+
...u === "soft" && {
|
|
167
117
|
backgroundColor: "color-mix(in oklch, var(--badge-color) 12%, transparent)",
|
|
168
118
|
color: "var(--badge-color)",
|
|
169
119
|
borderColor: "transparent"
|
|
170
120
|
}
|
|
171
|
-
} : void 0, L = r &&
|
|
172
|
-
(
|
|
173
|
-
} :
|
|
174
|
-
return /* @__PURE__ */
|
|
121
|
+
} : void 0, L = r && t ? (c) => {
|
|
122
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), p || r(c)), w.onKeyDown?.(c);
|
|
123
|
+
} : w.onKeyDown, P = !!(g || s || r && l && !s && !g), V = !!(t || i);
|
|
124
|
+
return /* @__PURE__ */ v(
|
|
175
125
|
m,
|
|
176
126
|
{
|
|
177
127
|
ref: K,
|
|
178
|
-
className:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
128
|
+
className: a(
|
|
129
|
+
J({ variant: u, size: f }),
|
|
130
|
+
H(u, C),
|
|
131
|
+
P && Q[f],
|
|
132
|
+
V && U[f],
|
|
182
133
|
r && "cursor-pointer hover:brightness-[0.97] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-1 transition-[color,background-color,border-color,transform,filter] duration-moderate-01 ease-productive-exit hover:duration-fast-02 hover:ease-productive-entrance active:scale-[0.95] active:brightness-[0.92] active:duration-[0ms]",
|
|
183
134
|
l && "ring-1 ring-current/20 transition-shadow duration-fast-02",
|
|
184
|
-
|
|
135
|
+
p && "opacity-action-disabled pointer-events-none saturate-[0.3]",
|
|
185
136
|
j && "justify-center px-0 aspect-square",
|
|
186
|
-
|
|
137
|
+
n
|
|
187
138
|
),
|
|
188
|
-
style: { ...G, ...
|
|
189
|
-
onClick:
|
|
139
|
+
style: { ...G, ...M, ...y ? { maxWidth: y } : void 0 },
|
|
140
|
+
onClick: p ? void 0 : r,
|
|
190
141
|
onKeyDown: L,
|
|
191
142
|
...m === "button" && { type: "button" },
|
|
192
|
-
...m === "button" &&
|
|
143
|
+
...m === "button" && p ? { disabled: !0 } : {},
|
|
193
144
|
...m === "div" && r ? { role: "button", tabIndex: 0 } : {},
|
|
194
|
-
...
|
|
145
|
+
...w,
|
|
195
146
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
147
|
+
/* @__PURE__ */ o(_, { children: g && /* @__PURE__ */ v(
|
|
148
|
+
F.span,
|
|
198
149
|
{
|
|
199
150
|
initial: { scale: 0 },
|
|
200
151
|
animate: { scale: 1 },
|
|
201
152
|
exit: { scale: 0 },
|
|
202
|
-
transition:
|
|
153
|
+
transition: O.snappy,
|
|
203
154
|
className: "relative inline-flex h-1.5 w-1.5 shrink-0",
|
|
204
155
|
"aria-hidden": "true",
|
|
205
156
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
|
|
157
|
+
/* @__PURE__ */ o(
|
|
158
|
+
F.span,
|
|
208
159
|
{
|
|
209
160
|
className: "absolute inset-0 rounded-full bg-current",
|
|
210
|
-
animate: { scale: [1, 2.5], opacity: [0.35, 0] },
|
|
211
|
-
transition: { repeat: 1 / 0, repeatDelay: 0.3, duration: 1.2, ease: [0, 0, 0.58, 1] }
|
|
161
|
+
animate: k ? void 0 : { scale: [1, 2.5], opacity: [0.35, 0] },
|
|
162
|
+
transition: k ? { duration: 0 } : { repeat: 1 / 0, repeatDelay: 0.3, duration: 1.2, ease: [0, 0, 0.58, 1] }
|
|
212
163
|
}
|
|
213
164
|
),
|
|
214
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ o("span", { className: "relative h-1.5 w-1.5 rounded-full bg-current" })
|
|
215
166
|
]
|
|
216
167
|
},
|
|
217
168
|
"dot"
|
|
218
169
|
) }),
|
|
219
|
-
r && !
|
|
220
|
-
|
|
170
|
+
r && !s && !g && /* @__PURE__ */ o(
|
|
171
|
+
F.span,
|
|
221
172
|
{
|
|
222
173
|
initial: !1,
|
|
223
174
|
animate: l ? { opacity: 1, scale: 1, width: "auto", marginRight: 0 } : { opacity: 0, scale: 0.5, width: 0, marginRight: -4 },
|
|
224
175
|
transition: { type: "tween", duration: 0.15, ease: [0.2, 0, 0.38, 0.9] },
|
|
225
176
|
className: "inline-flex shrink-0 overflow-hidden",
|
|
226
177
|
"aria-hidden": !l,
|
|
227
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ o(N, { icon: D, size: "xs" })
|
|
228
179
|
}
|
|
229
180
|
),
|
|
230
|
-
|
|
231
|
-
A ||
|
|
181
|
+
s && /* @__PURE__ */ o("span", { className: a("shrink-0", z[f]), children: s }),
|
|
182
|
+
A || y ? /* @__PURE__ */ o(
|
|
232
183
|
"span",
|
|
233
184
|
{
|
|
234
185
|
className: "truncate",
|
|
235
|
-
title: typeof
|
|
236
|
-
children:
|
|
186
|
+
title: typeof b == "string" ? b : void 0,
|
|
187
|
+
children: b
|
|
237
188
|
}
|
|
238
|
-
) :
|
|
239
|
-
|
|
240
|
-
|
|
189
|
+
) : b,
|
|
190
|
+
i && /* @__PURE__ */ o("span", { className: a("shrink-0", z[f]), children: i }),
|
|
191
|
+
t && /* @__PURE__ */ o(
|
|
241
192
|
"button",
|
|
242
193
|
{
|
|
243
194
|
type: "button",
|
|
244
|
-
onClick: (
|
|
245
|
-
|
|
195
|
+
onClick: (c) => {
|
|
196
|
+
c.stopPropagation(), t();
|
|
246
197
|
},
|
|
247
|
-
className:
|
|
198
|
+
className: a(
|
|
248
199
|
"shrink-0 rounded-full text-current/60 hover:text-current hover:bg-current/10 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-9",
|
|
249
|
-
|
|
200
|
+
f === "xs" ? "p-0 -mr-0.5 min-w-[16px] min-h-[16px]" : "p-px"
|
|
250
201
|
),
|
|
251
|
-
"aria-label": `Remove ${typeof
|
|
252
|
-
children: /* @__PURE__ */
|
|
202
|
+
"aria-label": `Remove ${typeof b == "string" ? b : ""}`.trim() || "Remove",
|
|
203
|
+
children: /* @__PURE__ */ o(N, { icon: E, size: "xs" })
|
|
253
204
|
}
|
|
254
205
|
)
|
|
255
206
|
]
|
|
@@ -257,33 +208,33 @@ const _ = O(
|
|
|
257
208
|
);
|
|
258
209
|
}
|
|
259
210
|
);
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
Indicator:
|
|
263
|
-
Group:
|
|
264
|
-
}),
|
|
211
|
+
S.displayName = "Badge";
|
|
212
|
+
const W = Object.assign(S, {
|
|
213
|
+
Indicator: q,
|
|
214
|
+
Group: B
|
|
215
|
+
}), Y = {
|
|
265
216
|
tight: "gap-1",
|
|
266
217
|
default: "gap-1.5",
|
|
267
218
|
loose: "gap-2"
|
|
268
219
|
};
|
|
269
|
-
function
|
|
270
|
-
max:
|
|
271
|
-
gap:
|
|
272
|
-
size:
|
|
273
|
-
onOverflowClick:
|
|
274
|
-
className:
|
|
275
|
-
children:
|
|
220
|
+
function B({
|
|
221
|
+
max: n,
|
|
222
|
+
gap: d = "default",
|
|
223
|
+
size: e,
|
|
224
|
+
onOverflowClick: x,
|
|
225
|
+
className: h,
|
|
226
|
+
children: s
|
|
276
227
|
}) {
|
|
277
|
-
const
|
|
278
|
-
return /* @__PURE__ */
|
|
228
|
+
const i = R.Children.toArray(s), g = i.length, t = n !== void 0 && g > n, r = t ? i.slice(0, n) : i, l = t ? g - n : 0;
|
|
229
|
+
return /* @__PURE__ */ v("div", { className: a("flex flex-wrap items-center", Y[d], h), children: [
|
|
279
230
|
r,
|
|
280
|
-
|
|
281
|
-
|
|
231
|
+
t && /* @__PURE__ */ v(
|
|
232
|
+
W,
|
|
282
233
|
{
|
|
283
234
|
variant: "outline",
|
|
284
235
|
color: "neutral",
|
|
285
|
-
size:
|
|
286
|
-
onClick:
|
|
236
|
+
size: e ?? "sm",
|
|
237
|
+
onClick: x,
|
|
287
238
|
children: [
|
|
288
239
|
"+",
|
|
289
240
|
l
|
|
@@ -292,9 +243,9 @@ function R({
|
|
|
292
243
|
)
|
|
293
244
|
] });
|
|
294
245
|
}
|
|
295
|
-
|
|
246
|
+
B.displayName = "BadgeGroup";
|
|
296
247
|
export {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
248
|
+
W as B,
|
|
249
|
+
B as a,
|
|
250
|
+
J as b
|
|
300
251
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { tweens as D } from "../ui/lib/motion.js";
|
|
5
|
+
import { Skeleton as L } from "../ui/skeleton.js";
|
|
6
|
+
import { Button as v } from "../ui/button.js";
|
|
7
|
+
import { Icon as x } from "../ui/icon.js";
|
|
8
|
+
import { IconChevronLeft as N, IconChevronRight as I } from "@tabler/icons-react";
|
|
9
|
+
import { pdfjs as b, Document as A, Page as F } from "react-pdf";
|
|
10
|
+
import { E as k, T as C } from "./file-preview.js";
|
|
11
|
+
import { A as M, m as j } from "./framer.js";
|
|
12
|
+
function $({ url: l, initialPage: u, onError: w }) {
|
|
13
|
+
n.useEffect(() => {
|
|
14
|
+
b.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${b.version}/build/pdf.worker.min.mjs`;
|
|
15
|
+
}, []);
|
|
16
|
+
const [a, y] = n.useState(0), [o, s] = n.useState(u), [m, i] = n.useState(String(u)), [P, S] = n.useState(!1), f = n.useRef(null), [p, g] = n.useState(!1);
|
|
17
|
+
n.useEffect(() => {
|
|
18
|
+
i(String(o));
|
|
19
|
+
}, [o]), n.useEffect(() => {
|
|
20
|
+
function t(r) {
|
|
21
|
+
const h = f.current;
|
|
22
|
+
!h || !h.contains(document.activeElement) && !p || (r.key === "ArrowRight" || r.key === "ArrowDown" ? (r.preventDefault(), s((d) => Math.min(a, d + 1))) : (r.key === "ArrowLeft" || r.key === "ArrowUp") && (r.preventDefault(), s((d) => Math.max(1, d - 1))));
|
|
23
|
+
}
|
|
24
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
25
|
+
}, [a, p]);
|
|
26
|
+
function E(t) {
|
|
27
|
+
if (t.key === "Enter") {
|
|
28
|
+
const r = parseInt(m, 10);
|
|
29
|
+
r >= 1 && r <= a ? s(r) : i(String(o));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return P ? /* @__PURE__ */ e(k, { message: "Could not load PDF", url: l }) : /* @__PURE__ */ c(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
ref: f,
|
|
36
|
+
className: "flex flex-col items-center gap-ds-03",
|
|
37
|
+
onMouseEnter: () => g(!0),
|
|
38
|
+
onMouseLeave: () => g(!1),
|
|
39
|
+
tabIndex: -1,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ e("div", { className: "overflow-auto max-h-[70vh] rounded-ds-md bg-surface-sunken border border-surface-border", children: /* @__PURE__ */ e(
|
|
42
|
+
A,
|
|
43
|
+
{
|
|
44
|
+
file: l,
|
|
45
|
+
onLoadSuccess: ({ numPages: t }) => y(t),
|
|
46
|
+
onLoadError: () => {
|
|
47
|
+
S(!0), w?.("PDF failed to load");
|
|
48
|
+
},
|
|
49
|
+
loading: /* @__PURE__ */ e(L, { className: "h-[500px] w-[400px]" }),
|
|
50
|
+
error: /* @__PURE__ */ e(k, { message: "Failed to load PDF", url: l }),
|
|
51
|
+
children: /* @__PURE__ */ e(M, { mode: "wait", children: /* @__PURE__ */ e(
|
|
52
|
+
j.div,
|
|
53
|
+
{
|
|
54
|
+
initial: { opacity: 0 },
|
|
55
|
+
animate: { opacity: 1 },
|
|
56
|
+
exit: { opacity: 0 },
|
|
57
|
+
transition: D.fade,
|
|
58
|
+
children: /* @__PURE__ */ e(F, { pageNumber: o, renderTextLayer: !1, renderAnnotationLayer: !1 })
|
|
59
|
+
},
|
|
60
|
+
o
|
|
61
|
+
) })
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
a > 0 && /* @__PURE__ */ c(C, { children: [
|
|
65
|
+
/* @__PURE__ */ e(v, { variant: "ghost", size: "icon-xs", onClick: () => s((t) => Math.max(1, t - 1)), disabled: o <= 1, "aria-label": "Previous page (←)", title: "Previous page", children: /* @__PURE__ */ e(x, { icon: N, size: "sm" }) }),
|
|
66
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-ds-01 text-ds-xs text-surface-fg-muted", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
"input",
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
value: m,
|
|
72
|
+
onChange: (t) => i(t.target.value),
|
|
73
|
+
onKeyDown: E,
|
|
74
|
+
onBlur: () => i(String(o)),
|
|
75
|
+
className: "w-8 bg-transparent text-center font-mono text-surface-fg outline-none focus:bg-surface-raised-hover rounded-ds-sm",
|
|
76
|
+
"aria-label": "Page number"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ c("span", { children: [
|
|
80
|
+
"/ ",
|
|
81
|
+
a
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e(v, { variant: "ghost", size: "icon-xs", onClick: () => s((t) => Math.min(a, t + 1)), disabled: o >= a, "aria-label": "Next page (→)", title: "Next page", children: /* @__PURE__ */ e(x, { icon: I, size: "sm" }) })
|
|
85
|
+
] })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
$ as default
|
|
92
|
+
};
|