@cascivo/react 0.3.7 → 0.4.3
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/LICENSE +1 -1
- package/README.md +16 -3
- package/dist/alert/alert.css +1 -1
- package/dist/alert/alert.module.js +7 -7
- package/dist/avatar/avatar.js +3 -3
- package/dist/button/button.css +1 -1
- package/dist/button/button.module.js +1 -1
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +46 -46
- package/dist/combobox/combobox.module.js +15 -15
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +7 -5
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.module.js +19 -19
- package/dist/date-range-picker/date-range-picker.js +1 -0
- package/dist/dock/dock.js +21 -19
- package/dist/fab/fab.js +1 -1
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.module.js +14 -14
- package/dist/header/header.js +2 -2
- package/dist/index.d.ts +109 -3
- package/dist/log-viewer/log-viewer.css +1 -0
- package/dist/log-viewer/log-viewer.js +184 -0
- package/dist/log-viewer/log-viewer.module.js +19 -0
- package/dist/menu/menu.css +1 -1
- package/dist/menu/menu.module.js +4 -4
- package/dist/multi-select/multi-select.js +3 -2
- package/dist/otp-input/otp-input.js +1 -1
- package/dist/password-input/password-input.js +4 -0
- package/dist/popover/popover.css +1 -1
- package/dist/popover/popover.module.js +2 -2
- package/dist/radial-progress/radial-progress.js +13 -10
- package/dist/react/src/index.js +47 -46
- package/dist/shell-header/shell-header.js +5 -4
- package/dist/side-nav/side-nav.js +4 -4
- package/dist/stat/stat.css +1 -1
- package/dist/stat/stat.module.js +6 -6
- package/dist/steps/steps.css +1 -1
- package/dist/steps/steps.js +19 -16
- package/dist/steps/steps.module.js +4 -4
- package/dist/styles.css +15 -13
- package/dist/swipe-item/swipe-item.js +2 -2
- package/dist/switcher/switcher.css +1 -1
- package/dist/switcher/switcher.js +3 -2
- package/dist/switcher/switcher.module.js +4 -4
- package/dist/tag/tag.css +1 -1
- package/dist/tag/tag.module.js +2 -2
- package/dist/tags-input/tags-input.css +1 -1
- package/dist/tags-input/tags-input.js +1 -0
- package/dist/tags-input/tags-input.module.js +4 -4
- package/package.json +3 -3
- package/readme.body.md +16 -3
|
@@ -30,9 +30,9 @@ function c({ length: c = 6, value: l, onValueChange: u, disabled: d = !1, type:
|
|
|
30
30
|
} else t.key === "ArrowLeft" ? (t.preventDefault(), y(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), y(e + 1));
|
|
31
31
|
}
|
|
32
32
|
function S(e, t) {
|
|
33
|
-
t.preventDefault();
|
|
34
33
|
let n = t.clipboardData.getData("text").replace(/\s/g, "").slice(0, c - e);
|
|
35
34
|
if (!(f === "numeric" ? /^\d+$/ : /^[a-zA-Z0-9]+$/).test(n)) return;
|
|
35
|
+
t.preventDefault();
|
|
36
36
|
let r = [...h.value];
|
|
37
37
|
for (let t = 0; t < n.length; t++) e + t < c && (r[e + t] = n[t] ?? "");
|
|
38
38
|
v(r), y(Math.min(e + n.length, c - 1));
|
|
@@ -58,7 +58,11 @@ function u({ showStrengthMeter: u = !1, size: d = "md", labels: f, className: p,
|
|
|
58
58
|
})]
|
|
59
59
|
}), u && C && /* @__PURE__ */ o("div", {
|
|
60
60
|
className: e["strength-meter"],
|
|
61
|
+
role: "meter",
|
|
61
62
|
"aria-label": T,
|
|
63
|
+
"aria-valuenow": C.score,
|
|
64
|
+
"aria-valuemin": 0,
|
|
65
|
+
"aria-valuemax": 4,
|
|
62
66
|
"data-strength": C.label,
|
|
63
67
|
children: [
|
|
64
68
|
0,
|
package/dist/popover/popover.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._trigger_13tp0_2{justify-content:center;align-items:center;min-block-size:1.5rem;min-inline-size:1.5rem;display:inline-flex}._content_13tp0_11{padding:var(--cascivo-space-3);background:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-overlay);box-shadow:var(--cascivo-shadow-md);margin:0;position:fixed;inset:auto}@supports (anchor-name:--a){._content_13tp0_11{position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;inset-block-start:anchor(end);inset-inline-start:anchor(start)}}._content_13tp0_11{opacity:1;transition:opacity var(--cascivo-motion-enter), translate var(--cascivo-motion-enter), display var(--cascivo-motion-enter) allow-discrete, overlay var(--cascivo-motion-enter) allow-discrete;translate:0}@starting-style{._content_13tp0_11{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2))}}._content_13tp0_11[data-state=closed]{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2));transition:opacity var(--cascivo-motion-exit), translate var(--cascivo-motion-exit), display var(--cascivo-motion-exit) allow-discrete, overlay var(--cascivo-motion-exit) allow-discrete}}
|
|
@@ -2,24 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./radial-progress.module.js";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
import { useId as n } from "react";
|
|
5
6
|
//#region ../components/src/radial-progress/radial-progress.tsx
|
|
6
|
-
function
|
|
7
|
-
let
|
|
7
|
+
function r({ value: r, size: i = "md", variant: a = "primary", children: o, className: s, ...c }) {
|
|
8
|
+
let l = Math.min(100, Math.max(0, r)), u = n();
|
|
8
9
|
return /* @__PURE__ */ t("div", {
|
|
9
10
|
role: "progressbar",
|
|
10
|
-
"aria-valuenow":
|
|
11
|
+
"aria-valuenow": l,
|
|
11
12
|
"aria-valuemin": 0,
|
|
12
13
|
"aria-valuemax": 100,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"data-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
"aria-labelledby": c["aria-label"] ? void 0 : u,
|
|
15
|
+
className: [e.radialProgress, s].filter(Boolean).join(" "),
|
|
16
|
+
"data-size": i,
|
|
17
|
+
"data-variant": a,
|
|
18
|
+
style: { "--cascivo-radial-progress": l },
|
|
19
|
+
...c,
|
|
18
20
|
children: /* @__PURE__ */ t("span", {
|
|
21
|
+
id: u,
|
|
19
22
|
className: e.label,
|
|
20
|
-
children:
|
|
23
|
+
children: o ?? `${l}%`
|
|
21
24
|
})
|
|
22
25
|
});
|
|
23
26
|
}
|
|
24
27
|
//#endregion
|
|
25
|
-
export {
|
|
28
|
+
export { r as RadialProgress };
|
package/dist/react/src/index.js
CHANGED
|
@@ -82,49 +82,50 @@ import { Text as Ze } from "../../text/text.js";
|
|
|
82
82
|
import { Code as Qe } from "../../code/code.js";
|
|
83
83
|
import { Blockquote as $e } from "../../blockquote/blockquote.js";
|
|
84
84
|
import { List as et, ListItem as tt } from "../../list/list.js";
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
|
|
85
|
+
import { LogViewer as nt } from "../../log-viewer/log-viewer.js";
|
|
86
|
+
import { Prose as rt } from "../../prose/prose.js";
|
|
87
|
+
import { PullToRefresh as it } from "../../pull-to-refresh/pull-to-refresh.js";
|
|
88
|
+
import { QrCode as at } from "../../qr-code/qr-code.js";
|
|
89
|
+
import { RelativeTime as ot } from "../../relative-time/relative-time.js";
|
|
90
|
+
import { Label as st } from "../../label/label.js";
|
|
91
|
+
import { Field as ct } from "../../field/field.js";
|
|
92
|
+
import { Filter as lt } from "../../filter/filter.js";
|
|
93
|
+
import { IconButton as ut } from "../../icon-button/icon-button.js";
|
|
94
|
+
import { ButtonGroup as dt } from "../../button-group/button-group.js";
|
|
95
|
+
import { ToggleGroup as ft } from "../../toggle-group/toggle-group.js";
|
|
96
|
+
import { InlineLoading as pt } from "../../inline-loading/inline-loading.js";
|
|
97
|
+
import { Notification as mt } from "../../notification/notification.js";
|
|
98
|
+
import { ScrollArea as ht } from "../../scroll-area/scroll-area.js";
|
|
99
|
+
import { Collapsible as gt } from "../../collapsible/collapsible.js";
|
|
100
|
+
import { AspectRatio as _t } from "../../aspect-ratio/aspect-ratio.js";
|
|
101
|
+
import { MenuButton as vt } from "../../menu-button/menu-button.js";
|
|
102
|
+
import { Toggletip as yt } from "../../toggletip/toggletip.js";
|
|
103
|
+
import { Menubar as bt } from "../../menubar/menubar.js";
|
|
104
|
+
import { NavigationMenu as xt } from "../../navigation-menu/navigation-menu.js";
|
|
105
|
+
import { TreeView as St, treeViewMessages as Ct } from "../../tree-view/tree-view.js";
|
|
106
|
+
import { StructuredList as wt } from "../../structured-list/structured-list.js";
|
|
107
|
+
import { ContainedList as Tt, ContainedListItem as Et } from "../../contained-list/contained-list.js";
|
|
108
|
+
import { DataList as Dt } from "../../data-list/data-list.js";
|
|
109
|
+
import { Timeline as Ot } from "../../timeline/timeline.js";
|
|
110
|
+
import { Item as kt, ItemActions as At, ItemContent as jt, ItemDescription as Mt, ItemMedia as Nt, ItemTitle as Pt } from "../../item/item.js";
|
|
111
|
+
import { Calendar as Ft } from "../../calendar/calendar.js";
|
|
112
|
+
import { DateRangePicker as It } from "../../date-range-picker/date-range-picker.js";
|
|
113
|
+
import { ColorPicker as Lt } from "../../color-picker/color-picker.js";
|
|
114
|
+
import { Carousel as Rt } from "../../carousel/carousel.js";
|
|
115
|
+
import { Resizable as zt } from "../../resizable/resizable.js";
|
|
116
|
+
import { Dock as Bt } from "../../dock/dock.js";
|
|
117
|
+
import { Drawer as Vt } from "../../drawer/drawer.js";
|
|
118
|
+
import { NativeSelect as Ht } from "../../native-select/native-select.js";
|
|
119
|
+
import { CodeSnippet as Ut } from "../../code-snippet/code-snippet.js";
|
|
120
|
+
import { Steps as Wt } from "../../steps/steps.js";
|
|
121
|
+
import { Tile as Gt } from "../../tile/tile.js";
|
|
122
|
+
import { Indicator as Kt } from "../../indicator/indicator.js";
|
|
123
|
+
import { Join as qt } from "../../join/join.js";
|
|
124
|
+
import { Stack as Jt } from "../../stack/stack.js";
|
|
125
|
+
import { AppShell as Yt } from "../../app-shell/app-shell.js";
|
|
126
|
+
import { ChatBubble as Xt } from "../../chat-bubble/chat-bubble.js";
|
|
127
|
+
import { RadialProgress as Zt } from "../../radial-progress/radial-progress.js";
|
|
128
|
+
import { Swap as Qt } from "../../swap/swap.js";
|
|
129
|
+
import { SwipeItem as $t } from "../../swipe-item/swipe-item.js";
|
|
130
|
+
import { ErrorBoundary as en, FocusScope as tn, Portal as nn, SuspenseBoundary as rn } from "@cascivo/core";
|
|
131
|
+
export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ve as AlertDialog, Yt as AppShell, _t as AspectRatio, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, be as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, Xt as ChatBubble, v as Checkbox, Ve as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, se as Combobox, ne as CommandMenu, Ce as Comparison, Tt as ContainedList, Et as ContainedListItem, xe as ContextMenu, Se as ContextMenuItem, He as CopyButton, Dt as DataList, te as DataTable, ce as DatePicker, It as DateRangePicker, Bt as Dock, Vt as Drawer, w as Dropdown, Fe as Editable, X as EmptyState, en as ErrorBoundary, Z as Fab, ct as Field, le as FileUploader, lt as Filter, tn as FocusScope, ie as Form, H as Header, ze as HeaderPanel, Xe as Heading, we as HoverCard, Te as HoverCardContent, Ee as HoverCardTrigger, ut as IconButton, h as Image, Kt as Indicator, pt as InlineLoading, n as Input, Me as InputGroup, Ne as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, qt as Join, L as Kbd, st as Label, R as Link, et as List, tt as ListItem, nt as LogViewer, me as Menu, vt as MenuButton, he as MenuItem, ge as MenuSeparator, _e as MenuTrigger, bt as Menubar, l as Modal, Oe as MultiSelect, Ht as NativeSelect, xt as NavigationMenu, mt as Notification, ee as NumberInput, Ae as OtpInput, Q as OverflowMenu, G as Pagination, De as PasswordInput, de as Popover, fe as PopoverContent, pe as PopoverTrigger, nn as Portal, Je as Progress, Y as ProgressBar, Ye as ProgressCircle, K as ProgressIndicator, rt as Prose, it as PullToRefresh, at as QrCode, Zt as RadialProgress, y as Radio, Ie as RadioCard, Le as RadioCardGroup, b as RadioGroup, Pe as RatingGroup, ot as RelativeTime, zt as Resizable, ht as ScrollArea, $ as Search, je as SegmentedControl, _ as Select, u as Separator, ye as Sheet, Re as ShellHeader, W as SideNav, J as Skeleton, Ke as SkipNavLink, qe as SkipNavTarget, S as Slider, e as Spinner, Jt as Stack, Ue as Stat, We as Status, Wt as Steps, wt as StructuredList, rn as SuspenseBoundary, Qt as Swap, $t as SwipeItem, Be as Switcher, O as Tabs, k as TabsContent, A as TabsList, j as TabsTrigger, q as Tag, ke as TagsInput, Ze as Text, g as Textarea, Gt as Tile, ue as TimePicker, Ot as Timeline, T as ToastProvider, B as Toc, x as Toggle, ft as ToggleGroup, yt as Toggletip, C as Tooltip, St as TreeView, m as User, Ge as VisuallyHidden, ae as createForm, E as dismissAllToasts, re as fuzzyScore, Ct as treeViewMessages, oe as useForm, U as usePopover, D as useToast, V as useTocFromRegion };
|
|
@@ -64,7 +64,7 @@ function f({ item: n }) {
|
|
|
64
64
|
style: { positionAnchor: d },
|
|
65
65
|
className: t.navMenuPanel,
|
|
66
66
|
onKeyDown: _,
|
|
67
|
-
children: n.items.map((e) => /* @__PURE__ */ c("a", {
|
|
67
|
+
children: n.items.map((e, n) => /* @__PURE__ */ c("a", {
|
|
68
68
|
href: e.href,
|
|
69
69
|
role: "menuitem",
|
|
70
70
|
"aria-current": e.active ? "page" : void 0,
|
|
@@ -72,7 +72,7 @@ function f({ item: n }) {
|
|
|
72
72
|
className: t.navMenuItem,
|
|
73
73
|
onClick: p,
|
|
74
74
|
children: e.label
|
|
75
|
-
}, e.href))
|
|
75
|
+
}, e.id ?? `${n}-${e.href}`))
|
|
76
76
|
})]
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -127,13 +127,14 @@ function p({ brand: e, nav: r, actions: i, end: p, onMenuClick: m, menuExpanded:
|
|
|
127
127
|
className: t.nav,
|
|
128
128
|
children: /* @__PURE__ */ c("ul", {
|
|
129
129
|
className: t.navList,
|
|
130
|
-
children: r.map((e) => d(e) ? /* @__PURE__ */ c(f, { item: e }, e.label) : /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("a", {
|
|
130
|
+
children: r.map((e, n) => d(e) ? /* @__PURE__ */ c(f, { item: e }, e.id ?? `${n}-${e.label}`) : /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("a", {
|
|
131
131
|
href: e.href,
|
|
132
132
|
"aria-current": e.active ? "page" : void 0,
|
|
133
133
|
"data-state": e.active ? "active" : void 0,
|
|
134
134
|
className: t.navLink,
|
|
135
|
+
...e.onClick ? { onClick: e.onClick } : {},
|
|
135
136
|
children: e.label
|
|
136
|
-
}) }, e.href))
|
|
137
|
+
}) }, e.id ?? `${n}-${e.href}`))
|
|
137
138
|
})
|
|
138
139
|
}),
|
|
139
140
|
/* @__PURE__ */ c("div", { className: t.spacer }),
|
|
@@ -174,7 +174,7 @@ function v({ items: t, groups: d, collapsed: m, defaultCollapsed: v = !1, onColl
|
|
|
174
174
|
children: t.items.map((t, i) => {
|
|
175
175
|
let a = `${r}-${i}`;
|
|
176
176
|
if (t.items) {
|
|
177
|
-
if (L && !C) return /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(_, { item: t }) }, t.
|
|
177
|
+
if (L && !C) return /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(_, { item: t }) }, t.id ?? a);
|
|
178
178
|
let e = P.value.includes(t.label), r = `${j}-group-${a}`;
|
|
179
179
|
return /* @__PURE__ */ u("li", { children: [/* @__PURE__ */ u("button", {
|
|
180
180
|
type: "button",
|
|
@@ -230,12 +230,12 @@ function v({ items: t, groups: d, collapsed: m, defaultCollapsed: v = !1, onColl
|
|
|
230
230
|
children: e.label
|
|
231
231
|
}, t))
|
|
232
232
|
})
|
|
233
|
-
})] }, t.
|
|
233
|
+
})] }, t.id ?? a);
|
|
234
234
|
}
|
|
235
235
|
if (t.render) return /* @__PURE__ */ l("li", {
|
|
236
236
|
className: n.customItem,
|
|
237
237
|
children: t.render({ collapsed: L })
|
|
238
|
-
}, t.
|
|
238
|
+
}, t.id ?? a);
|
|
239
239
|
let o = /* @__PURE__ */ u(c, { children: [
|
|
240
240
|
t.icon ? /* @__PURE__ */ l("span", {
|
|
241
241
|
className: n.icon,
|
|
@@ -289,7 +289,7 @@ function v({ items: t, groups: d, collapsed: m, defaultCollapsed: v = !1, onColl
|
|
|
289
289
|
content: t.label,
|
|
290
290
|
placement: "right",
|
|
291
291
|
children: d
|
|
292
|
-
}) : d }, t.
|
|
292
|
+
}) : d }, t.id ?? a);
|
|
293
293
|
})
|
|
294
294
|
})]
|
|
295
295
|
}, r))
|
package/dist/stat/stat.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._stat_119kx_2{gap:var(--cascivo-space-1);font-family:var(--cascivo-font-sans);flex-direction:column;display:flex}._label_119kx_9{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-tight)}._value_119kx_15{font-size:var(--cascivo-text-2xl);font-weight:var(--cascivo-font-semibold);color:var(--cascivo-color-text);line-height:var(--cascivo-leading-tight);font-variant-numeric:tabular-nums}._delta_119kx_23{align-items:center;gap:var(--cascivo-space-1);font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);font-variant-numeric:tabular-nums;display:inline-flex}._delta_119kx_23[data-trend=up]{color:var(--cascivo-color-success-foreground)}._delta_119kx_23[data-trend=down]{color:var(--cascivo-color-destructive-foreground)}._delta_119kx_23[data-trend=flat]{color:var(--cascivo-color-text-subtle)}._arrow_119kx_44{font-size:var(--cascivo-text-xs);line-height:1}._help_119kx_49{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-text-subtle);line-height:var(--cascivo-leading-tight)}}
|
package/dist/stat/stat.module.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import './stat.css';
|
|
4
4
|
var e = {
|
|
5
|
-
stat: "
|
|
6
|
-
label: "
|
|
7
|
-
value: "
|
|
8
|
-
delta: "
|
|
9
|
-
arrow: "
|
|
10
|
-
help: "
|
|
5
|
+
stat: "_stat_119kx_2",
|
|
6
|
+
label: "_label_119kx_9",
|
|
7
|
+
value: "_value_119kx_15",
|
|
8
|
+
delta: "_delta_119kx_23",
|
|
9
|
+
arrow: "_arrow_119kx_44",
|
|
10
|
+
help: "_help_119kx_49"
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
export { e as default };
|
package/dist/steps/steps.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._steps_1u41q_2{gap:0;margin:0;padding:0;list-style:none;display:flex}._steps_1u41q_2[data-orientation=horizontal]{flex-direction:row;align-items:center}._steps_1u41q_2[data-orientation=vertical]{flex-direction:column}._step_1u41q_2{flex:1;align-items:center;gap:.5rem;display:flex;position:relative}._step_1u41q_2:not(:last-child):after{content:"";background-color:var(--cascivo-border-default);flex:1;block-size:1px}._steps_1u41q_2[data-orientation=vertical] ._step_1u41q_2:not(:last-child):after{flex:none;block-size:calc(100% - 1.5rem);inline-size:1px;position:absolute;inset-block-start:2rem;inset-inline-start:.75rem}._circle_1u41q_42{border-radius:var(--cascivo-radius-full);border:2px solid var(--cascivo-border-default);background-color:var(--cascivo-color-surface);block-size:1.5rem;inline-size:1.5rem;color:var(--cascivo-color-text-muted);transition:background-color .15s var(--cascivo-ease-out), border-color .15s var(--cascivo-ease-out);flex-shrink:0;justify-content:center;align-items:center;font-size:.75rem;font-weight:600;display:flex}._step_1u41q_2[data-state=active] ._circle_1u41q_42{background-color:var(--cascivo-color-accent);border-color:var(--cascivo-color-accent);color:var(--cascivo-color-accent-content)}._step_1u41q_2[data-state=complete] ._circle_1u41q_42{background-color:var(--cascivo-color-success);border-color:var(--cascivo-color-success);color:var(--cascivo-color-success-content)}._step_1u41q_2[data-state=error] ._circle_1u41q_42{background-color:var(--cascivo-color-error);border-color:var(--cascivo-color-error);color:var(--cascivo-color-error-content)}._step_1u41q_2[data-state=complete]:not(:last-child):after{background-color:var(--cascivo-color-success)}._label_1u41q_82{color:var(--cascivo-color-text-subtle);font-size:.875rem}._step_1u41q_2[data-state=active] ._label_1u41q_82{color:var(--cascivo-color-text);font-weight:500}._step_1u41q_2[data-state=complete] ._label_1u41q_82{color:var(--cascivo-color-text-subtle)}._step_1u41q_2[data-state=error] ._label_1u41q_82{color:var(--cascivo-color-destructive-foreground)}}
|
package/dist/steps/steps.js
CHANGED
|
@@ -2,25 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./steps.module.js";
|
|
4
4
|
import { useSignal as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import {
|
|
5
|
+
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region ../components/src/steps/steps.tsx
|
|
7
|
-
function
|
|
8
|
+
function s({ steps: s, activeStep: c, orientation: l = "horizontal", className: u, ariaLabel: d }) {
|
|
8
9
|
n();
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
let f = t(c ?? 0);
|
|
11
|
+
f.value = c ?? f.value;
|
|
12
|
+
let p = d ?? i(r.steps.label);
|
|
13
|
+
return /* @__PURE__ */ a("ol", {
|
|
14
|
+
className: [e.steps, u].filter(Boolean).join(" "),
|
|
15
|
+
"data-orientation": l,
|
|
16
|
+
"aria-label": p,
|
|
17
|
+
children: s.map((t, n) => {
|
|
18
|
+
let r = t.state ?? (n < f.value ? "complete" : n === f.value ? "active" : "pending");
|
|
19
|
+
return /* @__PURE__ */ o("li", {
|
|
17
20
|
className: e.step,
|
|
18
|
-
"data-state":
|
|
19
|
-
"aria-current":
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
+
"data-state": r,
|
|
22
|
+
"aria-current": r === "active" ? "step" : void 0,
|
|
23
|
+
children: [/* @__PURE__ */ a("div", {
|
|
21
24
|
className: e.circle,
|
|
22
|
-
children:
|
|
23
|
-
}), /* @__PURE__ */
|
|
25
|
+
children: r === "complete" ? "✓" : r === "error" ? "✕" : n + 1
|
|
26
|
+
}), /* @__PURE__ */ a("span", {
|
|
24
27
|
className: e.label,
|
|
25
28
|
children: t.label
|
|
26
29
|
})]
|
|
@@ -29,4 +32,4 @@ function a({ steps: a, activeStep: o, orientation: s = "horizontal", className:
|
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
//#endregion
|
|
32
|
-
export {
|
|
35
|
+
export { s as Steps };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import './steps.css';
|
|
4
4
|
var e = {
|
|
5
|
-
steps: "
|
|
6
|
-
step: "
|
|
7
|
-
circle: "
|
|
8
|
-
label: "
|
|
5
|
+
steps: "_steps_1u41q_2",
|
|
6
|
+
step: "_step_1u41q_2",
|
|
7
|
+
circle: "_circle_1u41q_42",
|
|
8
|
+
label: "_label_1u41q_82"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { e as default };
|