@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.
Files changed (94) hide show
  1. package/README.md +72 -0
  2. package/dist/components/Accordion/Accordion.d.ts +13 -0
  3. package/dist/components/Accordion/Accordion.js +33 -0
  4. package/dist/components/Avatar/Avatar.d.ts +7 -0
  5. package/dist/components/Avatar/Avatar.js +39 -0
  6. package/dist/components/Badge/Badge.d.ts +9 -0
  7. package/dist/components/Badge/Badge.js +137 -0
  8. package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
  9. package/dist/components/Breadcrumb/Breadcrumb.js +51 -0
  10. package/dist/components/Button/Button.d.ts +10 -0
  11. package/dist/components/Button/Button.js +145 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +6 -0
  13. package/dist/components/Checkbox/Checkbox.js +46 -0
  14. package/dist/components/Combobox/Combobox.d.ts +16 -0
  15. package/dist/components/Combobox/Combobox.js +57 -0
  16. package/dist/components/CounterBadge/CounterBadge.d.ts +8 -0
  17. package/dist/components/CounterBadge/CounterBadge.js +25 -0
  18. package/dist/components/Divider/Divider.d.ts +4 -0
  19. package/dist/components/Divider/Divider.js +14 -0
  20. package/dist/components/Dropdown/Dropdown.d.ts +21 -0
  21. package/dist/components/Dropdown/Dropdown.js +64 -0
  22. package/dist/components/FeatureCard/FeatureCard.d.ts +9 -0
  23. package/dist/components/FeatureCard/FeatureCard.js +31 -0
  24. package/dist/components/HeaderBar/HeaderBar.d.ts +13 -0
  25. package/dist/components/HeaderBar/HeaderBar.js +41 -0
  26. package/dist/components/InfoLabel/InfoLabel.d.ts +5 -0
  27. package/dist/components/InfoLabel/InfoLabel.js +26 -0
  28. package/dist/components/Input/Input.d.ts +7 -0
  29. package/dist/components/Input/Input.js +39 -0
  30. package/dist/components/Logo/Logo.d.ts +20 -0
  31. package/dist/components/Logo/Logo.js +84 -0
  32. package/dist/components/Logo/assets/lexy-dark-horizontal-slogan.js +5 -0
  33. package/dist/components/Logo/assets/lexy-dark-horizontal.js +5 -0
  34. package/dist/components/Logo/assets/lexy-dark-isotipe.js +5 -0
  35. package/dist/components/Logo/assets/lexy-dark-vertical-slogan.js +5 -0
  36. package/dist/components/Logo/assets/lexy-dark-vertical.js +5 -0
  37. package/dist/components/Logo/assets/lexy-light-horizontal-slogan.js +5 -0
  38. package/dist/components/Logo/assets/lexy-light-horizontal.js +5 -0
  39. package/dist/components/Logo/assets/lexy-light-isotipe.js +5 -0
  40. package/dist/components/Logo/assets/lexy-light-vertical-slogan.js +5 -0
  41. package/dist/components/Logo/assets/lexy-light-vertical.js +5 -0
  42. package/dist/components/Logo/assets/lexydeudor-dark-v1.js +5 -0
  43. package/dist/components/Logo/assets/lexydeudor-dark-v2.js +5 -0
  44. package/dist/components/Logo/assets/lexydeudor-light-v1.js +5 -0
  45. package/dist/components/Logo/assets/lexydeudor-light-v2.js +5 -0
  46. package/dist/components/Logo/assets/lexysalud-dark-v1.js +5 -0
  47. package/dist/components/Logo/assets/lexysalud-dark-v2.js +5 -0
  48. package/dist/components/Logo/assets/lexysalud-light-v1.js +5 -0
  49. package/dist/components/Logo/assets/lexysalud-light-v2.js +5 -0
  50. package/dist/components/Menu/Menu.d.ts +49 -0
  51. package/dist/components/Menu/Menu.js +108 -0
  52. package/dist/components/Modal/Modal.d.ts +33 -0
  53. package/dist/components/Modal/Modal.js +89 -0
  54. package/dist/components/Nav/Nav.d.ts +20 -0
  55. package/dist/components/Nav/Nav.js +44 -0
  56. package/dist/components/ProfileCard/ProfileCard.d.ts +11 -0
  57. package/dist/components/ProfileCard/ProfileCard.js +46 -0
  58. package/dist/components/ProgressBar/ProgressBar.d.ts +6 -0
  59. package/dist/components/ProgressBar/ProgressBar.js +31 -0
  60. package/dist/components/Radio/Radio.d.ts +5 -0
  61. package/dist/components/Radio/Radio.js +28 -0
  62. package/dist/components/Searchbox/Searchbox.d.ts +10 -0
  63. package/dist/components/Searchbox/Searchbox.js +62 -0
  64. package/dist/components/Skeleton/Skeleton.d.ts +4 -0
  65. package/dist/components/Skeleton/Skeleton.js +13 -0
  66. package/dist/components/Slider/Slider.d.ts +9 -0
  67. package/dist/components/Slider/Slider.js +41 -0
  68. package/dist/components/Snippet/Snippet.d.ts +11 -0
  69. package/dist/components/Snippet/Snippet.js +52 -0
  70. package/dist/components/StatusDot/StatusDot.d.ts +8 -0
  71. package/dist/components/StatusDot/StatusDot.js +31 -0
  72. package/dist/components/Switch/Switch.d.ts +6 -0
  73. package/dist/components/Switch/Switch.js +27 -0
  74. package/dist/components/Tabs/Tabs.d.ts +24 -0
  75. package/dist/components/Tabs/Tabs.js +69 -0
  76. package/dist/components/Tag/Tag.d.ts +12 -0
  77. package/dist/components/Tag/Tag.js +49 -0
  78. package/dist/components/Textarea/Textarea.d.ts +9 -0
  79. package/dist/components/Textarea/Textarea.js +54 -0
  80. package/dist/components/Toast/Toast.d.ts +7 -0
  81. package/dist/components/Toast/Toast.js +60 -0
  82. package/dist/components/Tooltip/Tooltip.d.ts +7 -0
  83. package/dist/components/Tooltip/Tooltip.js +58 -0
  84. package/dist/components/Tree/Tree.d.ts +14 -0
  85. package/dist/components/Tree/Tree.js +39 -0
  86. package/dist/globals.css +243 -0
  87. package/dist/index.d.ts +36 -0
  88. package/dist/index.js +37 -0
  89. package/dist/lib/useFloating.d.ts +20 -0
  90. package/dist/lib/useFloating.js +54 -0
  91. package/dist/lib/utils.d.ts +2 -0
  92. package/dist/lib/utils.js +9 -0
  93. package/dist/tokens.css +256 -0
  94. package/package.json +57 -0
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { useState as t } from "react";
4
+ import { Check as n, Copy as r } from "lucide-react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { cva as o } from "class-variance-authority";
7
+ //#region src/components/Snippet/Snippet.tsx
8
+ var s = o(["relative flex items-start gap-3 rounded-[var(--radius-control-lg)] border bg-surface", "px-3 py-2.5 text-sm text-text-foreground"].join(" "), {
9
+ variants: {
10
+ variant: {
11
+ default: "border-border",
12
+ success: "border-status-success-border",
13
+ warning: "border-status-warning-border",
14
+ error: "border-status-danger-border"
15
+ },
16
+ font: {
17
+ mono: "font-mono",
18
+ sans: "[font-family:var(--font-base)]"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ variant: "default",
23
+ font: "mono"
24
+ }
25
+ });
26
+ function c({ variant: o, font: c, lines: l = "single", children: u, className: d, ...f }) {
27
+ let [p, m] = t(!1);
28
+ async function h() {
29
+ try {
30
+ await navigator.clipboard.writeText(u), m(!0), setTimeout(() => m(!1), 1500);
31
+ } catch {}
32
+ }
33
+ return /* @__PURE__ */ a("div", {
34
+ className: e(s({
35
+ variant: o,
36
+ font: c
37
+ }), d),
38
+ ...f,
39
+ children: [/* @__PURE__ */ i("pre", {
40
+ className: e("flex-1 overflow-x-auto", l === "single" ? "whitespace-nowrap" : "whitespace-pre"),
41
+ children: u
42
+ }), /* @__PURE__ */ i("button", {
43
+ type: "button",
44
+ onClick: h,
45
+ "aria-label": p ? "Copied" : "Copy",
46
+ className: e("flex-shrink-0 -m-1 p-1 rounded-md transition-all duration-150 cursor-pointer", "text-text-foreground-muted hover:text-text-foreground", "hover:bg-neutral-surface-muted active:bg-surface-pressed active:scale-90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"),
47
+ children: p ? /* @__PURE__ */ i(n, { className: "h-4 w-4 text-status-success" }) : /* @__PURE__ */ i(r, { className: "h-4 w-4" })
48
+ })]
49
+ });
50
+ }
51
+ //#endregion
52
+ export { c as Snippet };
@@ -0,0 +1,8 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ declare const dotVariants: (props?: ({
3
+ tone?: "gray" | "blue" | "purple" | "amber" | "red" | "pink" | "green" | "teal" | "inverted" | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ export interface StatusDotProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof dotVariants> {
6
+ }
7
+ export declare function StatusDot({ tone, children, className, ...props }: StatusDotProps): import("react").JSX.Element;
8
+ export {};
@@ -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
+ import { cva as r } from "class-variance-authority";
5
+ //#region src/components/StatusDot/StatusDot.tsx
6
+ var i = r("inline-block h-2 w-2 rounded-full flex-shrink-0", {
7
+ variants: { tone: {
8
+ gray: "bg-text-foreground",
9
+ blue: "bg-status-info",
10
+ purple: "bg-primary",
11
+ amber: "bg-status-warning",
12
+ red: "bg-status-danger",
13
+ pink: "bg-subbrand-deudor",
14
+ green: "bg-status-success",
15
+ teal: "bg-subbrand-salud",
16
+ inverted: "bg-surface-background-inverse"
17
+ } },
18
+ defaultVariants: { tone: "gray" }
19
+ });
20
+ function a({ tone: r, children: a, className: o, ...s }) {
21
+ return /* @__PURE__ */ n("span", {
22
+ className: e("inline-flex items-center gap-2", o),
23
+ ...s,
24
+ children: [/* @__PURE__ */ t("span", { className: i({ tone: r }) }), a && /* @__PURE__ */ t("span", {
25
+ className: "text-sm text-text-foreground [font-family:var(--font-base)]",
26
+ children: a
27
+ })]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { a as StatusDot };
@@ -0,0 +1,6 @@
1
+ export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
2
+ checked?: boolean;
3
+ defaultChecked?: boolean;
4
+ onChange?: (checked: boolean) => void;
5
+ }
6
+ export declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,27 @@
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 } from "react/jsx-runtime";
5
+ //#region src/components/Switch/Switch.tsx
6
+ var i = t(({ checked: t, defaultChecked: i = !1, disabled: a, onChange: o, className: s, ...c }, l) => {
7
+ let [u, d] = n(i), f = t !== void 0, p = f ? t : u;
8
+ function m() {
9
+ if (a) return;
10
+ let e = !p;
11
+ f || d(e), o?.(e);
12
+ }
13
+ return /* @__PURE__ */ r("button", {
14
+ ref: l,
15
+ role: "switch",
16
+ type: "button",
17
+ "aria-checked": p,
18
+ disabled: a,
19
+ onClick: m,
20
+ className: e("relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer rounded-full", "transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50", p ? "bg-primary" : "bg-border", s),
21
+ ...c,
22
+ children: /* @__PURE__ */ r("span", { className: e("pointer-events-none absolute top-[4px] h-3 w-3 rounded-full bg-neutral-white shadow-sm", "transition-transform duration-200", p ? "translate-x-[22px]" : "translate-x-[4px]") })
23
+ });
24
+ });
25
+ i.displayName = "Switch";
26
+ //#endregion
27
+ export { i as Switch };
@@ -0,0 +1,24 @@
1
+ type TabsSize = 'md' | 'lg';
2
+ export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ size?: TabsSize;
6
+ onValueChange?: (value: string) => void;
7
+ }
8
+ export declare function Tabs({ value, defaultValue, size, onValueChange, children, className, ...props }: TabsProps): import("react").JSX.Element;
9
+ export declare namespace Tabs {
10
+ var List: typeof TabsList;
11
+ var Tab: ({ value, closable, onClose, disabled, children, className, ...props }: TabProps) => import("react").JSX.Element;
12
+ var Panel: typeof TabPanel;
13
+ }
14
+ declare function TabsList({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
15
+ export interface TabProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
16
+ value: string;
17
+ closable?: boolean;
18
+ onClose?: () => void;
19
+ }
20
+ export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
21
+ value: string;
22
+ }
23
+ declare function TabPanel({ value, className, ...props }: TabPanelProps): import("react").JSX.Element | null;
24
+ export {};
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { createContext as t, useContext as n, useState as r } from "react";
4
+ import { X as i } from "lucide-react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/components/Tabs/Tabs.tsx
7
+ var s = t(null);
8
+ function c() {
9
+ let e = n(s);
10
+ if (!e) throw Error("Tabs.* must be used within <Tabs>");
11
+ return e;
12
+ }
13
+ function l({ value: e, defaultValue: t, size: n = "md", onValueChange: i, children: o, className: c, ...l }) {
14
+ let [u, d] = r(t ?? ""), f = e !== void 0, p = f ? e : u;
15
+ function m(e) {
16
+ f || d(e), i?.(e);
17
+ }
18
+ return /* @__PURE__ */ a(s.Provider, {
19
+ value: {
20
+ value: p,
21
+ setValue: m,
22
+ size: n
23
+ },
24
+ children: /* @__PURE__ */ a("div", {
25
+ className: c,
26
+ ...l,
27
+ children: o
28
+ })
29
+ });
30
+ }
31
+ function u({ className: t, ...n }) {
32
+ return /* @__PURE__ */ a("div", {
33
+ role: "tablist",
34
+ className: e("inline-flex items-center gap-1 p-1 rounded-lg bg-neutral-surface-muted", t),
35
+ ...n
36
+ });
37
+ }
38
+ function d({ value: t, closable: n, onClose: r, disabled: s, children: l, className: u, ...d }) {
39
+ let { value: f, setValue: p, size: m } = c(), h = f === t;
40
+ return /* @__PURE__ */ o("button", {
41
+ type: "button",
42
+ role: "tab",
43
+ "aria-selected": h,
44
+ disabled: s,
45
+ onClick: () => p(t),
46
+ className: e("inline-flex items-center rounded-[7px] font-medium [font-family:var(--font-base)] transition-colors cursor-pointer", m === "lg" ? "h-10 px-4 gap-2 text-base" : "h-[30px] px-3 gap-1.5 text-sm", "[&>svg]:shrink-0", m === "lg" ? "[&>svg]:size-5" : "[&>svg]:size-4", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary", "disabled:cursor-not-allowed disabled:opacity-50", h ? "bg-neutral-white text-primary shadow-sm" : "text-text-foreground-muted hover:text-text-foreground", u),
47
+ ...d,
48
+ children: [l, n && /* @__PURE__ */ a("span", {
49
+ role: "button",
50
+ "aria-label": "Close tab",
51
+ onClick: (e) => {
52
+ e.stopPropagation(), r?.();
53
+ },
54
+ className: "inline-flex items-center justify-center rounded-sm opacity-60 hover:opacity-100",
55
+ children: /* @__PURE__ */ a(i, { className: "h-3 w-3" })
56
+ })]
57
+ });
58
+ }
59
+ function f({ value: t, className: n, ...r }) {
60
+ let { value: i } = c();
61
+ return i === t ? /* @__PURE__ */ a("div", {
62
+ role: "tabpanel",
63
+ className: e("mt-3", n),
64
+ ...r
65
+ }) : null;
66
+ }
67
+ l.List = u, l.Tab = d, l.Panel = f;
68
+ //#endregion
69
+ export { l as Tabs };
@@ -0,0 +1,12 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ declare const tagVariants: (props?: ({
3
+ tone?: "gray" | "warning" | "success" | "brand" | "danger" | null | undefined;
4
+ shape?: "square" | "rounded" | null | undefined;
5
+ size?: "sm" | "md" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color'>, VariantProps<typeof tagVariants> {
8
+ removable?: boolean;
9
+ onRemove?: () => void;
10
+ }
11
+ export declare function Tag({ tone, shape, size, removable, onRemove, children, className, ...props }: TagProps): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { X as t } from "lucide-react";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import { cva as i } from "class-variance-authority";
6
+ //#region src/components/Tag/Tag.tsx
7
+ var a = i(["inline-flex items-center gap-1 border select-none", "[font-family:var(--font-base)] text-[length:var(--text-11)] font-medium leading-none"].join(" "), {
8
+ variants: {
9
+ tone: {
10
+ gray: "bg-neutral-surface-muted text-text-foreground-secondary border-border-muted",
11
+ brand: "bg-primary-subtle text-primary border-border-accent",
12
+ success: "bg-status-success-background text-status-success-foreground-strong border-status-success-border",
13
+ warning: "bg-status-warning-background text-status-warning-foreground-strong border-status-warning-border",
14
+ danger: "bg-status-danger-background text-status-danger-foreground border-status-danger-border"
15
+ },
16
+ shape: {
17
+ square: "rounded-[var(--radius-control)]",
18
+ rounded: "rounded-full"
19
+ },
20
+ size: {
21
+ sm: "h-[22px] px-2 py-0.5",
22
+ md: "h-7 px-2.5 py-1"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ tone: "gray",
27
+ shape: "square",
28
+ size: "sm"
29
+ }
30
+ });
31
+ function o({ tone: i, shape: o, size: s, removable: c, onRemove: l, children: u, className: d, ...f }) {
32
+ return /* @__PURE__ */ r("span", {
33
+ className: e(a({
34
+ tone: i,
35
+ shape: o,
36
+ size: s
37
+ }), d),
38
+ ...f,
39
+ children: [u, c && /* @__PURE__ */ n("button", {
40
+ type: "button",
41
+ onClick: l,
42
+ "aria-label": "Remove",
43
+ className: "inline-flex items-center justify-center rounded-full opacity-60 hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current transition-opacity -mr-0.5",
44
+ children: /* @__PURE__ */ n(t, { className: "h-3 w-3" })
45
+ })]
46
+ });
47
+ }
48
+ //#endregion
49
+ export { o as Tag };
@@ -0,0 +1,9 @@
1
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
2
+ label?: string;
3
+ required?: boolean;
4
+ error?: string;
5
+ resize?: 'none' | 'vertical' | 'horizontal' | 'both';
6
+ /** Auto-grow height to fit content (disables manual resize). */
7
+ autoResize?: boolean;
8
+ }
9
+ export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { forwardRef as t, useCallback as n, useLayoutEffect as r, useRef as i } from "react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ //#region src/components/Textarea/Textarea.tsx
6
+ var s = {
7
+ none: "resize-none",
8
+ vertical: "resize-y",
9
+ horizontal: "resize-x",
10
+ both: "resize"
11
+ }, c = t(({ label: t, required: c, error: l, resize: u = "vertical", autoResize: d = !1, disabled: f, onChange: p, className: m, id: h, ...g }, _) => {
12
+ let v = h ?? (t ? t.toLowerCase().replace(/\s+/g, "-") : void 0), y = i(null), b = n((e) => {
13
+ y.current = e, typeof _ == "function" ? _(e) : _ && (_.current = e);
14
+ }, [_]), x = n(() => {
15
+ let e = y.current;
16
+ !e || !d || (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
17
+ }, [d]);
18
+ return r(() => {
19
+ x();
20
+ }, [
21
+ x,
22
+ g.value,
23
+ g.defaultValue
24
+ ]), /* @__PURE__ */ o("div", {
25
+ className: "flex flex-col gap-1.5 w-full",
26
+ children: [
27
+ t && /* @__PURE__ */ o("label", {
28
+ htmlFor: v,
29
+ className: "text-sm font-medium text-text-foreground [font-family:var(--font-base)]",
30
+ children: [t, c && /* @__PURE__ */ a("span", {
31
+ className: "text-status-danger ml-0.5",
32
+ children: "*"
33
+ })]
34
+ }),
35
+ /* @__PURE__ */ a("textarea", {
36
+ ref: b,
37
+ id: v,
38
+ disabled: f,
39
+ onChange: (e) => {
40
+ x(), p?.(e);
41
+ },
42
+ className: e("w-full min-h-20 rounded-[var(--radius-control)] border bg-surface p-3", "text-sm text-text-foreground placeholder:text-text-foreground-muted [font-family:var(--font-base)]", "transition-colors duration-150 outline-none", "border-border hover:border-border-hover focus-visible:border-primary", d ? "resize-none overflow-hidden" : s[u], l && "border-status-danger focus-visible:border-status-danger", g.readOnly && "bg-surface-background-subtle cursor-default hover:border-border focus-visible:border-border", f && "opacity-50 cursor-not-allowed bg-surface-background-subtle", m),
43
+ ...g
44
+ }),
45
+ l && /* @__PURE__ */ a("span", {
46
+ className: "text-xs text-status-danger [font-family:var(--font-base)]",
47
+ children: l
48
+ })
49
+ ]
50
+ });
51
+ });
52
+ c.displayName = "Textarea";
53
+ //#endregion
54
+ export { c as Textarea };
@@ -0,0 +1,7 @@
1
+ export interface ToastProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ tone?: 'info' | 'success' | 'warning' | 'error';
3
+ title: string;
4
+ description?: string;
5
+ onClose?: () => void;
6
+ }
7
+ export declare function Toast({ tone, title, description, onClose, className, ...props }: ToastProps): import("react").JSX.Element;
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { AlertTriangle as t, CheckCircle as n, Info as r, X as i, XCircle as a } from "lucide-react";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ //#region src/components/Toast/Toast.tsx
6
+ var c = {
7
+ info: {
8
+ bg: "bg-status-info-background border-status-info-border",
9
+ icon: r,
10
+ iconColor: "text-status-info"
11
+ },
12
+ success: {
13
+ bg: "bg-status-success-background border-status-success-border",
14
+ icon: n,
15
+ iconColor: "text-status-success"
16
+ },
17
+ warning: {
18
+ bg: "bg-status-warning-background border-status-warning-border",
19
+ icon: t,
20
+ iconColor: "text-status-warning"
21
+ },
22
+ error: {
23
+ bg: "bg-status-danger-background border-status-danger-border",
24
+ icon: a,
25
+ iconColor: "text-status-danger"
26
+ }
27
+ };
28
+ function l({ tone: t = "info", title: n, description: r, onClose: a, className: l, ...u }) {
29
+ let { bg: d, icon: f, iconColor: p } = c[t];
30
+ return /* @__PURE__ */ s("div", {
31
+ role: "alert",
32
+ className: e("flex items-start gap-[var(--spacing-stack-sm)] p-[var(--spacing-inset-md)]", "rounded-[var(--radius-surface-sm)] border shadow-md w-[420px] max-w-full", d, l),
33
+ ...u,
34
+ children: [
35
+ /* @__PURE__ */ o(f, {
36
+ className: e("h-5 w-5 flex-shrink-0 mt-0.5", p),
37
+ "aria-hidden": !0
38
+ }),
39
+ /* @__PURE__ */ s("div", {
40
+ className: "flex-1 flex flex-col gap-0.5",
41
+ children: [/* @__PURE__ */ o("p", {
42
+ className: "text-sm font-medium text-text-foreground [font-family:var(--font-base)]",
43
+ children: n
44
+ }), r && /* @__PURE__ */ o("p", {
45
+ className: "text-xs text-text-foreground-secondary [font-family:var(--font-base)]",
46
+ children: r
47
+ })]
48
+ }),
49
+ a && /* @__PURE__ */ o("button", {
50
+ type: "button",
51
+ onClick: a,
52
+ "aria-label": "Dismiss",
53
+ className: "flex-shrink-0 text-text-foreground-muted hover:text-text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded",
54
+ children: /* @__PURE__ */ o(i, { className: "h-4 w-4" })
55
+ })
56
+ ]
57
+ });
58
+ }
59
+ //#endregion
60
+ export { l as Toast };
@@ -0,0 +1,7 @@
1
+ export interface TooltipProps {
2
+ content: React.ReactNode;
3
+ side?: 'top' | 'right' | 'bottom' | 'left';
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function Tooltip({ content, side, children, className }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { useLayoutEffect as t, useRef as n, useState as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/components/Tooltip/Tooltip.tsx
6
+ var o = 8, s = 8;
7
+ function c({ content: c, side: l = "top", children: u, className: d }) {
8
+ let [f, p] = r(!1), [m, h] = r({
9
+ top: 0,
10
+ left: 0
11
+ }), g = n(null), _ = n(null);
12
+ return t(() => {
13
+ if (!f || !g.current || !_.current) return;
14
+ let e = g.current.getBoundingClientRect(), t = _.current.getBoundingClientRect(), n = 0, r = 0;
15
+ switch (l) {
16
+ case "top":
17
+ n = e.top - t.height - o, r = e.left + e.width / 2 - t.width / 2;
18
+ break;
19
+ case "bottom":
20
+ n = e.bottom + o, r = e.left + e.width / 2 - t.width / 2;
21
+ break;
22
+ case "left":
23
+ r = e.left - t.width - o, n = e.top + e.height / 2 - t.height / 2;
24
+ break;
25
+ case "right":
26
+ r = e.right + o, n = e.top + e.height / 2 - t.height / 2;
27
+ break;
28
+ }
29
+ r = Math.min(Math.max(s, r), window.innerWidth - t.width - s), n = Math.min(Math.max(s, n), window.innerHeight - t.height - s), h({
30
+ top: n,
31
+ left: r
32
+ });
33
+ }, [
34
+ f,
35
+ l,
36
+ c
37
+ ]), /* @__PURE__ */ a("span", {
38
+ ref: g,
39
+ className: "inline-flex",
40
+ onMouseEnter: () => p(!0),
41
+ onMouseLeave: () => p(!1),
42
+ onFocus: () => p(!0),
43
+ onBlur: () => p(!1),
44
+ children: [u, f && /* @__PURE__ */ i("span", {
45
+ ref: _,
46
+ role: "tooltip",
47
+ style: {
48
+ position: "fixed",
49
+ top: m.top,
50
+ left: m.left
51
+ },
52
+ className: e("z-50 w-max max-w-xs whitespace-nowrap rounded-[var(--radius-tooltip)] px-2 py-1", "bg-surface-background-inverse text-neutral-white text-xs [font-family:var(--font-base)]", "shadow-md pointer-events-none", d),
53
+ children: c
54
+ })]
55
+ });
56
+ }
57
+ //#endregion
58
+ export { c as Tooltip };
@@ -0,0 +1,14 @@
1
+ export interface TreeProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ }
3
+ export declare function Tree({ className, ...props }: TreeProps): import("react").JSX.Element;
4
+ export declare namespace Tree {
5
+ var Item: typeof TreeItem;
6
+ }
7
+ export interface TreeItemProps {
8
+ label: React.ReactNode;
9
+ kind?: 'folder' | 'file';
10
+ defaultExpanded?: boolean;
11
+ children?: React.ReactNode;
12
+ }
13
+ declare function TreeItem({ label, kind, defaultExpanded, children }: TreeItemProps): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { createContext as t, useContext as n, useState as r } from "react";
4
+ import { ChevronRight as i, File as a, Folder as o, FolderOpen as s } from "lucide-react";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ //#region src/components/Tree/Tree.tsx
7
+ var d = t(0);
8
+ function f({ className: t, ...n }) {
9
+ return /* @__PURE__ */ l("div", {
10
+ role: "tree",
11
+ className: e("w-[360px] rounded-[var(--radius-card)] border border-border bg-surface p-1.5 [font-family:var(--font-base)]", t),
12
+ ...n
13
+ });
14
+ }
15
+ function p({ label: t, kind: f = "file", defaultExpanded: p = !1, children: m }) {
16
+ let h = n(d), [g, _] = r(p), v = f === "folder", y = !!m;
17
+ return /* @__PURE__ */ u("div", {
18
+ role: "treeitem",
19
+ "aria-expanded": v ? g : void 0,
20
+ children: [/* @__PURE__ */ u("div", {
21
+ onClick: () => v && _((e) => !e),
22
+ style: { paddingLeft: h * 16 + 8 },
23
+ className: e("flex items-center gap-1.5 h-8 pr-2 rounded-[var(--radius-control)] text-sm text-text-foreground transition-colors", v && "cursor-pointer", "hover:bg-surface-selected"),
24
+ children: [v ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(i, { className: e("h-4 w-4 flex-shrink-0 text-text-foreground-muted transition-transform", g && "rotate-90") }), l(g ? s : o, { className: "h-4 w-4 flex-shrink-0 text-primary" })] }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", { className: "w-4 flex-shrink-0" }), /* @__PURE__ */ l(a, { className: "h-4 w-4 flex-shrink-0 text-text-foreground-muted" })] }), /* @__PURE__ */ l("span", {
25
+ className: "truncate",
26
+ children: t
27
+ })]
28
+ }), v && g && y && /* @__PURE__ */ l(d.Provider, {
29
+ value: h + 1,
30
+ children: /* @__PURE__ */ l("div", {
31
+ role: "group",
32
+ children: m
33
+ })
34
+ })]
35
+ });
36
+ }
37
+ f.Item = p;
38
+ //#endregion
39
+ export { f as Tree };