@devalok/shilp-sutra 0.27.2 → 0.29.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 +299 -0
- package/dist/_chunks/framer.js +1915 -1980
- package/dist/_chunks/keybinding.js +4 -5
- package/dist/_chunks/primitives.js +3198 -3272
- package/dist/_chunks/sonner.js +29 -31
- package/dist/_chunks/stat-row.js +110 -131
- package/dist/_chunks/tiptap.js +42 -78
- package/dist/_chunks/tree-view.js +138 -149
- package/dist/_chunks/typing-indicator.js +565 -0
- package/dist/_chunks/use-calendar.js +416 -439
- package/dist/_chunks/vendor-client.js +977 -814
- package/dist/_chunks/vendor-utils.js +5 -5
- package/dist/ai/block-renderer.js +22 -22
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +241 -263
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +87 -107
- package/dist/composed/activity-feed.d.ts +2 -0
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +118 -90
- package/dist/composed/avatar-group.d.ts +1 -0
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +91 -67
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +29 -28
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +99 -113
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +29 -28
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +30 -27
- package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +261 -271
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +49 -48
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +12 -11
- package/dist/composed/global-loading.js +1 -1
- package/dist/composed/index.js +63 -63
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +55 -54
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +44 -43
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +35 -34
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +64 -64
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-header.js +31 -37
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +37 -36
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +287 -306
- package/dist/composed/schedule-view.js +62 -62
- package/dist/composed/status-badge.d.ts +4 -2
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +58 -45
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +93 -93
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +21 -20
- package/dist/shell/index.js +18 -18
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +96 -95
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +82 -85
- package/dist/shell/sidebar.js +59 -60
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +103 -103
- package/dist/tailwind/index.cjs +37 -4
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +38 -5
- package/dist/tokens/primitives.css +10 -0
- package/dist/tokens/semantic.css +70 -7
- package/dist/ui/accordion.d.ts +5 -2
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +44 -39
- package/dist/ui/alert-dialog.js +57 -57
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +30 -29
- package/dist/ui/aspect-ratio.js +4 -4
- package/dist/ui/autocomplete.js +56 -56
- package/dist/ui/avatar.js +2 -2
- package/dist/ui/badge-group.d.ts +22 -0
- package/dist/ui/badge-group.d.ts.map +1 -0
- package/dist/ui/badge-group.js +8 -0
- package/dist/ui/badge-indicator.d.ts +32 -0
- package/dist/ui/badge-indicator.d.ts.map +1 -0
- package/dist/ui/badge-indicator.js +54 -0
- package/dist/ui/badge.d.ts +27 -24
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +13 -129
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +27 -26
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +37 -36
- package/dist/ui/button-group.d.ts +12 -6
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +18 -18
- package/dist/ui/button-processing.d.ts +15 -0
- package/dist/ui/button-processing.d.ts.map +1 -0
- package/dist/ui/button-processing.js +77 -0
- package/dist/ui/button.d.ts +50 -25
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +243 -127
- package/dist/ui/card.js +20 -21
- package/dist/ui/charts/index.js +499 -508
- package/dist/ui/chat/date-separator.d.ts +12 -0
- package/dist/ui/chat/date-separator.d.ts.map +1 -0
- package/dist/ui/chat/index.d.ts +9 -0
- package/dist/ui/chat/index.d.ts.map +1 -0
- package/dist/ui/chat/index.js +12 -0
- package/dist/ui/chat/message-input.d.ts +16 -0
- package/dist/ui/chat/message-input.d.ts.map +1 -0
- package/dist/ui/chat/message-list.d.ts +24 -0
- package/dist/ui/chat/message-list.d.ts.map +1 -0
- package/dist/ui/chat/message.d.ts +108 -0
- package/dist/ui/chat/message.d.ts.map +1 -0
- package/dist/ui/chat/system-message.d.ts +11 -0
- package/dist/ui/chat/system-message.d.ts.map +1 -0
- package/dist/ui/chat/typing-indicator.d.ts +14 -0
- package/dist/ui/chat/typing-indicator.d.ts.map +1 -0
- package/dist/ui/chat/unread-separator.d.ts +12 -0
- package/dist/ui/chat/unread-separator.d.ts.map +1 -0
- package/dist/ui/checkbox.js +18 -18
- package/dist/ui/chip.d.ts +13 -62
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +10 -109
- package/dist/ui/collapsible.js +4 -4
- package/dist/ui/color-input.d.ts +19 -5
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +371 -79
- package/dist/ui/color-swatch.js +11 -11
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +74 -80
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +86 -85
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +51 -57
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +268 -296
- package/dist/ui/devalok-grain.d.ts +81 -0
- package/dist/ui/devalok-grain.d.ts.map +1 -0
- package/dist/ui/devalok-grain.js +69 -0
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +73 -72
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +93 -92
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +82 -82
- package/dist/ui/hover-card.js +29 -29
- package/dist/ui/icon-button.d.ts +7 -7
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-context.d.ts +15 -0
- package/dist/ui/icon-context.d.ts.map +1 -0
- package/dist/ui/icon-context.js +20 -0
- package/dist/ui/icon-group.d.ts +22 -0
- package/dist/ui/icon-group.d.ts.map +1 -0
- package/dist/ui/icon-group.js +32 -0
- package/dist/ui/icon.d.ts +57 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +122 -0
- package/dist/ui/index.d.ts +8 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +351 -329
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +21 -20
- package/dist/ui/input.d.ts +32 -11
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +149 -44
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/motion.d.ts +2 -0
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +13 -11
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +87 -86
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +23 -28
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +54 -53
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +45 -44
- package/dist/ui/popover.js +30 -30
- package/dist/ui/progress.d.ts +3 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +43 -39
- package/dist/ui/radio.js +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +47 -60
- package/dist/ui/segmented-control.js +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +54 -53
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +46 -45
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +196 -193
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.js +1 -1
- package/dist/ui/spinner.js +74 -74
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +85 -86
- package/dist/ui/switch.d.ts +3 -0
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +40 -26
- package/dist/ui/tabs.js +43 -43
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.js +10 -10
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +169 -169
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +5 -5
- package/dist/ui/tooltip.js +41 -41
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/docs/components/_header.md +4 -4
- package/docs/components/composed/activity-feed.md +7 -0
- package/docs/components/composed/avatar-group.md +8 -5
- package/docs/components/composed/status-badge.md +14 -1
- package/docs/components/ui/accordion.md +5 -2
- package/docs/components/ui/badge-group.md +38 -0
- package/docs/components/ui/badge-indicator.md +40 -0
- package/docs/components/ui/badge.md +36 -5
- package/docs/components/ui/button-processing.md +15 -0
- package/docs/components/ui/button.md +40 -11
- package/docs/components/ui/chat.md +214 -0
- package/docs/components/ui/color-input.md +58 -4
- package/docs/components/ui/data-table.md +3 -0
- package/docs/components/ui/devalok-grain.md +55 -0
- package/docs/components/ui/icon-button.md +12 -5
- package/docs/components/ui/icon-context.md +38 -0
- package/docs/components/ui/icon-group.md +36 -0
- package/docs/components/ui/icon.md +47 -0
- package/docs/components/ui/input.md +32 -6
- package/docs/components/ui/progress.md +5 -0
- package/docs/components/ui/spinner.md +3 -0
- package/docs/components/ui/switch.md +13 -0
- package/llms-full.txt +724 -44
- package/llms.txt +38 -19
- package/package.json +8 -2
package/dist/ui/button.js
CHANGED
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import { IconCheck as
|
|
5
|
-
import { S as
|
|
6
|
-
import * as
|
|
7
|
-
import { useButtonGroup as
|
|
8
|
-
import {
|
|
2
|
+
import { jsx as e, jsxs as j, Fragment as ue } from "react/jsx-runtime";
|
|
3
|
+
import { a as ge } from "../_chunks/vendor-utils.js";
|
|
4
|
+
import { IconCheck as ve, IconX as fe } from "@tabler/icons-react";
|
|
5
|
+
import { S as be, i as he } from "../_chunks/primitives.js";
|
|
6
|
+
import * as t from "react";
|
|
7
|
+
import { useButtonGroup as pe } from "./button-group.js";
|
|
8
|
+
import { Icon as xe } from "./icon.js";
|
|
9
|
+
import { IconProvider as we } from "./icon-context.js";
|
|
10
|
+
import { motionProps as Ne } from "./lib/motion.js";
|
|
11
|
+
import { ProcessingOverlay as ye } from "./button-processing.js";
|
|
9
12
|
import { cn as c } from "./lib/utils.js";
|
|
10
|
-
import { Spinner as
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
13
|
-
"inline-flex items-center justify-center
|
|
13
|
+
import { Spinner as T } from "./spinner.js";
|
|
14
|
+
import { u as ke, m as Se } from "../_chunks/framer.js";
|
|
15
|
+
const X = ge(
|
|
16
|
+
"relative inline-flex items-center justify-center whitespace-nowrap font-sans select-none overflow-hidden isolate focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-action-disabled disabled:cursor-not-allowed disabled:saturate-[0.3] [&>span:not([data-grain])]:relative [&>span:not([data-grain])]:z-[2]",
|
|
14
17
|
{
|
|
15
18
|
variants: {
|
|
16
19
|
variant: {
|
|
17
20
|
solid: "",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
outline: "",
|
|
21
|
+
soft: "",
|
|
22
|
+
outline: "border",
|
|
21
23
|
ghost: "",
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
|
|
24
|
+
link: "underline-offset-4 hover:underline active:opacity-80",
|
|
25
|
+
// Deprecated aliases
|
|
26
|
+
default: "",
|
|
27
|
+
destructive: ""
|
|
25
28
|
},
|
|
26
29
|
color: {
|
|
27
|
-
|
|
28
|
-
error: ""
|
|
30
|
+
accent: "",
|
|
31
|
+
error: "",
|
|
32
|
+
success: "",
|
|
33
|
+
warning: "",
|
|
34
|
+
neutral: "",
|
|
35
|
+
// Deprecated alias
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
weight: {
|
|
39
|
+
semibold: "font-semibold",
|
|
40
|
+
normal: "font-normal"
|
|
29
41
|
},
|
|
30
42
|
size: {
|
|
31
|
-
xs: "h-ds-xs-plus rounded-ds-
|
|
32
|
-
sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm",
|
|
33
|
-
md: "h-ds-md rounded-ds-
|
|
34
|
-
lg: "h-ds-lg rounded-ds-
|
|
43
|
+
xs: "h-ds-xs-plus rounded-ds-md px-ds-03 text-ds-sm gap-1",
|
|
44
|
+
sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm gap-1.5",
|
|
45
|
+
md: "h-ds-md rounded-ds-lg px-ds-05 text-ds-md gap-2",
|
|
46
|
+
lg: "h-ds-lg rounded-ds-xl px-ds-06 text-ds-base gap-2.5",
|
|
47
|
+
"compact-xs": "rounded-ds-md px-ds-02 py-[3px] text-ds-sm gap-1",
|
|
48
|
+
"compact-sm": "rounded-ds-md px-ds-03 py-[5px] text-ds-sm gap-1.5",
|
|
49
|
+
"compact-md": "rounded-ds-lg px-ds-04 py-ds-03 text-ds-md gap-2",
|
|
35
50
|
icon: "h-ds-md w-ds-md rounded-ds-md",
|
|
36
|
-
// alias → icon-md
|
|
37
51
|
"icon-xs": "h-ds-xs-plus w-ds-xs-plus rounded-ds-sm",
|
|
38
52
|
"icon-sm": "h-ds-sm w-ds-sm rounded-ds-md",
|
|
39
53
|
"icon-md": "h-ds-md w-ds-md rounded-ds-md",
|
|
@@ -41,141 +55,243 @@ const R = J(
|
|
|
41
55
|
}
|
|
42
56
|
},
|
|
43
57
|
compoundVariants: [
|
|
44
|
-
//
|
|
45
|
-
{ variant: "solid", color: "
|
|
46
|
-
|
|
47
|
-
{ variant: "
|
|
48
|
-
{ variant: "
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{ variant: "
|
|
52
|
-
|
|
53
|
-
{ variant: "
|
|
54
|
-
|
|
55
|
-
{ variant: "
|
|
56
|
-
//
|
|
57
|
-
{ variant: "outline", color: "
|
|
58
|
-
|
|
59
|
-
{ variant: "
|
|
60
|
-
|
|
61
|
-
{ variant: "
|
|
58
|
+
// ============ SOLID ============ (colored hover shadows — shadow tints with the button's own hue)
|
|
59
|
+
{ variant: "solid", color: "accent", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
|
|
60
|
+
{ variant: "solid", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised hover:shadow-error" },
|
|
61
|
+
{ variant: "solid", color: "success", className: "bg-success-9 text-success-fg hover:bg-success-10 shadow-raised hover:shadow-success" },
|
|
62
|
+
{ variant: "solid", color: "warning", className: "bg-warning-9 text-warning-fg hover:bg-warning-10 shadow-raised hover:shadow-warning" },
|
|
63
|
+
{ variant: "solid", color: "neutral", className: "bg-neutral-5 text-surface-fg hover:bg-neutral-7 shadow-raised" },
|
|
64
|
+
// ============ SOFT ============
|
|
65
|
+
{ variant: "soft", color: "accent", className: "bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5" },
|
|
66
|
+
{ variant: "soft", color: "error", className: "bg-error-3 text-error-11 hover:bg-error-4 active:bg-error-5" },
|
|
67
|
+
{ variant: "soft", color: "success", className: "bg-success-3 text-success-11 hover:bg-success-4 active:bg-success-5" },
|
|
68
|
+
{ variant: "soft", color: "warning", className: "bg-warning-3 text-warning-11 hover:bg-warning-4 active:bg-warning-5" },
|
|
69
|
+
{ variant: "soft", color: "neutral", className: "bg-surface-raised-hover text-surface-fg-muted hover:bg-surface-raised-active active:bg-neutral-5" },
|
|
70
|
+
// ============ OUTLINE ============
|
|
71
|
+
{ variant: "outline", color: "accent", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-3 active:bg-accent-4" },
|
|
72
|
+
{ variant: "outline", color: "error", className: "bg-transparent text-error-11 border-error-7 hover:bg-error-3 active:bg-error-4" },
|
|
73
|
+
{ variant: "outline", color: "success", className: "bg-transparent text-success-11 border-success-7 hover:bg-success-3 active:bg-success-4" },
|
|
74
|
+
{ variant: "outline", color: "warning", className: "bg-transparent text-warning-11 border-warning-7 hover:bg-warning-3 active:bg-warning-4" },
|
|
75
|
+
{ variant: "outline", color: "neutral", className: "bg-transparent text-surface-fg border-surface-border-strong hover:bg-surface-raised-hover active:bg-surface-raised-active" },
|
|
76
|
+
// ============ GHOST ============
|
|
77
|
+
// ghost+accent uses neutral look for backward compat (most common ghost is toolbar/icon ghost)
|
|
78
|
+
{ variant: "ghost", color: "accent", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
|
|
79
|
+
{ variant: "ghost", color: "error", className: "bg-transparent text-error-11 hover:bg-error-3 active:bg-error-4" },
|
|
80
|
+
{ variant: "ghost", color: "success", className: "bg-transparent text-success-11 hover:bg-success-3 active:bg-success-4" },
|
|
81
|
+
{ variant: "ghost", color: "warning", className: "bg-transparent text-warning-11 hover:bg-warning-3 active:bg-warning-4" },
|
|
82
|
+
{ variant: "ghost", color: "neutral", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
|
|
83
|
+
// ============ LINK ============
|
|
84
|
+
{ variant: "link", color: "accent", className: "text-accent-11" },
|
|
85
|
+
{ variant: "link", color: "error", className: "text-error-11" },
|
|
86
|
+
{ variant: "link", color: "success", className: "text-success-11" },
|
|
87
|
+
{ variant: "link", color: "warning", className: "text-warning-11" },
|
|
88
|
+
{ variant: "link", color: "neutral", className: "text-surface-fg-muted" },
|
|
89
|
+
// ============ DEPRECATED ALIASES ============
|
|
90
|
+
// "default" variant → solid
|
|
91
|
+
{ variant: "default", color: "accent", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
|
|
92
|
+
{ variant: "default", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
|
|
93
|
+
{ variant: "default", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
|
|
94
|
+
// "destructive" → solid + error (ignores color prop)
|
|
95
|
+
{ variant: "destructive", color: "accent", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
|
|
96
|
+
{ variant: "destructive", color: "error", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
|
|
97
|
+
{ variant: "destructive", color: "default", className: "bg-error-9 text-error-fg hover:bg-error-10 shadow-raised" },
|
|
98
|
+
// "default" color alias → accent
|
|
99
|
+
{ variant: "solid", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 shadow-raised hover:shadow-brand" },
|
|
100
|
+
{ variant: "soft", color: "default", className: "bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5" },
|
|
101
|
+
{ variant: "outline", color: "default", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-3 active:bg-accent-4" },
|
|
102
|
+
{ variant: "ghost", color: "default", className: "bg-transparent text-surface-fg-muted hover:bg-surface-raised-hover hover:text-surface-fg active:bg-surface-raised-active" },
|
|
103
|
+
{ variant: "link", color: "default", className: "text-accent-11" }
|
|
62
104
|
],
|
|
63
105
|
defaultVariants: {
|
|
64
106
|
variant: "solid",
|
|
65
|
-
color: "
|
|
107
|
+
color: "accent",
|
|
108
|
+
weight: "semibold",
|
|
66
109
|
size: "md"
|
|
67
110
|
}
|
|
68
111
|
}
|
|
69
|
-
),
|
|
70
|
-
xs: "
|
|
71
|
-
sm: "
|
|
72
|
-
md: "
|
|
73
|
-
lg: "
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
112
|
+
), $ = {
|
|
113
|
+
xs: "px-ds-04",
|
|
114
|
+
sm: "px-ds-05",
|
|
115
|
+
md: "px-ds-06",
|
|
116
|
+
lg: "px-ds-07",
|
|
117
|
+
"compact-xs": "px-ds-03",
|
|
118
|
+
"compact-sm": "px-ds-04",
|
|
119
|
+
"compact-md": "px-ds-05"
|
|
120
|
+
}, Re = {
|
|
121
|
+
xs: { start: "-ml-0.5", end: "-mr-0.5" },
|
|
122
|
+
sm: { start: "-ml-1", end: "-mr-1" },
|
|
123
|
+
md: { start: "-ml-1.5", end: "-mr-1.5" },
|
|
124
|
+
lg: { start: "-ml-2", end: "-mr-2" },
|
|
125
|
+
"compact-xs": { start: "-ml-0.5", end: "-mr-0.5" },
|
|
126
|
+
"compact-sm": { start: "-ml-0.5", end: "-mr-0.5" },
|
|
127
|
+
"compact-md": { start: "-ml-1", end: "-mr-1" },
|
|
128
|
+
icon: { start: "", end: "" },
|
|
129
|
+
"icon-xs": { start: "", end: "" },
|
|
130
|
+
"icon-sm": { start: "", end: "" },
|
|
131
|
+
"icon-md": { start: "", end: "" },
|
|
132
|
+
"icon-lg": { start: "", end: "" }
|
|
133
|
+
}, A = {
|
|
80
134
|
xs: "sm",
|
|
81
135
|
sm: "sm",
|
|
82
136
|
md: "sm",
|
|
83
137
|
lg: "md",
|
|
138
|
+
"compact-xs": "sm",
|
|
139
|
+
"compact-sm": "sm",
|
|
140
|
+
"compact-md": "sm",
|
|
84
141
|
icon: "sm",
|
|
85
142
|
"icon-xs": "sm",
|
|
86
143
|
"icon-sm": "sm",
|
|
87
144
|
"icon-md": "sm",
|
|
88
145
|
"icon-lg": "md"
|
|
89
|
-
},
|
|
146
|
+
}, ze = {
|
|
147
|
+
xs: "xs",
|
|
148
|
+
sm: "sm",
|
|
149
|
+
md: "md",
|
|
150
|
+
lg: "lg",
|
|
151
|
+
"compact-xs": "xs",
|
|
152
|
+
"compact-sm": "sm",
|
|
153
|
+
"compact-md": "md",
|
|
154
|
+
icon: "md",
|
|
155
|
+
"icon-xs": "xs",
|
|
156
|
+
"icon-sm": "sm",
|
|
157
|
+
"icon-md": "md",
|
|
158
|
+
"icon-lg": "lg"
|
|
159
|
+
}, Ce = t.forwardRef(
|
|
90
160
|
({
|
|
91
|
-
className:
|
|
92
|
-
variant:
|
|
93
|
-
color:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
161
|
+
className: B,
|
|
162
|
+
variant: H,
|
|
163
|
+
color: J,
|
|
164
|
+
weight: K,
|
|
165
|
+
size: L,
|
|
166
|
+
asChild: Q = !1,
|
|
167
|
+
shape: Y,
|
|
168
|
+
startIcon: h,
|
|
169
|
+
endIcon: y,
|
|
170
|
+
loading: D = !1,
|
|
171
|
+
loadingPosition: k = "start",
|
|
172
|
+
fullWidth: l = !1,
|
|
173
|
+
disabled: I,
|
|
174
|
+
onClick: W,
|
|
175
|
+
onClickAsync: S,
|
|
176
|
+
asyncFeedbackDuration: ee = 1500,
|
|
177
|
+
processing: m,
|
|
178
|
+
processingColor: re,
|
|
179
|
+
processingDisabled: R = !0,
|
|
180
|
+
children: O,
|
|
181
|
+
..._
|
|
182
|
+
}, u) => {
|
|
183
|
+
const g = pe(), o = H ?? g.variant, p = J ?? g.color, F = K ?? g.weight ?? "semibold", x = Y ?? g.shape ?? "default", n = L ?? g.size ?? "md", V = ke(), P = t.useRef(null), G = t.useRef(null), z = t.useRef(void 0);
|
|
184
|
+
t.useEffect(() => {
|
|
185
|
+
const r = G.current, N = P.current;
|
|
186
|
+
if (!(!r || !N || l || V))
|
|
187
|
+
return z.current = requestAnimationFrame(() => {
|
|
188
|
+
N.style.width = "auto";
|
|
189
|
+
const q = r.offsetWidth;
|
|
190
|
+
q > 0 && (N.getBoundingClientRect(), N.style.width = `${q}px`);
|
|
191
|
+
}), () => {
|
|
192
|
+
z.current && cancelAnimationFrame(z.current);
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
const [i, w] = t.useState("idle"), M = t.useRef(void 0), v = t.useRef(!0);
|
|
196
|
+
t.useEffect(() => () => {
|
|
197
|
+
v.current = !1, clearTimeout(M.current);
|
|
111
198
|
}, []);
|
|
112
|
-
const
|
|
113
|
-
!
|
|
114
|
-
|
|
199
|
+
const se = (r) => {
|
|
200
|
+
!S || i !== "idle" || (w("loading"), S(r).then(() => {
|
|
201
|
+
v.current && w("success");
|
|
115
202
|
}).catch(() => {
|
|
116
|
-
|
|
203
|
+
v.current && w("error");
|
|
117
204
|
}).finally(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
205
|
+
v.current && (M.current = setTimeout(() => {
|
|
206
|
+
v.current && w("idle");
|
|
207
|
+
}, ee));
|
|
121
208
|
}));
|
|
122
|
-
},
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
209
|
+
}, C = !!S, a = C ? i === "loading" : D, s = i === "success" || i === "error", U = s ? void 0 : m === !0 ? "working" : m === !1 || !m ? C && i === "loading" && !m ? "working" : void 0 : m, d = !!U, te = re ?? (p === "default" ? "accent" : p) ?? "accent";
|
|
210
|
+
if (Q) {
|
|
211
|
+
const r = {
|
|
125
212
|
className: c(
|
|
126
|
-
|
|
127
|
-
x && "
|
|
128
|
-
|
|
213
|
+
X({ variant: o, color: p, weight: F, size: n }),
|
|
214
|
+
x === "pill" && "rounded-full",
|
|
215
|
+
x === "pill" && $[n],
|
|
216
|
+
l && "w-full",
|
|
217
|
+
B
|
|
129
218
|
),
|
|
130
|
-
ref:
|
|
131
|
-
disabled:
|
|
132
|
-
"aria-busy":
|
|
133
|
-
...
|
|
219
|
+
ref: u,
|
|
220
|
+
disabled: I || a,
|
|
221
|
+
"aria-busy": a || void 0,
|
|
222
|
+
..._
|
|
134
223
|
};
|
|
135
|
-
return /* @__PURE__ */ e(
|
|
224
|
+
return /* @__PURE__ */ e(be, { ...r, children: /* @__PURE__ */ e(he, { children: O }) });
|
|
136
225
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
226
|
+
const f = Re[n] ?? { start: "", end: "" }, Z = o === "solid" || o === "soft" || o === "outline", ae = () => a && k === "start" ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", h && f.start), children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) }) : h ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", f.start, Z && "opacity-90"), children: h }) : null, ne = () => a && k === "end" ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center", y && f.end), children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) }) : y ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", f.end, Z && "opacity-90"), children: y }) : null, oe = t.Children.toArray(O), E = [], b = [];
|
|
227
|
+
oe.forEach((r) => {
|
|
228
|
+
t.isValidElement(r) && r.type?.displayName === "DevalokGrain" ? E.push(r) : b.push(r);
|
|
229
|
+
});
|
|
230
|
+
const ce = () => a && k === "center" ? /* @__PURE__ */ j("span", { className: "relative inline-flex items-center justify-center", children: [
|
|
231
|
+
/* @__PURE__ */ e("span", { className: "invisible", children: b }),
|
|
232
|
+
/* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(T, { size: A[n], variant: "bare" }) })
|
|
233
|
+
] }) : E.length > 0 ? /* @__PURE__ */ e("span", { children: b }) : /* @__PURE__ */ e(ue, { children: b }), ie = s ? i === "success" ? "bg-success-9 text-accent-fg border-transparent hover:bg-success-9" : "bg-error-9 text-accent-fg border-transparent hover:bg-error-9" : void 0, de = s ? /* @__PURE__ */ e("span", { className: c("inline-flex shrink-0 items-center justify-center pointer-events-none", h && f.start), children: /* @__PURE__ */ e(xe, { icon: i === "success" ? ve : fe, animate: "draw" }) }) : null, le = ze[n] ?? "md", me = /* @__PURE__ */ j(
|
|
234
|
+
Se.button,
|
|
142
235
|
{
|
|
143
|
-
|
|
144
|
-
animate: { opacity: 1, scale: 1 },
|
|
145
|
-
exit: { opacity: 0, scale: 0.5 },
|
|
146
|
-
transition: Y.bouncy,
|
|
147
|
-
className: c("inline-flex shrink-0 items-center justify-center", f),
|
|
148
|
-
children: t === "success" ? /* @__PURE__ */ e(L, { className: "h-full w-full" }) : /* @__PURE__ */ e(O, { className: "h-full w-full" })
|
|
149
|
-
},
|
|
150
|
-
t
|
|
151
|
-
) }) : null;
|
|
152
|
-
return /* @__PURE__ */ C(
|
|
153
|
-
"button",
|
|
154
|
-
{
|
|
155
|
-
...N,
|
|
236
|
+
...Ne(_),
|
|
156
237
|
className: c(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
238
|
+
X({
|
|
239
|
+
// When processing (and not showing async feedback), force soft variant so ants pop
|
|
240
|
+
variant: d && !s && o !== "ghost" && o !== "outline" && o !== "link" ? "soft" : o,
|
|
241
|
+
color: p,
|
|
242
|
+
weight: F,
|
|
243
|
+
size: n
|
|
244
|
+
}),
|
|
245
|
+
x === "pill" && "rounded-full",
|
|
246
|
+
x === "pill" && $[n],
|
|
247
|
+
l && "w-full",
|
|
248
|
+
// Asymmetric timing: hover-out is slow+relaxed, hover-in is fast+snappy (applied via hover: override)
|
|
249
|
+
!a && !s && "transition-[color,background-color,border-color,box-shadow,transform,filter] duration-moderate-01 ease-productive-exit",
|
|
250
|
+
!a && !s && "hover:duration-fast-02 hover:ease-productive-entrance",
|
|
251
|
+
!a && !s && "active:scale-[0.95] active:brightness-[0.92] active:saturate-[1.1] active:duration-[0ms]",
|
|
252
|
+
ie,
|
|
253
|
+
s && "transition-colors duration-moderate-01 ease-productive-standard",
|
|
254
|
+
d && R && "pointer-events-none cursor-default",
|
|
255
|
+
B
|
|
163
256
|
),
|
|
164
|
-
ref:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
257
|
+
ref: (r) => {
|
|
258
|
+
G.current = r, typeof u == "function" ? u(r) : u && (u.current = r);
|
|
259
|
+
},
|
|
260
|
+
disabled: I || a && !d,
|
|
261
|
+
"aria-busy": a || d || void 0,
|
|
262
|
+
"aria-disabled": d && R || void 0,
|
|
263
|
+
onClick: C ? se : d && R ? void 0 : W,
|
|
168
264
|
children: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
265
|
+
E,
|
|
266
|
+
s ? de : ae(),
|
|
267
|
+
s ? b : ce(),
|
|
268
|
+
s ? null : ne()
|
|
172
269
|
]
|
|
173
270
|
}
|
|
174
271
|
);
|
|
272
|
+
return /* @__PURE__ */ e(we, { size: le, children: /* @__PURE__ */ j(
|
|
273
|
+
"span",
|
|
274
|
+
{
|
|
275
|
+
ref: P,
|
|
276
|
+
className: c("relative inline-flex", l && "w-full"),
|
|
277
|
+
style: l || V ? void 0 : { transition: "width 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)" },
|
|
278
|
+
children: [
|
|
279
|
+
me,
|
|
280
|
+
/* @__PURE__ */ e(
|
|
281
|
+
ye,
|
|
282
|
+
{
|
|
283
|
+
active: d,
|
|
284
|
+
speed: U ?? "working",
|
|
285
|
+
color: te
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
) });
|
|
175
291
|
}
|
|
176
292
|
);
|
|
177
|
-
|
|
293
|
+
Ce.displayName = "Button";
|
|
178
294
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
295
|
+
Ce as Button,
|
|
296
|
+
X as buttonVariants
|
|
181
297
|
};
|
package/dist/ui/card.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { a as v } from "../_chunks/vendor-utils.js";
|
|
5
5
|
import { tweens as w, springs as b, motionProps as g } from "./lib/motion.js";
|
|
6
6
|
import { cn as o } from "./lib/utils.js";
|
|
7
7
|
import { m } from "../_chunks/framer.js";
|
|
@@ -36,19 +36,18 @@ const x = v(
|
|
|
36
36
|
right: "right-0 top-0 bottom-0 rounded-r-ds-lg",
|
|
37
37
|
bottom: "bottom-0 left-0 right-0 rounded-b-ds-lg"
|
|
38
38
|
};
|
|
39
|
-
function R(r,
|
|
40
|
-
|
|
41
|
-
return `${N[r] ?? ""} ${((e = y[r]) == null ? void 0 : e[a]) ?? ""}`;
|
|
39
|
+
function R(r, e) {
|
|
40
|
+
return `${N[r] ?? ""} ${y[r]?.[e] ?? ""}`;
|
|
42
41
|
}
|
|
43
42
|
function H(r) {
|
|
44
43
|
return C[r] ?? r;
|
|
45
44
|
}
|
|
46
45
|
const P = s.forwardRef(
|
|
47
|
-
({ className: r, variant:
|
|
46
|
+
({ className: r, variant: e, interactive: a, accent: d, accentColor: u = "default", accentWidth: h = 3, children: n, ...i }, c) => {
|
|
48
47
|
const l = o(
|
|
49
|
-
x({ variant:
|
|
48
|
+
x({ variant: e }),
|
|
50
49
|
d && "relative overflow-hidden",
|
|
51
|
-
|
|
50
|
+
a && "hover:shadow-raised-hover hover:border-surface-border-strong cursor-pointer transition-shadow duration-fast-02 ease-productive-standard",
|
|
52
51
|
r
|
|
53
52
|
), f = d ? /* @__PURE__ */ t(
|
|
54
53
|
m.span,
|
|
@@ -61,7 +60,7 @@ const P = s.forwardRef(
|
|
|
61
60
|
style: { backgroundColor: H(u) }
|
|
62
61
|
}
|
|
63
62
|
) : null;
|
|
64
|
-
return
|
|
63
|
+
return a ? /* @__PURE__ */ p(
|
|
65
64
|
m.div,
|
|
66
65
|
{
|
|
67
66
|
ref: c,
|
|
@@ -82,41 +81,41 @@ const P = s.forwardRef(
|
|
|
82
81
|
}
|
|
83
82
|
);
|
|
84
83
|
P.displayName = "Card";
|
|
85
|
-
const T = s.forwardRef(({ className: r, ...
|
|
84
|
+
const T = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
|
|
86
85
|
"div",
|
|
87
86
|
{
|
|
88
|
-
ref:
|
|
87
|
+
ref: a,
|
|
89
88
|
className: o("flex flex-col space-y-ds-02b p-ds-06", r),
|
|
90
|
-
...
|
|
89
|
+
...e
|
|
91
90
|
}
|
|
92
91
|
));
|
|
93
92
|
T.displayName = "CardHeader";
|
|
94
|
-
const j = s.forwardRef(({ className: r, ...
|
|
93
|
+
const j = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
|
|
95
94
|
"div",
|
|
96
95
|
{
|
|
97
|
-
ref:
|
|
96
|
+
ref: a,
|
|
98
97
|
className: o("font-sans font-semibold leading-ds-none tracking-normal text-surface-fg", r),
|
|
99
|
-
...
|
|
98
|
+
...e
|
|
100
99
|
}
|
|
101
100
|
));
|
|
102
101
|
j.displayName = "CardTitle";
|
|
103
|
-
const k = s.forwardRef(({ className: r, ...
|
|
102
|
+
const k = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
|
|
104
103
|
"div",
|
|
105
104
|
{
|
|
106
|
-
ref:
|
|
105
|
+
ref: a,
|
|
107
106
|
className: o("text-ds-md text-surface-fg-muted", r),
|
|
108
|
-
...
|
|
107
|
+
...e
|
|
109
108
|
}
|
|
110
109
|
));
|
|
111
110
|
k.displayName = "CardDescription";
|
|
112
|
-
const A = s.forwardRef(({ className: r, ...
|
|
111
|
+
const A = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t("div", { ref: a, className: o("p-ds-06 pt-0", r), ...e }));
|
|
113
112
|
A.displayName = "CardContent";
|
|
114
|
-
const D = s.forwardRef(({ className: r, ...
|
|
113
|
+
const D = s.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ t(
|
|
115
114
|
"div",
|
|
116
115
|
{
|
|
117
|
-
ref:
|
|
116
|
+
ref: a,
|
|
118
117
|
className: o("flex items-center p-ds-06 pt-0", r),
|
|
119
|
-
...
|
|
118
|
+
...e
|
|
120
119
|
}
|
|
121
120
|
));
|
|
122
121
|
D.displayName = "CardFooter";
|