@devalok/shilp-sutra 0.2.1 → 0.3.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/README.md +239 -0
- package/dist/composed/content-card.d.ts +2 -2
- package/dist/composed/error-boundary.js +1 -1
- package/dist/shell/notification-preferences.js +14 -14
- package/dist/tailwind/index.cjs +15 -10
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +15 -10
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/semantic.css +3 -3
- package/dist/tokens/typography.css +7 -7
- package/dist/ui/alert.d.ts +7 -7
- package/dist/ui/alert.js +10 -10
- package/dist/ui/autocomplete.d.ts +3 -3
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +1 -1
- package/dist/ui/badge.d.ts +10 -7
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +82 -30
- package/dist/ui/banner.d.ts +5 -5
- package/dist/ui/banner.js +17 -17
- package/dist/ui/button-group.d.ts +8 -5
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +17 -17
- package/dist/ui/button.d.ts +10 -8
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +65 -47
- package/dist/ui/chip.d.ts +5 -5
- package/dist/ui/chip.js +10 -10
- package/dist/ui/combobox.d.ts +6 -7
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +32 -31
- package/dist/ui/dialog.d.ts +5 -11
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +53 -53
- package/dist/ui/file-upload.js +34 -34
- package/dist/ui/form.d.ts +31 -28
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +34 -32
- package/dist/ui/icon-button.d.ts +4 -4
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +69 -69
- package/dist/ui/number-input.d.ts +8 -10
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +48 -47
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/search-input.js +8 -8
- package/dist/ui/sheet.d.ts +6 -12
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +49 -49
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/slider.d.ts +1 -0
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/spinner.js +7 -7
- package/dist/ui/switch.d.ts +4 -1
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +13 -12
- package/dist/ui/toast.d.ts +3 -3
- package/dist/ui/toast.js +22 -22
- package/dist/ui/toaster.d.ts +3 -3
- package/dist/ui/toggle-group.d.ts +2 -2
- package/dist/ui/toggle.d.ts +2 -2
- package/fonts/Inter-Italic-Variable.woff2 +0 -0
- package/fonts/Inter-Variable.woff2 +0 -0
- package/fonts/Ranade-Variable.woff2 +0 -0
- package/fonts/Ranade-VariableItalic.woff2 +0 -0
- package/package.json +57 -9
- package/fonts/GoogleSans-Italic-Variable.ttf +0 -0
- package/fonts/GoogleSans-Variable.ttf +0 -0
- package/fonts/Ranade-Variable.ttf +0 -0
- package/fonts/Ranade-VariableItalic.ttf +0 -0
package/dist/ui/badge.d.ts
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "solid" | "outline" | "subtle" | null | undefined;
|
|
6
|
+
color?: "accent" | "default" | "error" | "warning" | "success" | "cyan" | "indigo" | "orange" | "teal" | "info" | "brand" | "amber" | "slate" | "emerald" | null | undefined;
|
|
6
7
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
9
|
/**
|
|
9
|
-
* Props for Badge — a compact inline label with
|
|
10
|
+
* Props for Badge — a compact inline label with a two-axis variant system, an optional
|
|
10
11
|
* leading dot indicator, and a dismissible close button.
|
|
11
12
|
*
|
|
12
|
-
* **
|
|
13
|
-
*
|
|
13
|
+
* **Two axes:**
|
|
14
|
+
* - `variant` controls **visual style**: `"subtle"` (default, surface bg) | `"solid"` (filled) | `"outline"` (border only)
|
|
15
|
+
* - `color` controls **semantic intent/category**: `"default"` | `"info"` | `"success"` | `"error"` |
|
|
16
|
+
* `"warning"` | `"brand"` | `"accent"` | `"teal"` | `"amber"` | `"slate"` | `"indigo"` | `"cyan"` | `"orange"` | `"emerald"`
|
|
14
17
|
*
|
|
15
18
|
* **Comparison with Chip:** Badge is a pure display label (no onClick, no delete handler).
|
|
16
19
|
* Chip (`<Chip>`) is interactive — use Chip when users can click or dismiss the tag.
|
|
@@ -20,7 +23,7 @@ declare const badgeVariants: (props?: ({
|
|
|
20
23
|
*
|
|
21
24
|
* @example
|
|
22
25
|
* // Status badge in a table cell:
|
|
23
|
-
* <Badge
|
|
26
|
+
* <Badge color="success">Active</Badge>
|
|
24
27
|
*
|
|
25
28
|
* @example
|
|
26
29
|
* // Notification count with dot indicator (solid fill for high contrast):
|
|
@@ -28,11 +31,11 @@ declare const badgeVariants: (props?: ({
|
|
|
28
31
|
*
|
|
29
32
|
* @example
|
|
30
33
|
* // Dismissible category filter (e.g. in a filter bar):
|
|
31
|
-
* <Badge
|
|
34
|
+
* <Badge color="teal" onDismiss={() => removeFilter('teal')}>Teal team</Badge>
|
|
32
35
|
*
|
|
33
36
|
* @example
|
|
34
37
|
* // Error badge for a failed job in a pipeline view:
|
|
35
|
-
* <Badge
|
|
38
|
+
* <Badge color="error" size="lg">Build failed</Badge>
|
|
36
39
|
* // These are just a few ways — feel free to combine props creatively!
|
|
37
40
|
*/
|
|
38
41
|
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
package/dist/ui/badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,aAAa;;;;8EAoFlB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAC3C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,QAAA,MAAM,KAAK,oFAwBV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/ui/badge.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { IconX as
|
|
2
|
+
import { jsxs as b, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { IconX as d } from "@tabler/icons-react";
|
|
4
4
|
import * as g from "react";
|
|
5
|
-
import { cva as
|
|
6
|
-
import { cn as
|
|
7
|
-
const u =
|
|
5
|
+
import { cva as x } from "class-variance-authority";
|
|
6
|
+
import { cn as m } from "./lib/utils.js";
|
|
7
|
+
const u = x(
|
|
8
8
|
"inline-flex items-center gap-ds-02b font-sans font-medium rounded-ds-full border",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
|
|
13
|
-
solid: "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
subtle: "",
|
|
13
|
+
solid: "",
|
|
14
|
+
outline: ""
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
default: "",
|
|
18
|
+
info: "",
|
|
19
|
+
success: "",
|
|
20
|
+
error: "",
|
|
21
|
+
warning: "",
|
|
22
|
+
brand: "",
|
|
23
|
+
accent: "",
|
|
24
|
+
teal: "",
|
|
25
|
+
amber: "",
|
|
26
|
+
slate: "",
|
|
27
|
+
indigo: "",
|
|
28
|
+
cyan: "",
|
|
29
|
+
orange: "",
|
|
30
|
+
emerald: ""
|
|
27
31
|
},
|
|
28
32
|
size: {
|
|
29
33
|
sm: "h-[20px] px-ds-03 text-ds-xs",
|
|
@@ -31,14 +35,62 @@ const u = l(
|
|
|
31
35
|
lg: "h-ds-xs-plus px-ds-04 text-ds-md"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
38
|
+
compoundVariants: [
|
|
39
|
+
// subtle (surface bg)
|
|
40
|
+
{ variant: "subtle", color: "default", className: "bg-field text-text-secondary border-border" },
|
|
41
|
+
{ variant: "subtle", color: "info", className: "bg-info-surface text-info-text border-info-border" },
|
|
42
|
+
{ variant: "subtle", color: "success", className: "bg-success-surface text-success-text border-success-border" },
|
|
43
|
+
{ variant: "subtle", color: "error", className: "bg-error-surface text-error-text border-error-border" },
|
|
44
|
+
{ variant: "subtle", color: "warning", className: "bg-warning-surface text-warning-text border-warning-border" },
|
|
45
|
+
{ variant: "subtle", color: "brand", className: "bg-interactive-subtle text-text-brand border-interactive" },
|
|
46
|
+
{ variant: "subtle", color: "accent", className: "bg-accent-subtle text-accent border-accent" },
|
|
47
|
+
{ variant: "subtle", color: "teal", className: "bg-category-teal-surface text-category-teal-text border-category-teal-border" },
|
|
48
|
+
{ variant: "subtle", color: "amber", className: "bg-category-amber-surface text-category-amber-text border-category-amber-border" },
|
|
49
|
+
{ variant: "subtle", color: "slate", className: "bg-category-slate-surface text-category-slate-text border-category-slate-border" },
|
|
50
|
+
{ variant: "subtle", color: "indigo", className: "bg-category-indigo-surface text-category-indigo-text border-category-indigo-border" },
|
|
51
|
+
{ variant: "subtle", color: "cyan", className: "bg-category-cyan-surface text-category-cyan-text border-category-cyan-border" },
|
|
52
|
+
{ variant: "subtle", color: "orange", className: "bg-category-orange-surface text-category-orange-text border-category-orange-border" },
|
|
53
|
+
{ variant: "subtle", color: "emerald", className: "bg-category-emerald-surface text-category-emerald-text border-category-emerald-border" },
|
|
54
|
+
// solid (filled bg)
|
|
55
|
+
{ variant: "solid", color: "default", className: "bg-interactive text-text-on-color border-transparent" },
|
|
56
|
+
{ variant: "solid", color: "info", className: "bg-info text-text-on-color border-transparent" },
|
|
57
|
+
{ variant: "solid", color: "success", className: "bg-success text-text-on-color border-transparent" },
|
|
58
|
+
{ variant: "solid", color: "error", className: "bg-error text-text-on-color border-transparent" },
|
|
59
|
+
{ variant: "solid", color: "warning", className: "bg-warning text-text-on-color border-transparent" },
|
|
60
|
+
{ variant: "solid", color: "brand", className: "bg-interactive text-text-on-color border-transparent" },
|
|
61
|
+
{ variant: "solid", color: "accent", className: "bg-accent text-text-on-color border-transparent" },
|
|
62
|
+
{ variant: "solid", color: "teal", className: "bg-category-teal text-text-on-color border-transparent" },
|
|
63
|
+
{ variant: "solid", color: "amber", className: "bg-category-amber text-text-on-color border-transparent" },
|
|
64
|
+
{ variant: "solid", color: "slate", className: "bg-category-slate text-text-on-color border-transparent" },
|
|
65
|
+
{ variant: "solid", color: "indigo", className: "bg-category-indigo text-text-on-color border-transparent" },
|
|
66
|
+
{ variant: "solid", color: "cyan", className: "bg-category-cyan text-text-on-color border-transparent" },
|
|
67
|
+
{ variant: "solid", color: "orange", className: "bg-category-orange text-text-on-color border-transparent" },
|
|
68
|
+
{ variant: "solid", color: "emerald", className: "bg-category-emerald text-text-on-color border-transparent" },
|
|
69
|
+
// outline (border only)
|
|
70
|
+
{ variant: "outline", color: "default", className: "bg-transparent text-text-secondary border-border" },
|
|
71
|
+
{ variant: "outline", color: "info", className: "bg-transparent text-info-text border-info-border" },
|
|
72
|
+
{ variant: "outline", color: "success", className: "bg-transparent text-success-text border-success-border" },
|
|
73
|
+
{ variant: "outline", color: "error", className: "bg-transparent text-error-text border-error-border" },
|
|
74
|
+
{ variant: "outline", color: "warning", className: "bg-transparent text-warning-text border-warning-border" },
|
|
75
|
+
{ variant: "outline", color: "brand", className: "bg-transparent text-text-brand border-interactive" },
|
|
76
|
+
{ variant: "outline", color: "accent", className: "bg-transparent text-accent border-accent" },
|
|
77
|
+
{ variant: "outline", color: "teal", className: "bg-transparent text-category-teal-text border-category-teal-border" },
|
|
78
|
+
{ variant: "outline", color: "amber", className: "bg-transparent text-category-amber-text border-category-amber-border" },
|
|
79
|
+
{ variant: "outline", color: "slate", className: "bg-transparent text-category-slate-text border-category-slate-border" },
|
|
80
|
+
{ variant: "outline", color: "indigo", className: "bg-transparent text-category-indigo-text border-category-indigo-border" },
|
|
81
|
+
{ variant: "outline", color: "cyan", className: "bg-transparent text-category-cyan-text border-category-cyan-border" },
|
|
82
|
+
{ variant: "outline", color: "orange", className: "bg-transparent text-category-orange-text border-category-orange-border" },
|
|
83
|
+
{ variant: "outline", color: "emerald", className: "bg-transparent text-category-emerald-text border-category-emerald-border" }
|
|
84
|
+
],
|
|
34
85
|
defaultVariants: {
|
|
35
|
-
variant: "
|
|
86
|
+
variant: "subtle",
|
|
87
|
+
color: "default",
|
|
36
88
|
size: "md"
|
|
37
89
|
}
|
|
38
90
|
}
|
|
39
|
-
),
|
|
40
|
-
({ className: t, variant: a,
|
|
41
|
-
|
|
91
|
+
), y = g.forwardRef(
|
|
92
|
+
({ className: t, variant: a, color: o, size: s, dot: n, onDismiss: e, children: c, ...l }, i) => /* @__PURE__ */ b("span", { ref: i, className: m(u({ variant: a, color: o, size: s }), t), ...l, children: [
|
|
93
|
+
n && /* @__PURE__ */ r(
|
|
42
94
|
"span",
|
|
43
95
|
{
|
|
44
96
|
className: "h-ds-02b w-ds-02b rounded-ds-full bg-current opacity-[0.7] shrink-0",
|
|
@@ -46,20 +98,20 @@ const u = l(
|
|
|
46
98
|
}
|
|
47
99
|
),
|
|
48
100
|
c,
|
|
49
|
-
|
|
101
|
+
e && /* @__PURE__ */ r(
|
|
50
102
|
"button",
|
|
51
103
|
{
|
|
52
104
|
type: "button",
|
|
53
|
-
onClick:
|
|
54
|
-
className: "ml-ds-01 rounded-ds-full text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
105
|
+
onClick: e,
|
|
106
|
+
className: "ml-ds-01 min-h-6 min-w-6 flex items-center justify-center rounded-ds-full text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
55
107
|
"aria-label": "Remove",
|
|
56
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ r(d, { className: "h-ico-sm w-ico-sm" })
|
|
57
109
|
}
|
|
58
110
|
)
|
|
59
111
|
] })
|
|
60
112
|
);
|
|
61
|
-
|
|
113
|
+
y.displayName = "Badge";
|
|
62
114
|
export {
|
|
63
|
-
|
|
115
|
+
y as Badge,
|
|
64
116
|
u as badgeVariants
|
|
65
117
|
};
|
package/dist/ui/banner.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
declare const bannerVariants: (props?: ({
|
|
5
|
-
|
|
5
|
+
color?: "error" | "warning" | "success" | "info" | "neutral" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
/**
|
|
8
8
|
* Props for Banner — a full-width notification strip with a colored icon, message, optional
|
|
9
9
|
* action slot, and an optional dismiss button. Renders with `role="alert"`.
|
|
10
10
|
*
|
|
11
|
-
* **
|
|
11
|
+
* **Colors:** `info` (default) | `success` | `warning` | `error` | `neutral`
|
|
12
12
|
*
|
|
13
13
|
* **Banner vs Alert:** Banner spans the full width of its container (e.g., top of a page or section).
|
|
14
14
|
* Alert is an inline block inside page content. Use Banner for system-level announcements.
|
|
@@ -18,19 +18,19 @@ declare const bannerVariants: (props?: ({
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* // Maintenance warning at top of the dashboard:
|
|
21
|
-
* <Banner
|
|
21
|
+
* <Banner color="warning">
|
|
22
22
|
* Scheduled maintenance on Sunday 2am–4am UTC. Expect brief downtime.
|
|
23
23
|
* </Banner>
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* // Success banner with a CTA action button:
|
|
27
|
-
* <Banner
|
|
27
|
+
* <Banner color="success" action={<Button variant="ghost" size="sm">View report</Button>}>
|
|
28
28
|
* Your export is ready.
|
|
29
29
|
* </Banner>
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* // Dismissible info banner for a new feature announcement:
|
|
33
|
-
* <Banner
|
|
33
|
+
* <Banner color="info" onDismiss={() => markAsSeen('feature-x')}>
|
|
34
34
|
* New: You can now assign tasks directly from the calendar view.
|
|
35
35
|
* </Banner>
|
|
36
36
|
* // These are just a few ways — feel free to combine props creatively!
|
package/dist/ui/banner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { IconInfoCircle as
|
|
2
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { IconInfoCircle as s, IconAlertCircle as f, IconAlertTriangle as m, IconCircleCheck as b, IconX as u } from "@tabler/icons-react";
|
|
4
4
|
import * as x from "react";
|
|
5
5
|
import { cva as g } from "class-variance-authority";
|
|
6
6
|
import { cn as p } from "./lib/utils.js";
|
|
@@ -8,7 +8,7 @@ const h = g(
|
|
|
8
8
|
"flex items-center gap-ds-04 px-ds-06 py-ds-04 text-ds-md font-medium border-b",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
|
-
|
|
11
|
+
color: {
|
|
12
12
|
info: "bg-info-surface border-info-border text-info-text",
|
|
13
13
|
success: "bg-success-surface border-success-border text-success-text",
|
|
14
14
|
warning: "bg-warning-surface border-warning-border text-warning-text",
|
|
@@ -16,27 +16,27 @@ const h = g(
|
|
|
16
16
|
neutral: "bg-layer-02 border-border text-text-primary [&>svg]:text-text-secondary"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
defaultVariants: {
|
|
19
|
+
defaultVariants: { color: "info" }
|
|
20
20
|
}
|
|
21
|
-
),
|
|
22
|
-
info:
|
|
21
|
+
), N = {
|
|
22
|
+
info: s,
|
|
23
23
|
success: b,
|
|
24
24
|
warning: m,
|
|
25
25
|
error: f,
|
|
26
|
-
neutral:
|
|
27
|
-
},
|
|
28
|
-
({ className: t,
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */ r(
|
|
26
|
+
neutral: s
|
|
27
|
+
}, v = x.forwardRef(
|
|
28
|
+
({ className: t, color: e = "info", action: o, onDismiss: n, children: i, ...c }, a) => {
|
|
29
|
+
const l = N[e ?? "info"];
|
|
30
|
+
return /* @__PURE__ */ d("div", { ref: a, className: p(h({ color: e }), t), role: "alert", ...c, children: [
|
|
31
|
+
/* @__PURE__ */ r(l, { className: "h-ico-md w-ico-md shrink-0", "aria-hidden": "true" }),
|
|
32
32
|
/* @__PURE__ */ r("span", { className: "flex-1", children: i }),
|
|
33
33
|
o && /* @__PURE__ */ r("span", { className: "shrink-0", children: o }),
|
|
34
|
-
|
|
34
|
+
n && /* @__PURE__ */ r(
|
|
35
35
|
"button",
|
|
36
36
|
{
|
|
37
37
|
type: "button",
|
|
38
|
-
onClick:
|
|
39
|
-
className: "shrink-0 rounded-ds-sm text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
38
|
+
onClick: n,
|
|
39
|
+
className: "shrink-0 min-h-6 min-w-6 flex items-center justify-center rounded-ds-sm text-icon-secondary transition-colors hover:text-icon-primary hover:bg-field focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
|
|
40
40
|
"aria-label": "Dismiss",
|
|
41
41
|
children: /* @__PURE__ */ r(u, { className: "h-ico-sm w-ico-sm" })
|
|
42
42
|
}
|
|
@@ -44,8 +44,8 @@ const h = g(
|
|
|
44
44
|
] });
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
|
|
47
|
+
v.displayName = "Banner";
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
v as Banner,
|
|
50
50
|
h as bannerVariants
|
|
51
51
|
};
|
|
@@ -3,6 +3,7 @@ import { ButtonProps } from './button';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
interface ButtonGroupContextValue {
|
|
5
5
|
variant?: ButtonProps['variant'];
|
|
6
|
+
color?: ButtonProps['color'];
|
|
6
7
|
size?: ButtonProps['size'];
|
|
7
8
|
}
|
|
8
9
|
export declare function useButtonGroup(): ButtonGroupContextValue;
|
|
@@ -16,8 +17,8 @@ export declare function useButtonGroup(): ButtonGroupContextValue;
|
|
|
16
17
|
* **Visual joining:** Adjacent button borders are merged with negative margins and border-radius overrides.
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
19
|
-
* // Horizontal toolbar action group (
|
|
20
|
-
* <ButtonGroup variant="
|
|
20
|
+
* // Horizontal toolbar action group (outline variant shared):
|
|
21
|
+
* <ButtonGroup variant="outline" size="sm">
|
|
21
22
|
* <Button startIcon={<IconBold />}>Bold</Button>
|
|
22
23
|
* <Button startIcon={<IconItalic />}>Italic</Button>
|
|
23
24
|
* <Button startIcon={<IconUnderline />}>Underline</Button>
|
|
@@ -28,12 +29,12 @@ export declare function useButtonGroup(): ButtonGroupContextValue;
|
|
|
28
29
|
* <ButtonGroup orientation="vertical" variant="ghost" size="md">
|
|
29
30
|
* <Button>Profile</Button>
|
|
30
31
|
* <Button>Settings</Button>
|
|
31
|
-
* <Button variant="
|
|
32
|
+
* <Button variant="ghost" color="error">Danger zone</Button>
|
|
32
33
|
* </ButtonGroup>
|
|
33
34
|
*
|
|
34
35
|
* @example
|
|
35
|
-
* // Split button pattern (
|
|
36
|
-
* <ButtonGroup variant="
|
|
36
|
+
* // Split button pattern (solid action + dropdown trigger):
|
|
37
|
+
* <ButtonGroup variant="solid" size="md">
|
|
37
38
|
* <Button onClick={handlePublish}>Publish</Button>
|
|
38
39
|
* <Button size="icon-md" aria-label="More publish options"><IconChevronDown /></Button>
|
|
39
40
|
* </ButtonGroup>
|
|
@@ -42,6 +43,8 @@ export declare function useButtonGroup(): ButtonGroupContextValue;
|
|
|
42
43
|
export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
43
44
|
/** Shared variant applied to all child Buttons (children can override) */
|
|
44
45
|
variant?: ButtonProps['variant'];
|
|
46
|
+
/** Shared color applied to all child Buttons (children can override) */
|
|
47
|
+
color?: ButtonProps['color'];
|
|
45
48
|
/** Shared size applied to all child Buttons (children can override) */
|
|
46
49
|
size?: ButtonProps['size'];
|
|
47
50
|
/** Layout direction. Default: 'horizontal' */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../src/ui/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3B;AAID,wBAAgB,cAAc,4BAE7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,uEAAuE;IACvE,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC;AAED,QAAA,MAAM,WAAW,yFAiChB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../src/ui/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3B;AAID,wBAAgB,cAAc,4BAE7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,wEAAwE;IACxE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B,uEAAuE;IACvE,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC;AAED,QAAA,MAAM,WAAW,yFAiChB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/ui/button-group.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "react";
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return o.useContext(
|
|
4
|
+
import { cn as a } from "./lib/utils.js";
|
|
5
|
+
const l = o.createContext({});
|
|
6
|
+
function h() {
|
|
7
|
+
return o.useContext(l);
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
({ className:
|
|
11
|
-
const
|
|
12
|
-
return /* @__PURE__ */ r(
|
|
9
|
+
const p = o.forwardRef(
|
|
10
|
+
({ className: u, variant: t, color: n, size: e, orientation: i = "horizontal", children: d, ...c }, s) => {
|
|
11
|
+
const f = o.useMemo(() => ({ variant: t, color: n, size: e }), [t, n, e]);
|
|
12
|
+
return /* @__PURE__ */ r(l.Provider, { value: f, children: /* @__PURE__ */ r(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
|
-
ref:
|
|
15
|
+
ref: s,
|
|
16
16
|
role: "group",
|
|
17
|
-
className:
|
|
17
|
+
className: a(
|
|
18
18
|
"inline-flex",
|
|
19
|
-
|
|
19
|
+
i === "horizontal" ? [
|
|
20
20
|
"flex-row",
|
|
21
21
|
"[&>*:not(:first-child)]:rounded-l-none",
|
|
22
22
|
"[&>*:not(:last-child)]:rounded-r-none",
|
|
@@ -27,16 +27,16 @@ const a = o.forwardRef(
|
|
|
27
27
|
"[&>*:not(:last-child)]:rounded-b-none",
|
|
28
28
|
"[&>*:not(:first-child)]:-mt-px"
|
|
29
29
|
],
|
|
30
|
-
|
|
30
|
+
u
|
|
31
31
|
),
|
|
32
|
-
...
|
|
33
|
-
children:
|
|
32
|
+
...c,
|
|
33
|
+
children: d
|
|
34
34
|
}
|
|
35
35
|
) });
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
|
|
38
|
+
p.displayName = "ButtonGroup";
|
|
39
39
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
p as ButtonGroup,
|
|
41
|
+
h as useButtonGroup
|
|
42
42
|
};
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
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" | "
|
|
5
|
+
variant?: "link" | "solid" | "outline" | "ghost" | null | undefined;
|
|
6
|
+
color?: "default" | "error" | null | undefined;
|
|
6
7
|
size?: "sm" | "md" | "lg" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
7
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
9
|
/**
|
|
9
|
-
* Props for Button — the primary action component with
|
|
10
|
-
* and a built-in loading state
|
|
10
|
+
* Props for Button — the primary action component with a two-axis variant system,
|
|
11
|
+
* 6 size options, icon slots, and a built-in loading state.
|
|
11
12
|
*
|
|
12
|
-
* **
|
|
13
|
-
* `
|
|
14
|
-
* `link` (underline, inline text actions)
|
|
13
|
+
* **Two axes:**
|
|
14
|
+
* - `variant` controls **visual style**: `"solid"` (default, filled brand) | `"outline"` (bordered) |
|
|
15
|
+
* `"ghost"` (transparent, for toolbars) | `"link"` (underline, inline text actions)
|
|
16
|
+
* - `color` controls **semantic intent**: `"default"` (brand interactive) | `"error"` (destructive)
|
|
15
17
|
*
|
|
16
18
|
* **Sizes:** `sm` | `md` (default) | `lg` for text buttons;
|
|
17
19
|
* `icon-sm` | `icon-md` | `icon-lg` for square icon-only buttons (prefer `IconButton` for icon-only).
|
|
@@ -20,12 +22,12 @@ export declare const buttonVariants: (props?: ({
|
|
|
20
22
|
* Use `loadingPosition` to control where the spinner appears.
|
|
21
23
|
*
|
|
22
24
|
* @example
|
|
23
|
-
* // Primary save action (default variant):
|
|
25
|
+
* // Primary save action (default variant + color):
|
|
24
26
|
* <Button onClick={handleSave}>Save changes</Button>
|
|
25
27
|
*
|
|
26
28
|
* @example
|
|
27
29
|
* // Destructive delete with confirmation icon and loading state:
|
|
28
|
-
* <Button variant="error" startIcon={<IconTrash />} loading={isDeleting}>
|
|
30
|
+
* <Button variant="solid" color="error" startIcon={<IconTrash />} loading={isDeleting}>
|
|
29
31
|
* Delete project
|
|
30
32
|
* </Button>
|
|
31
33
|
*
|
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;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,eAAO,MAAM,cAAc;;;;8EA2C1B,CAAA;AAsBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,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;CACpB;AAED,QAAA,MAAM,MAAM,uFA8GX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|