quirk-ui 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css.d.ts +5 -0
- package/dist/assets/index2.css.d.ts +5 -0
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index3.css.d.ts +11 -0
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index4.css.d.ts +8 -0
- package/dist/components/Button/Button.test.js +41 -0
- package/dist/components/Button/__mocks__/styles.module.css.js +9 -0
- package/dist/components/Button/index.js +17 -7
- package/dist/components/Heading/Heading.test.js +36 -0
- package/dist/components/Heading/__mocks__/styles.module.css.js +11 -0
- package/dist/components/Heading/index.js +21 -7
- package/dist/index-CGClT4BC.js +46235 -0
- package/dist/lib/components/Button/Button.test.d.ts +0 -0
- package/dist/lib/components/Button/__mocks__/styles.module.css.d.ts +7 -0
- package/dist/lib/components/Button/index.d.ts +11 -1
- package/dist/lib/components/Heading/Heading.test.d.ts +0 -0
- package/dist/lib/components/Heading/__mocks__/styles.module.css.d.ts +9 -0
- package/dist/lib/components/Heading/index.d.ts +290 -1
- package/dist/lib/main.d.ts +1 -0
- package/dist/magic-string.es-D4UQQyt0.js +859 -0
- package/dist/main.js +2 -0
- package/package.json +17 -4
package/dist/assets/index3.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
._h1_4y3bu_1,._h2_4y3bu_2,._h3_4y3bu_3,._h4_4y3bu_4,._h5_4y3bu_5,._h6_4y3bu_6{margin:0;padding:0;line-height:1.2}._h1_4y3bu_1+*,._h2_4y3bu_2+*,._h3_4y3bu_3+*,._h4_4y3bu_4+*,._h5_4y3bu_5+*,._h6_4y3bu_6+*{margin-top:.75rem}._h1_4y3bu_1[class*=bg],._h2_4y3bu_2[class*=bg],._h3_4y3bu_3[class*=bg],._h4_4y3bu_4[class*=bg],._h5_4y3bu_5[class*=bg],._h6_4y3bu_6[class*=bg]{padding:.5rem .75rem;border-radius:5px}._h1_4y3bu_1{font-size:2.25rem;font-weight:700}._h2_4y3bu_2{font-size:1.875rem;font-weight:600}._h3_4y3bu_3{font-size:1.5rem;font-weight:600}._h4_4y3bu_4{font-size:1.25rem;font-weight:500}._h5_4y3bu_5{font-size:1rem;font-weight:500}._h6_4y3bu_6{font-size:.875rem;font-weight:500}._heading_4y3bu_52+*{margin-top:.75rem}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
readonly "_h1_4y3bu_1": string;
|
|
3
|
+
readonly "_h2_4y3bu_2": string;
|
|
4
|
+
readonly "_h3_4y3bu_3": string;
|
|
5
|
+
readonly "_h4_4y3bu_4": string;
|
|
6
|
+
readonly "_h5_4y3bu_5": string;
|
|
7
|
+
readonly "_h6_4y3bu_6": string;
|
|
8
|
+
readonly "_heading_4y3bu_52": string;
|
|
9
|
+
};
|
|
10
|
+
export = styles;
|
|
11
|
+
|
package/dist/assets/index4.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_f8285_1{border-radius:8px;border:1px solid transparent;padding:1rem 1.25rem;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}._button_f8285_1:hover{border-color:#646cff}._button_f8285_1:focus,._button_f8285_1:focus-visible{outline:4px auto -webkit-focus-ring-color}._button_f8285_1._primary_f8285_21{background-color:#646cff}._button_f8285_1._secondary_f8285_25{background-color:purple}._button_f8285_1._ghost_f8285_29{background-color:transparent;border-color:#646cff}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { v as i, d as l, i as o, r as n, s as a, g as e, f as r } from "../../index-CGClT4BC.js";
|
|
3
|
+
import { Button as c } from "./index.js";
|
|
4
|
+
i.mock("./styles.module.css", () => ({
|
|
5
|
+
default: {
|
|
6
|
+
button: "button",
|
|
7
|
+
primary: "primary",
|
|
8
|
+
secondary: "secondary",
|
|
9
|
+
ghost: "ghost"
|
|
10
|
+
}
|
|
11
|
+
}));
|
|
12
|
+
l("Button", () => {
|
|
13
|
+
o('renders with default "primary" variant', () => {
|
|
14
|
+
n(/* @__PURE__ */ s(c, { children: "Click me" }));
|
|
15
|
+
const t = a.getByRole("button", { name: /click me/i });
|
|
16
|
+
e(t).toBeInTheDocument(), e(t.className).toContain("button"), e(t.className).toContain("primary");
|
|
17
|
+
}), o("applies custom className", () => {
|
|
18
|
+
n(/* @__PURE__ */ s(c, { className: "my-custom-class", children: "Custom Class" }));
|
|
19
|
+
const t = a.getByRole("button", { name: /custom class/i });
|
|
20
|
+
e(t.className).toContain("my-custom-class");
|
|
21
|
+
}), o("uses the correct variant class", () => {
|
|
22
|
+
n(/* @__PURE__ */ s(c, { variant: "ghost", children: "Ghost" }));
|
|
23
|
+
const t = a.getByRole("button", { name: /ghost/i });
|
|
24
|
+
e(t.className).toContain("ghost");
|
|
25
|
+
}), o("calls the onClick handler when clicked", () => {
|
|
26
|
+
const t = i.fn();
|
|
27
|
+
n(/* @__PURE__ */ s(c, { onClick: t, children: "Click me" })), r.click(a.getByRole("button")), e(t).toHaveBeenCalledTimes(1);
|
|
28
|
+
}), o("forwards all other props", () => {
|
|
29
|
+
n(
|
|
30
|
+
/* @__PURE__ */ s(c, { type: "submit", disabled: !0, children: "Submit" })
|
|
31
|
+
);
|
|
32
|
+
const t = a.getByRole("button", { name: /submit/i });
|
|
33
|
+
e(t).toHaveAttribute("type", "submit"), e(t).toBeDisabled();
|
|
34
|
+
}), o("renders children properly", () => {
|
|
35
|
+
n(
|
|
36
|
+
/* @__PURE__ */ s(c, { variant: "secondary", children: /* @__PURE__ */ s("span", { children: "Child Text" }) })
|
|
37
|
+
);
|
|
38
|
+
const t = a.getByText("Child Text");
|
|
39
|
+
e(t).toBeInTheDocument();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/index4.css';const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index4.css';const c = "_button_f8285_1", y = "_primary_f8285_21", _ = "_secondary_f8285_25", e = "_ghost_f8285_29", t = {
|
|
3
|
+
button: c,
|
|
4
|
+
primary: y,
|
|
5
|
+
secondary: _,
|
|
6
|
+
ghost: e
|
|
7
|
+
}, i = {
|
|
8
|
+
primary: t.primary,
|
|
9
|
+
secondary: t.secondary,
|
|
10
|
+
ghost: t.ghost
|
|
11
|
+
};
|
|
12
|
+
function p({
|
|
13
|
+
variant: o = "primary",
|
|
14
|
+
className: r,
|
|
15
|
+
children: s,
|
|
6
16
|
...n
|
|
7
17
|
}) {
|
|
8
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ a("button", { className: `${r ?? ""} ${t.button} ${i[o]}`, ...n, children: s });
|
|
9
19
|
}
|
|
10
20
|
export {
|
|
11
|
-
|
|
21
|
+
p as Button
|
|
12
22
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { v as h, d as i, i as t, r as a, s as d, g as s } from "../../index-CGClT4BC.js";
|
|
3
|
+
import { Heading as n } from "./index.js";
|
|
4
|
+
h.mock("./styles.module.css", () => ({
|
|
5
|
+
default: {
|
|
6
|
+
h1: "style-h1",
|
|
7
|
+
h2: "style-h2",
|
|
8
|
+
h3: "style-h3",
|
|
9
|
+
h4: "style-h4",
|
|
10
|
+
h5: "style-h5",
|
|
11
|
+
h6: "style-h6"
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
i("Heading", () => {
|
|
15
|
+
t("renders with default level (h1)", () => {
|
|
16
|
+
a(/* @__PURE__ */ l(n, { children: "Test Heading" }));
|
|
17
|
+
const e = d.getByText("Test Heading");
|
|
18
|
+
s(e.tagName).toBe("H1");
|
|
19
|
+
}), t("renders the correct heading level", () => {
|
|
20
|
+
a(/* @__PURE__ */ l(n, { level: 3, children: "Heading Level 3" }));
|
|
21
|
+
const e = d.getByText("Heading Level 3");
|
|
22
|
+
s(e.tagName).toBe("H3");
|
|
23
|
+
}), t("applies className and style from level", () => {
|
|
24
|
+
a(
|
|
25
|
+
/* @__PURE__ */ l(n, { level: 2, className: "custom-class", children: "Styled Heading" })
|
|
26
|
+
);
|
|
27
|
+
const e = d.getByText("Styled Heading");
|
|
28
|
+
s(e).toHaveClass("custom-class"), s(e).toHaveClass("style-h2");
|
|
29
|
+
}), t("renders children properly", () => {
|
|
30
|
+
a(
|
|
31
|
+
/* @__PURE__ */ l(n, { level: 4, children: /* @__PURE__ */ l("span", { children: "Child Text" }) })
|
|
32
|
+
);
|
|
33
|
+
const e = d.getByText("Child Text");
|
|
34
|
+
s(e).toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../assets/index3.css';const
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import o from "react";
|
|
2
|
+
import '../../assets/index3.css';const e = "_h1_4y3bu_1", a = "_h2_4y3bu_2", u = "_h3_4y3bu_3", y = "_h4_4y3bu_4", b = "_h5_4y3bu_5", i = "_h6_4y3bu_6", r = "_heading_4y3bu_52", d = {
|
|
3
|
+
h1: e,
|
|
4
|
+
h2: a,
|
|
5
|
+
h3: u,
|
|
6
|
+
h4: y,
|
|
7
|
+
h5: b,
|
|
8
|
+
h6: i,
|
|
9
|
+
heading: r
|
|
10
|
+
};
|
|
11
|
+
function l({
|
|
12
|
+
level: h = 1,
|
|
13
|
+
className: _,
|
|
5
14
|
children: t,
|
|
6
|
-
...
|
|
15
|
+
...n
|
|
7
16
|
}) {
|
|
8
|
-
|
|
17
|
+
const s = `h${h}`, c = d[`h${h}`] || "";
|
|
18
|
+
return o.createElement(
|
|
19
|
+
s,
|
|
20
|
+
{ className: `${_ ?? ""} ${c}`, ...n },
|
|
21
|
+
t
|
|
22
|
+
);
|
|
9
23
|
}
|
|
10
24
|
export {
|
|
11
|
-
|
|
25
|
+
l as Heading
|
|
12
26
|
};
|