@caseparts-org/caseblocks 0.0.1
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 +97 -0
- package/dist/Text.module-ruz24ug-.js +25 -0
- package/dist/assets/Account.css +1 -0
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/Chip.css +1 -0
- package/dist/assets/ChipSelector.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/Flex2.css +1 -0
- package/dist/assets/Grid.css +1 -0
- package/dist/assets/HideAt.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/Link.css +1 -0
- package/dist/assets/Logo.css +1 -0
- package/dist/assets/MainNav.css +1 -0
- package/dist/assets/Root.css +1 -0
- package/dist/assets/SearchBox.css +1 -0
- package/dist/assets/Separator.css +1 -0
- package/dist/assets/Text.css +1 -0
- package/dist/assets/ToggleView.css +1 -0
- package/dist/atoms/Button/Button.d.ts +7 -0
- package/dist/atoms/Button/Button.js +45 -0
- package/dist/atoms/Button/Button.stories.d.ts +15 -0
- package/dist/atoms/Button/Button.stories.js +40 -0
- package/dist/atoms/Flex/Flex.d.ts +13 -0
- package/dist/atoms/Flex/Flex.js +35 -0
- package/dist/atoms/Flex/Flex.stories.d.ts +14 -0
- package/dist/atoms/Flex/Flex.stories.js +131 -0
- package/dist/atoms/Grid/Grid.d.ts +25 -0
- package/dist/atoms/Grid/Grid.js +40 -0
- package/dist/atoms/Grid/Grid.stories.d.ts +17 -0
- package/dist/atoms/Grid/Grid.stories.js +58 -0
- package/dist/atoms/HideAt.d.ts +9 -0
- package/dist/atoms/HideAt.js +15 -0
- package/dist/atoms/Icon/Icon.d.ts +8 -0
- package/dist/atoms/Icon/Icon.js +33 -0
- package/dist/atoms/Icon/Icon.stories.d.ts +14 -0
- package/dist/atoms/Icon/Icon.stories.js +28 -0
- package/dist/atoms/Link/Link.d.ts +7 -0
- package/dist/atoms/Link/Link.js +35 -0
- package/dist/atoms/Link/Link.stories.d.ts +13 -0
- package/dist/atoms/Link/Link.stories.js +21 -0
- package/dist/atoms/ResponsiveProp.d.ts +2 -0
- package/dist/atoms/ResponsiveProp.js +14 -0
- package/dist/atoms/Root/Head.d.ts +1 -0
- package/dist/atoms/Root/Head.js +13 -0
- package/dist/atoms/Root/Root.d.ts +4 -0
- package/dist/atoms/Root/Root.js +10 -0
- package/dist/atoms/Separator/Separator.d.ts +7 -0
- package/dist/atoms/Separator/Separator.js +30 -0
- package/dist/atoms/Separator/Separator.stories.d.ts +13 -0
- package/dist/atoms/Separator/Separator.stories.js +33 -0
- package/dist/atoms/Text/Text.d.ts +15 -0
- package/dist/atoms/Text/Text.js +32 -0
- package/dist/atoms/Text/Text.stories.d.ts +17 -0
- package/dist/atoms/Text/Text.stories.js +89 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/main.d.ts +29 -0
- package/dist/main.js +37 -0
- package/dist/molecules/Account/Account.d.ts +13 -0
- package/dist/molecules/Account/Account.js +66 -0
- package/dist/molecules/Account/Account.stories.d.ts +14 -0
- package/dist/molecules/Account/Account.stories.js +26 -0
- package/dist/molecules/Avatar/Avatar.d.ts +6 -0
- package/dist/molecules/Avatar/Avatar.js +35 -0
- package/dist/molecules/Avatar/Avatar.stories.d.ts +13 -0
- package/dist/molecules/Avatar/Avatar.stories.js +17 -0
- package/dist/molecules/Chip/Chip.d.ts +57 -0
- package/dist/molecules/Chip/Chip.js +71 -0
- package/dist/molecules/Chip/Chip.stories.d.ts +15 -0
- package/dist/molecules/Chip/Chip.stories.js +53 -0
- package/dist/molecules/Logo/Logo.d.ts +1 -0
- package/dist/molecules/Logo/Logo.js +53 -0
- package/dist/molecules/Logo/Logo.stories.d.ts +13 -0
- package/dist/molecules/Logo/Logo.stories.js +17 -0
- package/dist/molecules/SearchBox/SearchBox.d.ts +6 -0
- package/dist/molecules/SearchBox/SearchBox.js +60 -0
- package/dist/molecules/SearchBox/SearchBox.stories.d.ts +12 -0
- package/dist/molecules/SearchBox/SearchBox.stories.js +15 -0
- package/dist/molecules/ToggleView/ToggleView.d.ts +75 -0
- package/dist/molecules/ToggleView/ToggleView.js +102 -0
- package/dist/molecules/ToggleView/ToggleView.stories.d.ts +13 -0
- package/dist/molecules/ToggleView/ToggleView.stories.js +24 -0
- package/dist/organisms/ChipSelector/ChipSelector.d.ts +12 -0
- package/dist/organisms/ChipSelector/ChipSelector.js +43 -0
- package/dist/organisms/ChipSelector/ChipSelector.stories.d.ts +14 -0
- package/dist/organisms/ChipSelector/ChipSelector.stories.js +51 -0
- package/dist/organisms/MainNav/MainNav.d.ts +4 -0
- package/dist/organisms/MainNav/MainNav.js +103 -0
- package/dist/organisms/MainNav/MainNav.stories.d.ts +13 -0
- package/dist/organisms/MainNav/MainNav.stories.js +24 -0
- package/dist/styles/tokens.css +243 -0
- package/package.json +73 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Link as t } from "./Link.js";
|
|
2
|
+
const a = {
|
|
3
|
+
title: "Case Parts/Atoms/Link",
|
|
4
|
+
component: t,
|
|
5
|
+
parameters: {
|
|
6
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ["autodocs"]
|
|
11
|
+
}, s = {
|
|
12
|
+
args: {
|
|
13
|
+
children: "Link text",
|
|
14
|
+
href: "#",
|
|
15
|
+
disabled: !1
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
s as Default,
|
|
20
|
+
a as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function u(r) {
|
|
2
|
+
return Array.isArray(r) ? r : [r, r, r];
|
|
3
|
+
}
|
|
4
|
+
function l(r, e) {
|
|
5
|
+
const [n, t, i] = u(e);
|
|
6
|
+
return {
|
|
7
|
+
[`--${r}-small`]: n,
|
|
8
|
+
[`--${r}-medium`]: t,
|
|
9
|
+
[`--${r}-large`]: i
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
l as responsivePropToCSSVariables
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Head(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/Root.css';const r = "_root_15hbp_39", s = {
|
|
3
|
+
root: r
|
|
4
|
+
};
|
|
5
|
+
function c({ children: o }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", { className: s.root, children: o });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
c as Root
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HideAtProps } from '../HideAt';
|
|
2
|
+
/** A visual separator between elements. */
|
|
3
|
+
export interface SeparatorProps extends React.HTMLAttributes<HTMLSpanElement>, HideAtProps {
|
|
4
|
+
/** Orient the separator in a specific direction. */
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
}
|
|
7
|
+
export declare function Separator({ orientation, hideAt, className, ...otherProps }: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { getHideAtStyles as c } from "../HideAt.js";
|
|
4
|
+
import '../../assets/Separator.css';const i = "_separator_1ucrf_1", r = {
|
|
5
|
+
separator: i,
|
|
6
|
+
"separator-vertical": "_separator-vertical_1ucrf_19",
|
|
7
|
+
"separator-horizontal": "_separator-horizontal_1ucrf_27"
|
|
8
|
+
};
|
|
9
|
+
function f({
|
|
10
|
+
orientation: a = "vertical",
|
|
11
|
+
hideAt: t,
|
|
12
|
+
className: o,
|
|
13
|
+
...e
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ s(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: p(
|
|
19
|
+
r.separator,
|
|
20
|
+
r[`separator-${a}`],
|
|
21
|
+
c(t),
|
|
22
|
+
o
|
|
23
|
+
),
|
|
24
|
+
...e
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
f as Separator
|
|
30
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Separator } from './Separator';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Separator;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export declare const Vertical: StoryObj<typeof Separator>;
|
|
13
|
+
export declare const Horizontal: StoryObj<typeof Separator>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Separator as t } from "./Separator.js";
|
|
3
|
+
import { Flex as i } from "../Flex/Flex.js";
|
|
4
|
+
import { Text as r } from "../Text/Text.js";
|
|
5
|
+
const s = {
|
|
6
|
+
title: "Case Parts/Atoms/Separator",
|
|
7
|
+
component: t,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered"
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"]
|
|
12
|
+
}, m = {
|
|
13
|
+
render: () => /* @__PURE__ */ o(i, { flexDirection: "row", style: { gap: "10px" }, children: [
|
|
14
|
+
/* @__PURE__ */ e(r, { size: "md", children: "Before" }),
|
|
15
|
+
/* @__PURE__ */ e(t, {}),
|
|
16
|
+
/* @__PURE__ */ e(r, { size: "md", children: "Middle" }),
|
|
17
|
+
/* @__PURE__ */ e(t, {}),
|
|
18
|
+
/* @__PURE__ */ e(r, { size: "md", children: "After" })
|
|
19
|
+
] })
|
|
20
|
+
}, c = {
|
|
21
|
+
render: () => /* @__PURE__ */ o(i, { flexDirection: "column", style: { gap: "10px", width: "50vw" }, children: [
|
|
22
|
+
/* @__PURE__ */ e(r, { size: "md", children: "Before" }),
|
|
23
|
+
/* @__PURE__ */ e(t, { orientation: "horizontal" }),
|
|
24
|
+
/* @__PURE__ */ e(r, { size: "md", children: "Middle" }),
|
|
25
|
+
/* @__PURE__ */ e(t, { orientation: "horizontal" }),
|
|
26
|
+
/* @__PURE__ */ e(r, { size: "md", children: "After" })
|
|
27
|
+
] })
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
c as Horizontal,
|
|
31
|
+
m as Vertical,
|
|
32
|
+
s as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HideAtProps } from '../HideAt';
|
|
2
|
+
type ElementType = keyof Pick<JSX.IntrinsicElements, "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div">;
|
|
3
|
+
/** A text element. */
|
|
4
|
+
export type TextProps<T extends ElementType = "span"> = HideAtProps & {
|
|
5
|
+
/** The HTML element to render as */
|
|
6
|
+
as?: ElementType;
|
|
7
|
+
/** The size of the text. */
|
|
8
|
+
size: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
9
|
+
/** The variant of the text. */
|
|
10
|
+
variant?: "body" | "display";
|
|
11
|
+
/** The weight of the text. */
|
|
12
|
+
weight?: "thin" | "extra-light" | "light" | "regular" | "medium" | "semibold" | "bold";
|
|
13
|
+
} & Omit<React.ComponentPropsWithoutRef<T>, "size">;
|
|
14
|
+
export declare function Text<T extends ElementType = "span">({ as, size, variant, weight, children, hideAt, className, ...otherProps }: TextProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { getHideAtStyles as i } from "../HideAt.js";
|
|
3
|
+
import { t } from "../../Text.module-ruz24ug-.js";
|
|
4
|
+
import { c } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
function d({
|
|
6
|
+
as: o,
|
|
7
|
+
size: e,
|
|
8
|
+
variant: r = "body",
|
|
9
|
+
weight: m = "regular",
|
|
10
|
+
children: s,
|
|
11
|
+
hideAt: n,
|
|
12
|
+
className: p,
|
|
13
|
+
...x
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ a(
|
|
16
|
+
o || "span",
|
|
17
|
+
{
|
|
18
|
+
className: c(
|
|
19
|
+
t[`text-${r}`],
|
|
20
|
+
t[`text-${e}`],
|
|
21
|
+
t[`text-${m}`],
|
|
22
|
+
i(n),
|
|
23
|
+
p
|
|
24
|
+
),
|
|
25
|
+
...x,
|
|
26
|
+
children: s
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
d as Text
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Text } from './Text';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Text;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const AllProps: Story;
|
|
14
|
+
export declare const Sizes: StoryObj<typeof Text>;
|
|
15
|
+
export declare const Variants: StoryObj<typeof Text>;
|
|
16
|
+
export declare const Weights: StoryObj<typeof Text>;
|
|
17
|
+
export declare const AsElementType: StoryObj<typeof Text>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { Text as i } from "./Text.js";
|
|
3
|
+
import { Flex as r } from "../Flex/Flex.js";
|
|
4
|
+
const p = {
|
|
5
|
+
title: "Case Parts/Atoms/Text",
|
|
6
|
+
component: i,
|
|
7
|
+
parameters: {
|
|
8
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
9
|
+
layout: "centered"
|
|
10
|
+
},
|
|
11
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
12
|
+
tags: ["autodocs"]
|
|
13
|
+
}, m = {
|
|
14
|
+
args: {
|
|
15
|
+
size: "sm",
|
|
16
|
+
children: "Text value"
|
|
17
|
+
}
|
|
18
|
+
}, a = [
|
|
19
|
+
"xxs",
|
|
20
|
+
"xs",
|
|
21
|
+
"sm",
|
|
22
|
+
"md",
|
|
23
|
+
"lg",
|
|
24
|
+
"xl",
|
|
25
|
+
"2xl",
|
|
26
|
+
"3xl",
|
|
27
|
+
"4xl",
|
|
28
|
+
"5xl",
|
|
29
|
+
"6xl"
|
|
30
|
+
], h = {
|
|
31
|
+
render: () => /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: a.map((e) => /* @__PURE__ */ l(i, { size: e, children: [
|
|
32
|
+
e.charAt(0).toUpperCase() + e.slice(1),
|
|
33
|
+
" Text"
|
|
34
|
+
] }, e)) })
|
|
35
|
+
}, n = ["body", "display"], y = {
|
|
36
|
+
render: () => /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: n.map((e) => /* @__PURE__ */ l(i, { size: "md", variant: e, children: [
|
|
37
|
+
"variant: ",
|
|
38
|
+
e
|
|
39
|
+
] }, e)) })
|
|
40
|
+
}, t = [
|
|
41
|
+
"thin",
|
|
42
|
+
"extra-light",
|
|
43
|
+
"light",
|
|
44
|
+
"regular",
|
|
45
|
+
"medium",
|
|
46
|
+
"semibold",
|
|
47
|
+
"bold"
|
|
48
|
+
], f = {
|
|
49
|
+
render: () => /* @__PURE__ */ l(r, { flexDirection: "row", style: { gap: "100px" }, children: [
|
|
50
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
|
|
51
|
+
/* @__PURE__ */ s(i, { size: "xl", weight: "bold", children: "`body` variant" }),
|
|
52
|
+
t.map((e) => /* @__PURE__ */ l(i, { size: "lg", weight: e, children: [
|
|
53
|
+
e,
|
|
54
|
+
" Text"
|
|
55
|
+
] }, e))
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
|
|
58
|
+
/* @__PURE__ */ s(i, { size: "xl", weight: "bold", variant: "display", children: "`display` variant" }),
|
|
59
|
+
t.map((e) => /* @__PURE__ */ l(i, { size: "lg", weight: e, variant: "display", children: [
|
|
60
|
+
e,
|
|
61
|
+
" Text"
|
|
62
|
+
] }, e))
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
65
|
+
}, d = [
|
|
66
|
+
"span",
|
|
67
|
+
"p",
|
|
68
|
+
"h1",
|
|
69
|
+
"h2",
|
|
70
|
+
"h3",
|
|
71
|
+
"h4",
|
|
72
|
+
"h5",
|
|
73
|
+
"h6",
|
|
74
|
+
"div"
|
|
75
|
+
], g = {
|
|
76
|
+
render: () => /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: d.map((e) => /* @__PURE__ */ l(i, { size: "lg", as: e, children: [
|
|
77
|
+
"Rendered as `",
|
|
78
|
+
e,
|
|
79
|
+
"` element"
|
|
80
|
+
] }, e)) })
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
m as AllProps,
|
|
84
|
+
g as AsElementType,
|
|
85
|
+
h as Sizes,
|
|
86
|
+
y as Variants,
|
|
87
|
+
f as Weights,
|
|
88
|
+
p as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as c
|
|
16
|
+
};
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { Button } from './atoms/Button/Button';
|
|
2
|
+
export type { ButtonProps } from './atoms/Button/Button';
|
|
3
|
+
export { Flex } from './atoms/Flex/Flex';
|
|
4
|
+
export type { FlexProps } from './atoms/Flex/Flex';
|
|
5
|
+
export { Grid, Column } from './atoms/Grid/Grid';
|
|
6
|
+
export type { GridProps, ColumnProps } from './atoms/Grid/Grid';
|
|
7
|
+
export { Head } from './atoms/Root/Head';
|
|
8
|
+
export { Icon } from './atoms/Icon/Icon';
|
|
9
|
+
export { Link } from './atoms/Link/Link';
|
|
10
|
+
export type { LinkProps } from './atoms/Link/Link';
|
|
11
|
+
export { Root } from './atoms/Root/Root';
|
|
12
|
+
export { Separator } from './atoms/Separator/Separator';
|
|
13
|
+
export type { SeparatorProps } from './atoms/Separator/Separator';
|
|
14
|
+
export { Text } from './atoms/Text/Text';
|
|
15
|
+
export type { TextProps } from './atoms/Text/Text';
|
|
16
|
+
export { Account } from './molecules/Account/Account';
|
|
17
|
+
export type { AccountProps } from './molecules/Account/Account';
|
|
18
|
+
export { Avatar } from './molecules/Avatar/Avatar';
|
|
19
|
+
export type { AvatarProps } from './molecules/Avatar/Avatar';
|
|
20
|
+
export { Chip } from './molecules/Chip/Chip';
|
|
21
|
+
export type { ChipProps } from './molecules/Chip/Chip';
|
|
22
|
+
export { Logo } from './molecules/Logo/Logo';
|
|
23
|
+
export { SearchBox } from './molecules/SearchBox/SearchBox';
|
|
24
|
+
export type { SearchBoxProps } from './molecules/SearchBox/SearchBox';
|
|
25
|
+
export { ToggleView } from './molecules/ToggleView/ToggleView';
|
|
26
|
+
export type { ToggleViewProps, ToggleOptionProps, ToggleOptionBaseProps, } from './molecules/ToggleView/ToggleView';
|
|
27
|
+
export { MainNav } from './organisms/MainNav/MainNav';
|
|
28
|
+
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
29
|
+
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Button as e } from "./atoms/Button/Button.js";
|
|
2
|
+
import { Flex as p } from "./atoms/Flex/Flex.js";
|
|
3
|
+
import { Column as m, Grid as f } from "./atoms/Grid/Grid.js";
|
|
4
|
+
import { Head as i } from "./atoms/Root/Head.js";
|
|
5
|
+
import { Icon as c } from "./atoms/Icon/Icon.js";
|
|
6
|
+
import { Link as g } from "./atoms/Link/Link.js";
|
|
7
|
+
import { Root as u } from "./atoms/Root/Root.js";
|
|
8
|
+
import { Separator as S } from "./atoms/Separator/Separator.js";
|
|
9
|
+
import { Text as v } from "./atoms/Text/Text.js";
|
|
10
|
+
import { Account as B } from "./molecules/Account/Account.js";
|
|
11
|
+
import { Avatar as T } from "./molecules/Avatar/Avatar.js";
|
|
12
|
+
import { Chip as w } from "./molecules/Chip/Chip.js";
|
|
13
|
+
import { Logo as G } from "./molecules/Logo/Logo.js";
|
|
14
|
+
import { SearchBox as I } from "./molecules/SearchBox/SearchBox.js";
|
|
15
|
+
import { ToggleView as N } from "./molecules/ToggleView/ToggleView.js";
|
|
16
|
+
import { MainNav as V } from "./organisms/MainNav/MainNav.js";
|
|
17
|
+
import { ChipSelector as j } from "./organisms/ChipSelector/ChipSelector.js";
|
|
18
|
+
export {
|
|
19
|
+
B as Account,
|
|
20
|
+
T as Avatar,
|
|
21
|
+
e as Button,
|
|
22
|
+
w as Chip,
|
|
23
|
+
j as ChipSelector,
|
|
24
|
+
m as Column,
|
|
25
|
+
p as Flex,
|
|
26
|
+
f as Grid,
|
|
27
|
+
i as Head,
|
|
28
|
+
c as Icon,
|
|
29
|
+
g as Link,
|
|
30
|
+
G as Logo,
|
|
31
|
+
V as MainNav,
|
|
32
|
+
u as Root,
|
|
33
|
+
I as SearchBox,
|
|
34
|
+
S as Separator,
|
|
35
|
+
v as Text,
|
|
36
|
+
N as ToggleView
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HideAtProps } from '../../atoms/HideAt';
|
|
2
|
+
/** Base props shared by all account types */
|
|
3
|
+
export interface AccountProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
4
|
+
account?: {
|
|
5
|
+
/** The account number. */
|
|
6
|
+
number: string;
|
|
7
|
+
/** The account user's name. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The account user's initials. */
|
|
10
|
+
initials: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { getHideAtStyles as d } from "../../atoms/HideAt.js";
|
|
3
|
+
import { Icon as g } from "../../atoms/Icon/Icon.js";
|
|
4
|
+
import { Text as n } from "../../atoms/Text/Text.js";
|
|
5
|
+
import { Avatar as c } from "../Avatar/Avatar.js";
|
|
6
|
+
import { Flex as t } from "../../atoms/Flex/Flex.js";
|
|
7
|
+
import { Button as f } from "../../atoms/Button/Button.js";
|
|
8
|
+
import { c as a } from "../../clsx-OuTLNxxd.js";
|
|
9
|
+
import { Link as h } from "../../atoms/Link/Link.js";
|
|
10
|
+
import '../../assets/Account.css';const u = "_loggedIn_14vhg_1", x = "_customer_14vhg_9", o = {
|
|
11
|
+
loggedIn: u,
|
|
12
|
+
customer: x
|
|
13
|
+
};
|
|
14
|
+
function A(e) {
|
|
15
|
+
return e.account !== void 0;
|
|
16
|
+
}
|
|
17
|
+
function H(e) {
|
|
18
|
+
return A(e) ? /* @__PURE__ */ i(I, { ...e }) : /* @__PURE__ */ i(p, { ...e });
|
|
19
|
+
}
|
|
20
|
+
function I({
|
|
21
|
+
account: e,
|
|
22
|
+
className: m,
|
|
23
|
+
hideAt: s,
|
|
24
|
+
...l
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
27
|
+
t,
|
|
28
|
+
{
|
|
29
|
+
flexDirection: "row",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
className: a(o.loggedIn, d(s), m),
|
|
32
|
+
...l,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ r(
|
|
35
|
+
t,
|
|
36
|
+
{
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
alignItems: "flex-end",
|
|
39
|
+
hideAt: ["sm", "md"],
|
|
40
|
+
className: o.customer,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ r(n, { size: "xxs", children: [
|
|
43
|
+
"Acct: ",
|
|
44
|
+
e == null ? void 0 : e.number
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ i(h, { href: "#", children: /* @__PURE__ */ r(n, { size: "sm", variant: "display", children: [
|
|
47
|
+
"Hello ",
|
|
48
|
+
e == null ? void 0 : e.name
|
|
49
|
+
] }) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ i(c, { initials: e.initials })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function p(e) {
|
|
59
|
+
return /* @__PURE__ */ r(t, { flexDirection: "row", alignItems: "center", ...e, children: [
|
|
60
|
+
/* @__PURE__ */ i(f, { size: "sm", variant: "primary", hideAt: ["sm", "md"], children: "Sign In / Register" }),
|
|
61
|
+
/* @__PURE__ */ i(g, { iconKey: "fa-kit fa-user-anon", size: "lg", hideAt: "lg" })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
H as Account
|
|
66
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Account } from './Account';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Account;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Unauthenticated: Story;
|
|
14
|
+
export declare const Authenticated: Story;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Account as t } from "./Account.js";
|
|
2
|
+
const a = {
|
|
3
|
+
title: "Case Parts/Molecules/Account",
|
|
4
|
+
component: t,
|
|
5
|
+
parameters: {
|
|
6
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ["autodocs"]
|
|
11
|
+
}, n = {
|
|
12
|
+
args: {}
|
|
13
|
+
}, o = {
|
|
14
|
+
args: {
|
|
15
|
+
account: {
|
|
16
|
+
name: "Ringo",
|
|
17
|
+
initials: "RS",
|
|
18
|
+
number: "123456789012"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
o as Authenticated,
|
|
24
|
+
n as Unauthenticated,
|
|
25
|
+
a as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HideAtProps } from '../../atoms/HideAt';
|
|
2
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
3
|
+
/** The user's initials (2 characters) */
|
|
4
|
+
initials: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Avatar({ initials, className, hideAt, ...otherProps }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as i } from "../../atoms/Flex/Flex.js";
|
|
3
|
+
import { getHideAtStyles as m } from "../../atoms/HideAt.js";
|
|
4
|
+
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import { t } from "../../Text.module-ruz24ug-.js";
|
|
6
|
+
import '../../assets/Avatar.css';const c = "_avatar_18kx8_1", l = {
|
|
7
|
+
avatar: c
|
|
8
|
+
};
|
|
9
|
+
function d({
|
|
10
|
+
initials: r,
|
|
11
|
+
className: e,
|
|
12
|
+
hideAt: a,
|
|
13
|
+
...o
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ s(
|
|
16
|
+
i,
|
|
17
|
+
{
|
|
18
|
+
flexDirection: "row",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
className: n(
|
|
22
|
+
l.avatar,
|
|
23
|
+
t["text-display"],
|
|
24
|
+
t["text-md"],
|
|
25
|
+
m(a),
|
|
26
|
+
e
|
|
27
|
+
),
|
|
28
|
+
...o,
|
|
29
|
+
children: r.substring(0, 2)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
d as Avatar
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Avatar } from './Avatar';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Avatar;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Avatar as t } from "./Avatar.js";
|
|
2
|
+
const e = {
|
|
3
|
+
title: "Case Parts/Molecules/Avatar",
|
|
4
|
+
component: t,
|
|
5
|
+
parameters: {
|
|
6
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ["autodocs"]
|
|
11
|
+
}, o = {
|
|
12
|
+
args: { initials: "RS" }
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
o as Default,
|
|
16
|
+
e as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HideAtProps } from '../../atoms/HideAt';
|
|
2
|
+
export interface ChipProps extends React.ButtonHTMLAttributes<HTMLDivElement>, HideAtProps {
|
|
3
|
+
selected?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
text: string;
|
|
6
|
+
variant?: "selectable" | "dismissable" | "pill";
|
|
7
|
+
styleVariant?: "primary" | "secondary" | "error";
|
|
8
|
+
onDismiss?: () => void;
|
|
9
|
+
onSelect?: () => void;
|
|
10
|
+
count?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A versatile `Chip` component that can be used in various contexts such as selectable, dismissable, or as a pill.
|
|
14
|
+
*
|
|
15
|
+
* - **Stateless**: The component is stateless and relies on the parent to manage its state (e.g., `selected`).
|
|
16
|
+
* - **Variants**:
|
|
17
|
+
* - `selectable`: Can be selected or deselected.
|
|
18
|
+
* - `dismissable`: Includes a dismiss button.
|
|
19
|
+
* - `pill`: A pill-shaped chip.
|
|
20
|
+
*
|
|
21
|
+
* ### Props
|
|
22
|
+
* - `selected` (boolean): Indicates whether the chip is selected (used in `selectable` variant).
|
|
23
|
+
* - `disabled` (boolean): Disables the chip, preventing interactions.
|
|
24
|
+
* - `text` (string): The text content displayed inside the chip.
|
|
25
|
+
* - `variant` (`"selectable" | "dismissable" | "pill"`): The type of chip to render.
|
|
26
|
+
* - `styleVariant` (`"primary" | "secondary" | "error"`): The style variant for the chip (applies to `dismissable` variant).
|
|
27
|
+
* - `onDismiss` (function): Callback fired when the dismiss button is clicked (used in `dismissable` variant).
|
|
28
|
+
* - `onSelect` (function): Callback fired when the chip is clicked (used in `selectable` variant).
|
|
29
|
+
* - `count` (number): An optional count to display next to the chip text.
|
|
30
|
+
*
|
|
31
|
+
* ### Examples
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // Selectable chip
|
|
34
|
+
* <Chip
|
|
35
|
+
* variant="selectable"
|
|
36
|
+
* selected={true}
|
|
37
|
+
* text="Selectable Chip"
|
|
38
|
+
* onSelect={() => console.log("Chip selected!")}
|
|
39
|
+
* />
|
|
40
|
+
*
|
|
41
|
+
* // Dismissable chip
|
|
42
|
+
* <Chip
|
|
43
|
+
* variant="dismissable"
|
|
44
|
+
* text="Dismissable Chip"
|
|
45
|
+
* styleVariant="error"
|
|
46
|
+
* onDismiss={() => console.log("Chip dismissed!")}
|
|
47
|
+
* />
|
|
48
|
+
*
|
|
49
|
+
* // Pill chip
|
|
50
|
+
* <Chip
|
|
51
|
+
* variant="pill"
|
|
52
|
+
* text="Pill Chip"
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function Chip({ selected, text, hideAt, className, disabled, count, variant, styleVariant, // Default style variant
|
|
57
|
+
onDismiss, onSelect, ...otherProps }: ChipProps): import("react/jsx-runtime").JSX.Element;
|