@nipsys/shadcn-lsd 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -35
- package/dist/{Button-L-du0fyx.js → Button-DoTpV6G1.js} +31 -26
- package/dist/{Typography-D8OaaVSH.js → Typography-BW4Kc9SY.js} +18 -14
- package/dist/assets/style.css +1 -1
- package/dist/components/ui/alert-dialog/AlertDialogAction.js +1 -1
- package/dist/components/ui/alert-dialog/AlertDialogCancel.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-action.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-cancel.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-content.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-description.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-footer.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-header.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-overlay.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-title.test.js +1 -1
- package/dist/components/ui/alert-dialog/__tests__/alert-dialog-trigger.test.js +1 -1
- package/dist/components/ui/button/Button.js +1 -1
- package/dist/components/ui/button/button.test.js +159 -123
- package/dist/components/ui/button/types.d.ts +3 -3
- package/dist/components/ui/sidebar/SidebarContent.js +15 -15
- package/dist/components/ui/sidebar/__tests__/sidebar-group.test.js +1 -1
- package/dist/components/ui/sidebar/__tests__/sidebar-menu.test.js +1 -1
- package/dist/components/ui/sidebar/__tests__/sidebar.test.js +1 -1
- package/dist/components/ui/tabs/Tabs.js +1 -1
- package/dist/components/ui/tabs/TabsList.js +1 -1
- package/dist/components/ui/tabs/TabsTrigger.js +1 -1
- package/dist/components/ui/tabs/__tests__/tabs-list.test.js +25 -25
- package/dist/components/ui/tabs/__tests__/tabs-trigger.test.js +1 -3
- package/dist/components/ui/tabs/__tests__/tabs.test.js +23 -23
- package/dist/components/ui/typography/Typography.js +1 -1
- package/dist/components/ui/typography/types.d.ts +1 -1
- package/dist/components/ui/typography/typography.test.js +143 -111
- package/dist/lib/types.d.ts +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +219 -215
- package/dist/{types-B0wccExf.js → types-ClTXXuXM.js} +2 -2
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
2
|
+
import { d as o, i, r as d, g as l } from "../../../../vi.2VT5v0um-D9hIOtVQ.js";
|
|
3
3
|
import { Tabs as r } from "../Tabs.js";
|
|
4
|
-
import { TabsContent as
|
|
5
|
-
import { TabsList as
|
|
4
|
+
import { TabsContent as n } from "../TabsContent.js";
|
|
5
|
+
import { TabsList as c } from "../TabsList.js";
|
|
6
6
|
import { TabsTrigger as s } from "../TabsTrigger.js";
|
|
7
|
-
|
|
7
|
+
o("TabsList", () => {
|
|
8
8
|
i("renders without crashing", () => {
|
|
9
9
|
d(
|
|
10
10
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
11
|
-
/* @__PURE__ */ a(
|
|
11
|
+
/* @__PURE__ */ a(c, { children: [
|
|
12
12
|
/* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }),
|
|
13
13
|
/* @__PURE__ */ t(s, { value: "tab-2", children: "Tab 2" })
|
|
14
14
|
] }),
|
|
15
|
-
/* @__PURE__ */ t(
|
|
15
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
16
16
|
] })
|
|
17
17
|
), l(
|
|
18
18
|
document.querySelector('[data-slot="tabs-list"]')
|
|
@@ -20,8 +20,8 @@ c("TabsList", () => {
|
|
|
20
20
|
}), i("applies data-slot attribute", () => {
|
|
21
21
|
d(
|
|
22
22
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
23
|
-
/* @__PURE__ */ t(
|
|
24
|
-
/* @__PURE__ */ t(
|
|
23
|
+
/* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
24
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
25
25
|
] })
|
|
26
26
|
);
|
|
27
27
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -29,17 +29,17 @@ c("TabsList", () => {
|
|
|
29
29
|
}), i("applies base classes correctly", () => {
|
|
30
30
|
d(
|
|
31
31
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
-
/* @__PURE__ */ t(
|
|
32
|
+
/* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
33
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
34
34
|
] })
|
|
35
35
|
);
|
|
36
36
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
37
|
-
l(e).toHaveClass("lsd:bg-lsd-surface"), l(e).toHaveClass("lsd:border-b"), l(e).toHaveClass("lsd:
|
|
37
|
+
l(e).toHaveClass("lsd:bg-lsd-surface"), l(e).toHaveClass("lsd:border-b"), l(e).toHaveClass("lsd:flex"), l(e).toHaveClass("lsd:flex-row");
|
|
38
38
|
}), i("applies default size classes (lg)", () => {
|
|
39
39
|
d(
|
|
40
40
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
41
|
-
/* @__PURE__ */ t(
|
|
42
|
-
/* @__PURE__ */ t(
|
|
41
|
+
/* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
42
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
43
43
|
] })
|
|
44
44
|
);
|
|
45
45
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -47,8 +47,8 @@ c("TabsList", () => {
|
|
|
47
47
|
}), i('applies small size classes when size="sm"', () => {
|
|
48
48
|
d(
|
|
49
49
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
-
/* @__PURE__ */ t(
|
|
50
|
+
/* @__PURE__ */ t(c, { size: "sm", children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
51
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
52
52
|
] })
|
|
53
53
|
);
|
|
54
54
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -56,8 +56,8 @@ c("TabsList", () => {
|
|
|
56
56
|
}), i('applies medium size classes when size="md"', () => {
|
|
57
57
|
d(
|
|
58
58
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
59
|
-
/* @__PURE__ */ t(
|
|
60
|
-
/* @__PURE__ */ t(
|
|
59
|
+
/* @__PURE__ */ t(c, { size: "md", children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
60
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
61
61
|
] })
|
|
62
62
|
);
|
|
63
63
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -65,8 +65,8 @@ c("TabsList", () => {
|
|
|
65
65
|
}), i("applies default fullWidth classes (false)", () => {
|
|
66
66
|
d(
|
|
67
67
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
68
|
-
/* @__PURE__ */ t(
|
|
69
|
-
/* @__PURE__ */ t(
|
|
68
|
+
/* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
69
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
70
70
|
] })
|
|
71
71
|
);
|
|
72
72
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -74,8 +74,8 @@ c("TabsList", () => {
|
|
|
74
74
|
}), i("applies fullWidth classes when fullWidth={true}", () => {
|
|
75
75
|
d(
|
|
76
76
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
/* @__PURE__ */ t(
|
|
77
|
+
/* @__PURE__ */ t(c, { fullWidth: !0, children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
78
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
79
79
|
] })
|
|
80
80
|
);
|
|
81
81
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -83,8 +83,8 @@ c("TabsList", () => {
|
|
|
83
83
|
}), i("merges custom className with component classes", () => {
|
|
84
84
|
d(
|
|
85
85
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
86
|
-
/* @__PURE__ */ t(
|
|
87
|
-
/* @__PURE__ */ t(
|
|
86
|
+
/* @__PURE__ */ t(c, { className: "custom-list-class", children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
87
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
88
88
|
] })
|
|
89
89
|
);
|
|
90
90
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -92,8 +92,8 @@ c("TabsList", () => {
|
|
|
92
92
|
}), i("passes through additional props", () => {
|
|
93
93
|
d(
|
|
94
94
|
/* @__PURE__ */ a(r, { defaultValue: "tab-1", children: [
|
|
95
|
-
/* @__PURE__ */ t(
|
|
96
|
-
/* @__PURE__ */ t(
|
|
95
|
+
/* @__PURE__ */ t(c, { "data-testid": "test-list", id: "list-1", children: /* @__PURE__ */ t(s, { value: "tab-1", children: "Tab 1" }) }),
|
|
96
|
+
/* @__PURE__ */ t(n, { value: "tab-1", children: "Content 1" })
|
|
97
97
|
] })
|
|
98
98
|
);
|
|
99
99
|
const e = document.querySelector('[data-slot="tabs-list"]');
|
|
@@ -45,9 +45,7 @@ b("TabsTrigger", () => {
|
|
|
45
45
|
] })
|
|
46
46
|
);
|
|
47
47
|
const e = c.getByRole("tab", { name: "Tab 1" });
|
|
48
|
-
a(e).toHaveAttribute("data-state", "active"), a(e).toHaveClass(
|
|
49
|
-
"lsd:data-[state=active]:border-lsd-text-primary"
|
|
50
|
-
), a(e).toHaveClass("lsd:data-[state=active]:bg-lsd-surface"), a(e).toHaveClass("lsd:data-[state=active]:font-medium");
|
|
48
|
+
a(e).toHaveAttribute("data-state", "active"), a(e).toHaveClass("lsd:data-[state=active]:border-lsd-border"), a(e).toHaveClass("lsd:data-[state=active]:bg-lsd-surface"), a(e).toHaveClass("lsd:data-[state=active]:font-medium");
|
|
51
49
|
}), d("applies default size classes (lg)", () => {
|
|
52
50
|
i(
|
|
53
51
|
/* @__PURE__ */ l(n, { defaultValue: "tab-1", children: [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { d as C, i as s, r as b, g as t, s as f } from "../../../../vi.2VT5v0um-D9hIOtVQ.js";
|
|
3
3
|
import { Tabs as h } from "../Tabs.js";
|
|
4
|
-
import { TabsContent as
|
|
4
|
+
import { TabsContent as o } from "../TabsContent.js";
|
|
5
5
|
import { TabsList as m } from "../TabsList.js";
|
|
6
6
|
import { TabsTrigger as l } from "../TabsTrigger.js";
|
|
7
|
-
import { t as d, a as c, b as u } from "../../../../types-
|
|
7
|
+
import { t as d, a as c, b as u } from "../../../../types-ClTXXuXM.js";
|
|
8
8
|
C("Tabs", () => {
|
|
9
9
|
s("renders without crashing", () => {
|
|
10
10
|
b(
|
|
@@ -13,15 +13,15 @@ C("Tabs", () => {
|
|
|
13
13
|
/* @__PURE__ */ a(l, { value: "tab-1", children: "Tab 1" }),
|
|
14
14
|
/* @__PURE__ */ a(l, { value: "tab-2", children: "Tab 2" })
|
|
15
15
|
] }),
|
|
16
|
-
/* @__PURE__ */ a(
|
|
17
|
-
/* @__PURE__ */ a(
|
|
16
|
+
/* @__PURE__ */ a(o, { value: "tab-1", children: "Content 1" }),
|
|
17
|
+
/* @__PURE__ */ a(o, { value: "tab-2", children: "Content 2" })
|
|
18
18
|
] })
|
|
19
19
|
), t(document.querySelector('[data-slot="tabs"]')).toBeInTheDocument();
|
|
20
20
|
}), s("applies data-slot attribute", () => {
|
|
21
21
|
b(
|
|
22
22
|
/* @__PURE__ */ i(h, { defaultValue: "tab-1", children: [
|
|
23
23
|
/* @__PURE__ */ a(m, { children: /* @__PURE__ */ a(l, { value: "tab-1", children: "Tab 1" }) }),
|
|
24
|
-
/* @__PURE__ */ a(
|
|
24
|
+
/* @__PURE__ */ a(o, { value: "tab-1", children: "Content 1" })
|
|
25
25
|
] })
|
|
26
26
|
);
|
|
27
27
|
const e = document.querySelector('[data-slot="tabs"]');
|
|
@@ -30,7 +30,7 @@ C("Tabs", () => {
|
|
|
30
30
|
b(
|
|
31
31
|
/* @__PURE__ */ i(h, { defaultValue: "tab-1", "data-testid": "test-tabs", id: "tabs-1", children: [
|
|
32
32
|
/* @__PURE__ */ a(m, { children: /* @__PURE__ */ a(l, { value: "tab-1", children: "Tab 1" }) }),
|
|
33
|
-
/* @__PURE__ */ a(
|
|
33
|
+
/* @__PURE__ */ a(o, { value: "tab-1", children: "Content 1" })
|
|
34
34
|
] })
|
|
35
35
|
);
|
|
36
36
|
const e = document.querySelector('[data-slot="tabs"]');
|
|
@@ -39,7 +39,7 @@ C("Tabs", () => {
|
|
|
39
39
|
b(
|
|
40
40
|
/* @__PURE__ */ i(h, { defaultValue: "tab-1", className: "custom-tabs-class", children: [
|
|
41
41
|
/* @__PURE__ */ a(m, { children: /* @__PURE__ */ a(l, { value: "tab-1", children: "Tab 1" }) }),
|
|
42
|
-
/* @__PURE__ */ a(
|
|
42
|
+
/* @__PURE__ */ a(o, { value: "tab-1", children: "Content 1" })
|
|
43
43
|
] })
|
|
44
44
|
);
|
|
45
45
|
const e = document.querySelector('[data-slot="tabs"]');
|
|
@@ -52,9 +52,9 @@ C("Tabs", () => {
|
|
|
52
52
|
/* @__PURE__ */ a(l, { value: "tab-2", children: "Tab 2" }),
|
|
53
53
|
/* @__PURE__ */ a(l, { value: "tab-3", children: "Tab 3" })
|
|
54
54
|
] }),
|
|
55
|
-
/* @__PURE__ */ a(
|
|
56
|
-
/* @__PURE__ */ a(
|
|
57
|
-
/* @__PURE__ */ a(
|
|
55
|
+
/* @__PURE__ */ a(o, { value: "tab-1", children: "Content 1" }),
|
|
56
|
+
/* @__PURE__ */ a(o, { value: "tab-2", children: "Content 2" }),
|
|
57
|
+
/* @__PURE__ */ a(o, { value: "tab-3", children: "Content 3" })
|
|
58
58
|
] })
|
|
59
59
|
), t(document.querySelector('[data-slot="tabs"]')).toBeInTheDocument(), t(
|
|
60
60
|
document.querySelector('[data-slot="tabs-list"]')
|
|
@@ -68,23 +68,23 @@ C("tabsVariants", () => {
|
|
|
68
68
|
const e = d();
|
|
69
69
|
t(e).toBe("");
|
|
70
70
|
}), s("returns correct classes for size variants", () => {
|
|
71
|
-
const e = d({ size: "sm" }),
|
|
72
|
-
t(e).toBe(""), t(
|
|
71
|
+
const e = d({ size: "sm" }), n = d({ size: "md" }), r = d({ size: "lg" });
|
|
72
|
+
t(e).toBe(""), t(n).toBe(""), t(r).toBe("");
|
|
73
73
|
}), s("returns correct classes for fullWidth variants", () => {
|
|
74
|
-
const e = d({ fullWidth: !0 }),
|
|
75
|
-
t(e).toBe(""), t(
|
|
74
|
+
const e = d({ fullWidth: !0 }), n = d({ fullWidth: !1 });
|
|
75
|
+
t(e).toBe(""), t(n).toBe("");
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
C("tabsListVariants", () => {
|
|
79
79
|
s("returns correct classes for default variants", () => {
|
|
80
80
|
const e = c();
|
|
81
|
-
t(e).toContain("lsd:bg-lsd-surface"), t(e).toContain("lsd:border-b"), t(e).toContain("lsd:
|
|
81
|
+
t(e).toContain("lsd:bg-lsd-surface"), t(e).toContain("lsd:border-b"), t(e).toContain("lsd:flex"), t(e).toContain("lsd:flex-row"), t(e).toContain("lsd:h-12"), t(e).toContain("lsd:w-fit");
|
|
82
82
|
}), s("returns correct classes for size variants", () => {
|
|
83
|
-
const e = c({ size: "sm" }),
|
|
84
|
-
t(e).toContain("lsd:h-8"), t(
|
|
83
|
+
const e = c({ size: "sm" }), n = c({ size: "md" }), r = c({ size: "lg" });
|
|
84
|
+
t(e).toContain("lsd:h-8"), t(n).toContain("lsd:h-10"), t(r).toContain("lsd:h-12");
|
|
85
85
|
}), s("returns correct classes for fullWidth variants", () => {
|
|
86
|
-
const e = c({ fullWidth: !0 }),
|
|
87
|
-
t(e).toContain("lsd:w-full"), t(
|
|
86
|
+
const e = c({ fullWidth: !0 }), n = c({ fullWidth: !1 });
|
|
87
|
+
t(e).toContain("lsd:w-full"), t(n).toContain("lsd:w-fit");
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
C("tabsTriggerVariants", () => {
|
|
@@ -92,10 +92,10 @@ C("tabsTriggerVariants", () => {
|
|
|
92
92
|
const e = u();
|
|
93
93
|
t(e).toContain("lsd:text-lsd-text"), t(e).toContain("lsd:border"), t(e).toContain("lsd:border-transparent"), t(e).toContain("lsd:border-b-0"), t(e).toContain("lsd:flex"), t(e).toContain("lsd:items-center"), t(e).toContain("lsd:justify-center"), t(e).toContain("lsd:px-5"), t(e).toContain("lsd:py-2.5"), t(e).toContain("lsd:text-lg");
|
|
94
94
|
}), s("returns correct classes for size variants", () => {
|
|
95
|
-
const e = u({ size: "sm" }),
|
|
96
|
-
t(e).toContain("lsd:px-3"), t(e).toContain("lsd:py-1.5"), t(e).toContain("lsd:text-sm"), t(
|
|
95
|
+
const e = u({ size: "sm" }), n = u({ size: "md" }), r = u({ size: "lg" });
|
|
96
|
+
t(e).toContain("lsd:px-3"), t(e).toContain("lsd:py-1.5"), t(e).toContain("lsd:text-sm"), t(n).toContain("lsd:px-4"), t(n).toContain("lsd:py-2"), t(n).toContain("lsd:text-base"), t(r).toContain("lsd:px-5"), t(r).toContain("lsd:py-2.5"), t(r).toContain("lsd:text-lg");
|
|
97
97
|
}), s("returns correct classes for fullWidth variants", () => {
|
|
98
|
-
const e = u({ fullWidth: !0 }),
|
|
99
|
-
t(e).toContain("lsd:flex-1"), t(
|
|
98
|
+
const e = u({ fullWidth: !0 }), n = u({ fullWidth: !1 });
|
|
99
|
+
t(e).toContain("lsd:flex-1"), t(n).not.toContain("lsd:flex-1");
|
|
100
100
|
});
|
|
101
101
|
});
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export type TypographyVariant = 'display1' | 'display2' | 'display3' | 'display4' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'subtitle3' | 'subtitle4' | 'body1' | 'body2' | 'body3' | 'label1' | 'label2';
|
|
3
3
|
export declare const typographyVariants: (props?: ({
|
|
4
4
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "display1" | "display2" | "display3" | "display4" | "subtitle1" | "subtitle2" | "subtitle3" | "subtitle4" | "body1" | "body2" | "body3" | "label1" | "label2" | null | undefined;
|
|
5
|
-
color?: "secondary" | "primary" | null | undefined;
|
|
5
|
+
color?: "destructive" | "success" | "warning" | "info" | "secondary" | "primary" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type TypographyVariants = VariantProps<typeof typographyVariants>;
|
|
8
8
|
export interface TypographyProps extends Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'>, TypographyVariants {
|
|
@@ -1,157 +1,189 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { d as
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
l(/* @__PURE__ */
|
|
7
|
-
}),
|
|
8
|
-
l(/* @__PURE__ */
|
|
9
|
-
}),
|
|
10
|
-
l(/* @__PURE__ */
|
|
11
|
-
const e =
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { d as i, i as s, r as l, g as t, s as o, v as c } from "../../../vi.2VT5v0um-D9hIOtVQ.js";
|
|
3
|
+
import { t as n, T as r } from "../../../Typography-BW4Kc9SY.js";
|
|
4
|
+
i("Typography", () => {
|
|
5
|
+
s("renders without crashing", () => {
|
|
6
|
+
l(/* @__PURE__ */ a(r, { children: "Text" })), t(o.getByText("Text")).toBeInTheDocument();
|
|
7
|
+
}), s("renders children correctly", () => {
|
|
8
|
+
l(/* @__PURE__ */ a(r, { children: "Test Text" })), t(o.getByText("Test Text")).toBeInTheDocument();
|
|
9
|
+
}), s("uses default variant (body1) when not specified", () => {
|
|
10
|
+
l(/* @__PURE__ */ a(r, { children: "Text" }));
|
|
11
|
+
const e = o.getByText("Text");
|
|
12
12
|
t(e).toHaveClass("lsd:text-[1rem]"), t(e).toHaveClass("lsd:leading-[1.5rem]");
|
|
13
|
-
}),
|
|
14
|
-
l(/* @__PURE__ */
|
|
15
|
-
const e =
|
|
13
|
+
}), s("uses default color (primary) when not specified", () => {
|
|
14
|
+
l(/* @__PURE__ */ a(r, { children: "Text" }));
|
|
15
|
+
const e = o.getByText("Text");
|
|
16
16
|
t(e).toHaveClass("lsd:text-lsd-text-primary");
|
|
17
|
-
}),
|
|
18
|
-
l(/* @__PURE__ */
|
|
19
|
-
const e =
|
|
17
|
+
}), s("applies display1 variant classes correctly", () => {
|
|
18
|
+
l(/* @__PURE__ */ a(r, { variant: "display1", children: "Display 1" }));
|
|
19
|
+
const e = o.getByText("Display 1");
|
|
20
20
|
t(e).toHaveClass("lsd:text-[5.5rem]"), t(e).toHaveClass("lsd:font-normal"), t(e).toHaveClass("lsd:leading-[6rem]");
|
|
21
|
-
}),
|
|
22
|
-
l(/* @__PURE__ */
|
|
23
|
-
const e =
|
|
21
|
+
}), s("applies display2 variant classes correctly", () => {
|
|
22
|
+
l(/* @__PURE__ */ a(r, { variant: "display2", children: "Display 2" }));
|
|
23
|
+
const e = o.getByText("Display 2");
|
|
24
24
|
t(e).toHaveClass("lsd:text-[4rem]"), t(e).toHaveClass("lsd:leading-[4.5rem]");
|
|
25
|
-
}),
|
|
26
|
-
l(/* @__PURE__ */
|
|
27
|
-
const e =
|
|
25
|
+
}), s("applies display3 variant classes correctly", () => {
|
|
26
|
+
l(/* @__PURE__ */ a(r, { variant: "display3", children: "Display 3" }));
|
|
27
|
+
const e = o.getByText("Display 3");
|
|
28
28
|
t(e).toHaveClass("lsd:text-[3.5rem]"), t(e).toHaveClass("lsd:leading-[4rem]");
|
|
29
|
-
}),
|
|
30
|
-
l(/* @__PURE__ */
|
|
31
|
-
const e =
|
|
29
|
+
}), s("applies display4 variant classes correctly", () => {
|
|
30
|
+
l(/* @__PURE__ */ a(r, { variant: "display4", children: "Display 4" }));
|
|
31
|
+
const e = o.getByText("Display 4");
|
|
32
32
|
t(e).toHaveClass("lsd:text-[3rem]"), t(e).toHaveClass("lsd:leading-[3.5rem]");
|
|
33
|
-
}),
|
|
34
|
-
l(/* @__PURE__ */
|
|
35
|
-
const e =
|
|
33
|
+
}), s("applies h1 variant classes correctly", () => {
|
|
34
|
+
l(/* @__PURE__ */ a(r, { variant: "h1", children: "Heading 1" }));
|
|
35
|
+
const e = o.getByText("Heading 1");
|
|
36
36
|
t(e).toHaveClass("lsd:text-[2.5rem]"), t(e).toHaveClass("lsd:leading-[3rem]"), t(e.tagName).toBe("H1");
|
|
37
|
-
}),
|
|
38
|
-
l(/* @__PURE__ */
|
|
39
|
-
const e =
|
|
37
|
+
}), s("applies h2 variant classes correctly", () => {
|
|
38
|
+
l(/* @__PURE__ */ a(r, { variant: "h2", children: "Heading 2" }));
|
|
39
|
+
const e = o.getByText("Heading 2");
|
|
40
40
|
t(e).toHaveClass("lsd:text-[2rem]"), t(e).toHaveClass("lsd:leading-[2.5rem]"), t(e.tagName).toBe("H2");
|
|
41
|
-
}),
|
|
42
|
-
l(/* @__PURE__ */
|
|
43
|
-
const e =
|
|
41
|
+
}), s("applies h3 variant classes correctly", () => {
|
|
42
|
+
l(/* @__PURE__ */ a(r, { variant: "h3", children: "Heading 3" }));
|
|
43
|
+
const e = o.getByText("Heading 3");
|
|
44
44
|
t(e).toHaveClass("lsd:text-[1.75rem]"), t(e).toHaveClass("lsd:leading-[2.25rem]"), t(e.tagName).toBe("H3");
|
|
45
|
-
}),
|
|
46
|
-
l(/* @__PURE__ */
|
|
47
|
-
const e =
|
|
45
|
+
}), s("applies h4 variant classes correctly", () => {
|
|
46
|
+
l(/* @__PURE__ */ a(r, { variant: "h4", children: "Heading 4" }));
|
|
47
|
+
const e = o.getByText("Heading 4");
|
|
48
48
|
t(e).toHaveClass("lsd:text-[1.5rem]"), t(e).toHaveClass("lsd:leading-[2rem]"), t(e.tagName).toBe("H4");
|
|
49
|
-
}),
|
|
50
|
-
l(/* @__PURE__ */
|
|
51
|
-
const e =
|
|
49
|
+
}), s("applies h5 variant classes correctly", () => {
|
|
50
|
+
l(/* @__PURE__ */ a(r, { variant: "h5", children: "Heading 5" }));
|
|
51
|
+
const e = o.getByText("Heading 5");
|
|
52
52
|
t(e).toHaveClass("lsd:text-[1.25rem]"), t(e).toHaveClass("lsd:leading-[1.75rem]"), t(e.tagName).toBe("H5");
|
|
53
|
-
}),
|
|
54
|
-
l(/* @__PURE__ */
|
|
55
|
-
const e =
|
|
53
|
+
}), s("applies h6 variant classes correctly", () => {
|
|
54
|
+
l(/* @__PURE__ */ a(r, { variant: "h6", children: "Heading 6" }));
|
|
55
|
+
const e = o.getByText("Heading 6");
|
|
56
56
|
t(e).toHaveClass("lsd:text-[1rem]"), t(e).toHaveClass("lsd:leading-[1.5rem]"), t(e.tagName).toBe("H6");
|
|
57
|
-
}),
|
|
58
|
-
l(/* @__PURE__ */
|
|
59
|
-
const e =
|
|
57
|
+
}), s("applies subtitle1 variant classes correctly", () => {
|
|
58
|
+
l(/* @__PURE__ */ a(r, { variant: "subtitle1", children: "Subtitle 1" }));
|
|
59
|
+
const e = o.getByText("Subtitle 1");
|
|
60
60
|
t(e).toHaveClass("lsd:text-[1.125rem]"), t(e).toHaveClass("lsd:leading-[1.5rem]");
|
|
61
|
-
}),
|
|
62
|
-
l(/* @__PURE__ */
|
|
63
|
-
const e =
|
|
61
|
+
}), s("applies subtitle2 variant classes correctly", () => {
|
|
62
|
+
l(/* @__PURE__ */ a(r, { variant: "subtitle2", children: "Subtitle 2" }));
|
|
63
|
+
const e = o.getByText("Subtitle 2");
|
|
64
64
|
t(e).toHaveClass("lsd:text-[1rem]"), t(e).toHaveClass("lsd:leading-[1.5rem]");
|
|
65
|
-
}),
|
|
66
|
-
l(/* @__PURE__ */
|
|
67
|
-
const e =
|
|
65
|
+
}), s("applies subtitle3 variant classes correctly", () => {
|
|
66
|
+
l(/* @__PURE__ */ a(r, { variant: "subtitle3", children: "Subtitle 3" }));
|
|
67
|
+
const e = o.getByText("Subtitle 3");
|
|
68
68
|
t(e).toHaveClass("lsd:text-[0.875rem]"), t(e).toHaveClass("lsd:leading-[1.25rem]");
|
|
69
|
-
}),
|
|
70
|
-
l(/* @__PURE__ */
|
|
71
|
-
const e =
|
|
69
|
+
}), s("applies subtitle4 variant classes correctly", () => {
|
|
70
|
+
l(/* @__PURE__ */ a(r, { variant: "subtitle4", children: "Subtitle 4" }));
|
|
71
|
+
const e = o.getByText("Subtitle 4");
|
|
72
72
|
t(e).toHaveClass("lsd:text-[0.75rem]"), t(e).toHaveClass("lsd:leading-[1rem]");
|
|
73
|
-
}),
|
|
74
|
-
l(/* @__PURE__ */
|
|
75
|
-
const e =
|
|
73
|
+
}), s("applies body1 variant classes correctly", () => {
|
|
74
|
+
l(/* @__PURE__ */ a(r, { variant: "body1", children: "Body 1" }));
|
|
75
|
+
const e = o.getByText("Body 1");
|
|
76
76
|
t(e).toHaveClass("lsd:text-[1rem]"), t(e).toHaveClass("lsd:leading-[1.5rem]");
|
|
77
|
-
}),
|
|
78
|
-
l(/* @__PURE__ */
|
|
79
|
-
const e =
|
|
77
|
+
}), s("applies body2 variant classes correctly", () => {
|
|
78
|
+
l(/* @__PURE__ */ a(r, { variant: "body2", children: "Body 2" }));
|
|
79
|
+
const e = o.getByText("Body 2");
|
|
80
80
|
t(e).toHaveClass("lsd:text-[0.875rem]"), t(e).toHaveClass("lsd:leading-[1.25rem]");
|
|
81
|
-
}),
|
|
82
|
-
l(/* @__PURE__ */
|
|
83
|
-
const e =
|
|
81
|
+
}), s("applies body3 variant classes correctly", () => {
|
|
82
|
+
l(/* @__PURE__ */ a(r, { variant: "body3", children: "Body 3" }));
|
|
83
|
+
const e = o.getByText("Body 3");
|
|
84
84
|
t(e).toHaveClass("lsd:text-[0.75rem]"), t(e).toHaveClass("lsd:leading-[1rem]");
|
|
85
|
-
}),
|
|
86
|
-
l(/* @__PURE__ */
|
|
87
|
-
const e =
|
|
85
|
+
}), s("applies label1 variant classes correctly", () => {
|
|
86
|
+
l(/* @__PURE__ */ a(r, { variant: "label1", children: "Label 1" }));
|
|
87
|
+
const e = o.getByText("Label 1");
|
|
88
88
|
t(e).toHaveClass("lsd:text-[0.875rem]"), t(e).toHaveClass("lsd:leading-[1.25rem]"), t(e.tagName).toBe("LABEL");
|
|
89
|
-
}),
|
|
90
|
-
l(/* @__PURE__ */
|
|
91
|
-
const e =
|
|
89
|
+
}), s("applies label2 variant classes correctly", () => {
|
|
90
|
+
l(/* @__PURE__ */ a(r, { variant: "label2", children: "Label 2" }));
|
|
91
|
+
const e = o.getByText("Label 2");
|
|
92
92
|
t(e).toHaveClass("lsd:text-[0.75rem]"), t(e).toHaveClass("lsd:leading-[1rem]"), t(e.tagName).toBe("LABEL");
|
|
93
|
-
}),
|
|
94
|
-
l(/* @__PURE__ */
|
|
95
|
-
const e =
|
|
93
|
+
}), s("applies primary color classes correctly", () => {
|
|
94
|
+
l(/* @__PURE__ */ a(r, { color: "primary", children: "Primary" }));
|
|
95
|
+
const e = o.getByText("Primary");
|
|
96
96
|
t(e).toHaveClass("lsd:text-lsd-text-primary");
|
|
97
|
-
}),
|
|
98
|
-
l(/* @__PURE__ */
|
|
99
|
-
const e =
|
|
97
|
+
}), s("applies secondary color classes correctly", () => {
|
|
98
|
+
l(/* @__PURE__ */ a(r, { color: "secondary", children: "Secondary" }));
|
|
99
|
+
const e = o.getByText("Secondary");
|
|
100
100
|
t(e).toHaveClass("lsd:text-lsd-text-secondary");
|
|
101
|
-
}),
|
|
102
|
-
l(/* @__PURE__ */
|
|
103
|
-
const e =
|
|
101
|
+
}), s("applies destructive color classes correctly", () => {
|
|
102
|
+
l(/* @__PURE__ */ a(r, { color: "destructive", children: "Destructive" }));
|
|
103
|
+
const e = o.getByText("Destructive");
|
|
104
|
+
t(e).toHaveClass("lsd:text-lsd-destructive-text");
|
|
105
|
+
}), s("applies success color classes correctly", () => {
|
|
106
|
+
l(/* @__PURE__ */ a(r, { color: "success", children: "Success" }));
|
|
107
|
+
const e = o.getByText("Success");
|
|
108
|
+
t(e).toHaveClass("lsd:text-lsd-success-text");
|
|
109
|
+
}), s("applies warning color classes correctly", () => {
|
|
110
|
+
l(/* @__PURE__ */ a(r, { color: "warning", children: "Warning" }));
|
|
111
|
+
const e = o.getByText("Warning");
|
|
112
|
+
t(e).toHaveClass("lsd:text-lsd-warning-text");
|
|
113
|
+
}), s("applies info color classes correctly", () => {
|
|
114
|
+
l(/* @__PURE__ */ a(r, { color: "info", children: "Info" }));
|
|
115
|
+
const e = o.getByText("Info");
|
|
116
|
+
t(e).toHaveClass("lsd:text-lsd-info-text");
|
|
117
|
+
}), s("merges custom className with component classes", () => {
|
|
118
|
+
l(/* @__PURE__ */ a(r, { className: "custom-class", children: "Custom" }));
|
|
119
|
+
const e = o.getByText("Custom");
|
|
104
120
|
t(e).toHaveClass("custom-class");
|
|
105
|
-
}),
|
|
106
|
-
l(/* @__PURE__ */
|
|
107
|
-
const e =
|
|
121
|
+
}), s("allows overriding the as prop", () => {
|
|
122
|
+
l(/* @__PURE__ */ a(r, { as: "p", children: "Paragraph" }));
|
|
123
|
+
const e = o.getByText("Paragraph");
|
|
108
124
|
t(e.tagName).toBe("P");
|
|
109
|
-
}),
|
|
110
|
-
const e =
|
|
111
|
-
l(/* @__PURE__ */
|
|
112
|
-
}),
|
|
125
|
+
}), s("forwards ref to underlying element", () => {
|
|
126
|
+
const e = c.fn();
|
|
127
|
+
l(/* @__PURE__ */ a(r, { ref: e, children: "Ref Test" })), t(e).toHaveBeenCalled();
|
|
128
|
+
}), s("passes through additional props", () => {
|
|
113
129
|
l(
|
|
114
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ a(r, { "data-testid": "test-typography", id: "text-1", children: "Text" })
|
|
115
131
|
);
|
|
116
|
-
const e =
|
|
132
|
+
const e = o.getByText("Text");
|
|
117
133
|
t(e).toHaveAttribute("data-testid", "test-typography"), t(e).toHaveAttribute("id", "text-1");
|
|
118
|
-
}),
|
|
119
|
-
l(/* @__PURE__ */
|
|
134
|
+
}), s("display variants default to div element", () => {
|
|
135
|
+
l(/* @__PURE__ */ a(r, { variant: "display1", children: "Display" })), t(o.getByText("Display").tagName).toBe("DIV");
|
|
120
136
|
});
|
|
121
137
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
t(
|
|
138
|
+
i("typographyVariants", () => {
|
|
139
|
+
s("returns correct classes for display1 variant", () => {
|
|
140
|
+
t(n({ variant: "display1" })).toContain(
|
|
125
141
|
"lsd:text-[5.5rem]"
|
|
126
|
-
), t(
|
|
142
|
+
), t(n({ variant: "display1" })).toContain(
|
|
127
143
|
"lsd:leading-[6rem]"
|
|
128
144
|
);
|
|
129
|
-
}),
|
|
130
|
-
t(
|
|
145
|
+
}), s("returns correct classes for h1 variant", () => {
|
|
146
|
+
t(n({ variant: "h1" })).toContain(
|
|
131
147
|
"lsd:text-[2.5rem]"
|
|
132
|
-
), t(
|
|
148
|
+
), t(n({ variant: "h1" })).toContain(
|
|
133
149
|
"lsd:leading-[3rem]"
|
|
134
150
|
);
|
|
135
|
-
}),
|
|
136
|
-
t(
|
|
151
|
+
}), s("returns correct classes for body1 variant", () => {
|
|
152
|
+
t(n({ variant: "body1" })).toContain(
|
|
137
153
|
"lsd:text-[1rem]"
|
|
138
|
-
), t(
|
|
154
|
+
), t(n({ variant: "body1" })).toContain(
|
|
139
155
|
"lsd:leading-[1.5rem]"
|
|
140
156
|
);
|
|
141
|
-
}),
|
|
142
|
-
t(
|
|
157
|
+
}), s("returns correct classes for primary color", () => {
|
|
158
|
+
t(n({ color: "primary" })).toContain(
|
|
143
159
|
"lsd:text-lsd-text-primary"
|
|
144
160
|
);
|
|
145
|
-
}),
|
|
146
|
-
t(
|
|
161
|
+
}), s("returns correct classes for secondary color", () => {
|
|
162
|
+
t(n({ color: "secondary" })).toContain(
|
|
147
163
|
"lsd:text-lsd-text-secondary"
|
|
148
164
|
);
|
|
149
|
-
}),
|
|
150
|
-
t(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}),
|
|
154
|
-
|
|
165
|
+
}), s("returns correct classes for destructive color", () => {
|
|
166
|
+
t(n({ color: "destructive" })).toContain(
|
|
167
|
+
"lsd:text-lsd-destructive-text"
|
|
168
|
+
);
|
|
169
|
+
}), s("returns correct classes for success color", () => {
|
|
170
|
+
t(n({ color: "success" })).toContain(
|
|
171
|
+
"lsd:text-lsd-success-text"
|
|
172
|
+
);
|
|
173
|
+
}), s("returns correct classes for warning color", () => {
|
|
174
|
+
t(n({ color: "warning" })).toContain(
|
|
175
|
+
"lsd:text-lsd-warning-text"
|
|
176
|
+
);
|
|
177
|
+
}), s("returns correct classes for info color", () => {
|
|
178
|
+
t(n({ color: "info" })).toContain(
|
|
179
|
+
"lsd:text-lsd-info-text"
|
|
180
|
+
);
|
|
181
|
+
}), s("uses default variant when not specified", () => {
|
|
182
|
+
t(n({})).toContain("lsd:text-[1rem]");
|
|
183
|
+
}), s("uses default color when not specified", () => {
|
|
184
|
+
t(n({})).toContain("lsd:text-lsd-text-primary");
|
|
185
|
+
}), s("combines variant and color correctly", () => {
|
|
186
|
+
const e = n({ variant: "h2", color: "secondary" });
|
|
155
187
|
t(e).toContain("lsd:text-[2rem]"), t(e).toContain("lsd:text-lsd-text-secondary");
|
|
156
188
|
});
|
|
157
189
|
});
|
package/dist/lib/types.d.ts
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './components/ui/label';
|
|
|
13
13
|
export * from './components/ui/menubar';
|
|
14
14
|
export * from './components/ui/popover';
|
|
15
15
|
export * from './components/ui/progress';
|
|
16
|
+
export * from './components/ui/scroll-area';
|
|
16
17
|
export * from './components/ui/select';
|
|
17
18
|
export * from './components/ui/separator';
|
|
18
19
|
export * from './components/ui/sheet';
|