@caseparts-org/caseblocks 0.0.248 → 0.0.250
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/Modal.css +1 -1
- package/dist/assets/Pill.css +1 -1
- package/dist/atoms/Pill/Pill.d.ts +6 -3
- package/dist/atoms/Pill/Pill.js +54 -32
- package/dist/atoms/Pill/Pill.stories.d.ts +1 -0
- package/dist/atoms/Pill/Pill.stories.js +22 -16
- package/dist/molecules/Modal/Modal.js +28 -28
- package/package.json +1 -1
package/dist/assets/Modal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._overlay_62mbc_1{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:2000}._container_62mbc_11{background-color:var(--surface-surface-primary);color:var(--text-text-primary);border-radius:var(--border-radius-sm);box-shadow:0 4px 6px #0000001a;width:min(800px,92vw);max-height:80vh;display:flex;flex-direction:column;overflow:hidden}@media (max-width:767px){._container_62mbc_11{border-radius:0;width:100%;box-shadow:none;height:100dvh;max-height:100dvh}}._toolbar_62mbc_30{position:sticky;top:0;display:flex;flex-direction:row;align-items:center;justify-content:space-between;background-color:var(--surface-surface-secondary);border-bottom:1px solid var(--border-border-secondary-btn);padding:var(--spacing-spacing-2xs) var(--spacing-spacing-default);gap:var(--spacing-spacing-2xs);z-index:1}@media (max-width:767px){._toolbar_62mbc_30{padding:var(--spacing-spacing-2xs)}}._toolbarPlain_62mbc_47{background-color:transparent;border-bottom:none}._headerGroup_62mbc_52{display:flex;flex-direction:row;align-items:center;gap:var(--spacing-spacing-2xs);flex:1 1 0}._headerLeft_62mbc_60{justify-content:flex-start}._headerRight_62mbc_64{justify-content:flex-end}._closeButton_62mbc_68{position:absolute;right:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;border-radius:var(--radius-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background-color .2s ease-in}._closeButton_62mbc_68:hover{background-color:var(--color-neutrals-neutral-2)}._content_62mbc_87{overflow:auto;padding:var(--spacing-spacing-default)}@media (max-width:767px){._content_62mbc_87{padding:var(--spacing-spacing-2xs)}}
|
package/dist/assets/Pill.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._pill_i5js9_1{display:flex;justify-content:center;align-items:center;border-radius:28px;border:1px solid}._pill-xs_i5js9_17{padding:2px 10px}._pill-sm_i5js9_25{padding:2px 12px}._pill-md_i5js9_33{padding:4px 16px}._pill-color-neutral_i5js9_41{background:var(--color-neutrals-neutral-1)}._pill-color-secondary_i5js9_49{background:var(--color-brand-secondary-lt-teal-blue)}._pill-color-caution-tips_i5js9_57{background:var(--color-brand-secondary-lt-yellow)}._pill-color-warning_i5js9_65{background:var(--color-brand-secondary-lt-orange)}._pill-color-success_i5js9_73{background:var(--color-brand-secondary-lt-green)}._pill-color-error-warning_i5js9_81{background:var(--color-brand-secondary-lt-red)}._pill-border-neutral_i5js9_89{border-color:var(--border-border-primary)}._pill-border-secondary_i5js9_97{border-color:var(--border-border-primary-chit)}._pill-border-caution-tips_i5js9_105{border-color:var(--border-border-help)}._pill-border-warning_i5js9_113{border-color:var(--border-border-warning)}._pill-border-success_i5js9_121{border-color:var(--border-border-success)}._pill-border-error-warning_i5js9_129{border-color:var(--border-border-error-warning)}._noBorder_i5js9_137{border:none}._uppercase_i5js9_145{text-transform:uppercase;letter-spacing:.03em}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { TextColorToken } from '../Text/Text';
|
|
2
|
+
import { TextColorToken, TextWeight } from '../Text/Text';
|
|
3
3
|
export interface PillProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
colorToken?: "neutral" | "secondary" | "caution-tips" | "warning" | "success" | "error-warning";
|
|
6
6
|
customColor?: string;
|
|
7
7
|
textColorToken?: TextColorToken;
|
|
8
|
-
|
|
8
|
+
weight?: TextWeight;
|
|
9
|
+
uppercase?: boolean;
|
|
10
|
+
hideBorder?: boolean;
|
|
11
|
+
size?: "xs" | "sm" | "md";
|
|
9
12
|
className?: string;
|
|
10
13
|
}
|
|
11
|
-
export declare function Pill({ colorToken, textColorToken, customColor, size, className, children, ...otherProps }: PillProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Pill({ colorToken, textColorToken, customColor, weight, uppercase, hideBorder, size, className, children, ...otherProps }: PillProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/atoms/Pill/Pill.js
CHANGED
|
@@ -1,42 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Text as
|
|
3
|
-
import { c as
|
|
4
|
-
import '../../assets/Pill.css';const
|
|
5
|
-
pill:
|
|
6
|
-
"pill-xs": "_pill-
|
|
7
|
-
"pill-sm": "_pill-
|
|
8
|
-
"pill-md": "_pill-
|
|
9
|
-
"pill-color-neutral": "_pill-color-
|
|
10
|
-
"pill-color-secondary": "_pill-color-
|
|
11
|
-
"pill-color-caution-tips": "_pill-color-caution-
|
|
12
|
-
"pill-color-warning": "_pill-color-
|
|
13
|
-
"pill-color-success": "_pill-color-
|
|
14
|
-
"pill-color-error-warning": "_pill-color-error-
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Text as u } from "../Text/Text.js";
|
|
3
|
+
import { c as _ } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import '../../assets/Pill.css';const j = "_pill_i5js9_1", m = "_noBorder_i5js9_137", b = "_uppercase_i5js9_145", r = {
|
|
5
|
+
pill: j,
|
|
6
|
+
"pill-xs": "_pill-xs_i5js9_17",
|
|
7
|
+
"pill-sm": "_pill-sm_i5js9_25",
|
|
8
|
+
"pill-md": "_pill-md_i5js9_33",
|
|
9
|
+
"pill-color-neutral": "_pill-color-neutral_i5js9_41",
|
|
10
|
+
"pill-color-secondary": "_pill-color-secondary_i5js9_49",
|
|
11
|
+
"pill-color-caution-tips": "_pill-color-caution-tips_i5js9_57",
|
|
12
|
+
"pill-color-warning": "_pill-color-warning_i5js9_65",
|
|
13
|
+
"pill-color-success": "_pill-color-success_i5js9_73",
|
|
14
|
+
"pill-color-error-warning": "_pill-color-error-warning_i5js9_81",
|
|
15
|
+
"pill-border-neutral": "_pill-border-neutral_i5js9_89",
|
|
16
|
+
"pill-border-secondary": "_pill-border-secondary_i5js9_97",
|
|
17
|
+
"pill-border-caution-tips": "_pill-border-caution-tips_i5js9_105",
|
|
18
|
+
"pill-border-warning": "_pill-border-warning_i5js9_113",
|
|
19
|
+
"pill-border-success": "_pill-border-success_i5js9_121",
|
|
20
|
+
"pill-border-error-warning": "_pill-border-error-warning_i5js9_129",
|
|
21
|
+
noBorder: m,
|
|
22
|
+
uppercase: b
|
|
15
23
|
};
|
|
16
|
-
function
|
|
17
|
-
colorToken:
|
|
18
|
-
textColorToken:
|
|
19
|
-
customColor:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
function y({
|
|
25
|
+
colorToken: l = "success",
|
|
26
|
+
textColorToken: e,
|
|
27
|
+
customColor: s,
|
|
28
|
+
weight: c = "medium",
|
|
29
|
+
uppercase: n = !1,
|
|
30
|
+
hideBorder: o = !1,
|
|
31
|
+
size: i = "xs",
|
|
32
|
+
className: a,
|
|
33
|
+
children: d,
|
|
34
|
+
...t
|
|
24
35
|
}) {
|
|
25
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ p(
|
|
26
37
|
"span",
|
|
27
38
|
{
|
|
28
|
-
className:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
className: _(
|
|
40
|
+
r.pill,
|
|
41
|
+
r[`pill-color-${l}`],
|
|
42
|
+
r[`pill-${i}`],
|
|
43
|
+
!o && r[`pill-border-${l}`],
|
|
44
|
+
o && r.noBorder,
|
|
45
|
+
a
|
|
33
46
|
),
|
|
34
|
-
style:
|
|
35
|
-
...
|
|
36
|
-
children: /* @__PURE__ */
|
|
47
|
+
style: s ? { background: s } : void 0,
|
|
48
|
+
...t,
|
|
49
|
+
children: /* @__PURE__ */ p(
|
|
50
|
+
u,
|
|
51
|
+
{
|
|
52
|
+
size: i === "xs" ? "xxs" : i === "sm" ? "xs" : "sm",
|
|
53
|
+
weight: c,
|
|
54
|
+
colorToken: e ?? (l === "neutral" ? "primary" : l === "secondary" ? "secondary" : l === "success" ? "success" : l === "error-warning" ? "error-warning" : "warning"),
|
|
55
|
+
className: _(n && r.uppercase),
|
|
56
|
+
children: d
|
|
57
|
+
}
|
|
58
|
+
)
|
|
37
59
|
}
|
|
38
60
|
);
|
|
39
61
|
}
|
|
40
62
|
export {
|
|
41
|
-
|
|
63
|
+
y as Pill
|
|
42
64
|
};
|
|
@@ -15,3 +15,4 @@ export declare const Variants: StoryObj<typeof Pill>;
|
|
|
15
15
|
export declare const Sizes: StoryObj<typeof Pill>;
|
|
16
16
|
export declare const TextColors: StoryObj<typeof Pill>;
|
|
17
17
|
export declare const CustomColor: StoryObj<typeof Pill>;
|
|
18
|
+
export declare const WithoutBorder: Story;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Pill as
|
|
1
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Pill as s } from "./Pill.js";
|
|
3
3
|
const a = {
|
|
4
4
|
title: "Case Parts/Atoms/Pill",
|
|
5
|
-
component:
|
|
5
|
+
component: s,
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: "centered"
|
|
8
8
|
},
|
|
9
9
|
tags: ["autodocs"]
|
|
10
10
|
}, d = {
|
|
11
11
|
args: {
|
|
12
|
-
children: "
|
|
12
|
+
children: "Success",
|
|
13
13
|
colorToken: "success",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
size: "md"
|
|
14
|
+
weight: "semibold",
|
|
15
|
+
uppercase: !0
|
|
17
16
|
}
|
|
18
17
|
}, n = [
|
|
19
18
|
"neutral",
|
|
@@ -29,16 +28,16 @@ const a = {
|
|
|
29
28
|
"success",
|
|
30
29
|
"warning",
|
|
31
30
|
"error-warning"
|
|
32
|
-
],
|
|
33
|
-
render: () => /* @__PURE__ */
|
|
34
|
-
},
|
|
35
|
-
render: () => /* @__PURE__ */
|
|
31
|
+
], p = {
|
|
32
|
+
render: () => /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: n.map((e) => /* @__PURE__ */ r(s, { colorToken: e, children: e }, e)) })
|
|
33
|
+
}, c = ["xs", "sm", "md"], m = {
|
|
34
|
+
render: () => /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: c.map((e) => /* @__PURE__ */ o(s, { size: e, colorToken: "secondary", children: [
|
|
36
35
|
e.toUpperCase(),
|
|
37
36
|
" size"
|
|
38
37
|
] }, e)) })
|
|
39
38
|
}, u = {
|
|
40
|
-
render: () => /* @__PURE__ */
|
|
41
|
-
|
|
39
|
+
render: () => /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: t.map((e) => /* @__PURE__ */ r(
|
|
40
|
+
s,
|
|
42
41
|
{
|
|
43
42
|
size: "sm",
|
|
44
43
|
colorToken: "secondary",
|
|
@@ -48,13 +47,20 @@ const a = {
|
|
|
48
47
|
e
|
|
49
48
|
)) })
|
|
50
49
|
}, x = {
|
|
51
|
-
render: () => /* @__PURE__ */ s
|
|
50
|
+
render: () => /* @__PURE__ */ r(s, { size: "sm", customColor: "#7c3aed", textColorToken: "default-inverted", children: "Custom purple" })
|
|
51
|
+
}, h = {
|
|
52
|
+
args: {
|
|
53
|
+
children: "No border",
|
|
54
|
+
colorToken: "secondary",
|
|
55
|
+
hideBorder: !0
|
|
56
|
+
}
|
|
52
57
|
};
|
|
53
58
|
export {
|
|
54
59
|
d as AllProps,
|
|
55
60
|
x as CustomColor,
|
|
56
|
-
|
|
61
|
+
m as Sizes,
|
|
57
62
|
u as TextColors,
|
|
58
|
-
|
|
63
|
+
p as Variants,
|
|
64
|
+
h as WithoutBorder,
|
|
59
65
|
a as default
|
|
60
66
|
};
|
|
@@ -2,15 +2,15 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import f from "react";
|
|
3
3
|
import { c as s } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { Text as h } from "../../atoms/Text/Text.js";
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/Modal.css';const
|
|
7
|
-
overlay:
|
|
5
|
+
import { Icon as b } from "../../atoms/Icon/Icon.js";
|
|
6
|
+
import '../../assets/Modal.css';const p = "_overlay_62mbc_1", g = "_container_62mbc_11", v = "_toolbar_62mbc_30", y = "_toolbarPlain_62mbc_47", T = "_headerGroup_62mbc_52", x = "_headerLeft_62mbc_60", z = "_headerRight_62mbc_64", B = "_closeButton_62mbc_68", M = "_content_62mbc_87", r = {
|
|
7
|
+
overlay: p,
|
|
8
8
|
container: g,
|
|
9
|
-
toolbar:
|
|
10
|
-
toolbarPlain:
|
|
11
|
-
headerGroup:
|
|
12
|
-
headerLeft:
|
|
13
|
-
headerRight:
|
|
9
|
+
toolbar: v,
|
|
10
|
+
toolbarPlain: y,
|
|
11
|
+
headerGroup: T,
|
|
12
|
+
headerLeft: x,
|
|
13
|
+
headerRight: z,
|
|
14
14
|
closeButton: B,
|
|
15
15
|
content: M
|
|
16
16
|
}, N = {
|
|
@@ -25,13 +25,13 @@ import '../../assets/Modal.css';const z = "_overlay_1n58z_1", g = "_container_1n
|
|
|
25
25
|
isOpen: t,
|
|
26
26
|
onClose: o,
|
|
27
27
|
closeOnOverlayClick: e = !0,
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
30
|
-
...
|
|
28
|
+
className: c,
|
|
29
|
+
children: l,
|
|
30
|
+
...m
|
|
31
31
|
}) => {
|
|
32
32
|
const a = f.useRef(!1);
|
|
33
33
|
if (!t) return null;
|
|
34
|
-
const
|
|
34
|
+
const u = (d) => {
|
|
35
35
|
e && (a.current = d.target === d.currentTarget);
|
|
36
36
|
}, _ = (d) => {
|
|
37
37
|
if (!e) {
|
|
@@ -40,36 +40,36 @@ import '../../assets/Modal.css';const z = "_overlay_1n58z_1", g = "_container_1n
|
|
|
40
40
|
}
|
|
41
41
|
a.current && d.target === d.currentTarget && o(), a.current = !1;
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ n("div", { className: s(r.overlay), onMouseDown:
|
|
44
|
-
},
|
|
43
|
+
return /* @__PURE__ */ n("div", { className: s(r.overlay), onMouseDown: u, onMouseUp: _, children: /* @__PURE__ */ n("div", { className: s(r.container, c), role: "dialog", "aria-modal": "true", ...m, children: l }) });
|
|
44
|
+
}, w = ({ variant: t = "standard", className: o, children: e, ...c }) => /* @__PURE__ */ n(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
className: s(r.toolbar, t === "plain" && r.toolbarPlain, o),
|
|
48
|
-
...
|
|
48
|
+
...c,
|
|
49
49
|
children: e
|
|
50
50
|
}
|
|
51
|
-
),
|
|
51
|
+
), C = ({
|
|
52
52
|
align: t = "left",
|
|
53
53
|
size: o = "md",
|
|
54
54
|
variant: e = "display",
|
|
55
|
-
className:
|
|
56
|
-
children:
|
|
57
|
-
...
|
|
55
|
+
className: c,
|
|
56
|
+
children: l,
|
|
57
|
+
...m
|
|
58
58
|
}) => {
|
|
59
|
-
const a = typeof
|
|
59
|
+
const a = typeof l == "string";
|
|
60
60
|
return /* @__PURE__ */ n(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
className: s(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight,
|
|
64
|
-
...
|
|
65
|
-
children: a ? /* @__PURE__ */ n(h, { as: "div", size: N[o], variant: e, children:
|
|
63
|
+
className: s(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, c),
|
|
64
|
+
...m,
|
|
65
|
+
children: a ? /* @__PURE__ */ n(h, { as: "div", size: N[o], variant: e, weight: "medium", children: l }) : l
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
|
-
},
|
|
69
|
-
i.Toolbar =
|
|
70
|
-
i.Header =
|
|
71
|
-
i.CloseButton =
|
|
72
|
-
i.Content =
|
|
68
|
+
}, G = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ n("button", { type: "button", className: s(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ n(b, { iconKey: "fa-regular fa-xmark", size: R[t] }) }), L = ({ className: t, children: o, ...e }) => /* @__PURE__ */ n("div", { className: s(r.content, t), ...e, children: o });
|
|
69
|
+
i.Toolbar = w;
|
|
70
|
+
i.Header = C;
|
|
71
|
+
i.CloseButton = G;
|
|
72
|
+
i.Content = L;
|
|
73
73
|
export {
|
|
74
74
|
i as Modal
|
|
75
75
|
};
|