@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
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @lexydesign/designsystem
|
|
2
|
+
|
|
3
|
+
The Lexy Design System — 34 React components built on **Tailwind CSS v4**, generated from Figma. Works in Vite, CRA, and **Next.js App Router** (all interactive components ship with `"use client"`).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lexydesign/designsystem
|
|
9
|
+
# peer deps (if not already in your app):
|
|
10
|
+
npm install react react-dom
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup (Tailwind v4)
|
|
14
|
+
|
|
15
|
+
The components use Tailwind utility classes + design-token CSS variables. In your app's main CSS file:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
@import "tailwindcss";
|
|
19
|
+
@import "@lexydesign/designsystem/tokens.css"; /* design tokens → @theme */
|
|
20
|
+
@import "@lexydesign/designsystem/globals.css"; /* optional: reset, base body, .type-* */
|
|
21
|
+
|
|
22
|
+
/* let Tailwind generate the utilities the components use */
|
|
23
|
+
@source "../node_modules/@lexydesign/designsystem/dist";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> The `@source` line points Tailwind at our compiled JS so it can scan the class names we use and emit exactly those utilities. Adjust the relative path to your CSS file's location.
|
|
27
|
+
|
|
28
|
+
Geist (the type family) is pulled in automatically by `globals.css`. Skip that import if you load Geist yourself.
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Button, Modal, Badge } from '@lexydesign/designsystem';
|
|
34
|
+
|
|
35
|
+
export function Example() {
|
|
36
|
+
return (
|
|
37
|
+
<div className="flex gap-2">
|
|
38
|
+
<Button variant="primary">Save</Button>
|
|
39
|
+
<Button variant="destructive" hierarchy="outline">Delete</Button>
|
|
40
|
+
<Badge tone="green" variant="subtle">Active</Badge>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Compound components expose their parts as properties:
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { Modal } from '@lexydesign/designsystem';
|
|
50
|
+
|
|
51
|
+
<Modal open={open} onClose={close}>
|
|
52
|
+
<Modal.Header title="Invite members" />
|
|
53
|
+
<Modal.Body>…</Modal.Body>
|
|
54
|
+
<Modal.Footer>
|
|
55
|
+
<Button onClick={close}>Done</Button>
|
|
56
|
+
</Modal.Footer>
|
|
57
|
+
</Modal>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Also exported: `cn` (class merge helper) and `useFloating` (anchored-popover positioning hook).
|
|
61
|
+
|
|
62
|
+
## Components
|
|
63
|
+
|
|
64
|
+
Accordion · Avatar · Badge · Breadcrumb · Button · Checkbox · Combobox · CounterBadge · Divider · Dropdown · FeatureCard · HeaderBar · InfoLabel · Input · Logo · Menu · Modal · Nav · ProfileCard · ProgressBar · Radio · Searchbox · Skeleton · Slider · Snippet · StatusDot · Switch · Tabs · Tag · Textarea · Toast · Tooltip · Tree
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run storybook # explore components
|
|
70
|
+
npm run css # regenerate tokens from figma-export.json
|
|
71
|
+
npm run build # build the distributable library to dist/
|
|
72
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
}
|
|
3
|
+
export declare function Accordion({ className, ...props }: AccordionProps): import("react").JSX.Element;
|
|
4
|
+
export declare namespace Accordion {
|
|
5
|
+
var Item: typeof AccordionItem;
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
8
|
+
title: React.ReactNode;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function AccordionItem({ title, defaultOpen, disabled, children, className, ...props }: AccordionItemProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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/Accordion/Accordion.tsx
|
|
7
|
+
function a({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
className: e("w-full overflow-hidden rounded-[var(--radius-surface)] border border-border bg-surface [font-family:var(--font-base)]", "[&>*:last-child]:border-b-0", t),
|
|
10
|
+
...n
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function o({ title: a, defaultOpen: o = !1, disabled: s, children: c, className: l, ...u }) {
|
|
14
|
+
let [d, f] = t(o);
|
|
15
|
+
return /* @__PURE__ */ i("div", {
|
|
16
|
+
className: e("border-b border-border", l),
|
|
17
|
+
...u,
|
|
18
|
+
children: [/* @__PURE__ */ i("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
"aria-expanded": d,
|
|
21
|
+
disabled: s,
|
|
22
|
+
onClick: () => f((e) => !e),
|
|
23
|
+
className: e("flex w-full items-center justify-between h-12 px-4 text-left cursor-pointer", "text-sm font-medium text-text-foreground transition-colors", "hover:bg-surface-background-subtle", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset", "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent"),
|
|
24
|
+
children: [/* @__PURE__ */ r("span", { children: a }), /* @__PURE__ */ r(n, { className: e("h-4 w-4 text-text-foreground-muted transition-transform duration-200", d && "rotate-180") })]
|
|
25
|
+
}), d && /* @__PURE__ */ r("div", {
|
|
26
|
+
className: "px-4 pb-4 text-xs text-text-foreground-secondary",
|
|
27
|
+
children: c
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
a.Item = o;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as Accordion };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
2
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
initials?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Avatar({ size, src, alt, initials, className, ...props }: AvatarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
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/Avatar/Avatar.tsx
|
|
5
|
+
var n = {
|
|
6
|
+
sm: {
|
|
7
|
+
px: "h-6 w-6",
|
|
8
|
+
text: "text-[10px]"
|
|
9
|
+
},
|
|
10
|
+
md: {
|
|
11
|
+
px: "h-8 w-8",
|
|
12
|
+
text: "text-xs"
|
|
13
|
+
},
|
|
14
|
+
lg: {
|
|
15
|
+
px: "h-10 w-10",
|
|
16
|
+
text: "text-sm"
|
|
17
|
+
},
|
|
18
|
+
xl: {
|
|
19
|
+
px: "h-12 w-12",
|
|
20
|
+
text: "text-sm"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function r({ size: r = "md", src: i, alt: a = "", initials: o, className: s, ...c }) {
|
|
24
|
+
let { px: l, text: u } = n[r];
|
|
25
|
+
return /* @__PURE__ */ t("span", {
|
|
26
|
+
className: e("inline-flex items-center justify-center rounded-full overflow-hidden flex-shrink-0", "bg-accent text-primary-pressed font-medium [font-family:var(--font-base)]", l, u, s),
|
|
27
|
+
...c,
|
|
28
|
+
children: i ? /* @__PURE__ */ t("img", {
|
|
29
|
+
src: i,
|
|
30
|
+
alt: a,
|
|
31
|
+
className: "h-full w-full object-cover"
|
|
32
|
+
}) : /* @__PURE__ */ t("span", {
|
|
33
|
+
"aria-label": a,
|
|
34
|
+
children: o ?? "?"
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { r as Avatar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const badgeVariants: (props?: ({
|
|
3
|
+
tone?: "gray" | "blue" | "purple" | "amber" | "red" | "pink" | "green" | "teal" | "inverted" | null | undefined;
|
|
4
|
+
variant?: "solid" | "subtle" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
export declare function Badge({ className, tone, variant, ...props }: BadgeProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { cva as n } from "class-variance-authority";
|
|
5
|
+
//#region src/components/Badge/Badge.tsx
|
|
6
|
+
var r = n([
|
|
7
|
+
"inline-flex items-center justify-center gap-[5px]",
|
|
8
|
+
"h-5 px-2 py-0.5",
|
|
9
|
+
"rounded-full",
|
|
10
|
+
"text-xs font-medium leading-none whitespace-nowrap select-none",
|
|
11
|
+
"[font-family:var(--font-base)]"
|
|
12
|
+
].join(" "), {
|
|
13
|
+
variants: {
|
|
14
|
+
tone: {
|
|
15
|
+
gray: "",
|
|
16
|
+
blue: "",
|
|
17
|
+
purple: "",
|
|
18
|
+
amber: "",
|
|
19
|
+
red: "",
|
|
20
|
+
pink: "",
|
|
21
|
+
green: "",
|
|
22
|
+
teal: "",
|
|
23
|
+
inverted: ""
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
solid: "border",
|
|
27
|
+
subtle: ""
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: [
|
|
31
|
+
{
|
|
32
|
+
tone: "gray",
|
|
33
|
+
variant: "solid",
|
|
34
|
+
class: "bg-text-foreground text-neutral-white border-text-foreground"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
tone: "blue",
|
|
38
|
+
variant: "solid",
|
|
39
|
+
class: "bg-status-info text-neutral-white border-status-info"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
tone: "purple",
|
|
43
|
+
variant: "solid",
|
|
44
|
+
class: "bg-primary text-primary-foreground border-primary"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
tone: "amber",
|
|
48
|
+
variant: "solid",
|
|
49
|
+
class: "bg-status-warning text-neutral-white border-status-warning"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
tone: "red",
|
|
53
|
+
variant: "solid",
|
|
54
|
+
class: "bg-status-danger text-neutral-white border-status-danger"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
tone: "pink",
|
|
58
|
+
variant: "solid",
|
|
59
|
+
class: "bg-subbrand-deudor text-neutral-white border-subbrand-deudor"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
tone: "green",
|
|
63
|
+
variant: "solid",
|
|
64
|
+
class: "bg-status-success text-neutral-white border-status-success"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
tone: "teal",
|
|
68
|
+
variant: "solid",
|
|
69
|
+
class: "bg-subbrand-salud text-subbrand-salud-foreground-strong border-subbrand-salud"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
tone: "inverted",
|
|
73
|
+
variant: "solid",
|
|
74
|
+
class: "bg-surface-background-inverse text-neutral-white border-surface-background-inverse"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
tone: "gray",
|
|
78
|
+
variant: "subtle",
|
|
79
|
+
class: "bg-surface-background-muted text-text-foreground"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
tone: "blue",
|
|
83
|
+
variant: "subtle",
|
|
84
|
+
class: "bg-status-info-background text-status-info-foreground-strong"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
tone: "purple",
|
|
88
|
+
variant: "subtle",
|
|
89
|
+
class: "bg-accent text-primary-pressed"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
tone: "amber",
|
|
93
|
+
variant: "subtle",
|
|
94
|
+
class: "bg-status-warning-background text-status-warning-foreground-strong"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
tone: "red",
|
|
98
|
+
variant: "subtle",
|
|
99
|
+
class: "bg-status-danger-background text-status-danger-foreground-strong"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
tone: "pink",
|
|
103
|
+
variant: "subtle",
|
|
104
|
+
class: "bg-subbrand-deudor-background text-subbrand-deudor-foreground"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
tone: "green",
|
|
108
|
+
variant: "subtle",
|
|
109
|
+
class: "bg-status-success-background text-status-success-foreground-strong"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
tone: "teal",
|
|
113
|
+
variant: "subtle",
|
|
114
|
+
class: "bg-subbrand-salud-background text-subbrand-salud-foreground-strong"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
tone: "inverted",
|
|
118
|
+
variant: "subtle",
|
|
119
|
+
class: "bg-surface-background text-text-foreground border border-border"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
defaultVariants: {
|
|
123
|
+
tone: "gray",
|
|
124
|
+
variant: "solid"
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
function i({ className: n, tone: i, variant: a, ...o }) {
|
|
128
|
+
return /* @__PURE__ */ t("span", {
|
|
129
|
+
className: e(r({
|
|
130
|
+
tone: i,
|
|
131
|
+
variant: a
|
|
132
|
+
}), n),
|
|
133
|
+
...o
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { i as Badge };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
2
|
+
}
|
|
3
|
+
export declare function Breadcrumb({ className, children, ...props }: BreadcrumbProps): import("react").JSX.Element;
|
|
4
|
+
export declare namespace Breadcrumb {
|
|
5
|
+
var Item: typeof BreadcrumbItem;
|
|
6
|
+
var Separator: typeof BreadcrumbSeparator;
|
|
7
|
+
}
|
|
8
|
+
export interface BreadcrumbItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
9
|
+
type?: 'link' | 'current' | 'ellipsis';
|
|
10
|
+
href?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function BreadcrumbItem({ type, href, children, className, ...props }: BreadcrumbItemProps): import("react").JSX.Element;
|
|
13
|
+
declare function BreadcrumbSeparator({ className, ...props }: React.HTMLAttributes<HTMLLIElement>): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { ChevronRight as t, MoreHorizontal as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Breadcrumb/Breadcrumb.tsx
|
|
6
|
+
function a({ className: e, children: t, ...n }) {
|
|
7
|
+
return /* @__PURE__ */ r("nav", {
|
|
8
|
+
"aria-label": "Breadcrumb",
|
|
9
|
+
className: e,
|
|
10
|
+
...n,
|
|
11
|
+
children: /* @__PURE__ */ r("ol", {
|
|
12
|
+
className: "flex items-center gap-2 [font-family:var(--font-base)] text-sm",
|
|
13
|
+
children: t
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function o({ type: t = "link", href: a, children: o, className: s, ...c }) {
|
|
18
|
+
return /* @__PURE__ */ i("li", {
|
|
19
|
+
className: e("flex items-center", s),
|
|
20
|
+
...c,
|
|
21
|
+
children: [
|
|
22
|
+
t === "link" && /* @__PURE__ */ r("a", {
|
|
23
|
+
href: a,
|
|
24
|
+
className: "text-neutral-gray hover:text-text-foreground transition-colors",
|
|
25
|
+
children: o
|
|
26
|
+
}),
|
|
27
|
+
t === "current" && /* @__PURE__ */ r("span", {
|
|
28
|
+
"aria-current": "page",
|
|
29
|
+
className: "text-text-foreground font-medium",
|
|
30
|
+
children: o
|
|
31
|
+
}),
|
|
32
|
+
t === "ellipsis" && /* @__PURE__ */ r("span", {
|
|
33
|
+
className: "text-text-foreground-muted flex items-center",
|
|
34
|
+
"aria-label": "More",
|
|
35
|
+
children: /* @__PURE__ */ r(n, { className: "h-4 w-4" })
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function s({ className: n, ...i }) {
|
|
41
|
+
return /* @__PURE__ */ r("li", {
|
|
42
|
+
role: "presentation",
|
|
43
|
+
"aria-hidden": !0,
|
|
44
|
+
className: e("flex items-center text-text-foreground-muted", n),
|
|
45
|
+
...i,
|
|
46
|
+
children: /* @__PURE__ */ r(t, { className: "h-4 w-4" })
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
a.Item = o, a.Separator = s;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { a as Breadcrumb };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const buttonVariants: (props?: ({
|
|
3
|
+
variant?: "primary" | "secondary" | "destructive" | "warning" | "success" | "neutral" | null | undefined;
|
|
4
|
+
hierarchy?: "normal" | "ghost" | "outline" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef as t } from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { cva as r } from "class-variance-authority";
|
|
6
|
+
//#region src/components/Button/Button.tsx
|
|
7
|
+
var i = r([
|
|
8
|
+
"inline-flex items-center justify-center whitespace-nowrap select-none border border-transparent",
|
|
9
|
+
"gap-[var(--gap-button)]",
|
|
10
|
+
"[font-family:var(--font-base)] text-[length:var(--text-button)] font-[number:var(--font-weight-button)]",
|
|
11
|
+
"rounded-[var(--radius-control)]",
|
|
12
|
+
"transition-colors duration-150 cursor-pointer",
|
|
13
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",
|
|
14
|
+
"disabled:cursor-not-allowed",
|
|
15
|
+
"disabled:bg-surface-background-subtle disabled:text-neutral-border disabled:border-border disabled:[&>svg]:opacity-50"
|
|
16
|
+
].join(" "), {
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
primary: "",
|
|
20
|
+
secondary: "",
|
|
21
|
+
destructive: "",
|
|
22
|
+
warning: "",
|
|
23
|
+
success: "",
|
|
24
|
+
neutral: ""
|
|
25
|
+
},
|
|
26
|
+
hierarchy: {
|
|
27
|
+
normal: "",
|
|
28
|
+
ghost: "",
|
|
29
|
+
outline: ""
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
sm: "h-[var(--height-button-sm)] px-[var(--padding-button-horizontal-sm)]",
|
|
33
|
+
md: "h-[var(--height-button-md)] px-[var(--padding-button-horizontal-md)]",
|
|
34
|
+
lg: "h-[var(--height-button-lg)] px-[var(--padding-button-horizontal-lg)]"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
{
|
|
39
|
+
variant: "primary",
|
|
40
|
+
hierarchy: "normal",
|
|
41
|
+
class: "bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-pressed"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
variant: "primary",
|
|
45
|
+
hierarchy: "ghost",
|
|
46
|
+
class: "bg-transparent text-primary hover:bg-alpha-primary-alpha-hover active:bg-alpha-primary-alpha-pressed"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: "primary",
|
|
50
|
+
hierarchy: "outline",
|
|
51
|
+
class: "bg-surface text-primary border-primary hover:bg-alpha-primary-alpha-hover active:bg-alpha-primary-alpha-pressed"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
variant: "secondary",
|
|
55
|
+
hierarchy: "normal",
|
|
56
|
+
class: "bg-surface text-neutral-gray border-border hover:text-primary hover:border-primary active:bg-neutral-surface-muted active:text-primary active:border-primary"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
variant: "secondary",
|
|
60
|
+
hierarchy: "ghost",
|
|
61
|
+
class: "bg-transparent text-neutral-gray hover:bg-alpha-neutral-alpha-hover active:bg-alpha-neutral-alpha-pressed"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
variant: "secondary",
|
|
65
|
+
hierarchy: "outline",
|
|
66
|
+
class: "bg-surface text-neutral-gray border-border hover:text-primary hover:border-primary active:bg-neutral-surface-muted"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
variant: "destructive",
|
|
70
|
+
hierarchy: "normal",
|
|
71
|
+
class: "bg-status-danger text-primary-foreground hover:bg-status-danger-hover active:bg-status-danger-pressed"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
variant: "destructive",
|
|
75
|
+
hierarchy: "ghost",
|
|
76
|
+
class: "bg-transparent text-status-danger hover:bg-alpha-danger-alpha-hover active:bg-alpha-danger-alpha-pressed"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
variant: "destructive",
|
|
80
|
+
hierarchy: "outline",
|
|
81
|
+
class: "bg-surface text-status-danger border-status-danger hover:bg-alpha-danger-alpha-hover active:bg-alpha-danger-alpha-pressed"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
variant: "warning",
|
|
85
|
+
hierarchy: "normal",
|
|
86
|
+
class: "bg-status-warning text-primary-foreground hover:bg-status-warning-hover active:bg-status-warning-pressed"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
variant: "warning",
|
|
90
|
+
hierarchy: "ghost",
|
|
91
|
+
class: "bg-transparent text-status-warning hover:bg-alpha-warning-alpha-hover active:bg-alpha-warning-alpha-pressed"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
variant: "warning",
|
|
95
|
+
hierarchy: "outline",
|
|
96
|
+
class: "bg-surface text-status-warning border-status-warning hover:bg-alpha-warning-alpha-hover active:bg-alpha-warning-alpha-pressed"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
variant: "success",
|
|
100
|
+
hierarchy: "normal",
|
|
101
|
+
class: "bg-status-success text-primary-foreground hover:bg-status-success-hover active:bg-status-success-pressed"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
variant: "success",
|
|
105
|
+
hierarchy: "ghost",
|
|
106
|
+
class: "bg-transparent text-status-success hover:bg-alpha-success-alpha-hover active:bg-alpha-success-alpha-pressed"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
variant: "success",
|
|
110
|
+
hierarchy: "outline",
|
|
111
|
+
class: "bg-surface text-status-success border-status-success hover:bg-alpha-success-alpha-hover active:bg-alpha-success-alpha-pressed"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
variant: "neutral",
|
|
115
|
+
hierarchy: "normal",
|
|
116
|
+
class: "bg-neutral-surface-muted text-text-foreground hover:bg-surface-pressed active:bg-surface-selected"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
variant: "neutral",
|
|
120
|
+
hierarchy: "ghost",
|
|
121
|
+
class: "bg-transparent text-neutral-gray hover:bg-alpha-neutral-alpha-hover active:bg-alpha-neutral-alpha-pressed"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
variant: "neutral",
|
|
125
|
+
hierarchy: "outline",
|
|
126
|
+
class: "bg-surface text-neutral-gray border-border hover:bg-neutral-surface-muted active:bg-surface-pressed"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
defaultVariants: {
|
|
130
|
+
variant: "primary",
|
|
131
|
+
hierarchy: "normal",
|
|
132
|
+
size: "md"
|
|
133
|
+
}
|
|
134
|
+
}), a = t(({ className: t, variant: r, hierarchy: a, size: o, ...s }, c) => /* @__PURE__ */ n("button", {
|
|
135
|
+
ref: c,
|
|
136
|
+
className: e(i({
|
|
137
|
+
variant: r,
|
|
138
|
+
hierarchy: a,
|
|
139
|
+
size: o
|
|
140
|
+
}), t),
|
|
141
|
+
...s
|
|
142
|
+
}));
|
|
143
|
+
a.displayName = "Button";
|
|
144
|
+
//#endregion
|
|
145
|
+
export { a as Button };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type'> {
|
|
2
|
+
indeterminate?: boolean;
|
|
3
|
+
onChange?: (checked: boolean) => void;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
4
|
+
import { Check as a, Minus as o } from "lucide-react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Checkbox/Checkbox.tsx
|
|
7
|
+
var l = t(({ checked: t, defaultChecked: l, indeterminate: u = !1, disabled: d, onChange: f, children: p, className: m, ...h }, g) => {
|
|
8
|
+
let _ = r(null), v = g ?? _, [y, b] = i(l ?? !1), x = t !== void 0, S = x ? t : y;
|
|
9
|
+
n(() => {
|
|
10
|
+
v.current && (v.current.indeterminate = u);
|
|
11
|
+
}, [u, v]);
|
|
12
|
+
function C(e) {
|
|
13
|
+
x || b(e.target.checked), f?.(e.target.checked);
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ c("label", {
|
|
16
|
+
className: e("inline-flex items-center gap-2 cursor-pointer", d && "cursor-not-allowed opacity-50", m),
|
|
17
|
+
children: [/* @__PURE__ */ c("span", {
|
|
18
|
+
className: "relative inline-flex h-4 w-4 flex-shrink-0",
|
|
19
|
+
children: [/* @__PURE__ */ s("input", {
|
|
20
|
+
ref: v,
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
checked: x ? t : void 0,
|
|
23
|
+
defaultChecked: x ? void 0 : l,
|
|
24
|
+
disabled: d,
|
|
25
|
+
onChange: C,
|
|
26
|
+
className: "sr-only peer",
|
|
27
|
+
...h
|
|
28
|
+
}), /* @__PURE__ */ c("span", {
|
|
29
|
+
className: e("absolute inset-0 flex items-center justify-center rounded-[var(--radius-control-sm)] border border-border", "transition-colors duration-150", "peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-1", S || u ? "bg-primary border-primary" : "bg-neutral-white"),
|
|
30
|
+
children: [S && !u && /* @__PURE__ */ s(a, {
|
|
31
|
+
className: "h-3 w-3 text-neutral-white",
|
|
32
|
+
strokeWidth: 3
|
|
33
|
+
}), u && /* @__PURE__ */ s(o, {
|
|
34
|
+
className: "h-3 w-3 text-neutral-white",
|
|
35
|
+
strokeWidth: 3
|
|
36
|
+
})]
|
|
37
|
+
})]
|
|
38
|
+
}), p && /* @__PURE__ */ s("span", {
|
|
39
|
+
className: "text-sm text-text-foreground [font-family:var(--font-base)]",
|
|
40
|
+
children: p
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
l.displayName = "Checkbox";
|
|
45
|
+
//#endregion
|
|
46
|
+
export { l as Checkbox };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ComboboxOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ComboboxProps {
|
|
7
|
+
options: ComboboxOption[];
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function Combobox({ options, value, defaultValue, onValueChange, placeholder, error, disabled, className, }: ComboboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useFloating as t } from "../../lib/useFloating.js";
|
|
4
|
+
import { useMemo as n, useRef as r, useState as i } from "react";
|
|
5
|
+
import { Check as a, ChevronDown as o } from "lucide-react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Combobox/Combobox.tsx
|
|
8
|
+
function l({ options: l, value: u, defaultValue: d, onValueChange: f, placeholder: p = "Search…", error: m, disabled: h, className: g }) {
|
|
9
|
+
let [_, v] = i(d), [y, b] = i(""), x = u !== void 0, S = x ? u : _, C = r(null), { triggerRef: w, floatingRef: T, open: E, setOpen: D, floatingStyle: O } = t({ matchTriggerWidth: !0 }), k = l.find((e) => e.value === S)?.label ?? "", A = n(() => l.filter((e) => e.label.toLowerCase().includes(y.toLowerCase())), [l, y]);
|
|
10
|
+
function j(e) {
|
|
11
|
+
x || v(e), f?.(e), b(""), D(!1);
|
|
12
|
+
}
|
|
13
|
+
function M() {
|
|
14
|
+
h || (D(!0), requestAnimationFrame(() => C.current?.focus()));
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ c("div", {
|
|
17
|
+
className: e("w-[260px] [font-family:var(--font-base)]", g),
|
|
18
|
+
children: [/* @__PURE__ */ c("div", {
|
|
19
|
+
ref: w,
|
|
20
|
+
onClick: M,
|
|
21
|
+
className: e("flex items-center justify-between w-full h-10 px-3 gap-2 rounded-[var(--radius-control-lg)] border bg-surface text-sm transition-colors cursor-text", "border-border hover:border-border-hover", E && "border-primary", m && "border-status-danger", h && "opacity-50 cursor-not-allowed bg-surface-background-subtle"),
|
|
22
|
+
children: [E ? /* @__PURE__ */ s("input", {
|
|
23
|
+
ref: C,
|
|
24
|
+
value: y,
|
|
25
|
+
placeholder: k || p,
|
|
26
|
+
onChange: (e) => b(e.target.value),
|
|
27
|
+
className: "flex-1 min-w-0 bg-transparent outline-none text-text-foreground placeholder:text-text-foreground-muted"
|
|
28
|
+
}) : /* @__PURE__ */ s("span", {
|
|
29
|
+
className: e("truncate", k ? "text-text-foreground" : "text-text-foreground-muted"),
|
|
30
|
+
children: k || p
|
|
31
|
+
}), /* @__PURE__ */ s(o, { className: e("h-4 w-4 flex-shrink-0 text-text-foreground-muted transition-transform", E && "rotate-180") })]
|
|
32
|
+
}), E && /* @__PURE__ */ s("div", {
|
|
33
|
+
ref: T,
|
|
34
|
+
role: "listbox",
|
|
35
|
+
style: O,
|
|
36
|
+
className: "z-50 rounded-[var(--radius-popover)] border border-border bg-surface shadow-md p-1 max-h-64 overflow-auto",
|
|
37
|
+
children: A.length === 0 ? /* @__PURE__ */ s("div", {
|
|
38
|
+
className: "h-8 px-2 flex items-center text-sm text-text-foreground-muted",
|
|
39
|
+
children: "No results"
|
|
40
|
+
}) : A.map((t) => {
|
|
41
|
+
let n = t.value === S;
|
|
42
|
+
return /* @__PURE__ */ c("div", {
|
|
43
|
+
role: "option",
|
|
44
|
+
"aria-selected": n,
|
|
45
|
+
onClick: () => !t.disabled && j(t.value),
|
|
46
|
+
className: e("flex items-center justify-between h-8 px-2 rounded-[var(--radius-control-sm)] text-sm cursor-pointer transition-colors", n ? "bg-primary-subtle text-primary" : "text-text-foreground hover:bg-alpha-neutral-alpha-hover", t.disabled && "pointer-events-none text-text-foreground-disabled"),
|
|
47
|
+
children: [/* @__PURE__ */ s("span", {
|
|
48
|
+
className: "truncate",
|
|
49
|
+
children: t.label
|
|
50
|
+
}), n && /* @__PURE__ */ s(a, { className: "h-4 w-4 flex-shrink-0" })]
|
|
51
|
+
}, t.value);
|
|
52
|
+
})
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { l as Combobox };
|