@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export type ProcessingSpeed = 'ambient' | 'working' | 'urgent';
|
|
3
|
+
export interface ProcessingOverlayProps {
|
|
4
|
+
active: boolean;
|
|
5
|
+
speed: ProcessingSpeed;
|
|
6
|
+
/** Resolved color name — maps to CSS token `--color-{name}-9` */
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Internal overlay component for button processing state.
|
|
11
|
+
* Renders marching ants (SVG dashed rect with animated stroke-dashoffset).
|
|
12
|
+
* Not exported from the barrel — used only by Button.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ProcessingOverlay({ active, speed, color }: ProcessingOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=button-processing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-processing.d.ts","sourceRoot":"","sources":["../../src/ui/button-processing.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE9D,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,eAAe,CAAA;IACtB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;CACd;AAwBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,sBAAsB,2CA6EjF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { A as k, m as w } from "../_chunks/framer.js";
|
|
5
|
+
const v = {
|
|
6
|
+
accent: "var(--color-accent-11)",
|
|
7
|
+
error: "var(--color-error-11)",
|
|
8
|
+
success: "var(--color-success-11)",
|
|
9
|
+
warning: "var(--color-warning-11)",
|
|
10
|
+
neutral: "var(--color-surface-fg)"
|
|
11
|
+
}, C = {
|
|
12
|
+
ambient: 3,
|
|
13
|
+
working: 2,
|
|
14
|
+
urgent: 1
|
|
15
|
+
};
|
|
16
|
+
function N({ active: t, speed: d, color: r }) {
|
|
17
|
+
const n = v[r] ?? v.accent, s = D(), x = C[d], l = e.useRef(null), [u, R] = e.useState(8), [f, E] = e.useState({ array: "8 6", cycle: 14 });
|
|
18
|
+
return e.useEffect(() => {
|
|
19
|
+
const o = l.current?.closest("span")?.previousElementSibling;
|
|
20
|
+
if (!o) return;
|
|
21
|
+
const b = getComputedStyle(o), M = parseFloat(b.borderRadius) || 8, p = o.offsetWidth - 2, h = o.offsetHeight - 2, a = Math.min(M, h / 2, p / 2);
|
|
22
|
+
R(a);
|
|
23
|
+
const m = 2 * (p - 2 * a) + 2 * (h - 2 * a) + 2 * Math.PI * a, c = 8, P = c + 6, y = Math.round(m / P), S = (m - y * c) / y, g = Math.max(2, S);
|
|
24
|
+
E({ array: `${c} ${g.toFixed(1)}`, cycle: c + g });
|
|
25
|
+
}, [t]), /* @__PURE__ */ i(k, { children: t && /* @__PURE__ */ i(
|
|
26
|
+
w.span,
|
|
27
|
+
{
|
|
28
|
+
initial: { opacity: 0 },
|
|
29
|
+
animate: { opacity: 1 },
|
|
30
|
+
exit: { opacity: 0 },
|
|
31
|
+
transition: { duration: 0.2 },
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
className: "absolute inset-0 pointer-events-none",
|
|
34
|
+
children: /* @__PURE__ */ i(
|
|
35
|
+
"svg",
|
|
36
|
+
{
|
|
37
|
+
className: "absolute inset-0 w-full h-full",
|
|
38
|
+
style: { overflow: "visible" },
|
|
39
|
+
children: /* @__PURE__ */ i(
|
|
40
|
+
w.rect,
|
|
41
|
+
{
|
|
42
|
+
ref: l,
|
|
43
|
+
x: "1",
|
|
44
|
+
y: "1",
|
|
45
|
+
width: "calc(100% - 2px)",
|
|
46
|
+
height: "calc(100% - 2px)",
|
|
47
|
+
rx: u,
|
|
48
|
+
ry: u,
|
|
49
|
+
fill: "none",
|
|
50
|
+
stroke: n,
|
|
51
|
+
strokeWidth: "2",
|
|
52
|
+
strokeDasharray: f.array,
|
|
53
|
+
style: { transition: "stroke 0.3s ease" },
|
|
54
|
+
animate: s ? {} : { strokeDashoffset: [0, -f.cycle] },
|
|
55
|
+
transition: s ? {} : {
|
|
56
|
+
duration: x,
|
|
57
|
+
ease: "linear",
|
|
58
|
+
repeat: 1 / 0
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
},
|
|
65
|
+
"processing-ants"
|
|
66
|
+
) });
|
|
67
|
+
}
|
|
68
|
+
function D() {
|
|
69
|
+
const [t, d] = e.useState(() => typeof window > "u" ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
70
|
+
return e.useEffect(() => {
|
|
71
|
+
const r = window.matchMedia("(prefers-reduced-motion: reduce)"), n = (s) => d(s.matches);
|
|
72
|
+
return r.addEventListener("change", n), () => r.removeEventListener("change", n);
|
|
73
|
+
}, []), t;
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
N as ProcessingOverlay
|
|
77
|
+
};
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,21 +2,31 @@
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "link" | "outline" | "default" | "solid" | "
|
|
6
|
-
color?: "default" | "error" | null | undefined;
|
|
7
|
-
|
|
5
|
+
variant?: "link" | "outline" | "default" | "solid" | "soft" | "ghost" | "destructive" | null | undefined;
|
|
6
|
+
color?: "default" | "accent" | "success" | "error" | "warning" | "neutral" | null | undefined;
|
|
7
|
+
weight?: "normal" | "semibold" | null | undefined;
|
|
8
|
+
size?: "xs" | "sm" | "md" | "lg" | "icon" | "compact-xs" | "compact-sm" | "compact-md" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
8
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
10
|
/**
|
|
10
11
|
* Props for Button — the primary action component with a two-axis variant system,
|
|
11
|
-
*
|
|
12
|
+
* multiple size options, icon slots, and a built-in loading state.
|
|
12
13
|
*
|
|
13
14
|
* **Two axes:**
|
|
14
|
-
* - `variant` controls **visual style**: `"solid"` (default, filled
|
|
15
|
-
* `"ghost"` (transparent, for toolbars) | `"link"` (underline, inline
|
|
16
|
-
* - `color` controls **semantic intent**: `"
|
|
15
|
+
* - `variant` controls **visual style**: `"solid"` (default, filled) | `"soft"` (tinted bg) |
|
|
16
|
+
* `"outline"` (bordered) | `"ghost"` (transparent, for toolbars) | `"link"` (underline, inline)
|
|
17
|
+
* - `color` controls **semantic intent**: `"accent"` (default, brand) | `"error"` (destructive) |
|
|
18
|
+
* `"success"` | `"warning"` | `"neutral"` (subdued)
|
|
17
19
|
*
|
|
18
|
-
* **Sizes:** `sm` | `md` (default) | `lg` for text buttons;
|
|
19
|
-
* `
|
|
20
|
+
* **Sizes:** `xs` | `sm` | `md` (default) | `lg` for text buttons;
|
|
21
|
+
* `compact-xs` | `compact-sm` | `compact-md` for height-less inline buttons;
|
|
22
|
+
* `icon` | `icon-xs` | `icon-sm` | `icon-md` | `icon-lg` for square icon-only buttons.
|
|
23
|
+
*
|
|
24
|
+
* **Shape:** `"default"` uses per-size border-radius; `"pill"` applies `rounded-full`.
|
|
25
|
+
*
|
|
26
|
+
* **Weight:** `"semibold"` (default) | `"normal"` for lighter labels.
|
|
27
|
+
*
|
|
28
|
+
* **Note:** `ghost` + `accent` renders with neutral styling for backward compat —
|
|
29
|
+
* most ghost buttons are toolbar/icon actions where neutral is expected.
|
|
20
30
|
*
|
|
21
31
|
* **Loading:** When `loading={true}` the button is disabled and aria-busy is set.
|
|
22
32
|
* Use `loadingPosition` to control where the spinner appears.
|
|
@@ -26,34 +36,37 @@ export declare const buttonVariants: (props?: ({
|
|
|
26
36
|
* <Button onClick={handleSave}>Save changes</Button>
|
|
27
37
|
*
|
|
28
38
|
* @example
|
|
29
|
-
* //
|
|
30
|
-
* <Button variant="
|
|
31
|
-
*
|
|
39
|
+
* // Soft success feedback:
|
|
40
|
+
* <Button variant="soft" color="success" startIcon={<Icon icon={IconCheck} />}>
|
|
41
|
+
* Approved
|
|
32
42
|
* </Button>
|
|
33
43
|
*
|
|
34
44
|
* @example
|
|
35
|
-
* //
|
|
36
|
-
* <Button variant="
|
|
37
|
-
*
|
|
45
|
+
* // Destructive delete with loading state:
|
|
46
|
+
* <Button variant="solid" color="error" startIcon={<Icon icon={IconTrash} />} loading={isDeleting}>
|
|
47
|
+
* Delete project
|
|
38
48
|
* </Button>
|
|
39
49
|
*
|
|
40
50
|
* @example
|
|
41
|
-
* //
|
|
42
|
-
* <Button
|
|
43
|
-
*
|
|
51
|
+
* // Compact pill tag:
|
|
52
|
+
* <Button variant="soft" color="warning" size="compact-sm" shape="pill">
|
|
53
|
+
* Overdue
|
|
44
54
|
* </Button>
|
|
45
55
|
*
|
|
46
56
|
* @example
|
|
47
|
-
* //
|
|
48
|
-
* <Button variant="
|
|
49
|
-
*
|
|
57
|
+
* // Ghost toolbar action:
|
|
58
|
+
* <Button variant="ghost" size="sm" startIcon={<Icon icon={IconEdit} />}>
|
|
59
|
+
* Edit
|
|
60
|
+
* </Button>
|
|
50
61
|
*/
|
|
51
62
|
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
|
|
52
63
|
asChild?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
/** Icon element rendered
|
|
56
|
-
|
|
64
|
+
/** Button shape — 'pill' applies rounded-full for chip/tag-like buttons */
|
|
65
|
+
shape?: 'default' | 'pill';
|
|
66
|
+
/** Icon element rendered before children — use <Icon icon={...} /> */
|
|
67
|
+
startIcon?: React.ReactElement | null;
|
|
68
|
+
/** Icon element rendered after children — use <Icon icon={...} /> */
|
|
69
|
+
endIcon?: React.ReactElement | null;
|
|
57
70
|
/** Show loading spinner and disable button */
|
|
58
71
|
loading?: boolean;
|
|
59
72
|
/** Where to render the spinner: replaces startIcon, endIcon, or centers over children */
|
|
@@ -69,6 +82,18 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
69
82
|
onClickAsync?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
|
|
70
83
|
/** How long (ms) to show the success/error state before reverting. Default: 1500 */
|
|
71
84
|
asyncFeedbackDuration?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Show processing animation — animated border/glow while content stays visible.
|
|
87
|
+
* `true` = "working" speed. Semantic speeds:
|
|
88
|
+
* - `"ambient"` (3s) — background sync, file upload
|
|
89
|
+
* - `"working"` (2s) — standard API call, generation
|
|
90
|
+
* - `"urgent"` (1s) — retry, nearly done
|
|
91
|
+
*/
|
|
92
|
+
processing?: boolean | 'ambient' | 'working' | 'urgent';
|
|
93
|
+
/** Override processing animation color. Defaults to button's own color. */
|
|
94
|
+
processingColor?: 'accent' | 'error' | 'success' | 'warning' | 'neutral';
|
|
95
|
+
/** Disable button during processing. Default: true. Set false for cancel-by-click patterns. */
|
|
96
|
+
processingDisabled?: boolean;
|
|
72
97
|
}
|
|
73
98
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
74
99
|
export { Button };
|
package/dist/ui/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,eAAO,MAAM,cAAc;;;;;8EAsG1B,CAAA;AAoDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,EAClE,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC1B,sEAAsE;IACtE,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;IACrC,qEAAqE;IACrE,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;IACnC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yFAAyF;IACzF,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;IAC5C,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxE,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;IAEvD,2EAA2E;IAC3E,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAExE,+FAA+F;IAC/F,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,QAAA,MAAM,MAAM,uFAkRX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|