@lexydesign/designsystem 0.1.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 +72 -0
- package/dist/components/Accordion/Accordion.d.ts +13 -0
- package/dist/components/Accordion/Accordion.js +33 -0
- package/dist/components/Avatar/Avatar.d.ts +7 -0
- package/dist/components/Avatar/Avatar.js +39 -0
- package/dist/components/Badge/Badge.d.ts +9 -0
- package/dist/components/Badge/Badge.js +137 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +51 -0
- package/dist/components/Button/Button.d.ts +10 -0
- package/dist/components/Button/Button.js +145 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/Checkbox.js +46 -0
- package/dist/components/Combobox/Combobox.d.ts +16 -0
- package/dist/components/Combobox/Combobox.js +57 -0
- package/dist/components/CounterBadge/CounterBadge.d.ts +8 -0
- package/dist/components/CounterBadge/CounterBadge.js +25 -0
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/Divider/Divider.js +14 -0
- package/dist/components/Dropdown/Dropdown.d.ts +21 -0
- package/dist/components/Dropdown/Dropdown.js +64 -0
- package/dist/components/FeatureCard/FeatureCard.d.ts +9 -0
- package/dist/components/FeatureCard/FeatureCard.js +31 -0
- package/dist/components/HeaderBar/HeaderBar.d.ts +13 -0
- package/dist/components/HeaderBar/HeaderBar.js +41 -0
- package/dist/components/InfoLabel/InfoLabel.d.ts +5 -0
- package/dist/components/InfoLabel/InfoLabel.js +26 -0
- package/dist/components/Input/Input.d.ts +7 -0
- package/dist/components/Input/Input.js +39 -0
- package/dist/components/Logo/Logo.d.ts +20 -0
- package/dist/components/Logo/Logo.js +84 -0
- package/dist/components/Logo/assets/lexy-dark-horizontal-slogan.js +5 -0
- package/dist/components/Logo/assets/lexy-dark-horizontal.js +5 -0
- package/dist/components/Logo/assets/lexy-dark-isotipe.js +5 -0
- package/dist/components/Logo/assets/lexy-dark-vertical-slogan.js +5 -0
- package/dist/components/Logo/assets/lexy-dark-vertical.js +5 -0
- package/dist/components/Logo/assets/lexy-light-horizontal-slogan.js +5 -0
- package/dist/components/Logo/assets/lexy-light-horizontal.js +5 -0
- package/dist/components/Logo/assets/lexy-light-isotipe.js +5 -0
- package/dist/components/Logo/assets/lexy-light-vertical-slogan.js +5 -0
- package/dist/components/Logo/assets/lexy-light-vertical.js +5 -0
- package/dist/components/Logo/assets/lexydeudor-dark-v1.js +5 -0
- package/dist/components/Logo/assets/lexydeudor-dark-v2.js +5 -0
- package/dist/components/Logo/assets/lexydeudor-light-v1.js +5 -0
- package/dist/components/Logo/assets/lexydeudor-light-v2.js +5 -0
- package/dist/components/Logo/assets/lexysalud-dark-v1.js +5 -0
- package/dist/components/Logo/assets/lexysalud-dark-v2.js +5 -0
- package/dist/components/Logo/assets/lexysalud-light-v1.js +5 -0
- package/dist/components/Logo/assets/lexysalud-light-v2.js +5 -0
- package/dist/components/Menu/Menu.d.ts +49 -0
- package/dist/components/Menu/Menu.js +108 -0
- package/dist/components/Modal/Modal.d.ts +33 -0
- package/dist/components/Modal/Modal.js +89 -0
- package/dist/components/Nav/Nav.d.ts +20 -0
- package/dist/components/Nav/Nav.js +44 -0
- package/dist/components/ProfileCard/ProfileCard.d.ts +11 -0
- package/dist/components/ProfileCard/ProfileCard.js +46 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +6 -0
- package/dist/components/ProgressBar/ProgressBar.js +31 -0
- package/dist/components/Radio/Radio.d.ts +5 -0
- package/dist/components/Radio/Radio.js +28 -0
- package/dist/components/Searchbox/Searchbox.d.ts +10 -0
- package/dist/components/Searchbox/Searchbox.js +62 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -0
- package/dist/components/Skeleton/Skeleton.js +13 -0
- package/dist/components/Slider/Slider.d.ts +9 -0
- package/dist/components/Slider/Slider.js +41 -0
- package/dist/components/Snippet/Snippet.d.ts +11 -0
- package/dist/components/Snippet/Snippet.js +52 -0
- package/dist/components/StatusDot/StatusDot.d.ts +8 -0
- package/dist/components/StatusDot/StatusDot.js +31 -0
- package/dist/components/Switch/Switch.d.ts +6 -0
- package/dist/components/Switch/Switch.js +27 -0
- package/dist/components/Tabs/Tabs.d.ts +24 -0
- package/dist/components/Tabs/Tabs.js +69 -0
- package/dist/components/Tag/Tag.d.ts +12 -0
- package/dist/components/Tag/Tag.js +49 -0
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/Textarea.js +54 -0
- package/dist/components/Toast/Toast.d.ts +7 -0
- package/dist/components/Toast/Toast.js +60 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.js +58 -0
- package/dist/components/Tree/Tree.d.ts +14 -0
- package/dist/components/Tree/Tree.js +39 -0
- package/dist/globals.css +243 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +37 -0
- package/dist/lib/useFloating.d.ts +20 -0
- package/dist/lib/useFloating.js +54 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +9 -0
- package/dist/tokens.css +256 -0
- package/package.json +57 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
export interface MenuProps {
|
|
3
|
+
/** The element that opens the menu (rendered as the anchor). */
|
|
4
|
+
trigger: React.ReactNode;
|
|
5
|
+
align?: 'start' | 'end';
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function Menu({ trigger, align, className, children }: MenuProps): import("react").JSX.Element;
|
|
10
|
+
export declare namespace Menu {
|
|
11
|
+
var Item: typeof MenuItem;
|
|
12
|
+
var CheckboxItem: typeof MenuCheckboxItem;
|
|
13
|
+
var RadioItem: typeof MenuRadioItem;
|
|
14
|
+
var SubTrigger: typeof MenuSubTrigger;
|
|
15
|
+
var Label: typeof MenuLabel;
|
|
16
|
+
var Separator: typeof MenuSeparator;
|
|
17
|
+
}
|
|
18
|
+
export interface MenuItemProps {
|
|
19
|
+
icon?: LucideIcon;
|
|
20
|
+
shortcut?: string;
|
|
21
|
+
destructive?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
onSelect?: () => void;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare function MenuItem({ icon: Icon, shortcut, destructive, disabled, onSelect, children }: MenuItemProps): import("react").JSX.Element;
|
|
27
|
+
export interface MenuCheckboxItemProps {
|
|
28
|
+
checked?: boolean;
|
|
29
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
declare function MenuCheckboxItem({ checked, onCheckedChange, disabled, children }: MenuCheckboxItemProps): import("react").JSX.Element;
|
|
34
|
+
export interface MenuRadioItemProps {
|
|
35
|
+
checked?: boolean;
|
|
36
|
+
onSelect?: () => void;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
declare function MenuRadioItem({ checked, onSelect, disabled, children }: MenuRadioItemProps): import("react").JSX.Element;
|
|
41
|
+
declare function MenuSubTrigger({ icon: Icon, children }: {
|
|
42
|
+
icon?: LucideIcon;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
declare function MenuLabel({ children }: {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
}): import("react").JSX.Element;
|
|
48
|
+
declare function MenuSeparator(): import("react").JSX.Element;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useFloating as t } from "../../lib/useFloating.js";
|
|
4
|
+
import { createContext as n, useContext as r } from "react";
|
|
5
|
+
import { Check as i, ChevronRight as a } from "lucide-react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Menu/Menu.tsx
|
|
8
|
+
var c = n(null);
|
|
9
|
+
function l({ trigger: n, align: r = "start", className: i, children: a }) {
|
|
10
|
+
let { triggerRef: l, floatingRef: u, open: d, setOpen: f, floatingStyle: p } = t({ placement: r === "end" ? "bottom-end" : "bottom-start" });
|
|
11
|
+
return /* @__PURE__ */ s(c.Provider, {
|
|
12
|
+
value: { close: () => f(!1) },
|
|
13
|
+
children: [/* @__PURE__ */ o("div", {
|
|
14
|
+
ref: l,
|
|
15
|
+
className: "inline-flex",
|
|
16
|
+
onClick: () => f((e) => !e),
|
|
17
|
+
children: n
|
|
18
|
+
}), d && /* @__PURE__ */ o("div", {
|
|
19
|
+
ref: u,
|
|
20
|
+
role: "menu",
|
|
21
|
+
style: p,
|
|
22
|
+
className: e("z-50 min-w-[220px] rounded-[var(--radius-popover)] border border-border bg-surface shadow-md p-1", "[font-family:var(--font-base)]", i),
|
|
23
|
+
children: a
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var u = "flex items-center gap-2 h-8 px-2 rounded-[var(--radius-control-sm)] text-sm cursor-pointer transition-colors select-none";
|
|
28
|
+
function d({ icon: t, shortcut: n, destructive: i, disabled: a, onSelect: l, children: d }) {
|
|
29
|
+
let f = r(c);
|
|
30
|
+
return /* @__PURE__ */ s("div", {
|
|
31
|
+
role: "menuitem",
|
|
32
|
+
"aria-disabled": a || void 0,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
a || (l?.(), f?.close());
|
|
35
|
+
},
|
|
36
|
+
className: e(u, i ? "text-status-danger-foreground" : "text-text-foreground", !a && "hover:bg-alpha-neutral-alpha-hover", a && "pointer-events-none text-text-foreground-disabled"),
|
|
37
|
+
children: [
|
|
38
|
+
t && /* @__PURE__ */ o(t, { className: "h-4 w-4 flex-shrink-0" }),
|
|
39
|
+
/* @__PURE__ */ o("span", {
|
|
40
|
+
className: "flex-1 truncate",
|
|
41
|
+
children: d
|
|
42
|
+
}),
|
|
43
|
+
n && /* @__PURE__ */ o("span", {
|
|
44
|
+
className: "text-xs text-text-foreground-muted",
|
|
45
|
+
children: n
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function f({ checked: t, onCheckedChange: n, disabled: r, children: a }) {
|
|
51
|
+
return /* @__PURE__ */ s("div", {
|
|
52
|
+
role: "menuitemcheckbox",
|
|
53
|
+
"aria-checked": t,
|
|
54
|
+
onClick: () => !r && n?.(!t),
|
|
55
|
+
className: e(u, "text-text-foreground", !r && "hover:bg-alpha-neutral-alpha-hover", r && "pointer-events-none text-text-foreground-disabled"),
|
|
56
|
+
children: [/* @__PURE__ */ o("span", {
|
|
57
|
+
className: "flex h-4 w-4 flex-shrink-0 items-center justify-center",
|
|
58
|
+
children: t && /* @__PURE__ */ o(i, { className: "h-4 w-4" })
|
|
59
|
+
}), /* @__PURE__ */ o("span", {
|
|
60
|
+
className: "flex-1 truncate",
|
|
61
|
+
children: a
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function p({ checked: t, onSelect: n, disabled: r, children: i }) {
|
|
66
|
+
return /* @__PURE__ */ s("div", {
|
|
67
|
+
role: "menuitemradio",
|
|
68
|
+
"aria-checked": t,
|
|
69
|
+
onClick: () => !r && n?.(),
|
|
70
|
+
className: e(u, "text-text-foreground", !r && "hover:bg-alpha-neutral-alpha-hover", r && "pointer-events-none text-text-foreground-disabled"),
|
|
71
|
+
children: [/* @__PURE__ */ o("span", {
|
|
72
|
+
className: "flex h-4 w-4 flex-shrink-0 items-center justify-center",
|
|
73
|
+
children: t && /* @__PURE__ */ o("span", { className: "h-1.5 w-1.5 rounded-full bg-current" })
|
|
74
|
+
}), /* @__PURE__ */ o("span", {
|
|
75
|
+
className: "flex-1 truncate",
|
|
76
|
+
children: i
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function m({ icon: t, children: n }) {
|
|
81
|
+
return /* @__PURE__ */ s("div", {
|
|
82
|
+
role: "menuitem",
|
|
83
|
+
className: e(u, "text-text-foreground hover:bg-alpha-neutral-alpha-hover"),
|
|
84
|
+
children: [
|
|
85
|
+
t && /* @__PURE__ */ o(t, { className: "h-4 w-4 flex-shrink-0" }),
|
|
86
|
+
/* @__PURE__ */ o("span", {
|
|
87
|
+
className: "flex-1 truncate",
|
|
88
|
+
children: n
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ o(a, { className: "h-4 w-4 flex-shrink-0 text-text-foreground-muted" })
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function h({ children: e }) {
|
|
95
|
+
return /* @__PURE__ */ o("div", {
|
|
96
|
+
className: "h-7 px-2 flex items-center text-xs font-medium text-text-foreground-muted select-none",
|
|
97
|
+
children: e
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function g() {
|
|
101
|
+
return /* @__PURE__ */ o("div", {
|
|
102
|
+
role: "separator",
|
|
103
|
+
className: "my-1 h-px bg-border"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
l.Item = d, l.CheckboxItem = f, l.RadioItem = p, l.SubTrigger = m, l.Label = h, l.Separator = g;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { l as Menu };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function Modal({ open, onClose, className, children }: ModalProps): import("react").JSX.Element | null;
|
|
9
|
+
export declare namespace Modal {
|
|
10
|
+
var Header: typeof ModalHeader;
|
|
11
|
+
var Body: typeof ModalBody;
|
|
12
|
+
var Footer: typeof ModalFooter;
|
|
13
|
+
}
|
|
14
|
+
export interface ModalHeaderProps {
|
|
15
|
+
title: React.ReactNode;
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
icon?: LucideIcon;
|
|
18
|
+
alignment?: 'left' | 'center';
|
|
19
|
+
}
|
|
20
|
+
declare function ModalHeader({ title, description, icon: Icon, alignment }: ModalHeaderProps): import("react").JSX.Element;
|
|
21
|
+
declare function ModalBody({ alignment, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
22
|
+
alignment?: 'left' | 'center';
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
declare const footerAlign: {
|
|
25
|
+
right: string;
|
|
26
|
+
left: string;
|
|
27
|
+
center: string;
|
|
28
|
+
split: string;
|
|
29
|
+
};
|
|
30
|
+
declare function ModalFooter({ alignment, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
alignment?: keyof typeof footerAlign;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useEffect as t, useRef as n } from "react";
|
|
4
|
+
import { X as r } from "lucide-react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Modal/Modal.tsx
|
|
7
|
+
function o({ open: o, onClose: s, className: c, children: l }) {
|
|
8
|
+
let u = n(null), d = n(null);
|
|
9
|
+
return t(() => {
|
|
10
|
+
if (!o) return;
|
|
11
|
+
d.current = document.activeElement;
|
|
12
|
+
let e = document.body.style.overflow;
|
|
13
|
+
document.body.style.overflow = "hidden";
|
|
14
|
+
let t = () => u.current?.querySelectorAll("a[href],button:not([disabled]),textarea,input,select,[tabindex]:not([tabindex=\"-1\"])");
|
|
15
|
+
t()?.[0]?.focus();
|
|
16
|
+
let n = (e) => {
|
|
17
|
+
if (e.key === "Escape") {
|
|
18
|
+
s();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (e.key === "Tab") {
|
|
22
|
+
let n = t();
|
|
23
|
+
if (!n || n.length === 0) return;
|
|
24
|
+
let r = n[0], i = n[n.length - 1];
|
|
25
|
+
e.shiftKey && document.activeElement === r ? (e.preventDefault(), i.focus()) : !e.shiftKey && document.activeElement === i && (e.preventDefault(), r.focus());
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return document.addEventListener("keydown", n), () => {
|
|
29
|
+
document.removeEventListener("keydown", n), document.body.style.overflow = e, d.current?.focus();
|
|
30
|
+
};
|
|
31
|
+
}, [o, s]), o ? /* @__PURE__ */ i("div", {
|
|
32
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-surface-background-inverse/50 [font-family:var(--font-base)]",
|
|
33
|
+
onClick: s,
|
|
34
|
+
children: /* @__PURE__ */ a("div", {
|
|
35
|
+
ref: u,
|
|
36
|
+
role: "dialog",
|
|
37
|
+
"aria-modal": "true",
|
|
38
|
+
onClick: (e) => e.stopPropagation(),
|
|
39
|
+
className: e("relative flex w-full max-w-[520px] flex-col gap-6 rounded-[var(--radius-modal)] border border-border bg-surface p-6 shadow-md", c),
|
|
40
|
+
children: [/* @__PURE__ */ i("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
"aria-label": "Close",
|
|
43
|
+
onClick: s,
|
|
44
|
+
className: "absolute right-4 top-4 text-text-foreground-muted hover:text-text-foreground transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded",
|
|
45
|
+
children: /* @__PURE__ */ i(r, { className: "h-4 w-4" })
|
|
46
|
+
}), l]
|
|
47
|
+
})
|
|
48
|
+
}) : null;
|
|
49
|
+
}
|
|
50
|
+
function s({ title: t, description: n, icon: r, alignment: o = "left" }) {
|
|
51
|
+
return /* @__PURE__ */ a("div", {
|
|
52
|
+
className: e("flex flex-col gap-1", o === "center" && "items-center text-center"),
|
|
53
|
+
children: [
|
|
54
|
+
r && /* @__PURE__ */ i("span", {
|
|
55
|
+
className: "mb-2 inline-flex h-10 w-10 items-center justify-center rounded-full bg-primary-subtle text-primary",
|
|
56
|
+
children: /* @__PURE__ */ i(r, { className: "h-5 w-5" })
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ i("h2", {
|
|
59
|
+
className: "text-base font-medium text-text-foreground pr-6",
|
|
60
|
+
children: t
|
|
61
|
+
}),
|
|
62
|
+
n && /* @__PURE__ */ i("p", {
|
|
63
|
+
className: "text-sm text-text-foreground-muted",
|
|
64
|
+
children: n
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function c({ alignment: t = "left", className: n, ...r }) {
|
|
70
|
+
return /* @__PURE__ */ i("div", {
|
|
71
|
+
className: e("text-sm text-text-foreground-secondary", t === "center" && "text-center", n),
|
|
72
|
+
...r
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
var l = {
|
|
76
|
+
right: "justify-end",
|
|
77
|
+
left: "justify-start",
|
|
78
|
+
center: "justify-center",
|
|
79
|
+
split: "justify-between"
|
|
80
|
+
};
|
|
81
|
+
function u({ alignment: t = "right", className: n, ...r }) {
|
|
82
|
+
return /* @__PURE__ */ i("div", {
|
|
83
|
+
className: e("flex items-center gap-2", l[t], n),
|
|
84
|
+
...r
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
o.Header = s, o.Body = c, o.Footer = u;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { o as Modal };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
export interface NavProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare function Nav({ className, ...props }: NavProps): import("react").JSX.Element;
|
|
5
|
+
export declare namespace Nav {
|
|
6
|
+
var Item: typeof NavItem;
|
|
7
|
+
var Group: typeof NavGroup;
|
|
8
|
+
}
|
|
9
|
+
export interface NavItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
10
|
+
active?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
icon?: LucideIcon;
|
|
13
|
+
}
|
|
14
|
+
declare function NavItem({ active, disabled, icon: Icon, children, className, ...props }: NavItemProps): import("react").JSX.Element;
|
|
15
|
+
export interface NavGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
16
|
+
title: React.ReactNode;
|
|
17
|
+
defaultExpanded?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function NavGroup({ title, defaultExpanded, children, className, ...props }: NavGroupProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useState as t } from "react";
|
|
4
|
+
import { ChevronDown as n } from "lucide-react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Nav/Nav.tsx
|
|
7
|
+
function a({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ r("nav", {
|
|
9
|
+
className: e("flex flex-col gap-0.5 w-64 [font-family:var(--font-base)]", t),
|
|
10
|
+
...n
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function o({ active: t, disabled: n, icon: a, children: o, className: s, ...c }) {
|
|
14
|
+
return /* @__PURE__ */ i("a", {
|
|
15
|
+
"aria-current": t ? "page" : void 0,
|
|
16
|
+
"aria-disabled": n || void 0,
|
|
17
|
+
className: e("flex items-center gap-2 h-8 px-3 rounded-[var(--radius-control)] text-sm transition-colors cursor-pointer", a ? "pl-2" : "pl-3", t ? "bg-primary-subtle text-primary font-medium" : "text-text-foreground-secondary hover:bg-neutral-surface-muted hover:text-text-foreground", n && "pointer-events-none text-text-foreground-muted opacity-60", s),
|
|
18
|
+
...c,
|
|
19
|
+
children: [a && /* @__PURE__ */ r(a, { className: "h-4 w-4 flex-shrink-0" }), /* @__PURE__ */ r("span", {
|
|
20
|
+
className: "truncate",
|
|
21
|
+
children: o
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function s({ title: a, defaultExpanded: o = !0, children: s, className: c, ...l }) {
|
|
26
|
+
let [u, d] = t(o);
|
|
27
|
+
return /* @__PURE__ */ i("div", {
|
|
28
|
+
className: c,
|
|
29
|
+
...l,
|
|
30
|
+
children: [/* @__PURE__ */ i("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-expanded": u,
|
|
33
|
+
onClick: () => d((e) => !e),
|
|
34
|
+
className: "flex items-center gap-3 w-full h-8 px-2 rounded-[var(--radius-control)] text-sm font-medium text-text-foreground transition-colors hover:bg-neutral-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
35
|
+
children: [/* @__PURE__ */ r(n, { className: e("h-4 w-4 text-text-foreground-muted transition-transform", !u && "-rotate-90") }), /* @__PURE__ */ r("span", { children: a })]
|
|
36
|
+
}), u && /* @__PURE__ */ r("div", {
|
|
37
|
+
className: "flex flex-col gap-0.5 mt-0.5",
|
|
38
|
+
children: s
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
a.Item = o, a.Group = s;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { a as Nav };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ProfileCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
name: string;
|
|
3
|
+
role?: string;
|
|
4
|
+
initials?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
primaryAction?: string;
|
|
7
|
+
secondaryAction?: string;
|
|
8
|
+
onPrimary?: () => void;
|
|
9
|
+
onSecondary?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ProfileCard({ name, role, initials, src, primaryAction, secondaryAction, onPrimary, onSecondary, className, ...props }: ProfileCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Avatar as t } from "../Avatar/Avatar.js";
|
|
4
|
+
import { Button as n } from "../Button/Button.js";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/ProfileCard/ProfileCard.tsx
|
|
7
|
+
function a({ name: a, role: o, initials: s, src: c, primaryAction: l = "Ver perfil", secondaryAction: u = "Mensaje", onPrimary: d, onSecondary: f, className: p, ...m }) {
|
|
8
|
+
return /* @__PURE__ */ i("div", {
|
|
9
|
+
className: e("flex w-[280px] flex-col gap-4 p-6 rounded-[var(--radius-card)] border border-border bg-surface", "[font-family:var(--font-base)] transition-shadow hover:shadow-md", p),
|
|
10
|
+
...m,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ r(t, {
|
|
13
|
+
size: "lg",
|
|
14
|
+
src: c,
|
|
15
|
+
initials: s,
|
|
16
|
+
alt: a
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ i("div", {
|
|
19
|
+
className: "flex flex-col gap-0.5",
|
|
20
|
+
children: [/* @__PURE__ */ r("span", {
|
|
21
|
+
className: "text-sm font-medium text-text-foreground",
|
|
22
|
+
children: a
|
|
23
|
+
}), o && /* @__PURE__ */ r("span", {
|
|
24
|
+
className: "text-xs text-text-foreground-muted",
|
|
25
|
+
children: o
|
|
26
|
+
})]
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ i("div", {
|
|
29
|
+
className: "flex gap-2",
|
|
30
|
+
children: [/* @__PURE__ */ r(n, {
|
|
31
|
+
size: "sm",
|
|
32
|
+
variant: "primary",
|
|
33
|
+
onClick: d,
|
|
34
|
+
children: l
|
|
35
|
+
}), /* @__PURE__ */ r(n, {
|
|
36
|
+
size: "sm",
|
|
37
|
+
variant: "secondary",
|
|
38
|
+
onClick: f,
|
|
39
|
+
children: u
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { a as ProfileCard };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
value: number;
|
|
3
|
+
variant?: 'default' | 'success' | 'warning' | 'error';
|
|
4
|
+
showLabel?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function ProgressBar({ value, variant, showLabel, className, ...props }: ProgressBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ProgressBar/ProgressBar.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
default: "bg-primary",
|
|
7
|
+
success: "bg-status-success",
|
|
8
|
+
warning: "bg-status-warning",
|
|
9
|
+
error: "bg-status-danger"
|
|
10
|
+
};
|
|
11
|
+
function i({ value: i, variant: a = "default", showLabel: o = !1, className: s, ...c }) {
|
|
12
|
+
let l = Math.min(100, Math.max(0, i));
|
|
13
|
+
return /* @__PURE__ */ t("div", {
|
|
14
|
+
role: "progressbar",
|
|
15
|
+
"aria-valuenow": l,
|
|
16
|
+
"aria-valuemin": 0,
|
|
17
|
+
"aria-valuemax": 100,
|
|
18
|
+
className: e("w-full rounded-full bg-neutral-surface-muted overflow-hidden", o ? "h-6" : "h-2.5", s),
|
|
19
|
+
...c,
|
|
20
|
+
children: /* @__PURE__ */ t("div", {
|
|
21
|
+
className: e("h-full rounded-full transition-[width] duration-300 flex items-center justify-end", r[a]),
|
|
22
|
+
style: { width: `${l}%` },
|
|
23
|
+
children: o && l > 0 && /* @__PURE__ */ n("span", {
|
|
24
|
+
className: "pr-2 text-[length:var(--text-11)] font-bold text-neutral-white [font-family:var(--font-base)] leading-none select-none",
|
|
25
|
+
children: [l, "%"]
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as ProgressBar };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type'> {
|
|
2
|
+
onChange?: (checked: boolean) => void;
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const Radio: import('react').ForwardRefExoticComponent<RadioProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef as t } from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Radio/Radio.tsx
|
|
6
|
+
var i = t(({ disabled: t, onChange: i, children: a, className: o, ...s }, c) => /* @__PURE__ */ r("label", {
|
|
7
|
+
className: e("inline-flex items-center gap-2 cursor-pointer", t && "cursor-not-allowed opacity-50", o),
|
|
8
|
+
children: [/* @__PURE__ */ r("span", {
|
|
9
|
+
className: "relative inline-flex h-4 w-4 flex-shrink-0",
|
|
10
|
+
children: [/* @__PURE__ */ n("input", {
|
|
11
|
+
ref: c,
|
|
12
|
+
type: "radio",
|
|
13
|
+
disabled: t,
|
|
14
|
+
onChange: (e) => i?.(e.target.checked),
|
|
15
|
+
className: "peer sr-only",
|
|
16
|
+
...s
|
|
17
|
+
}), /* @__PURE__ */ n("span", {
|
|
18
|
+
className: e("absolute inset-0 flex items-center justify-center rounded-full border bg-surface", "border-border transition-colors duration-150", "peer-checked:border-primary peer-checked:[&>span]:scale-100", "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-1"),
|
|
19
|
+
children: /* @__PURE__ */ n("span", { className: "h-2 w-2 rounded-full bg-primary scale-0 transition-transform duration-150" })
|
|
20
|
+
})]
|
|
21
|
+
}), a && /* @__PURE__ */ n("span", {
|
|
22
|
+
className: "text-sm text-text-foreground [font-family:var(--font-base)]",
|
|
23
|
+
children: a
|
|
24
|
+
})]
|
|
25
|
+
}));
|
|
26
|
+
i.displayName = "Radio";
|
|
27
|
+
//#endregion
|
|
28
|
+
export { i as Radio };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SearchboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
onClear?: () => void;
|
|
3
|
+
}
|
|
4
|
+
export declare const Searchbox: import('react').ForwardRefExoticComponent<SearchboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export interface ExpandingSearchboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
6
|
+
/** Width when expanded. */
|
|
7
|
+
expandedWidth?: string;
|
|
8
|
+
}
|
|
9
|
+
/** A compact search button that expands into a full searchbox (same shape/spacing as Searchbox). */
|
|
10
|
+
export declare function ExpandingSearchbox({ placeholder, expandedWidth, className, ...props }: ExpandingSearchboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef as t, useRef as n, useState as r } from "react";
|
|
4
|
+
import { Search as i, X as a } from "lucide-react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Searchbox/Searchbox.tsx
|
|
7
|
+
var c = t(({ disabled: t, value: n, onClear: r, className: c, ...l }, u) => {
|
|
8
|
+
let d = n !== void 0 && n !== "";
|
|
9
|
+
return /* @__PURE__ */ s("div", {
|
|
10
|
+
className: e("inline-flex items-center gap-2 h-9 w-80 px-2.5 rounded-[var(--radius-control-lg)] border bg-surface", "border-border transition-colors duration-150", "focus-within:border-primary", t && "opacity-50 cursor-not-allowed bg-surface-background-subtle", c),
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ o(i, { className: "h-4 w-4 flex-shrink-0 text-text-foreground-muted" }),
|
|
13
|
+
/* @__PURE__ */ o("input", {
|
|
14
|
+
ref: u,
|
|
15
|
+
type: "search",
|
|
16
|
+
value: n,
|
|
17
|
+
disabled: t,
|
|
18
|
+
className: e("flex-1 min-w-0 bg-transparent outline-none text-sm text-text-foreground", "placeholder:text-text-foreground-muted [font-family:var(--font-base)]", "[&::-webkit-search-cancel-button]:hidden"),
|
|
19
|
+
...l
|
|
20
|
+
}),
|
|
21
|
+
d && r && /* @__PURE__ */ o("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
onClick: r,
|
|
24
|
+
"aria-label": "Clear search",
|
|
25
|
+
className: "flex-shrink-0 text-text-foreground-muted hover:text-text-foreground transition-colors",
|
|
26
|
+
children: /* @__PURE__ */ o(a, { className: "h-4 w-4" })
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
c.displayName = "Searchbox";
|
|
32
|
+
function l({ placeholder: t = "Search…", expandedWidth: a = "20rem", className: c, ...l }) {
|
|
33
|
+
let [u, d] = r(!1), f = n(null);
|
|
34
|
+
function p() {
|
|
35
|
+
d(!0), requestAnimationFrame(() => f.current?.focus());
|
|
36
|
+
}
|
|
37
|
+
function m(e) {
|
|
38
|
+
e.target.value || d(!1);
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ s("div", {
|
|
41
|
+
className: e("inline-flex items-center h-9 rounded-[var(--radius-control-lg)] border bg-surface overflow-hidden", "transition-[width,border-color] duration-300 ease-out", u ? "gap-2 px-2.5 border-primary justify-start" : "gap-0 px-0 justify-center border-border hover:border-border-hover", c),
|
|
42
|
+
style: { width: u ? a : "2.25rem" },
|
|
43
|
+
children: [/* @__PURE__ */ o("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
onClick: p,
|
|
46
|
+
"aria-label": "Open search",
|
|
47
|
+
tabIndex: u ? -1 : 0,
|
|
48
|
+
className: e("flex items-center justify-center flex-shrink-0 h-4 w-4 text-text-foreground-muted transition-colors", u ? "pointer-events-none" : "hover:text-text-foreground"),
|
|
49
|
+
children: /* @__PURE__ */ o(i, { className: "h-4 w-4" })
|
|
50
|
+
}), /* @__PURE__ */ o("input", {
|
|
51
|
+
ref: f,
|
|
52
|
+
type: "search",
|
|
53
|
+
placeholder: t,
|
|
54
|
+
onBlur: m,
|
|
55
|
+
tabIndex: u ? 0 : -1,
|
|
56
|
+
className: e("bg-transparent outline-none text-sm text-text-foreground", "placeholder:text-text-foreground-muted [font-family:var(--font-base)]", "[&::-webkit-search-cancel-button]:hidden", u ? "opacity-100 flex-1 min-w-0" : "opacity-0 w-0 flex-none"),
|
|
57
|
+
...l
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { l as ExpandingSearchbox, c as Searchbox };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Skeleton/Skeleton.tsx
|
|
5
|
+
function n({ shape: n = "line", className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
className: e("animate-pulse bg-surface-background-muted", n === "line" && "h-4 w-full rounded-[var(--radius-control)]", n === "avatar" && "h-10 w-10 rounded-full", n === "block" && "h-24 w-full rounded-[var(--radius-control-lg)]", r),
|
|
9
|
+
...i
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as Skeleton };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'value' | 'defaultValue'> {
|
|
2
|
+
value?: number;
|
|
3
|
+
defaultValue?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
onChange?: (value: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Slider: import('react').ForwardRefExoticComponent<SliderProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef as t, useState as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Slider/Slider.tsx
|
|
6
|
+
var a = t(({ value: t, defaultValue: a = 0, min: o = 0, max: s = 100, step: c = 1, disabled: l, onChange: u, className: d, ...f }, p) => {
|
|
7
|
+
let [m, h] = n(a), g = t !== void 0, _ = g ? t : m, v = (_ - o) / (s - o) * 100;
|
|
8
|
+
function y(e) {
|
|
9
|
+
let t = Number(e.target.value);
|
|
10
|
+
g || h(t), u?.(t);
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ i("div", {
|
|
13
|
+
className: e("relative flex items-center w-[280px] h-4 select-none", l && "opacity-50", d),
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ r("div", { className: "absolute inset-x-0 h-1.5 rounded-full bg-neutral-surface-muted" }),
|
|
16
|
+
/* @__PURE__ */ r("div", {
|
|
17
|
+
className: "absolute h-1.5 rounded-full bg-primary",
|
|
18
|
+
style: { width: `${v}%` }
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ r("div", {
|
|
21
|
+
className: "absolute h-4 w-4 rounded-full bg-surface border border-primary shadow-sm -translate-x-1/2 pointer-events-none",
|
|
22
|
+
style: { left: `${v}%` }
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ r("input", {
|
|
25
|
+
ref: p,
|
|
26
|
+
type: "range",
|
|
27
|
+
min: o,
|
|
28
|
+
max: s,
|
|
29
|
+
step: c,
|
|
30
|
+
value: _,
|
|
31
|
+
disabled: l,
|
|
32
|
+
onChange: y,
|
|
33
|
+
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer disabled:cursor-not-allowed m-0",
|
|
34
|
+
...f
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
a.displayName = "Slider";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { a as Slider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const snippetVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "warning" | "success" | "error" | null | undefined;
|
|
4
|
+
font?: "mono" | "sans" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface SnippetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>, VariantProps<typeof snippetVariants> {
|
|
7
|
+
children: string;
|
|
8
|
+
lines?: 'single' | 'multi';
|
|
9
|
+
}
|
|
10
|
+
export declare function Snippet({ variant, font, lines, children, className, ...props }: SnippetProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|