@caseparts-org/caseblocks 0.0.21 → 0.0.23
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/SearchBox.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/atoms/Link/Link.d.ts +10 -2
- package/dist/atoms/Link/Link.js +50 -29
- package/dist/molecules/Cart/Cart.js +10 -11
- package/dist/molecules/CategoryNav/CategoryNav.js +11 -13
- package/dist/molecules/SearchBox/SearchBox.js +14 -14
- package/dist/molecules/Tooltip/Tooltip.d.ts +11 -8
- package/dist/molecules/Tooltip/Tooltip.js +277 -487
- package/dist/molecules/Tooltip/Tooltip.stories.d.ts +2 -13
- package/dist/molecules/Tooltip/Tooltip.stories.js +28 -33
- package/package.json +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_11jol_1{box-sizing:border-box;cursor:pointer;width:var(--spacing-2-5);height:var(--spacing-2-5);padding:var(--spacing-0-5);border-width:0;border-radius:0px var(--spacing-0-125) var(--spacing-0-125) 0px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:inherit;color:var(--icons-icon-search)}._text_11jol_16{flex:1;position:relative;border:none;border-radius:40px;outline:none;font-family:var(--font-family-body);font-size:var(--font-size-sm);line-height:var(--line-height-sm);background:var(--surface-surface-searchBar, #f6f6f6);padding:0px var(--spacing-0-5) 0px var(--spacing-0-5)}._text_11jol_16::placeholder{font-style:italic;font-weight:var(--font-weight-light);color:var(--text-text-search-bar)}._input_11jol_33{flex:1;padding:0px 0px 0px var(--spacing-0-5);box-sizing:border-box}._inputSearch_11jol_38{flex:1;border-radius:var(--spacing-0-125)}._searchfield_11jol_42{flex:1;height:var(--spacing-2-5);border-radius:var(--spacing-2-5);overflow:hidden;background-color:var(--surface-surface-search-bar)}._searchBox_11jol_49{flex:1;width:100%;min-width:250px;height:var(--spacing-2-5);position:relative;border-radius:var(--spacing-2-5);overflow:hidden;text-align:left;background-color:var(--surface-surface-search-bar)}
|
package/dist/assets/Tooltip.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_ogovb_1{box-shadow:8px 8px 12px #00000026;background-color:#fff;padding:var(--spacing-1);box-sizing:border-box;width:max-content;border:1px solid var(--color-neutrals-neutral-1);border-radius:4px;z-index:9999}._wrapper_ogovb_12{position:relative;display:inline-block}._tooltip_ogovb_17{position:absolute;z-index:1000;padding:var(--spacing-0-5);background:var(--color-neutrals-neutral-1);border-radius:4px;box-shadow:0 4px 12px #0000002e;opacity:0;pointer-events:none;visibility:hidden;transition:opacity .15s ease,transform .15s ease}._open_ogovb_30{opacity:1;visibility:visible;transform:translateY(0)}._tooltip_ogovb_17[data-position=top]{bottom:100%;left:50%;transform:translate(-50%,-4px)}._open_ogovb_30._tooltip_ogovb_17[data-position=top]{transform:translate(-50%)}._tooltip_ogovb_17[data-position=bottom]{top:100%;left:50%;transform:translate(-50%,4px)}._open_ogovb_30._tooltip_ogovb_17[data-position=bottom]{transform:translate(-50%)}._tooltip_ogovb_17[data-position=left]{right:100%;top:50%;transform:translate(-4px,-50%)}._open_ogovb_30._tooltip_ogovb_17[data-position=left]{transform:translateY(-50%)}._tooltip_ogovb_17[data-position=right]{left:100%;top:50%;transform:translate(4px,-50%)}._open_ogovb_30._tooltip_ogovb_17[data-position=right]{transform:translateY(-50%)}._tooltip_ogovb_17[data-position=top]{bottom:100%;left:50%;transform:translate(calc(-50% + var(--tooltip-shift-x, 0px)),-4px)}._open_ogovb_30._tooltip_ogovb_17[data-position=top]{transform:translate(calc(-50% + var(--tooltip-shift-x, 0px)))}._tooltip_ogovb_17[data-position=bottom]{top:100%;left:50%;transform:translate(calc(-50% + var(--tooltip-shift-x, 0px)),4px)}._open_ogovb_30._tooltip_ogovb_17[data-position=bottom]{transform:translate(calc(-50% + var(--tooltip-shift-x, 0px)))}._tooltip_ogovb_17[data-position=left]{right:100%;top:50%;transform:translate(-4px,calc(-50% + var(--tooltip-shift-y, 0px)))}._open_ogovb_30._tooltip_ogovb_17[data-position=left]{transform:translateY(calc(-50% + var(--tooltip-shift-y, 0px)))}._tooltip_ogovb_17[data-position=right]{left:100%;top:50%;transform:translate(4px,calc(-50% + var(--tooltip-shift-y, 0px)))}._open_ogovb_30._tooltip_ogovb_17[data-position=right]{transform:translateY(calc(-50% + var(--tooltip-shift-y, 0px)))}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { HideAtProps } from '../HideAt';
|
|
2
3
|
/** A link element. */
|
|
3
4
|
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>, HideAtProps {
|
|
4
|
-
|
|
5
|
+
href: string;
|
|
6
|
+
children: React.ReactNode;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
/** Signature an external router link (e.g. next/link) must satisfy */
|
|
10
|
+
export type LinkComponent = (_props: LinkProps) => JSX.Element;
|
|
11
|
+
export declare function LinkProvider({ component, children, }: {
|
|
12
|
+
component: LinkComponent;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Link({ href, children, disabled, hideAt, className, onClick, ...otherProps }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/atoms/Link/Link.js
CHANGED
|
@@ -1,35 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { t as k } from "../../Text.module-smM1g1J4.js";
|
|
4
|
+
import { c as y } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import { getHideAtStyles as _ } from "../HideAt.js";
|
|
6
|
+
import '../../assets/Link.css';const g = "_link_ygp31_1", v = "_disabled_ygp31_14", f = {
|
|
7
|
+
link: g,
|
|
8
|
+
disabled: v
|
|
9
|
+
}, p = c.createContext(null);
|
|
10
|
+
function P({
|
|
11
|
+
component: n,
|
|
12
|
+
children: e
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a(p.Provider, { value: n, children: e });
|
|
15
|
+
}
|
|
16
|
+
function S({
|
|
17
|
+
href: n,
|
|
18
|
+
children: e,
|
|
12
19
|
disabled: t = !1,
|
|
13
|
-
hideAt:
|
|
14
|
-
className:
|
|
15
|
-
|
|
20
|
+
hideAt: i,
|
|
21
|
+
className: u,
|
|
22
|
+
onClick: r,
|
|
23
|
+
...o
|
|
16
24
|
}) {
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
s.link,
|
|
24
|
-
t ? s.disabled : "",
|
|
25
|
-
m(o),
|
|
26
|
-
l
|
|
27
|
-
),
|
|
28
|
-
...r,
|
|
29
|
-
children: i
|
|
30
|
-
}
|
|
25
|
+
const l = c.useContext(p), x = y(
|
|
26
|
+
k["text-body"],
|
|
27
|
+
f.link,
|
|
28
|
+
t && f.disabled,
|
|
29
|
+
_(i),
|
|
30
|
+
u
|
|
31
31
|
);
|
|
32
|
+
function d(s) {
|
|
33
|
+
if (t) {
|
|
34
|
+
s.preventDefault(), s.stopPropagation();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
r == null || r(s);
|
|
38
|
+
}
|
|
39
|
+
const m = {
|
|
40
|
+
...o,
|
|
41
|
+
href: t ? "#" : n,
|
|
42
|
+
className: x,
|
|
43
|
+
children: e,
|
|
44
|
+
disabled: t,
|
|
45
|
+
hideAt: i,
|
|
46
|
+
onClick: d,
|
|
47
|
+
"aria-disabled": t || void 0,
|
|
48
|
+
tabIndex: t ? -1 : o.tabIndex,
|
|
49
|
+
role: t ? "link" : o.role
|
|
50
|
+
};
|
|
51
|
+
return l ? /* @__PURE__ */ a(l, { ...m }) : /* @__PURE__ */ a("a", { ...m, children: e });
|
|
32
52
|
}
|
|
33
53
|
export {
|
|
34
|
-
|
|
54
|
+
S as Link,
|
|
55
|
+
P as LinkProvider
|
|
35
56
|
};
|
|
@@ -3,19 +3,19 @@ import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
|
3
3
|
import { Text as n } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Button as a } from "../../atoms/Button/Button.js";
|
|
5
5
|
import { Tooltip as l } from "../Tooltip/Tooltip.js";
|
|
6
|
-
import '../../assets/Cart.css';const d = "_cart_15bzn_1", h = "_count_15bzn_8", p = "_cartContainer_15bzn_23",
|
|
6
|
+
import '../../assets/Cart.css';const d = "_cart_15bzn_1", h = "_count_15bzn_8", p = "_cartContainer_15bzn_23", _ = "_cartItems_15bzn_32", g = "_noItems_15bzn_58", s = {
|
|
7
7
|
cart: d,
|
|
8
8
|
count: h,
|
|
9
9
|
cartContainer: p,
|
|
10
|
-
cartItems:
|
|
11
|
-
noItems:
|
|
10
|
+
cartItems: _,
|
|
11
|
+
noItems: g
|
|
12
12
|
};
|
|
13
13
|
function v({
|
|
14
14
|
cart: e,
|
|
15
15
|
onItemQtyChange: I,
|
|
16
16
|
onItemDelete: u,
|
|
17
17
|
onItemEdit: z,
|
|
18
|
-
onCheckout:
|
|
18
|
+
onCheckout: r,
|
|
19
19
|
...c
|
|
20
20
|
}) {
|
|
21
21
|
return e = e || { items: [] }, /* @__PURE__ */ t(
|
|
@@ -32,24 +32,23 @@ function v({
|
|
|
32
32
|
),
|
|
33
33
|
e.items.length > 0 && /* @__PURE__ */ t("div", { className: s.count, children: /* @__PURE__ */ t(n, { size: "xxs", children: e.items.length }) })
|
|
34
34
|
] }),
|
|
35
|
-
|
|
36
|
-
position: "bottom right",
|
|
35
|
+
position: "bottom",
|
|
37
36
|
on: "click",
|
|
38
37
|
children: /* @__PURE__ */ i("div", { className: s.cartContainer, children: [
|
|
39
38
|
/* @__PURE__ */ t(n, { as: "h1", size: "2xl", children: "Cart" }),
|
|
40
39
|
/* @__PURE__ */ t("div", { className: s.cartItems, children: e.items.length > 0 ? /* @__PURE__ */ t("ul", { children: e.items.map(
|
|
41
|
-
(
|
|
42
|
-
/* @__PURE__ */ t("img", { src:
|
|
40
|
+
(o) => /* @__PURE__ */ i("li", { children: [
|
|
41
|
+
/* @__PURE__ */ t("img", { src: o.imageUrl, alt: `${o.itemId} product image` }),
|
|
43
42
|
/* @__PURE__ */ i("div", { children: [
|
|
44
|
-
/* @__PURE__ */ t(n, { as: "p", size: "sm", children:
|
|
43
|
+
/* @__PURE__ */ t(n, { as: "p", size: "sm", children: o.description }),
|
|
45
44
|
/* @__PURE__ */ i(n, { as: "p", size: "sm", children: [
|
|
46
45
|
"Part # ",
|
|
47
|
-
|
|
46
|
+
o.itemId
|
|
48
47
|
] })
|
|
49
48
|
] })
|
|
50
49
|
] })
|
|
51
50
|
) }) : /* @__PURE__ */ t("div", { className: s.noItems, children: /* @__PURE__ */ t(n, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
52
|
-
/* @__PURE__ */ t(a, { disabled: e.items.length === 0, onClick:
|
|
51
|
+
/* @__PURE__ */ t(a, { disabled: e.items.length === 0, onClick: r, variant: "cta-primary", size: "md", children: "Checkout" })
|
|
53
52
|
] })
|
|
54
53
|
}
|
|
55
54
|
);
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../../clsx-OuTLNxxd.js";
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Link as
|
|
3
|
+
import { Text as s } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Link as n } from "../../atoms/Link/Link.js";
|
|
5
5
|
import { Icon as m } from "../../atoms/Icon/Icon.js";
|
|
6
6
|
import { getHideAtStyles as c } from "../../atoms/HideAt.js";
|
|
7
7
|
import { Tooltip as h } from "../Tooltip/Tooltip.js";
|
|
8
|
-
import '../../assets/CategoryNav.css';const d = "_categories_1m4w9_1", u = "_category_1m4w9_16", p = "_submenuTooltip_1m4w9_42",
|
|
8
|
+
import '../../assets/CategoryNav.css';const d = "_categories_1m4w9_1", u = "_category_1m4w9_16", p = "_submenuTooltip_1m4w9_42", l = {
|
|
9
9
|
categories: d,
|
|
10
10
|
category: u,
|
|
11
11
|
submenuTooltip: p
|
|
12
12
|
};
|
|
13
13
|
function z({
|
|
14
|
-
categories:
|
|
14
|
+
categories: o
|
|
15
15
|
}) {
|
|
16
|
-
return !
|
|
16
|
+
return !o || o.length === 0 ? null : /* @__PURE__ */ e("ul", { className: a(l.categories, c(["sm"])), children: o.map(
|
|
17
17
|
(i) => i.children.length > 0 ? /* @__PURE__ */ e(
|
|
18
18
|
h,
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: i.label }),
|
|
20
|
+
trigger: /* @__PURE__ */ e("li", { className: l.category, children: /* @__PURE__ */ t(n, { href: i.route, children: [
|
|
21
|
+
/* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: i.label }),
|
|
23
22
|
i.showChevron && /* @__PURE__ */ e(
|
|
24
23
|
m,
|
|
25
24
|
{
|
|
@@ -29,13 +28,12 @@ function z({
|
|
|
29
28
|
}
|
|
30
29
|
)
|
|
31
30
|
] }) }),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
children: /* @__PURE__ */ e("ul", { className: o.submenuTooltip, children: i.children.map((l) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(s, { href: l.route, children: /* @__PURE__ */ e(n, { size: "sm", weight: "semibold", children: l.label }) }) }, l.id)) })
|
|
31
|
+
position: "bottom",
|
|
32
|
+
children: /* @__PURE__ */ e("ul", { className: l.submenuTooltip, children: i.children.map((r) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(n, { href: r.route, children: /* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: r.label }) }) }, r.id)) })
|
|
35
33
|
},
|
|
36
34
|
i.id
|
|
37
|
-
) : /* @__PURE__ */ e("li", { className:
|
|
38
|
-
/* @__PURE__ */ e(
|
|
35
|
+
) : /* @__PURE__ */ e("li", { className: l.category, children: /* @__PURE__ */ t(n, { href: i.route, children: [
|
|
36
|
+
/* @__PURE__ */ e(s, { size: "sm", weight: "semibold", children: i.label }),
|
|
39
37
|
i.showChevron && /* @__PURE__ */ e(
|
|
40
38
|
m,
|
|
41
39
|
{
|
|
@@ -3,7 +3,7 @@ import { c as h } from "../../clsx-OuTLNxxd.js";
|
|
|
3
3
|
import { Flex as r } from "../../atoms/Flex/Flex.js";
|
|
4
4
|
import { getHideAtStyles as u } from "../../atoms/HideAt.js";
|
|
5
5
|
import { Icon as f } from "../../atoms/Icon/Icon.js";
|
|
6
|
-
import '../../assets/SearchBox.css';const p = "
|
|
6
|
+
import '../../assets/SearchBox.css';const p = "_button_11jol_1", x = "_text_11jol_16", _ = "_input_11jol_33", d = "_inputSearch_11jol_38", g = "_searchfield_11jol_42", b = "_searchBox_11jol_49", t = {
|
|
7
7
|
button: p,
|
|
8
8
|
text: x,
|
|
9
9
|
input: _,
|
|
@@ -11,30 +11,30 @@ import '../../assets/SearchBox.css';const p = "_button_1izj4_1", x = "_text_1izj
|
|
|
11
11
|
searchfield: g,
|
|
12
12
|
searchBox: b
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
onSearch:
|
|
16
|
-
inputName:
|
|
14
|
+
function N({
|
|
15
|
+
onSearch: n,
|
|
16
|
+
inputName: o,
|
|
17
17
|
hideAt: s,
|
|
18
|
-
className:
|
|
19
|
-
...
|
|
18
|
+
className: a,
|
|
19
|
+
...i
|
|
20
20
|
}) {
|
|
21
21
|
return /* @__PURE__ */ e(
|
|
22
22
|
r,
|
|
23
23
|
{
|
|
24
24
|
flexDirection: "row",
|
|
25
25
|
alignItems: "center",
|
|
26
|
-
className: h(t.searchBox, u(s),
|
|
27
|
-
...
|
|
26
|
+
className: h(t.searchBox, u(s), a),
|
|
27
|
+
...i,
|
|
28
28
|
children: /* @__PURE__ */ e(
|
|
29
29
|
r,
|
|
30
30
|
{
|
|
31
31
|
flexDirection: "row",
|
|
32
32
|
alignItems: "center",
|
|
33
33
|
className: t.searchfield,
|
|
34
|
-
children: /* @__PURE__ */ e("div", { className: t.inputSearch, children: /* @__PURE__ */ e("form", { onSubmit: (
|
|
35
|
-
|
|
36
|
-
const l = (new FormData(
|
|
37
|
-
|
|
34
|
+
children: /* @__PURE__ */ e("div", { className: t.inputSearch, children: /* @__PURE__ */ e("form", { onSubmit: (c) => {
|
|
35
|
+
c.preventDefault();
|
|
36
|
+
const l = (new FormData(c.currentTarget).get(o ?? "search") || "").trim();
|
|
37
|
+
n(l);
|
|
38
38
|
}, children: /* @__PURE__ */ m(
|
|
39
39
|
r,
|
|
40
40
|
{
|
|
@@ -49,7 +49,7 @@ function D({
|
|
|
49
49
|
type: "text",
|
|
50
50
|
className: t.text,
|
|
51
51
|
placeholder: "Search by keyword(s) or Part #....",
|
|
52
|
-
name:
|
|
52
|
+
name: o ?? "search"
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
@@ -61,5 +61,5 @@ function D({
|
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
N as SearchBox
|
|
65
65
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type TooltipProps = PopupProps & {
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
trigger: React.ReactElement;
|
|
5
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
6
|
+
delay?: number;
|
|
8
7
|
tooltipClassName?: string;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
on?: "hover" | "click" | "auto";
|
|
10
|
+
autoAdjust?: boolean;
|
|
11
|
+
flip?: boolean;
|
|
12
|
+
viewportPadding?: number;
|
|
13
|
+
}
|
|
11
14
|
export declare const Tooltip: React.FC<TooltipProps>;
|