@g4rcez/components 3.0.0-0 → 3.0.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/components/core/button.d.ts +2 -8
- package/dist/components/core/button.d.ts.map +1 -1
- package/dist/components/core/button.jsx +11 -18
- package/dist/components/core/polymorph.d.ts.map +1 -1
- package/dist/components/core/slot.d.ts +1 -1
- package/dist/components/core/slot.d.ts.map +1 -1
- package/dist/components/core/slot.jsx +28 -35
- package/dist/components/core/tag.d.ts +1 -1
- package/dist/components/core/tag.d.ts.map +1 -1
- package/dist/components/core/tag.jsx +3 -3
- package/dist/components/core/typography.d.ts.map +1 -1
- package/dist/components/core/typography.jsx +16 -20
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/alert.jsx +19 -17
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/calendar.jsx +6 -8
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/card.jsx +6 -6
- package/dist/components/display/empty.jsx +1 -1
- package/dist/components/display/notifications.d.ts +2 -0
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/notifications.jsx +76 -48
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/progress.jsx +7 -9
- package/dist/components/display/shortcut.jsx +1 -1
- package/dist/components/display/skeleton.d.ts.map +1 -1
- package/dist/components/display/skeleton.jsx +3 -5
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/step.jsx +27 -27
- package/dist/components/display/tabs.d.ts.map +1 -1
- package/dist/components/display/tabs.jsx +5 -7
- package/dist/components/display/timeline.jsx +1 -1
- package/dist/components/floating/command-palette.d.ts +1 -0
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.jsx +92 -70
- package/dist/components/floating/dropdown.d.ts.map +1 -1
- package/dist/components/floating/dropdown.jsx +15 -15
- package/dist/components/floating/menu.d.ts +2 -2
- package/dist/components/floating/menu.jsx +2 -2
- package/dist/components/floating/modal.d.ts +20 -53
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.jsx +109 -51
- package/dist/components/floating/tooltip.d.ts.map +1 -1
- package/dist/components/floating/tooltip.jsx +2 -8
- package/dist/components/floating/wizard.d.ts +1 -1
- package/dist/components/floating/wizard.d.ts.map +1 -1
- package/dist/components/floating/wizard.jsx +50 -53
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/autocomplete.jsx +42 -38
- package/dist/components/form/checkbox.jsx +3 -3
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.jsx +14 -14
- package/dist/components/form/file-upload.jsx +13 -13
- package/dist/components/form/free-text.d.ts.map +1 -1
- package/dist/components/form/free-text.jsx +3 -3
- package/dist/components/form/input-field.d.ts +3 -2
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.jsx +43 -41
- package/dist/components/form/multi-select.d.ts.map +1 -1
- package/dist/components/form/multi-select.jsx +56 -56
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/select.jsx +3 -3
- package/dist/components/form/slider.d.ts.map +1 -1
- package/dist/components/form/slider.jsx +10 -10
- package/dist/components/form/switch.jsx +2 -2
- package/dist/components/form/transfer-list.jsx +3 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/page-calendar/calendar-header.d.ts +16 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
- package/dist/components/page-calendar/calendar-header.jsx +81 -0
- package/dist/components/page-calendar/day-view.d.ts +12 -0
- package/dist/components/page-calendar/day-view.d.ts.map +1 -0
- package/dist/components/page-calendar/day-view.jsx +87 -0
- package/dist/components/page-calendar/event-pill.d.ts +9 -0
- package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
- package/dist/components/page-calendar/event-pill.jsx +25 -0
- package/dist/components/page-calendar/index.d.ts +4 -0
- package/dist/components/page-calendar/index.d.ts.map +1 -0
- package/dist/components/page-calendar/index.js +2 -0
- package/dist/components/page-calendar/month-view.d.ts +11 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +47 -0
- package/dist/components/page-calendar/page-calendar.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +41 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.types.js +1 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.utils.js +71 -0
- package/dist/components/page-calendar/week-view.d.ts +11 -0
- package/dist/components/page-calendar/week-view.d.ts.map +1 -0
- package/dist/components/page-calendar/week-view.jsx +64 -0
- package/dist/components/table/filter.jsx +4 -4
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.jsx +10 -10
- package/dist/components/table/inner-table.d.ts.map +1 -1
- package/dist/components/table/inner-table.jsx +18 -18
- package/dist/components/table/metadata.d.ts.map +1 -1
- package/dist/components/table/metadata.jsx +29 -30
- package/dist/components/table/pagination.jsx +1 -1
- package/dist/components/table/row.d.ts.map +1 -1
- package/dist/components/table/row.jsx +17 -17
- package/dist/components/table/sort.jsx +1 -1
- package/dist/components/table/table-lib.d.ts.map +1 -1
- package/dist/components/table/table-lib.js +1 -2
- package/dist/components/table/thead.d.ts.map +1 -1
- package/dist/components/table/thead.jsx +6 -6
- package/dist/config/context.d.ts.map +1 -1
- package/dist/config/default-translations.d.ts +17 -0
- package/dist/config/default-translations.d.ts.map +1 -1
- package/dist/config/default-translations.jsx +18 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/hooks/use-components-provider.jsx +4 -1
- package/dist/hooks/use-form.d.ts +11 -11
- package/dist/hooks/use-form.d.ts.map +1 -1
- package/dist/hooks/use-form.js +1 -0
- package/dist/hooks/use-input-id.d.ts.map +1 -1
- package/dist/hooks/use-is-coarse-device.js +1 -1
- package/dist/hooks/use-preferences.d.ts.map +1 -1
- package/dist/hooks/use-previous.d.ts.map +1 -1
- package/dist/hooks/use-previous.js +1 -0
- package/dist/hooks/use-reactive.d.ts.map +1 -1
- package/dist/hooks/use-reactive.js +1 -0
- package/dist/hooks/use-resize-observer.d.ts.map +1 -1
- package/dist/hooks/use-stable-ref.d.ts.map +1 -1
- package/dist/hooks/use-stable-ref.js +1 -0
- package/dist/hooks/use-swipe.d.ts.map +1 -1
- package/dist/hooks/use-swipe.js +1 -0
- package/dist/hooks/use-translations.d.ts +17 -0
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13689 -12344
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +24 -17
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/dom.d.ts +1 -0
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/lib/dom.js +20 -2
- package/dist/lib/fns.d.ts.map +1 -1
- package/dist/lib/fns.js +2 -2
- package/dist/preset/plugin.tailwind.d.ts +9 -0
- package/dist/preset/plugin.tailwind.d.ts.map +1 -0
- package/dist/preset/plugin.tailwind.js +27 -0
- package/dist/preset/preset.tailwind.d.ts +8 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -0
- package/dist/preset/preset.tailwind.js +54 -0
- package/dist/preset/src/styles/common.d.ts +2 -14
- package/dist/preset/src/styles/common.d.ts.map +1 -1
- package/dist/preset/src/styles/common.js +1 -0
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +119 -114
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +111 -106
- package/dist/preset/src/styles/theme.types.d.ts +17 -8
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/styles/common.d.ts +2 -14
- package/dist/styles/common.d.ts.map +1 -1
- package/dist/styles/common.js +1 -0
- package/dist/styles/dark.d.ts.map +1 -1
- package/dist/styles/dark.js +119 -114
- package/dist/styles/light.d.ts.map +1 -1
- package/dist/styles/light.js +111 -106
- package/dist/styles/theme.types.d.ts +17 -8
- package/dist/styles/theme.types.d.ts.map +1 -1
- package/package.json +299 -301
- package/dist/preset/tailwindcssv4.d.ts +0 -3
- package/dist/preset/tailwindcssv4.d.ts.map +0 -1
- package/dist/preset/tailwindcssv4.js +0 -75
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Toast as Base } from "@base-ui/react/toast";
|
|
2
3
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import { XIcon } from "lucide-react";
|
|
4
|
+
import { XIcon, CheckCircleIcon, TriangleAlertIcon, InfoIcon, Loader2Icon } from "lucide-react";
|
|
4
5
|
import { AnimatePresence, motion } from "motion/react";
|
|
5
|
-
import { Toast as Base } from "@base-ui/react/toast";
|
|
6
6
|
import { createContext, useCallback, useContext, useRef } from "react";
|
|
7
7
|
import { useHover } from "../../hooks/use-hover";
|
|
8
|
-
|
|
8
|
+
import { css } from "../../lib/dom";
|
|
9
|
+
const variants = cva("relative isolate z-tooltip flex w-full flex-col overflow-hidden rounded-xl border bg-card-background backdrop-blur-md text-sm shadow-notification transition-all duration-300", {
|
|
9
10
|
variants: {
|
|
10
11
|
theme: {
|
|
11
|
-
default: "border-card-border
|
|
12
|
+
default: "border-card-border text-foreground shadow-black/5",
|
|
12
13
|
info: "bg-alert-info-bg text-alert-info-text border-alert-info-border",
|
|
13
14
|
warn: "bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",
|
|
14
15
|
muted: "bg-alert-muted-bg text-alert-muted-text border-alert-muted-border",
|
|
@@ -19,53 +20,66 @@ const variants = cva("relative isolate z-tooltip flex justify-between overflow-h
|
|
|
19
20
|
},
|
|
20
21
|
defaultVariants: { theme: "default" },
|
|
21
22
|
});
|
|
23
|
+
const themeIcons = {
|
|
24
|
+
default: InfoIcon,
|
|
25
|
+
info: InfoIcon,
|
|
26
|
+
warn: TriangleAlertIcon,
|
|
27
|
+
muted: InfoIcon,
|
|
28
|
+
danger: TriangleAlertIcon,
|
|
29
|
+
success: CheckCircleIcon,
|
|
30
|
+
secondary: InfoIcon,
|
|
31
|
+
};
|
|
22
32
|
const NotificationContext = createContext(() => {
|
|
23
33
|
throw new Error("Not implemented");
|
|
24
34
|
});
|
|
25
35
|
export const useNotification = () => useContext(NotificationContext);
|
|
26
|
-
const animatedIndex = {
|
|
27
|
-
0: { opacity: 1, y: [10, 15], scale: [1, 0.98] },
|
|
28
|
-
1: { opacity: 1, y: [15, 20], scale: [1, 0.97] },
|
|
29
|
-
2: { opacity: 1, y: [20, 25], scale: [1, 0.96] },
|
|
30
|
-
default: { opacity: 1, y: [25, 30], scale: [1, 0.95] },
|
|
31
|
-
};
|
|
32
36
|
function Notification(props) {
|
|
33
37
|
const closable = props.toast.data?.closable ?? true;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
const loading = props.toast.data?.loading ?? false;
|
|
39
|
+
const theme = props.toast.data?.theme || "default";
|
|
40
|
+
const className = variants({ theme });
|
|
41
|
+
const Icon = loading ? Loader2Icon : themeIcons[theme] || InfoIcon;
|
|
42
|
+
return (<Base.Root toast={props.toast} swipeDirection="right">
|
|
43
|
+
<motion.li layout initial={{ opacity: 0, y: -20, scale: 0.95 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, scale: 0.9, y: -20, transition: { duration: 0.2 } }} transition={{
|
|
44
|
+
type: "spring",
|
|
45
|
+
damping: 25,
|
|
46
|
+
stiffness: 300,
|
|
47
|
+
}} className="pointer-events-auto w-full list-none">
|
|
48
|
+
<Base.Content className={css(className, "shadow-lg")}>
|
|
49
|
+
<div className="flex items-start gap-3 p-4">
|
|
50
|
+
<div className={css("mt-0.5 shrink-0 opacity-80", loading && "animate-spin")}>
|
|
51
|
+
<Icon className="size-4"/>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div className="flex flex-1 flex-col gap-1 overflow-hidden">
|
|
55
|
+
{props.toast.title ? <Base.Title className="select-text truncate font-semibold leading-tight tracking-tight"/> : null}
|
|
56
|
+
<Base.Description className="line-clamp-2 select-text text-xs font-medium leading-relaxed opacity-90"/>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
{closable && !loading ? (<Base.Close className="-mr-1 -mt-1 shrink-0 rounded-lg p-1.5 text-foreground/40 transition hover:bg-foreground/10 hover:text-foreground">
|
|
60
|
+
<XIcon className="size-3.5"/>
|
|
61
|
+
</Base.Close>) : null}
|
|
62
|
+
</div>
|
|
63
|
+
</Base.Content>
|
|
64
|
+
</motion.li>
|
|
65
|
+
</Base.Root>);
|
|
53
66
|
}
|
|
54
67
|
function NotificationsViewport({ max = 5 }) {
|
|
55
68
|
const ref = useRef(null);
|
|
56
69
|
const hover = useHover(ref);
|
|
57
70
|
const toastManager = Base.useToastManager();
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
const allToasts = max ? toastManager.toasts.slice(0, max) : toastManager.toasts;
|
|
72
|
+
const visibleToasts = hover ? allToasts : allToasts.slice(0, 3);
|
|
73
|
+
const hiddenCount = allToasts.length - visibleToasts.length;
|
|
74
|
+
return (<Base.Viewport ref={ref} className="pointer-events-none fixed left-1/2 top-6 z-[100] flex w-full max-w-[380px] -translate-x-1/2 flex-col gap-3 overflow-visible outline-none">
|
|
75
|
+
<AnimatePresence mode="popLayout" initial={false}>
|
|
76
|
+
{visibleToasts.map((toast) => (<Notification key={toast.id} toast={toast}/>))}
|
|
77
|
+
</AnimatePresence>
|
|
78
|
+
|
|
79
|
+
{!hover && hiddenCount > 0 && (<motion.div layout initial={{ opacity: 0, y: -10 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: -10 }} className="pointer-events-auto cursor-default self-center rounded-full border border-card-border bg-card-background/80 px-3 py-1 text-[10px] font-bold uppercase tracking-wider text-foreground/50 shadow-sm backdrop-blur transition-all hover:bg-card-background hover:text-foreground/80">
|
|
80
|
+
+{hiddenCount} more
|
|
81
|
+
</motion.div>)}
|
|
82
|
+
</Base.Viewport>);
|
|
69
83
|
}
|
|
70
84
|
function NotificationsInner({ children, max = 5 }) {
|
|
71
85
|
const toastManager = Base.useToastManager();
|
|
@@ -73,11 +87,25 @@ function NotificationsInner({ children, max = 5 }) {
|
|
|
73
87
|
toastManager.toasts.forEach((t) => toastManager.close(t.id));
|
|
74
88
|
}, [toastManager]);
|
|
75
89
|
const notify = useCallback((description, args) => {
|
|
90
|
+
const data = { theme: args?.theme, closable: args?.closable, loading: args?.loading };
|
|
91
|
+
if (args?.id) {
|
|
92
|
+
const existing = toastManager.toasts.find((t) => t.id === args.id);
|
|
93
|
+
if (existing) {
|
|
94
|
+
toastManager.update(args.id, {
|
|
95
|
+
description,
|
|
96
|
+
title: args.title,
|
|
97
|
+
timeout: args.timeout,
|
|
98
|
+
data,
|
|
99
|
+
});
|
|
100
|
+
return { close: () => toastManager.close(args.id), clear };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
76
103
|
const id = toastManager.add({
|
|
77
104
|
description,
|
|
105
|
+
id: args?.id,
|
|
78
106
|
title: args?.title,
|
|
79
107
|
timeout: args?.timeout,
|
|
80
|
-
data
|
|
108
|
+
data,
|
|
81
109
|
});
|
|
82
110
|
return {
|
|
83
111
|
close: () => toastManager.close(id),
|
|
@@ -85,14 +113,14 @@ function NotificationsInner({ children, max = 5 }) {
|
|
|
85
113
|
};
|
|
86
114
|
}, [toastManager, clear]);
|
|
87
115
|
return (<NotificationContext.Provider value={notify}>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
116
|
+
{children}
|
|
117
|
+
<Base.Portal>
|
|
118
|
+
<NotificationsViewport max={max}/>
|
|
119
|
+
</Base.Portal>
|
|
120
|
+
</NotificationContext.Provider>);
|
|
93
121
|
}
|
|
94
122
|
export function Notifications({ children, max = 5, timeout = 5000 }) {
|
|
95
123
|
return (<Base.Provider limit={max} timeout={timeout}>
|
|
96
|
-
|
|
97
|
-
|
|
124
|
+
<NotificationsInner max={max}>{children}</NotificationsInner>
|
|
125
|
+
</Base.Provider>);
|
|
98
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/display/progress.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,KAAK,aAAa,GAAG;
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/display/progress.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,KAAK,aAAa,GAAG;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,eAAe,CAAC,aAAa,CAAC,gCAwB7D,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Is } from "sidekicker";
|
|
2
|
-
import { Progress as
|
|
2
|
+
import { Progress as RadixProgress } from "@base-ui/react/progress";
|
|
3
3
|
import { css } from "../../lib/dom";
|
|
4
4
|
export const Progress = (props) => {
|
|
5
|
-
return (<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</
|
|
11
|
-
: null}
|
|
12
|
-
</ProgressBar.Root>);
|
|
5
|
+
return (<RadixProgress.Root max={props.max} value={props.percent ?? null} style={{ transform: "translateZ(0)" }} className={css("relative h-6 w-full overflow-hidden rounded-full bg-background", props.container)}>
|
|
6
|
+
<RadixProgress.Indicator style={{ transform: Is.number(props.percent) ? `translateX(-${100 - props.percent}%)` : undefined }} className={css("size-full bg-primary transition-transform duration-500 ease-in-out", props.className)}/>
|
|
7
|
+
{Is.number(props.percent) ? (<p className={css("absolute inset-0 flex w-full items-center justify-center font-semibold tabular-nums text-primary-foreground", props.textClassName)}>
|
|
8
|
+
{props.label ? props.label : `${props.percent} %`}
|
|
9
|
+
</p>) : null}
|
|
10
|
+
</RadixProgress.Root>);
|
|
13
11
|
};
|
|
@@ -11,7 +11,7 @@ const remap = (x) => {
|
|
|
11
11
|
};
|
|
12
12
|
export const Shortcut = (props) => {
|
|
13
13
|
const p = props.value.trim().split("+");
|
|
14
|
-
return (<span className="flex
|
|
14
|
+
return (<span className="flex items-center gap-1 text-sm">
|
|
15
15
|
{p.map((x, i) => {
|
|
16
16
|
const isLast = p.length - 1 === i;
|
|
17
17
|
return (<Fragment key={`${props.value}-${x}-key-${i}`}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAU,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIvE,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAU,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIvE,eAAO,MAAM,YAAY,mBAAiE,CAAC;AAE3F,eAAO,MAAM,QAAQ,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,sBAE9F,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,sBAQvE,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
2
|
import { css } from "../../lib/dom";
|
|
3
3
|
import { Polymorph } from "../core/polymorph";
|
|
4
|
-
export const SkeletonCell = <div className="w-10/12
|
|
5
|
-
export const Skeleton = (props) => (<Polymorph {...props} as={props.as || "span"} className={css("block
|
|
4
|
+
export const SkeletonCell = <div className="h-6 w-10/12 animate-pulse rounded bg-muted"/>;
|
|
5
|
+
export const Skeleton = (props) => (<Polymorph {...props} as={props.as || "span"} className={css("block h-8 w-32 animate-pulse rounded bg-muted", props.className)}/>);
|
|
6
6
|
export const SkeletonList = (props) => {
|
|
7
7
|
const items = useRef(Array.from({ length: props.rows }).map((_, i) => {
|
|
8
8
|
const rand = Math.max(100, Math.random() * 99);
|
|
9
9
|
return <Skeleton key={`skeleton-${rand}-${i}`} style={{ width: `${rand}%` }} as="li"/>;
|
|
10
10
|
}));
|
|
11
|
-
return
|
|
12
|
-
{items.current}
|
|
13
|
-
</ul>);
|
|
11
|
+
return <ul className={css("flex flex-col gap-6", props.className)}>{items.current}</ul>;
|
|
14
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAA2C,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAEnI,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMpC,KAAK,gBAAgB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA+BlH,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAA2C,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAEnI,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMpC,KAAK,gBAAgB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA+BlH,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AA2BF,eAAO,MAAM,cAAc,+BAAgC,CAAC;AAE5D,eAAO,MAAM,IAAI,GAAI,gEAAgE,SAAS,sBA6F7F,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,sBA0BrF,CAAC"}
|
|
@@ -11,17 +11,17 @@ const states = {
|
|
|
11
11
|
animate: { pathLength: 1, opacity: 1 },
|
|
12
12
|
};
|
|
13
13
|
const ErrorIcon = (props) => (<svg {...props} viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<motion.path className="currentColor" initial={states.initial} animate={states.animate} transition={iconTransitions} d="M18 6 6 18"/>
|
|
15
|
+
<motion.path className="currentColor" initial={states.initial} animate={states.animate} transition={iconTransitions} d="m6 6 12 12"/>
|
|
16
|
+
</svg>);
|
|
17
17
|
const CheckIcon = (props) => (<svg {...props} fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={3}>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
<motion.path d="M5 13l4 4L19 7" strokeLinecap="round" strokeLinejoin="round" animate={states.animate} initial={states.initial} transition={iconTransitions}/>
|
|
19
|
+
</svg>);
|
|
20
20
|
const variants = {
|
|
21
21
|
complete: { scale: 1.25 },
|
|
22
|
-
active: { scale: 1, transition: { delay: 0, duration: 0.3 } }
|
|
22
|
+
active: { scale: 1, transition: { delay: 0, duration: 0.3 } },
|
|
23
23
|
};
|
|
24
|
-
const transitions = { duration: 0.6, delay: 0.2, type: "tween", ease: "circOut"
|
|
24
|
+
const transitions = { duration: 0.6, delay: 0.2, type: "tween", ease: "circOut" };
|
|
25
25
|
const getCurrentStatus = (step, currentStep, status) => {
|
|
26
26
|
if (status === "error")
|
|
27
27
|
return "error";
|
|
@@ -65,12 +65,12 @@ export const Step = ({ step, currentStep, status, title, titleClassName, ...prop
|
|
|
65
65
|
return () => clearTimeout(timer);
|
|
66
66
|
}, [currentStep, context, step]);
|
|
67
67
|
const innerStatus = getCurrentStatus(step, visualCurrentStep, status);
|
|
68
|
-
const widthPerStep = context?.steps ? 100 /
|
|
68
|
+
const widthPerStep = context?.steps ? 100 / context?.steps : undefined;
|
|
69
69
|
return (<Fragment>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
<div className={`hidden h-[2px] w-full bg-card-border first:hidden xl:block ${innerStatus === "active" || innerStatus === "complete" ? "bg-success" : ""}`}/>
|
|
71
|
+
<motion.button {...props} type="button" data-step={step} animate={innerStatus} className="relative flex w-auto items-center justify-center text-center">
|
|
72
|
+
<motion.div variants={variants} transition={transitions} className={`absolute inset-0 hidden rounded-full text-center xl:block ${innerStatus === "error" ? "bg-danger" : ""}`}/>
|
|
73
|
+
<motion.div initial={false} animate={innerStatus} transition={transition} className="relative flex aspect-square size-10 items-center justify-center rounded-full font-semibold" variants={{
|
|
74
74
|
error: {
|
|
75
75
|
color: parser("var(--danger-foreground)"),
|
|
76
76
|
borderColor: parser("var(--danger-hover)"),
|
|
@@ -95,17 +95,17 @@ export const Step = ({ step, currentStep, status, title, titleClassName, ...prop
|
|
|
95
95
|
backgroundColor: parser("var(--success-DEFAULT)"),
|
|
96
96
|
},
|
|
97
97
|
}}>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
<div className="flex items-center justify-center">
|
|
99
|
+
{innerStatus === "complete" ? (<CheckIcon className="size-6 text-primary-foreground"/>) : innerStatus === "error" ? (<ErrorIcon className="size-6 text-danger-foreground"/>) : (<Fragment>
|
|
100
|
+
<span>{step}</span>
|
|
101
|
+
</Fragment>)}
|
|
102
|
+
</div>
|
|
103
|
+
</motion.div>
|
|
104
|
+
<header className="flex flex-col items-start justify-start px-2">
|
|
105
|
+
<h3 className={`flex h-full items-center whitespace-nowrap ${titleClassName}`}>{title}</h3>
|
|
106
|
+
</header>
|
|
107
|
+
</motion.button>
|
|
108
|
+
</Fragment>);
|
|
109
109
|
};
|
|
110
110
|
export const Steps = (props) => {
|
|
111
111
|
const previousStepRef = useRef(props.currentStep);
|
|
@@ -124,8 +124,8 @@ export const Steps = (props) => {
|
|
|
124
124
|
steps: React.Children.count(props.children),
|
|
125
125
|
};
|
|
126
126
|
return (<StepContext.Provider value={contextValue}>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
<div className="relative flex w-full flex-col items-start justify-center gap-4 lg:flex-row lg:items-center lg:justify-between">
|
|
128
|
+
{props.children}
|
|
129
|
+
</div>
|
|
130
|
+
</StepContext.Provider>);
|
|
131
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAMzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAMzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AA+BF,eAAO,MAAM,IAAI,GAAI,OAAO,iBAAiB,CAAC,SAAS,CAAC,sBAsFvD,CAAC;AAIF,KAAK,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,QAAQ,GAAG,cAAc,GACjC,CACM;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GACpC;IACI,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9B,CACN,CAAC;AAEN,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,CAAC,QAAQ,CAAC,sBAGrD,CAAC"}
|
|
@@ -17,9 +17,7 @@ const getNElement = (elements, currentIndex, direction) => {
|
|
|
17
17
|
if (!isElementDisabled(element))
|
|
18
18
|
return element;
|
|
19
19
|
}
|
|
20
|
-
return direction === "backward"
|
|
21
|
-
? getNElement(elements, elements.length - 1, "backward")
|
|
22
|
-
: getNElement(elements, -1, "forward");
|
|
20
|
+
return direction === "backward" ? getNElement(elements, elements.length - 1, "backward") : getNElement(elements, -1, "forward");
|
|
23
21
|
};
|
|
24
22
|
const moveOn = (ul, direction) => {
|
|
25
23
|
const items = Array.from(ul.querySelectorAll("li"));
|
|
@@ -73,15 +71,15 @@ export const Tabs = (props) => {
|
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
73
|
return (<Context.Provider value={active}>
|
|
76
|
-
<Card className={props.className} container={css("pt-0 max-w-full w-full min-w-0", props.container)} header={<header className="overflow-x-auto
|
|
77
|
-
<div className="absolute bottom-0 w-full
|
|
74
|
+
<Card className={props.className} container={css("pt-0 max-w-full w-full min-w-0", props.container)} header={<header className="relative mb-2 overflow-x-auto">
|
|
75
|
+
<div className="absolute bottom-0 h-[1px] w-full bg-card-border"/>
|
|
78
76
|
<nav className="min-w-0">
|
|
79
|
-
<ul onKeyDown={onKeyDown} ref={ref} className="flex
|
|
77
|
+
<ul onKeyDown={onKeyDown} ref={ref} className="flex w-0 min-w-full flex-1 justify-start overflow-x-auto">
|
|
80
78
|
{items.map((x) => {
|
|
81
79
|
const inner = x.props;
|
|
82
80
|
const current = active === inner.id;
|
|
83
81
|
return (<li data-id={inner.id} data-active={current} key={`tab-header-${inner.id}`} aria-disabled={inner.disabled} className={css("relative w-fit border-b border-transparent transition-all", current ? "border-primary font-medium text-primary" : "", inner.disabled ? "aria-disabled:text-disabled" : "")}>
|
|
84
|
-
<Polymorph as="button" type="button" data-id={inner.id} aria-current="page" disabled={inner.disabled} onClick={inner.disabled ? undefined : onClick} className="block
|
|
82
|
+
<Polymorph as="button" type="button" data-id={inner.id} aria-current="page" disabled={inner.disabled} onClick={inner.disabled ? undefined : onClick} className="block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed">
|
|
85
83
|
{inner.title}
|
|
86
84
|
</Polymorph>
|
|
87
85
|
</li>);
|
|
@@ -6,7 +6,7 @@ export const TimelineItem = (props) => (<li data-component="timeline-item" class
|
|
|
6
6
|
<div className="relative flex items-stretch justify-start space-x-3">{props.children}</div>
|
|
7
7
|
</li>);
|
|
8
8
|
TimelineItem.Icon = function TimelineIcon(props) {
|
|
9
|
-
return (<header {...props} className={css("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-
|
|
9
|
+
return (<header {...props} className={css("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-warn-foreground", props.className)}>
|
|
10
10
|
{props.children}
|
|
11
11
|
</header>);
|
|
12
12
|
};
|
|
@@ -16,6 +16,7 @@ type CommandShortcutItem = CommandItem<"shortcut", {
|
|
|
16
16
|
shortcut?: string;
|
|
17
17
|
action: (args: {
|
|
18
18
|
text: string;
|
|
19
|
+
setText: (state: string) => void;
|
|
19
20
|
setOpen: (state: boolean) => void;
|
|
20
21
|
event: KeyboardEvent | React.MouseEvent | React.KeyboardEvent;
|
|
21
22
|
}) => void | Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/floating/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAmE,MAAM,OAAO,CAAC;AAQxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/floating/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAmE,MAAM,OAAO,CAAC;AAQxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC;CACvD,CAAC;AAEF,KAAK,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;AAEpD,KAAK,mBAAmB,GAAG,WAAW,CAClC,UAAU,EACV;IACI,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,IAAI,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACjC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QAClC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC;KACjE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CACJ,CAAC;AAEF,KAAK,gBAAgB,GAAG,WAAW,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AA8CtE,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAAC;CACnF,CAAC;AAgCF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,sBA0LxD,CAAC"}
|