@caseparts-org/caseblocks 0.0.205 → 0.0.207

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.
Files changed (34) hide show
  1. package/dist/Cart.module-CqE2A_OG.js +25 -0
  2. package/dist/assets/Availability.css +1 -1
  3. package/dist/assets/Cart.css +1 -1
  4. package/dist/assets/DropdownButton.css +1 -0
  5. package/dist/atoms/DropdownButton/DropdownButton.d.ts +26 -0
  6. package/dist/atoms/DropdownButton/DropdownButton.js +126 -0
  7. package/dist/atoms/DropdownButton/DropdownButton.stories.d.ts +13 -0
  8. package/dist/atoms/DropdownButton/DropdownButton.stories.js +33 -0
  9. package/dist/atoms/Popover/Popover.d.ts +1 -0
  10. package/dist/atoms/Popover/Popover.js +44 -43
  11. package/dist/main-client.d.ts +2 -0
  12. package/dist/main-client.js +51 -49
  13. package/dist/main-server.d.ts +1 -1
  14. package/dist/molecules/Availability/Availability.d.ts +14 -5
  15. package/dist/molecules/Availability/Availability.js +61 -30
  16. package/dist/molecules/Availability/Availability.stories.d.ts +14 -13
  17. package/dist/molecules/Availability/Availability.stories.js +81 -46
  18. package/dist/molecules/Cart/Cart.d.ts +3 -3
  19. package/dist/molecules/Cart/Cart.js +1 -1
  20. package/dist/molecules/Cart/Cart.stories.d.ts +15 -0
  21. package/dist/molecules/Cart/Cart.stories.js +4 -6
  22. package/dist/molecules/Cart/CartPart.d.ts +4 -5
  23. package/dist/molecules/Cart/CartPart.js +42 -43
  24. package/dist/molecules/Cart/CartPart.stories.d.ts +3 -3
  25. package/dist/molecules/Cart/CartPart.stories.js +30 -20
  26. package/dist/molecules/Cart/CartSlideInPanel.d.ts +1 -4
  27. package/dist/molecules/Cart/CartSlideInPanel.js +13 -17
  28. package/dist/organisms/MainNav/MainNav.stories.js +6 -8
  29. package/dist/organisms/Product/Product.d.ts +1 -1
  30. package/dist/organisms/Product/Product.js +76 -77
  31. package/dist/organisms/Product/Product.stories.d.ts +0 -11
  32. package/dist/organisms/Product/Product.stories.js +12 -25
  33. package/package.json +1 -1
  34. package/dist/Cart.module-CcoNa4Nj.js +0 -25
@@ -0,0 +1,25 @@
1
+ import './assets/Cart.css';const t = "_cartIconButton_16z8i_2", o = "_count_16z8i_15", e = "_cartContainer_16z8i_30", n = "_headerWrapper_16z8i_41", _ = "_header_16z8i_41", i = "_cartItems_16z8i_59", a = "_cartItem_16z8i_59", c = "_topRow_16z8i_85", r = "_itemInfo_16z8i_92", s = "_editUnit_16z8i_97", m = "_purchaseInformation_16z8i_113", I = "_availabilitySlot_16z8i_119", u = "_priceSlot_16z8i_122", z = "_itemManagement_16z8i_125", l = "_quantitySlot_16z8i_131", p = "_itemImage_16z8i_141", h = "_removeItem_16z8i_144", d = "_noItems_16z8i_154", S = "_subtotal_16z8i_161", y = "_checkoutButton_16z8i_168", b = {
2
+ cartIconButton: t,
3
+ count: o,
4
+ cartContainer: e,
5
+ headerWrapper: n,
6
+ header: _,
7
+ cartItems: i,
8
+ cartItem: a,
9
+ topRow: c,
10
+ itemInfo: r,
11
+ editUnit: s,
12
+ purchaseInformation: m,
13
+ availabilitySlot: I,
14
+ priceSlot: u,
15
+ itemManagement: z,
16
+ quantitySlot: l,
17
+ itemImage: p,
18
+ removeItem: h,
19
+ noItems: d,
20
+ subtotal: S,
21
+ checkoutButton: y
22
+ };
23
+ export {
24
+ b as s
25
+ };
@@ -1 +1 @@
1
- ._availability_jaqg4_1{font-style:italic}._availabilityLink_jaqg4_4{font-style:italic;font-size:var(--font-size-xs)}._available_jaqg4_8{color:var(--color-alerts-success)}._limited_jaqg4_11{color:var(--color-alerts-warning)}._unavailable_jaqg4_14{color:var(--color-alerts-error-warning)}
1
+ ._availability_9rzvh_1{font-style:italic}._tooltipContent_9rzvh_5{max-width:370px}._tooltipContent_9rzvh_5>ul{padding:0;margin:var(--spacing-spacing-2xs) 0}._tooltipContent_9rzvh_5 li{list-style:none}._available_9rzvh_18,._in-stock_9rzvh_18{color:var(--color-alerts-success)}._limited_9rzvh_21{color:var(--color-alerts-warning)}._discontinued_9rzvh_24{color:var(--color-alerts-error-warning)}
@@ -1 +1 @@
1
- ._cartIconButton_m34kh_2{position:relative;border:none;padding:0;margin:0;background-color:transparent;cursor:pointer;color:#000;transition:color .3s ease,transform .3s ease}._cartIconButton_m34kh_2:hover{color:var(--color-brand-primary-primary-teal-blue);transform:scale(1.04)}._count_m34kh_16{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_m34kh_31{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_m34kh_42{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_m34kh_42>button{padding:0;margin:0;background-color:transparent;border:none}._header_m34kh_42{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_m34kh_60{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_m34kh_60 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_m34kh_60{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--spacing-0-5);align-items:start;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border:1px solid var(--color-neutrals-neutral-2);border-radius:var(--border-radius-md)}._topRow_m34kh_86{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:var(--spacing-spacing-4xs)}._itemInfo_m34kh_93{display:flex;flex-direction:column;align-items:flex-start}._editUnit_m34kh_98{display:flex;align-items:center;text-align:start;gap:var(--spacing-spacing-3xs);border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;color:var(--text-text-links);word-wrap:break-word;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}._purchaseInformation_m34kh_114{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:flex-start;width:100%}._availabilitySlot_m34kh_120{min-width:0}._priceSlot_m34kh_123{justify-self:end}._itemManagement_m34kh_126{display:flex;flex-direction:column;align-items:stretch;gap:var(--spacing-spacing-3xs)}._quantitySlot_m34kh_132{align-self:flex-end}._cartItem_m34kh_60 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_m34kh_142{object-fit:contain}._removeItem_m34kh_145{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_m34kh_155{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_m34kh_162{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_m34kh_169{width:100%;height:fit-content}
1
+ ._cartIconButton_16z8i_2{position:relative;border:none;padding:0;margin:0;background-color:transparent;cursor:pointer;color:#000;transition:color .3s ease,transform .3s ease}._cartIconButton_16z8i_2:hover{color:var(--color-brand-primary-primary-teal-blue)}._count_16z8i_15{position:absolute;top:0;left:14px;border-radius:50%;width:18px;height:18px;display:flex;flex-direction:row;align-items:center;justify-content:center;background-color:var(--color-brand-primary-primary-tangerine);color:var(--color-neutrals-neutral-1);font-weight:var(--font-weight-semibold)}._cartContainer_16z8i_30{height:100vh;width:100%;min-width:320px;max-width:375px;box-sizing:border-box;display:grid;grid-template-rows:auto auto 1fr auto auto;gap:var(--spacing-1);padding:var(--spacing-1)}._headerWrapper_16z8i_41{display:flex;flex-direction:row;align-items:flex-start;gap:var(--spacing-spacing-2xs)}._headerWrapper_16z8i_41>button{padding:0;margin:0;background-color:transparent;border:none}._header_16z8i_41{display:flex;flex-direction:column;align-items:flex-start;width:100%}._cartItems_16z8i_59{height:100%;overflow-y:auto;overflow-x:hidden}._cartItems_16z8i_59 ul{margin:0;padding:0;display:flex;flex-direction:column;gap:var(--spacing-spacing-1xs)}._cartItem_16z8i_59{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--spacing-0-5);align-items:start;box-sizing:border-box;position:relative;list-style:none;margin:0;padding:var(--spacing-0-5);width:100%;border:1px solid var(--color-neutrals-neutral-2);border-radius:var(--border-radius-md)}._topRow_16z8i_85{display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:var(--spacing-spacing-4xs)}._itemInfo_16z8i_92{display:flex;flex-direction:column;align-items:flex-start}._editUnit_16z8i_97{display:flex;align-items:center;text-align:start;gap:var(--spacing-spacing-3xs);border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;color:var(--text-text-links);word-wrap:break-word;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}._purchaseInformation_16z8i_113{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:flex-start;width:100%}._availabilitySlot_16z8i_119{min-width:0}._priceSlot_16z8i_122{justify-self:end}._itemManagement_16z8i_125{display:flex;flex-direction:column;align-items:stretch;gap:var(--spacing-spacing-3xs)}._quantitySlot_16z8i_131{align-self:flex-end}._cartItem_16z8i_59 p{margin:0;padding:0;word-wrap:break-word;white-space:normal;overflow-wrap:break-word}._itemImage_16z8i_141{object-fit:contain}._removeItem_16z8i_144{border:none;background-color:transparent;padding:0;margin:0;cursor:pointer;width:min-content;height:min-content}._noItems_16z8i_154{display:flex;flex-direction:row;align-items:center;justify-content:center;height:100%}._subtotal_16z8i_161{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--spacing-0-5)}._checkoutButton_16z8i_168{width:100%;height:fit-content}
@@ -0,0 +1 @@
1
+ ._root_1q683_1{display:inline-flex;align-items:stretch}._segment_1q683_6{height:100%}._segment-sm_1q683_10{min-height:22px}._segment-md_1q683_14{min-height:32px}._segment-lg_1q683_18{min-height:40px}._actionSegment_1q683_22{border-top-right-radius:0;border-bottom-right-radius:0}._actionSegment-sm_1q683_27{min-width:70px}._actionSegment-md_1q683_31{min-width:90px}._actionSegment-lg_1q683_35{min-width:112px}._toggleSegment_1q683_39{border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid white;padding-inline:var(--spacing-spacing-2xs)}._toggleSegment-sm_1q683_46{min-width:26px}._toggleSegment-md_1q683_50{min-width:32px}._toggleSegment-lg_1q683_54{min-width:40px}._menu_1q683_58{padding:var(--spacing-spacing-2xs);min-width:0;box-sizing:border-box}._menuList_1q683_65{display:flex;flex-direction:column;width:100%}._menuItem_1q683_71{background:transparent;border:none;border-radius:var(--border-radius-xs);color:inherit;cursor:pointer;padding:var(--spacing-spacing-3xs);text-align:left;width:100%;box-sizing:border-box}._menuItem_1q683_71:hover{background:var(--surface-surface-secondary)}._menuItem_1q683_71:disabled{color:var(--surface-surface-disabled-btn);cursor:default}._menuItem_1q683_71:disabled:hover{background:transparent}
@@ -0,0 +1,26 @@
1
+ import { ButtonProps } from '../Button/Button';
2
+ import * as React from "react";
3
+ type DropdownButtonSize = "sm" | "md" | "lg";
4
+ export interface DropdownButtonOption {
5
+ key: React.Key;
6
+ label: React.ReactNode;
7
+ onClick: () => void;
8
+ disabled?: boolean;
9
+ }
10
+ export interface DropdownButtonStyles {
11
+ root?: string;
12
+ action?: string;
13
+ toggle?: string;
14
+ menu?: string;
15
+ menuItem?: string;
16
+ }
17
+ export interface DropdownButtonProps extends Omit<ButtonProps, "children" | "size"> {
18
+ children: React.ReactNode;
19
+ size: DropdownButtonSize;
20
+ options: DropdownButtonOption[];
21
+ menuLabel?: string;
22
+ toggleLabel?: string;
23
+ styles?: DropdownButtonStyles;
24
+ }
25
+ export declare function DropdownButton({ children, options, menuLabel, toggleLabel, styles: styleOverrides, size, variant, hideAt, className, disabled, type, ...otherProps }: DropdownButtonProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,126 @@
1
+ import { jsxs as L, jsx as o } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { c } from "../../clsx-OuTLNxxd.js";
4
+ import { getHideAtStyles as R } from "../HideAt.js";
5
+ import { Icon as $ } from "../Icon/Icon.js";
6
+ import { Popover as k } from "../Popover/Popover.js";
7
+ import { buttonClassNames as b } from "../Button/buttonClassName.js";
8
+ import { Text as W } from "../Text/Text.js";
9
+ import '../../assets/DropdownButton.css';const j = "_root_1q683_1", B = "_segment_1q683_6", D = "_actionSegment_1q683_22", M = "_toggleSegment_1q683_39", T = "_menu_1q683_58", A = "_menuList_1q683_65", E = "_menuItem_1q683_71", n = {
10
+ root: j,
11
+ segment: B,
12
+ "segment-sm": "_segment-sm_1q683_10",
13
+ "segment-md": "_segment-md_1q683_14",
14
+ "segment-lg": "_segment-lg_1q683_18",
15
+ actionSegment: D,
16
+ "actionSegment-sm": "_actionSegment-sm_1q683_27",
17
+ "actionSegment-md": "_actionSegment-md_1q683_31",
18
+ "actionSegment-lg": "_actionSegment-lg_1q683_35",
19
+ toggleSegment: M,
20
+ "toggleSegment-sm": "_toggleSegment-sm_1q683_46",
21
+ "toggleSegment-md": "_toggleSegment-md_1q683_50",
22
+ "toggleSegment-lg": "_toggleSegment-lg_1q683_54",
23
+ menu: T,
24
+ menuList: A,
25
+ menuItem: E
26
+ };
27
+ function U({
28
+ children: f,
29
+ options: s,
30
+ menuLabel: p = "More actions",
31
+ toggleLabel: q = "Open actions menu",
32
+ styles: t,
33
+ size: e,
34
+ variant: l,
35
+ hideAt: h,
36
+ className: d,
37
+ disabled: a,
38
+ type: N = "button",
39
+ ...x
40
+ }) {
41
+ const r = s.length > 0, _ = a || !r, I = e === "sm" ? "xs" : e === "md" ? "sm" : "md", i = u.useRef(null), [w, C] = u.useState();
42
+ return u.useLayoutEffect(() => {
43
+ const g = i.current;
44
+ if (!g) return;
45
+ const m = () => {
46
+ C(g.getBoundingClientRect().width + 2);
47
+ };
48
+ m();
49
+ const S = new ResizeObserver(m);
50
+ return S.observe(g), () => {
51
+ S.disconnect();
52
+ };
53
+ }, []), /* @__PURE__ */ L(
54
+ "div",
55
+ {
56
+ ref: i,
57
+ className: c(n.root, R(h), d, t == null ? void 0 : t.root),
58
+ role: "group",
59
+ children: [
60
+ /* @__PURE__ */ o(
61
+ "button",
62
+ {
63
+ className: c(
64
+ b({ size: e, variant: l, disabled: a, className: t == null ? void 0 : t.action }),
65
+ n.segment,
66
+ n[`segment-${e}`],
67
+ n[`actionSegment-${e}`],
68
+ n.actionSegment
69
+ ),
70
+ disabled: a,
71
+ type: N,
72
+ ...x,
73
+ children: f
74
+ }
75
+ ),
76
+ /* @__PURE__ */ o(
77
+ k,
78
+ {
79
+ disabled: _,
80
+ position: "bottom right",
81
+ contentClassName: c(n.menu, t == null ? void 0 : t.menu),
82
+ contentStyle: { width: w },
83
+ trigger: /* @__PURE__ */ o(
84
+ "button",
85
+ {
86
+ type: "button",
87
+ className: c(
88
+ b({
89
+ size: e,
90
+ variant: l,
91
+ disabled: _,
92
+ className: t == null ? void 0 : t.toggle
93
+ }),
94
+ n.segment,
95
+ n[`segment-${e}`],
96
+ n[`toggleSegment-${e}`],
97
+ n.toggleSegment
98
+ ),
99
+ "aria-label": q,
100
+ disabled: _,
101
+ children: /* @__PURE__ */ o($, { iconKey: "fa-solid fa-chevron-down", size: "3xs" })
102
+ }
103
+ ),
104
+ children: ({ close: g }) => /* @__PURE__ */ o("div", { className: n.menuList, role: "menu", "aria-label": p, children: s.map((m) => /* @__PURE__ */ o(
105
+ "button",
106
+ {
107
+ type: "button",
108
+ role: "menuitem",
109
+ className: c(n.menuItem, t == null ? void 0 : t.menuItem),
110
+ disabled: m.disabled,
111
+ onClick: () => {
112
+ m.onClick(), g();
113
+ },
114
+ children: /* @__PURE__ */ o(W, { size: I, children: m.label })
115
+ },
116
+ m.key
117
+ )) })
118
+ }
119
+ )
120
+ ]
121
+ }
122
+ );
123
+ }
124
+ export {
125
+ U as DropdownButton
126
+ };
@@ -0,0 +1,13 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { DropdownButton } from './DropdownButton';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof DropdownButton;
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;
@@ -0,0 +1,33 @@
1
+ import { DropdownButton as o } from "./DropdownButton.js";
2
+ const e = {
3
+ title: "Case Parts/Atoms/DropdownButton",
4
+ component: o,
5
+ parameters: {
6
+ layout: "centered"
7
+ },
8
+ tags: ["autodocs"]
9
+ }, a = {
10
+ args: {
11
+ children: "Save",
12
+ size: "md",
13
+ variant: "primary",
14
+ options: [
15
+ {
16
+ key: "submit",
17
+ label: "Claim and Submit",
18
+ onClick: () => {
19
+ }
20
+ },
21
+ {
22
+ key: "review",
23
+ label: "Save for review",
24
+ onClick: () => {
25
+ }
26
+ }
27
+ ]
28
+ }
29
+ };
30
+ export {
31
+ a as AllProps,
32
+ e as default
33
+ };
@@ -12,6 +12,7 @@ export type PopoverProps = {
12
12
  position?: Position;
13
13
  popoverClassName?: string;
14
14
  contentClassName?: string;
15
+ contentStyle?: React.CSSProperties;
15
16
  disabled?: boolean;
16
17
  closeOnOutsideClick?: boolean;
17
18
  /** If true, clicking any element with `data-popover-close` inside content will close */
@@ -1,50 +1,51 @@
1
- import { jsxs as F, Fragment as H, jsx as k } from "react/jsx-runtime";
1
+ import { jsxs as H, Fragment as N, jsx as z } from "react/jsx-runtime";
2
2
  import * as f from "react";
3
- import { r as N } from "../../index-BkF-BQ3Q.js";
4
- import { c as z } from "../../clsx-OuTLNxxd.js";
5
- import '../../assets/Popover.css';const W = "_popover_vlr81_1", q = "_content_vlr81_7", P = {
6
- popover: W,
7
- content: q
3
+ import { r as W } from "../../index-BkF-BQ3Q.js";
4
+ import { c as P } from "../../clsx-OuTLNxxd.js";
5
+ import '../../assets/Popover.css';const q = "_popover_vlr81_1", D = "_content_vlr81_7", M = {
6
+ popover: q,
7
+ content: D
8
8
  };
9
- function D(r) {
9
+ function T(r) {
10
10
  return r ? r.includes(" ") ? r : `${r} center` : "top center";
11
11
  }
12
- function T(r) {
13
- const d = D(r).toLowerCase(), [s, c] = d.split(" ");
12
+ function U(r) {
13
+ const d = T(r).toLowerCase(), [s, c] = d.split(" ");
14
14
  return { side: ["top", "right", "bottom", "left"].includes(s) ? s : "top", align: c === "left" || c === "top" ? "start" : c === "right" || c === "bottom" ? "end" : "center" };
15
15
  }
16
- function U(r, d, s, c, p = 8) {
17
- const n = r.getBoundingClientRect(), l = d.getBoundingClientRect();
18
- let a = 0, u = 0;
19
- s === "top" ? a = n.top - l.height - p : s === "bottom" ? a = n.bottom + p : s === "left" ? u = n.left - l.width - p : s === "right" && (u = n.right + p), s === "top" || s === "bottom" ? c === "start" ? u = n.left : c === "end" ? u = n.right - l.width : u = n.left + n.width / 2 - l.width / 2 : c === "start" ? a = n.top : c === "end" ? a = n.bottom - l.height : a = n.top + n.height / 2 - l.height / 2;
20
- const w = window.innerWidth, h = window.innerHeight;
21
- return a = Math.max(4, Math.min(h - l.height - 4, a)), u = Math.max(4, Math.min(w - l.width - 4, u)), { top: a, left: u };
16
+ function $(r, d, s, c, p = 8) {
17
+ const n = r.getBoundingClientRect(), u = d.getBoundingClientRect();
18
+ let l = 0, a = 0;
19
+ s === "top" ? l = n.top - u.height - p : s === "bottom" ? l = n.bottom + p : s === "left" ? a = n.left - u.width - p : s === "right" && (a = n.right + p), s === "top" || s === "bottom" ? c === "start" ? a = n.left : c === "end" ? a = n.right - u.width : a = n.left + n.width / 2 - u.width / 2 : c === "start" ? l = n.top : c === "end" ? l = n.bottom - u.height : l = n.top + n.height / 2 - u.height / 2;
20
+ const g = window.innerWidth, w = window.innerHeight;
21
+ return l = Math.max(4, Math.min(w - u.height - 4, l)), a = Math.max(4, Math.min(g - u.width - 4, a)), { top: l, left: a };
22
22
  }
23
- const J = ({
23
+ const K = ({
24
24
  trigger: r,
25
25
  children: d,
26
26
  position: s,
27
27
  popoverClassName: c,
28
28
  contentClassName: p,
29
- disabled: n,
29
+ contentStyle: n,
30
+ disabled: u,
30
31
  closeOnOutsideClick: l = !0,
31
32
  closeOnInsideClickAttr: a = !0,
32
- open: u,
33
+ open: g,
33
34
  onOpenChange: w
34
35
  }) => {
35
- const { side: h, align: y } = T(s), [M, S] = f.useState(!1), x = typeof u == "boolean", o = x ? u : M, [m, R] = f.useState(null), b = f.useRef(null), v = f.useRef(null), L = (t) => {
36
+ const { side: y, align: b } = U(s), [S, j] = f.useState(!1), R = typeof g == "boolean", o = R ? g : S, [m, _] = f.useState(null), L = f.useRef(null), v = f.useRef(null), x = (t) => {
36
37
  const e = typeof t == "function" ? t(o) : t;
37
- x ? w == null || w(e) : S(e);
38
- }, _ = () => {
39
- n || L((t) => !t);
40
- }, E = () => L(!1), j = () => L(!0), B = f.cloneElement(r, {
38
+ R ? w == null || w(e) : j(e);
39
+ }, k = () => {
40
+ u || x((t) => !t);
41
+ }, E = () => x(!1), B = () => x(!0), F = f.cloneElement(r, {
41
42
  ref: (t) => {
42
43
  const { ref: e } = r;
43
- typeof e == "function" ? e(t) : e && (e.current = t), b.current = t;
44
+ typeof e == "function" ? e(t) : e && (e.current = t), L.current = t;
44
45
  },
45
46
  onClick: (t) => {
46
47
  var e, i;
47
- (i = (e = r.props).onClick) == null || i.call(e, t), _();
48
+ (i = (e = r.props).onClick) == null || i.call(e, t), k();
48
49
  },
49
50
  "aria-haspopup": "dialog",
50
51
  "aria-expanded": o || void 0,
@@ -53,22 +54,22 @@ const J = ({
53
54
  });
54
55
  return f.useLayoutEffect(() => {
55
56
  if (!o) {
56
- R(null);
57
+ _(null);
57
58
  return;
58
59
  }
59
- const t = b.current, e = v.current;
60
+ const t = L.current, e = v.current;
60
61
  if (!t || !e) return;
61
62
  const i = () => {
62
- R(U(t, e, h, y, 8));
63
+ _($(t, e, y, b, 8));
63
64
  };
64
65
  return i(), window.addEventListener("resize", i), window.addEventListener("scroll", i, !0), () => {
65
66
  window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0);
66
67
  };
67
- }, [o, h, y, d]), f.useEffect(() => {
68
+ }, [o, y, b, d]), f.useEffect(() => {
68
69
  if (!o || !l) return;
69
70
  const t = (e) => {
70
- const i = v.current, g = b.current;
71
- !i || !g || i.contains(e.target) || g.contains(e.target) || E();
71
+ const i = v.current, h = L.current;
72
+ !i || !h || i.contains(e.target) || h.contains(e.target) || E();
72
73
  };
73
74
  return window.addEventListener("mousedown", t), () => window.removeEventListener("mousedown", t);
74
75
  }, [o, l]), f.useEffect(() => {
@@ -76,9 +77,9 @@ const J = ({
76
77
  const t = v.current;
77
78
  if (!t) return;
78
79
  const e = (i) => {
79
- const g = i.target;
80
- if (!g) return;
81
- g.closest('[data-popover-close="true"]') && setTimeout(() => E(), 0);
80
+ const h = i.target;
81
+ if (!h) return;
82
+ h.closest('[data-popover-close="true"]') && setTimeout(() => E(), 0);
82
83
  };
83
84
  return t.addEventListener("click", e), () => t.removeEventListener("click", e);
84
85
  }, [o, a]), f.useEffect(() => {
@@ -94,19 +95,19 @@ const J = ({
94
95
  );
95
96
  t == null || t.focus();
96
97
  }
97
- }, [o]), /* @__PURE__ */ F(H, { children: [
98
- B,
99
- o && typeof document < "u" && N.createPortal(
100
- /* @__PURE__ */ k(
98
+ }, [o]), /* @__PURE__ */ H(N, { children: [
99
+ F,
100
+ o && typeof document < "u" && W.createPortal(
101
+ /* @__PURE__ */ z(
101
102
  "div",
102
103
  {
103
104
  id: "popover-panel",
104
105
  ref: v,
105
106
  role: "dialog",
106
107
  "aria-modal": "false",
107
- className: z(P.popover, c),
108
- "data-side": h,
109
- "data-align": y,
108
+ className: P(M.popover, c),
109
+ "data-side": y,
110
+ "data-align": b,
110
111
  style: {
111
112
  position: "absolute",
112
113
  top: (m == null ? void 0 : m.top) ?? 0,
@@ -114,7 +115,7 @@ const J = ({
114
115
  visibility: m ? "visible" : "hidden",
115
116
  zIndex: 20
116
117
  },
117
- children: /* @__PURE__ */ k("div", { className: z(P.content, p), children: typeof d == "function" ? d({ close: E, open: j, toggle: _ }) : d })
118
+ children: /* @__PURE__ */ z("div", { className: P(M.content, p), style: n, children: typeof d == "function" ? d({ close: E, open: B, toggle: k }) : d })
118
119
  }
119
120
  ),
120
121
  document.body
@@ -122,5 +123,5 @@ const J = ({
122
123
  ] });
123
124
  };
124
125
  export {
125
- J as Popover
126
+ K as Popover
126
127
  };
@@ -3,6 +3,8 @@ export { HorizontalScroll } from './atoms/HorizontalScroll/HorizontalScroll';
3
3
  export type { HorizontalScrollProps } from './atoms/HorizontalScroll/HorizontalScroll';
4
4
  export { SlideInPanel } from './atoms/SlideInPanel/SlideInPanel';
5
5
  export type { SlideInPanelProps } from './atoms/SlideInPanel/SlideInPanel';
6
+ export { DropdownButton } from './atoms/DropdownButton/DropdownButton';
7
+ export type { DropdownButtonProps, DropdownButtonOption, DropdownButtonStyles } from './atoms/DropdownButton/DropdownButton';
6
8
  export { Tooltip } from './atoms/Tooltip/Tooltip';
7
9
  export { Popover } from './atoms/Popover/Popover';
8
10
  export type { PopoverProps } from './atoms/Popover/Popover';
@@ -8,13 +8,13 @@ import { Separator as C } from "./atoms/Separator/Separator.js";
8
8
  import { Text as S } from "./atoms/Text/Text.js";
9
9
  import { Input as A } from "./atoms/Input/Input.js";
10
10
  import { ToggleSwitch as k } from "./atoms/ToggleSwitch/ToggleSwitch.js";
11
- import { Link as P } from "./atoms/Link/Link.js";
11
+ import { Link as I } from "./atoms/Link/Link.js";
12
12
  import { linkClassName as h } from "./atoms/Link/linkClassName.js";
13
- import { configureLink as L, routerOverride as w } from "./atoms/Link/configureLink.js";
13
+ import { configureLink as w, routerOverride as L } from "./atoms/Link/configureLink.js";
14
14
  import { LinkButton as y } from "./atoms/LinkButton/LinkButton.js";
15
15
  import { configureImage as H } from "./atoms/Image/configureImage.js";
16
16
  import { getHideAtStyles as N } from "./atoms/HideAt.js";
17
- import { Logo as z } from "./molecules/Logo/Logo.js";
17
+ import { Logo as D } from "./molecules/Logo/Logo.js";
18
18
  import { SearchBox as E } from "./molecules/SearchBox/SearchBox.js";
19
19
  import { QuantityInput as O } from "./molecules/QuantityInput/QuantityInput.js";
20
20
  import { Pricing as R } from "./molecules/Pricing/Pricing.js";
@@ -28,79 +28,81 @@ import { Admonition as eo } from "./molecules/Admonition/Admonition.js";
28
28
  import { NotFound as mo } from "./organisms/NotFound/NotFound.js";
29
29
  import { HorizontalScroll as fo } from "./atoms/HorizontalScroll/HorizontalScroll.js";
30
30
  import { SlideInPanel as ao } from "./atoms/SlideInPanel/SlideInPanel.js";
31
- import { Tooltip as no } from "./atoms/Tooltip/Tooltip.js";
32
- import { Popover as uo } from "./atoms/Popover/Popover.js";
33
- import { Account as Co } from "./molecules/Account/Account.js";
34
- import { Chip as So } from "./molecules/Chip/Chip.js";
35
- import { ToggleView as Ao } from "./molecules/ToggleView/ToggleView.js";
36
- import { CartPart as ko } from "./molecules/Cart/CartPart.js";
37
- import { AddToCartPart as Po } from "./molecules/AddToCartPart/AddToCartPart.js";
38
- import { CartSlideInPanel as ho } from "./molecules/Cart/CartSlideInPanel.js";
39
- import { StatefulButton as Lo } from "./molecules/StatefulButton/StatefulButton.js";
40
- import { AnimatedCheckMark as bo } from "./molecules/StatefulButton/AnimatedCheckmark.js";
41
- import { AddToCart as Fo } from "./molecules/AddToCart/AddToCart.js";
42
- import { Modal as Mo } from "./molecules/Modal/Modal.js";
43
- import { ImageViewer as Vo } from "./molecules/ImageViewer/ImageViewer.js";
44
- import { T as Do } from "./Table-BX4PtCNE.js";
45
- import { Error as Go } from "./molecules/Error/Error.js";
46
- import { MainNav as Qo } from "./organisms/MainNav/MainNav.js";
47
- import { ChipSelector as Zo } from "./organisms/ChipSelector/ChipSelector.js";
48
- import { Product as qo } from "./organisms/Product/Product.js";
49
- import { Carousel as Ko } from "./organisms/Carousel/Carousel.js";
50
- import { Footer as Wo } from "./organisms/Footer/Footer.js";
51
- import { default as Yo } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
31
+ import { DropdownButton as no } from "./atoms/DropdownButton/DropdownButton.js";
32
+ import { Tooltip as uo } from "./atoms/Tooltip/Tooltip.js";
33
+ import { Popover as Co } from "./atoms/Popover/Popover.js";
34
+ import { Account as So } from "./molecules/Account/Account.js";
35
+ import { Chip as Ao } from "./molecules/Chip/Chip.js";
36
+ import { ToggleView as ko } from "./molecules/ToggleView/ToggleView.js";
37
+ import { CartPart as Io } from "./molecules/Cart/CartPart.js";
38
+ import { AddToCartPart as ho } from "./molecules/AddToCartPart/AddToCartPart.js";
39
+ import { CartSlideInPanel as wo } from "./molecules/Cart/CartSlideInPanel.js";
40
+ import { StatefulButton as bo } from "./molecules/StatefulButton/StatefulButton.js";
41
+ import { AnimatedCheckMark as Fo } from "./molecules/StatefulButton/AnimatedCheckmark.js";
42
+ import { AddToCart as Mo } from "./molecules/AddToCart/AddToCart.js";
43
+ import { Modal as Vo } from "./molecules/Modal/Modal.js";
44
+ import { ImageViewer as zo } from "./molecules/ImageViewer/ImageViewer.js";
45
+ import { T as Go } from "./Table-BX4PtCNE.js";
46
+ import { Error as Qo } from "./molecules/Error/Error.js";
47
+ import { MainNav as Zo } from "./organisms/MainNav/MainNav.js";
48
+ import { ChipSelector as qo } from "./organisms/ChipSelector/ChipSelector.js";
49
+ import { Product as Ko } from "./organisms/Product/Product.js";
50
+ import { Carousel as Wo } from "./organisms/Carousel/Carousel.js";
51
+ import { Footer as Yo } from "./organisms/Footer/Footer.js";
52
+ import { default as $o } from "./organisms/SpinZoomViewer/SpinZoomViewer.js";
52
53
  export {
53
- Co as Account,
54
- Fo as AddToCart,
55
- Po as AddToCartPart,
54
+ So as Account,
55
+ Mo as AddToCart,
56
+ ho as AddToCartPart,
56
57
  eo as Admonition,
57
- bo as AnimatedCheckMark,
58
+ Fo as AnimatedCheckMark,
58
59
  j as Availability,
59
60
  J as Avatar,
60
61
  U as BannerCard,
61
62
  _ as Breadcrumbs,
62
63
  e as Button,
63
64
  X as CardLink,
64
- Ko as Carousel,
65
- ko as CartPart,
66
- ho as CartSlideInPanel,
67
- So as Chip,
68
- Zo as ChipSelector,
65
+ Wo as Carousel,
66
+ Io as CartPart,
67
+ wo as CartSlideInPanel,
68
+ Ao as Chip,
69
+ qo as ChipSelector,
69
70
  f as Column,
70
71
  oo as Disclaimer,
71
- Go as Error,
72
+ no as DropdownButton,
73
+ Qo as Error,
72
74
  m as Flex,
73
- Wo as Footer,
75
+ Yo as Footer,
74
76
  x as Grid,
75
77
  i as Head,
76
78
  fo as HorizontalScroll,
77
79
  l as Icon,
78
- Vo as ImageViewer,
80
+ zo as ImageViewer,
79
81
  A as Input,
80
- P as Link,
82
+ I as Link,
81
83
  y as LinkButton,
82
- z as Logo,
83
- Qo as MainNav,
84
- Mo as Modal,
84
+ D as Logo,
85
+ Zo as MainNav,
86
+ Vo as Modal,
85
87
  mo as NotFound,
86
- uo as Popover,
88
+ Co as Popover,
87
89
  R as Pricing,
88
- qo as Product,
90
+ Ko as Product,
89
91
  O as QuantityInput,
90
92
  u as Root,
91
93
  E as SearchBox,
92
94
  C as Separator,
93
95
  ao as SlideInPanel,
94
- Yo as SpinZoomViewer,
95
- Lo as StatefulButton,
96
- Do as Table,
96
+ $o as SpinZoomViewer,
97
+ bo as StatefulButton,
98
+ Go as Table,
97
99
  S as Text,
98
100
  k as ToggleSwitch,
99
- Ao as ToggleView,
100
- no as Tooltip,
101
+ ko as ToggleView,
102
+ uo as Tooltip,
101
103
  H as configureImage,
102
- L as configureLink,
104
+ w as configureLink,
103
105
  N as getHideAtStyles,
104
106
  h as linkClassName,
105
- w as routerOverride
107
+ L as routerOverride
106
108
  };
@@ -35,7 +35,7 @@ export { QuantityInput } from './molecules/QuantityInput/QuantityInput';
35
35
  export { Pricing } from './molecules/Pricing/Pricing';
36
36
  export type { PricingProps } from './molecules/Pricing/Pricing';
37
37
  export { Availability } from './molecules/Availability/Availability';
38
- export type { AvailabilityProps, ContactUsLinkBehavior } from './molecules/Availability/Availability';
38
+ export type { AvailabilityProps } from './molecules/Availability/Availability';
39
39
  export { Avatar } from './molecules/Avatar/Avatar';
40
40
  export type { AvatarProps } from './molecules/Avatar/Avatar';
41
41
  export { BannerCard } from './molecules/BannerCard/BannerCard';
@@ -1,9 +1,18 @@
1
- export type ContactUsLinkBehavior = "same-tab" | "new-tab";
2
1
  export interface AvailabilityProps {
3
- availId: string;
2
+ availId: AvailabilityId;
4
3
  availDescription: string;
5
- contactHref: string;
6
- contactLinkBehavior: ContactUsLinkBehavior;
7
4
  availClassName?: string;
5
+ enableTooltip?: boolean;
6
+ inventory?: Inventory;
8
7
  }
9
- export declare function Availability({ availId: id, availDescription: description, contactHref, contactLinkBehavior, availClassName: className }: AvailabilityProps): import("react/jsx-runtime").JSX.Element;
8
+ export interface WarehouseInventory {
9
+ Unreserved: number;
10
+ Available: number;
11
+ }
12
+ export interface Inventory {
13
+ MPK?: WarehouseInventory;
14
+ SEA?: WarehouseInventory;
15
+ STL?: WarehouseInventory;
16
+ }
17
+ export type AvailabilityId = "in-stock" | "limited" | "discontinued" | "available" | "not-found";
18
+ export declare function Availability({ availId: id, availDescription: description, availClassName: className, enableTooltip, inventory }: AvailabilityProps): import("react/jsx-runtime").JSX.Element;