@devalok/shilp-sutra 0.55.1 → 0.56.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/BREAKING.json +13 -0
- package/MIGRATION.md +56 -0
- package/README.md +16 -1
- package/dist/_chunks/badge-group.js +45 -45
- package/dist/_chunks/emoji-suggestion.js +32 -30
- package/dist/_chunks/emoji-suggestion.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +35 -34
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/primitives-internal.js +437 -537
- package/dist/_chunks/primitives-internal.js.map +1 -1
- package/dist/composed/content-card.js +18 -18
- package/dist/composed/extensions/emoji-node.js +8 -7
- package/dist/composed/extensions/emoji-node.js.map +1 -1
- package/dist/composed/rich-chat-input.js +535 -526
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.js +201 -193
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/ui/alert.js +29 -29
- package/dist/ui/avatar.js +42 -42
- package/dist/ui/banner.js +25 -25
- package/dist/ui/button.js +31 -31
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.js +39 -39
- package/dist/ui/combobox.js +135 -135
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/dot.js +13 -13
- package/dist/ui/input.js +25 -25
- package/dist/ui/lib/utils.js +2 -1
- package/dist/ui/lib/utils.js.map +1 -1
- package/dist/ui/number-input.js +36 -36
- package/dist/ui/progress.js +55 -55
- package/dist/ui/select.js +58 -58
- package/dist/ui/sheet.js +46 -46
- package/dist/ui/sidebar.js +128 -128
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.js +39 -39
- package/dist/ui/slider.js +18 -18
- package/dist/ui/surface.js +9 -9
- package/dist/ui/tabs.js +47 -47
- package/dist/ui/text.js +8 -8
- package/dist/ui/textarea.js +12 -12
- package/dist/ui/toggle.js +12 -12
- package/docs/recipes/install-astro.md +2 -2
- package/docs/recipes/install-next-app-router.md +2 -2
- package/docs/recipes/install-remix.md +2 -2
- package/docs/recipes/install-tanstack-start.md +2 -2
- package/docs/recipes/install-vite.md +2 -2
- package/docs/recipes/troubleshoot.md +26 -5
- package/llms.txt +1 -1
- package/mcp-manifest.json +24 -3
- package/package.json +38 -11
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +1 -1
- package/skill/references/setup-astro.md +2 -2
- package/skill/references/setup-next-app-router.md +2 -2
- package/skill/references/setup-remix.md +2 -2
- package/skill/references/setup-tanstack-start.md +2 -2
- package/skill/references/setup-vite.md +2 -2
- package/skill/references/troubleshoot.md +26 -5
- package/dist/_chunks/tiptap.js +0 -18809
- package/dist/_chunks/tiptap.js.map +0 -1
- package/dist/_chunks/vendor-utils.js +0 -1766
- package/dist/_chunks/vendor-utils.js.map +0 -1
- package/scripts/welcome.mjs +0 -312
package/dist/ui/dot.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { cn as e } from "./lib/utils.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { cva as i } from "class-variance-authority";
|
|
6
6
|
//#region src/ui/dot.tsx
|
|
7
7
|
var a = {
|
|
8
8
|
accent: "bg-accent-9",
|
|
@@ -40,7 +40,7 @@ var a = {
|
|
|
40
40
|
slow: "2s",
|
|
41
41
|
normal: "1s",
|
|
42
42
|
fast: "0.6s"
|
|
43
|
-
}, u =
|
|
43
|
+
}, u = i("relative inline-flex shrink-0 rounded-pill", {
|
|
44
44
|
variants: { size: {
|
|
45
45
|
xs: "h-1 w-1",
|
|
46
46
|
sm: "h-1.5 w-1.5",
|
|
@@ -53,26 +53,26 @@ var a = {
|
|
|
53
53
|
sm: "text-body-xs",
|
|
54
54
|
md: "text-body-sm",
|
|
55
55
|
lg: "text-body-sm"
|
|
56
|
-
}, f =
|
|
57
|
-
let C =
|
|
58
|
-
className:
|
|
56
|
+
}, f = t.forwardRef(({ color: t = "neutral", size: i = "md", variant: f = "filled", withBorder: p = !1, pulse: m = !1, pulseSpeed: h = "normal", label: g, labelPosition: _ = "end", labelClassName: v, className: y, "aria-label": b, ...x }, S) => {
|
|
57
|
+
let C = i ?? "md", w = g != null || b != null, T = m && f !== "off", E = e(u({ size: C }), f === "filled" && a[t], f === "ring" && e("border-[1.5px] bg-transparent", o[t]), f === "off" && e("border", s[t]), p && "ring-2 ring-surface-raised"), D = g == null ? null : /* @__PURE__ */ n("span", {
|
|
58
|
+
className: e(d[C], c[t], "font-sans", v),
|
|
59
59
|
children: g
|
|
60
60
|
});
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ r("span", {
|
|
62
62
|
ref: S,
|
|
63
63
|
role: w ? "status" : void 0,
|
|
64
64
|
"aria-hidden": !w || void 0,
|
|
65
65
|
"aria-label": b,
|
|
66
|
-
className:
|
|
66
|
+
className: e("inline-flex items-center gap-ds-02", y),
|
|
67
67
|
...x,
|
|
68
68
|
children: [
|
|
69
69
|
_ === "start" && D,
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ n("span", {
|
|
71
71
|
className: "relative inline-flex shrink-0",
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ n("span", {
|
|
73
73
|
"data-pulse": T ? "" : void 0,
|
|
74
74
|
style: T ? { animationDuration: l[h] } : void 0,
|
|
75
|
-
className:
|
|
75
|
+
className: e(E, T && "animate-pulse motion-reduce:animate-none")
|
|
76
76
|
})
|
|
77
77
|
}),
|
|
78
78
|
_ === "end" && D
|
package/dist/ui/input.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { IconProvider as e } from "./icon-context.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
3
|
+
import { cn as t } from "./lib/utils.js";
|
|
4
|
+
import { useFormField as n } from "./form.js";
|
|
5
|
+
import { resolveFieldState as r } from "../_chunks/field-state.js";
|
|
6
|
+
import * as i from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { cva as s } from "class-variance-authority";
|
|
9
9
|
//#region src/ui/input.tsx
|
|
10
|
-
var c =
|
|
10
|
+
var c = s([
|
|
11
11
|
"relative flex items-center w-full font-sans",
|
|
12
12
|
"bg-surface-raised-hover text-surface-fg",
|
|
13
13
|
"border border-surface-border-strong rounded-control",
|
|
@@ -34,8 +34,8 @@ var c = t([
|
|
|
34
34
|
sm: "sm",
|
|
35
35
|
md: "md",
|
|
36
36
|
lg: "lg"
|
|
37
|
-
}, d =
|
|
38
|
-
let S = f ?? "md", C =
|
|
37
|
+
}, d = i.forwardRef(({ className: i, type: s, state: d, size: f = "md", startSection: p, endSection: m, startSectionClickable: h, endSectionClickable: g, startSectionType: _, endSectionType: v, wrapperClassName: y, ...b }, x) => {
|
|
38
|
+
let S = f ?? "md", C = n(), w = r(d, C.state), T = b["aria-describedby"] ?? C.helperTextId, E = b["aria-required"] ?? C.required, D = b.id ?? C.inputId, O = !!p, k = !!m, A = _ ?? (typeof p == "string" ? "label" : "icon"), j = v ?? (typeof m == "string" ? "label" : "icon"), M = {
|
|
39
39
|
xs: "px-ds-02",
|
|
40
40
|
sm: "px-ds-02",
|
|
41
41
|
md: "px-ds-03",
|
|
@@ -46,28 +46,28 @@ var c = t([
|
|
|
46
46
|
md: "text-body-sm",
|
|
47
47
|
lg: "text-body-md"
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
className:
|
|
49
|
+
return /* @__PURE__ */ o("div", {
|
|
50
|
+
className: t(c({ size: S }), w === "error" && "border-error-7 focus-within:ring-error-7", w === "warning" && "border-warning-7 focus-within:ring-warning-7", w === "success" && "border-success-7 focus-within:ring-success-7", y),
|
|
51
51
|
children: [
|
|
52
|
-
O && A === "label" && /* @__PURE__ */
|
|
53
|
-
className:
|
|
52
|
+
O && A === "label" && /* @__PURE__ */ a("span", {
|
|
53
|
+
className: t("flex items-center shrink-0 select-none self-stretch", "border-r border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-l-[inherit]", M[S], N[S], !h && "pointer-events-none"),
|
|
54
54
|
children: p
|
|
55
55
|
}),
|
|
56
|
-
O && A === "icon" && /* @__PURE__ */
|
|
56
|
+
O && A === "icon" && /* @__PURE__ */ a(e, {
|
|
57
57
|
size: u[S],
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
className:
|
|
58
|
+
children: /* @__PURE__ */ a("span", {
|
|
59
|
+
className: t("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !h && "pointer-events-none"),
|
|
60
60
|
children: p
|
|
61
61
|
})
|
|
62
62
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
type:
|
|
65
|
-
className:
|
|
63
|
+
/* @__PURE__ */ a("input", {
|
|
64
|
+
type: s,
|
|
65
|
+
className: t("flex-1 min-w-0 h-full bg-transparent outline-hidden font-sans", "placeholder:text-surface-fg-subtle", "disabled:cursor-not-allowed", "read-only:cursor-default", {
|
|
66
66
|
xs: "px-ds-02",
|
|
67
67
|
sm: "px-ds-03",
|
|
68
68
|
md: "px-ds-03",
|
|
69
69
|
lg: "px-ds-04"
|
|
70
|
-
}[S], O && A === "icon" && "pl-0", k && j === "icon" && "pr-0",
|
|
70
|
+
}[S], O && A === "icon" && "pl-0", k && j === "icon" && "pr-0", i),
|
|
71
71
|
"aria-invalid": w === "error" || void 0,
|
|
72
72
|
"aria-describedby": T,
|
|
73
73
|
"aria-required": E || void 0,
|
|
@@ -75,14 +75,14 @@ var c = t([
|
|
|
75
75
|
...b,
|
|
76
76
|
id: D
|
|
77
77
|
}),
|
|
78
|
-
k && j === "label" && /* @__PURE__ */
|
|
79
|
-
className:
|
|
78
|
+
k && j === "label" && /* @__PURE__ */ a("span", {
|
|
79
|
+
className: t("flex items-center shrink-0 select-none self-stretch", "border-l border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-r-[inherit]", M[S], N[S], !g && "pointer-events-none"),
|
|
80
80
|
children: m
|
|
81
81
|
}),
|
|
82
|
-
k && j === "icon" && /* @__PURE__ */
|
|
82
|
+
k && j === "icon" && /* @__PURE__ */ a(e, {
|
|
83
83
|
size: u[S],
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
className:
|
|
84
|
+
children: /* @__PURE__ */ a("span", {
|
|
85
|
+
className: t("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !g && "pointer-events-none"),
|
|
86
86
|
children: m
|
|
87
87
|
})
|
|
88
88
|
})
|
package/dist/ui/lib/utils.js
CHANGED
package/dist/ui/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/ui/lib/utils.ts"],"sourcesContent":["// @server-safe\nimport { type ClassValue,clsx } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n spacing: ['ds-01', 'ds-02', 'ds-02b', 'ds-03', 'ds-04', 'ds-05', 'ds-05b', 'ds-06', 'ds-06b', 'ds-07', 'ds-08', 'ds-09', 'ds-10', 'ds-11', 'ds-12', 'ds-13'],\n },\n classGroups: {\n // All size ramps live in the font-size group so they're mutually exclusive\n // with EACH OTHER but NOT confused with text-COLOR utilities (text-error-11,\n // text-surface-fg, …). Without registering these, tw-merge classifies\n // `text-body-md` as a colour and silently strips a real colour on the same element.\n 'font-size': [\n { 'text-ds': ['xs', 'sm', 'md', 'base', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'] },\n { 'text-heading': ['2xl', 'xl', 'lg', 'md', 'sm', 'xs'] },\n { 'text-body': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label-plain': ['lg', 'md', 'sm'] },\n 'text-caption',\n 'text-code',\n ],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/ui/lib/utils.ts"],"sourcesContent":["// @server-safe\nimport { type ClassValue,clsx } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n spacing: ['ds-01', 'ds-02', 'ds-02b', 'ds-03', 'ds-04', 'ds-05', 'ds-05b', 'ds-06', 'ds-06b', 'ds-07', 'ds-08', 'ds-09', 'ds-10', 'ds-11', 'ds-12', 'ds-13'],\n },\n classGroups: {\n // All size ramps live in the font-size group so they're mutually exclusive\n // with EACH OTHER but NOT confused with text-COLOR utilities (text-error-11,\n // text-surface-fg, …). Without registering these, tw-merge classifies\n // `text-body-md` as a colour and silently strips a real colour on the same element.\n 'font-size': [\n { 'text-ds': ['xs', 'sm', 'md', 'base', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'] },\n { 'text-heading': ['2xl', 'xl', 'lg', 'md', 'sm', 'xs'] },\n { 'text-body': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label-plain': ['lg', 'md', 'sm'] },\n 'text-caption',\n 'text-code',\n ],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;AAIA,IAAM,IAAU,EAAoB,EAClC,QAAQ;CACN,OAAO,EACL,SAAS;EAAC;EAAS;EAAS;EAAU;EAAS;EAAS;EAAS;EAAU;EAAS;EAAU;EAAS;EAAS;EAAS;EAAS;EAAS;EAAS;CAAO,EAC7J;CACA,aAAa,EAKX,aAAa;EACX,EAAE,WAAW;GAAC;GAAM;GAAM;GAAM;GAAQ;GAAM;GAAM;GAAO;GAAO;GAAO;GAAO;EAAK,EAAE;EACvF,EAAE,gBAAgB;GAAC;GAAO;GAAM;GAAM;GAAM;GAAM;EAAI,EAAE;EACxD,EAAE,aAAa;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACxC,EAAE,cAAc;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACzC,EAAE,oBAAoB;GAAC;GAAM;GAAM;EAAI,EAAE;EACzC;EACA;CACF,EACF;AACF,EACF,CAAC;AAED,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}
|
package/dist/ui/number-input.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { cn as e } from "./lib/utils.js";
|
|
3
|
+
import { Icon as t } from "./icon.js";
|
|
4
|
+
import { useFormField as n } from "./form.js";
|
|
5
|
+
import { resolveFieldState as r } from "../_chunks/field-state.js";
|
|
6
|
+
import * as i from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { IconMinus as s, IconPlus as c } from "@tabler/icons-react";
|
|
9
|
+
import { cva as l } from "class-variance-authority";
|
|
10
10
|
//#region src/ui/number-input.tsx
|
|
11
|
-
var u =
|
|
11
|
+
var u = l("flex items-center justify-between rounded-control border border-surface-border-strong", {
|
|
12
12
|
variants: { size: {
|
|
13
13
|
xs: "h-ds-xs-plus",
|
|
14
14
|
sm: "h-ds-sm",
|
|
@@ -36,43 +36,43 @@ var u = e("flex items-center justify-between rounded-control border border-surfa
|
|
|
36
36
|
error: "border-error-7",
|
|
37
37
|
warning: "border-warning-7",
|
|
38
38
|
success: "border-success-7"
|
|
39
|
-
}, h =
|
|
40
|
-
let T = b ?? "md", E =
|
|
39
|
+
}, h = i.forwardRef(({ value: i = 0, onValueChange: l, min: h = -(2 ** 53 - 1), max: g = 2 ** 53 - 1, step: _ = 1, disabled: v = !1, className: y, size: b = "md", state: x, "aria-label": S, ...C }, w) => {
|
|
40
|
+
let T = b ?? "md", E = n(), D = S ?? (C.id || E.helperTextId ? void 0 : "Numeric value"), O = r(x, E.state) ?? "default", k = (e) => {
|
|
41
41
|
let t = e.target.value.trim();
|
|
42
42
|
if (t === "" || t === "-") {
|
|
43
|
-
|
|
43
|
+
l?.(h >= 0 ? h : 0);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
let n = Number(t);
|
|
47
|
-
Number.isNaN(n) ||
|
|
48
|
-
}, A = (
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
}, j = (
|
|
53
|
-
|
|
54
|
-
let
|
|
55
|
-
|
|
47
|
+
Number.isNaN(n) || l?.(Math.min(Math.max(n, h), g));
|
|
48
|
+
}, A = (e) => {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
let t = i + _;
|
|
51
|
+
t <= g && l?.(t);
|
|
52
|
+
}, j = (e) => {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
let t = i - _;
|
|
55
|
+
t >= h && l?.(t);
|
|
56
56
|
}, M = d[T], N = f[T], P = p[T];
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
className:
|
|
57
|
+
return /* @__PURE__ */ o("div", {
|
|
58
|
+
className: e(u({ size: T }), m[O], y),
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ a("button", {
|
|
61
61
|
type: "button",
|
|
62
62
|
onClick: j,
|
|
63
|
-
disabled: v ||
|
|
63
|
+
disabled: v || i <= h,
|
|
64
64
|
"aria-label": "Decrease value",
|
|
65
65
|
title: "Decrease",
|
|
66
|
-
className:
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
icon:
|
|
66
|
+
className: e("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
|
|
67
|
+
children: /* @__PURE__ */ a(t, {
|
|
68
|
+
icon: s,
|
|
69
69
|
size: N
|
|
70
70
|
})
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ a("input", {
|
|
73
73
|
ref: w,
|
|
74
74
|
type: "number",
|
|
75
|
-
value:
|
|
75
|
+
value: i,
|
|
76
76
|
onChange: k,
|
|
77
77
|
min: h,
|
|
78
78
|
max: g,
|
|
@@ -81,19 +81,19 @@ var u = e("flex items-center justify-between rounded-control border border-surfa
|
|
|
81
81
|
"aria-label": D,
|
|
82
82
|
"aria-invalid": O === "error" || void 0,
|
|
83
83
|
"aria-describedby": C["aria-describedby"] ?? E.helperTextId,
|
|
84
|
-
className:
|
|
84
|
+
className: e("bg-transparent font-semibold border-0 text-center text-surface-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", P),
|
|
85
85
|
...C,
|
|
86
86
|
id: C.id ?? E.inputId
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ a("button", {
|
|
89
89
|
type: "button",
|
|
90
90
|
onClick: A,
|
|
91
|
-
disabled: v ||
|
|
91
|
+
disabled: v || i >= g,
|
|
92
92
|
"aria-label": "Increase value",
|
|
93
93
|
title: "Increase",
|
|
94
|
-
className:
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
icon:
|
|
94
|
+
className: e("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
|
|
95
|
+
children: /* @__PURE__ */ a(t, {
|
|
96
|
+
icon: c,
|
|
97
97
|
size: N
|
|
98
98
|
})
|
|
99
99
|
})
|
package/dist/ui/progress.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { springs as e } from "./lib/motion.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { cn as t } from "./lib/utils.js";
|
|
4
|
+
import { Root as n } from "../_chunks/primitives/react-progress.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { motion as o } from "framer-motion";
|
|
8
|
+
import { cva as s } from "class-variance-authority";
|
|
9
9
|
//#region src/ui/progress.tsx
|
|
10
|
-
var c =
|
|
10
|
+
var c = s("relative w-full overflow-hidden rounded-pill bg-surface-raised", {
|
|
11
11
|
variants: { size: {
|
|
12
12
|
sm: "h-1",
|
|
13
13
|
md: "h-2",
|
|
@@ -19,127 +19,127 @@ var c = t("relative w-full overflow-hidden rounded-pill bg-surface-raised", {
|
|
|
19
19
|
success: "bg-success-9",
|
|
20
20
|
warning: "bg-warning-9",
|
|
21
21
|
error: "bg-error-9"
|
|
22
|
-
}, u =
|
|
22
|
+
}, u = s("h-full transition-[width] duration-moderate-02 ease-expressive-standard", {
|
|
23
23
|
variants: { color: l },
|
|
24
24
|
defaultVariants: { color: "accent" }
|
|
25
25
|
});
|
|
26
26
|
function d(e) {
|
|
27
27
|
return e == null ? "accent" : e > 100 ? "error" : e >= 85 ? "success" : e >= 60 ? "warning" : "accent";
|
|
28
28
|
}
|
|
29
|
-
var f = (e, t) => Math.max(0, Math.min(100, e / t * 100)), p =
|
|
29
|
+
var f = (e, t) => Math.max(0, Math.min(100, e / t * 100)), p = r.createContext(null);
|
|
30
30
|
function m(e) {
|
|
31
|
-
let t =
|
|
31
|
+
let t = r.useContext(p);
|
|
32
32
|
if (!t) throw Error(`<Progress.${e}> must be rendered inside <Progress.Root>.`);
|
|
33
33
|
return t;
|
|
34
34
|
}
|
|
35
|
-
var h =
|
|
36
|
-
let u =
|
|
35
|
+
var h = r.forwardRef(({ value: e = null, max: n = 100, size: a = "md", className: o, children: s, ...c }, l) => {
|
|
36
|
+
let u = r.useMemo(() => ({
|
|
37
37
|
value: e,
|
|
38
|
-
max:
|
|
39
|
-
size:
|
|
38
|
+
max: n,
|
|
39
|
+
size: a,
|
|
40
40
|
indeterminate: e == null
|
|
41
41
|
}), [
|
|
42
42
|
e,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
n,
|
|
44
|
+
a
|
|
45
45
|
]);
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ i(p.Provider, {
|
|
47
47
|
value: u,
|
|
48
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ i("div", {
|
|
49
49
|
ref: l,
|
|
50
|
-
className:
|
|
50
|
+
className: t("flex w-full items-center gap-ds-03", o),
|
|
51
51
|
...c,
|
|
52
52
|
children: s
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
h.displayName = "Progress.Root";
|
|
57
|
-
var g =
|
|
57
|
+
var g = r.forwardRef(({ className: e, children: r, ...a }, o) => {
|
|
58
58
|
let { value: s, max: l, size: u, indeterminate: d } = m("Track");
|
|
59
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ i(n, {
|
|
60
60
|
ref: o,
|
|
61
61
|
value: d ? null : s,
|
|
62
62
|
max: l,
|
|
63
|
-
className:
|
|
64
|
-
...
|
|
65
|
-
children:
|
|
63
|
+
className: t(c({ size: u }), "flex-1", e),
|
|
64
|
+
...a,
|
|
65
|
+
children: r
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
g.displayName = "Progress.Track";
|
|
69
|
-
var _ =
|
|
70
|
-
let { value: l, max: p, indeterminate: h } = m("Indicator"), g =
|
|
71
|
-
return h ? /* @__PURE__ */
|
|
69
|
+
var _ = r.forwardRef(({ color: n, autoColor: r, className: a, ...s }, c) => {
|
|
70
|
+
let { value: l, max: p, indeterminate: h } = m("Indicator"), g = n ?? (r === !1 ? "accent" : d(l));
|
|
71
|
+
return h ? /* @__PURE__ */ i("div", {
|
|
72
72
|
ref: c,
|
|
73
|
-
className:
|
|
74
|
-
...
|
|
75
|
-
}) : /* @__PURE__ */
|
|
73
|
+
className: t(u({ color: g }), "w-2/5 animate-progress-indeterminate motion-reduce:animate-none", a),
|
|
74
|
+
...s
|
|
75
|
+
}) : /* @__PURE__ */ i(o.div, {
|
|
76
76
|
ref: c,
|
|
77
|
-
className:
|
|
77
|
+
className: t(u({ color: g }), "transition-colors", a),
|
|
78
78
|
initial: !1,
|
|
79
79
|
animate: { width: `${f(l ?? 0, p)}%` },
|
|
80
80
|
transition: e.smooth,
|
|
81
|
-
...
|
|
81
|
+
...s
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
_.displayName = "Progress.Indicator";
|
|
85
|
-
var v =
|
|
85
|
+
var v = r.forwardRef(({ value: e, color: n = "accent", className: r, style: a, ...o }, s) => {
|
|
86
86
|
let { max: c } = m("Segment");
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ i("div", {
|
|
88
88
|
ref: s,
|
|
89
89
|
"aria-hidden": "true",
|
|
90
|
-
className:
|
|
90
|
+
className: t("h-full first:rounded-l-pill last:rounded-r-pill", l[n], r),
|
|
91
91
|
style: {
|
|
92
92
|
width: `${f(e, c)}%`,
|
|
93
|
-
...
|
|
93
|
+
...a
|
|
94
94
|
},
|
|
95
95
|
...o
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
v.displayName = "Progress.Segment";
|
|
99
|
-
var y =
|
|
99
|
+
var y = r.forwardRef(({ className: e, ...n }, r) => (m("Label"), /* @__PURE__ */ i("span", {
|
|
100
100
|
ref: r,
|
|
101
|
-
className:
|
|
102
|
-
...
|
|
101
|
+
className: t("shrink-0 text-body-sm font-medium text-surface-fg", e),
|
|
102
|
+
...n
|
|
103
103
|
})));
|
|
104
104
|
y.displayName = "Progress.Label";
|
|
105
|
-
var b =
|
|
105
|
+
var b = r.forwardRef(({ className: e, format: n, children: r, ...a }, o) => {
|
|
106
106
|
let { value: s, max: c, indeterminate: l } = m("Value"), u = l ? 0 : f(s ?? 0, c);
|
|
107
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ i("span", {
|
|
108
108
|
ref: o,
|
|
109
|
-
className:
|
|
110
|
-
...
|
|
111
|
-
children: r ?? (l ? "" :
|
|
109
|
+
className: t("shrink-0 text-caption text-surface-fg-muted tabular-nums", e),
|
|
110
|
+
...a,
|
|
111
|
+
children: r ?? (l ? "" : n ? n(u, s, c) : `${Math.round(u)}%`)
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
b.displayName = "Progress.Value";
|
|
115
|
-
var x =
|
|
116
|
-
let T =
|
|
117
|
-
return /* @__PURE__ */
|
|
115
|
+
var x = r.forwardRef(({ value: e = null, max: n = 100, size: o, color: s, autoColor: c, label: l, showValue: u, segments: d, trackClassName: f, indicatorClassName: p, className: m, "aria-label": x, "aria-labelledby": S, ...C }, w) => {
|
|
116
|
+
let T = r.useId(), E = l != null;
|
|
117
|
+
return /* @__PURE__ */ a(h, {
|
|
118
118
|
ref: w,
|
|
119
119
|
value: e,
|
|
120
|
-
max:
|
|
121
|
-
size:
|
|
120
|
+
max: n,
|
|
121
|
+
size: o ?? "md",
|
|
122
122
|
className: m,
|
|
123
123
|
...C,
|
|
124
124
|
children: [
|
|
125
|
-
E && /* @__PURE__ */
|
|
125
|
+
E && /* @__PURE__ */ i(y, {
|
|
126
126
|
id: T,
|
|
127
127
|
children: l
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ i(g, {
|
|
130
130
|
"aria-label": x,
|
|
131
131
|
"aria-labelledby": S ?? (E ? T : void 0),
|
|
132
|
-
className:
|
|
133
|
-
children: d ? d.map((e, t) => /* @__PURE__ */
|
|
132
|
+
className: t(d && "flex", f),
|
|
133
|
+
children: d ? d.map((e, t) => /* @__PURE__ */ i(v, {
|
|
134
134
|
value: e.value,
|
|
135
135
|
color: e.color
|
|
136
|
-
}, t)) : /* @__PURE__ */
|
|
136
|
+
}, t)) : /* @__PURE__ */ i(_, {
|
|
137
137
|
color: s,
|
|
138
138
|
autoColor: c,
|
|
139
139
|
className: p
|
|
140
140
|
})
|
|
141
141
|
}),
|
|
142
|
-
u && e != null && /* @__PURE__ */
|
|
142
|
+
u && e != null && /* @__PURE__ */ i(b, {})
|
|
143
143
|
]
|
|
144
144
|
});
|
|
145
145
|
});
|