quirk-ui 0.1.68 → 0.1.69
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/core/components/ButtonGroup/ButtonGroup.test.cjs +1 -1
- package/dist/core/components/ButtonGroup/ButtonGroup.test.mjs +4 -4
- package/dist/core/components/ButtonGroup/index.cjs +1 -1
- package/dist/core/components/ButtonGroup/index.mjs +25 -25
- package/dist/core.d.ts +17 -17
- package/dist/index33.css +1 -1
- package/dist/main.d.ts +18 -18
- package/dist/next/ui/CallToAction/index.cjs +1 -1
- package/dist/next/ui/CallToAction/index.mjs +15 -14
- package/dist/next/utils/blockRenderers.cjs +1 -1
- package/dist/next/utils/blockRenderers.mjs +23 -14
- package/dist/next.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),e=require("../../../index-DITXfOUM.cjs"),o=require("./index.cjs");e.describe("ButtonGroup",()=>{e.describe("Rendering",()=>{e.it("renders children",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]})),e.globalExpect(e.screen.getByText("One")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Two")).toBeInTheDocument()}),e.it("renders multiple button types",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"Button"}),t.jsx("a",{href:"#",children:"Link"}),t.jsx("span",{children:"Text"})]})),e.globalExpect(e.screen.getByText("Button")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Link")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Text")).toBeInTheDocument()})}),e.describe("Orientation",()=>{e.it("applies horizontal orientation by default",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("horizontal")}),e.it("applies vertical orientation when specified",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{orientation:"vertical",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("vertical")})}),e.describe("Alignment",()=>{e.it("applies left alignment by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("left")}),e.it("applies center alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"center",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("center")}),e.it("applies right alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"right",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("right")})}),e.describe("Size",()=>{e.it("applies md size by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("md")}),e.it("applies sm size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),e=require("../../../index-DITXfOUM.cjs"),o=require("./index.cjs");e.describe("ButtonGroup",()=>{e.describe("Rendering",()=>{e.it("renders children",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]})),e.globalExpect(e.screen.getByText("One")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Two")).toBeInTheDocument()}),e.it("renders multiple button types",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"Button"}),t.jsx("a",{href:"#",children:"Link"}),t.jsx("span",{children:"Text"})]})),e.globalExpect(e.screen.getByText("Button")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Link")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Text")).toBeInTheDocument()})}),e.describe("Orientation",()=>{e.it("applies horizontal orientation by default",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("horizontal")}),e.it("applies vertical orientation when specified",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{orientation:"vertical",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("vertical")})}),e.describe("Alignment",()=>{e.it("applies left alignment by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("left")}),e.it("applies center alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"center",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("center")}),e.it("applies right alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"right",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("right")})}),e.describe("Size",()=>{e.it("applies md size by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("md")}),e.it("applies sm size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{spacing:"sm",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("sm")}),e.it("applies lg size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{spacing:"lg",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("lg")})}),e.describe("Full width",()=>{e.it("does not apply fullWidth by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).not.toHaveClass("fullWidth")}),e.it("applies fullWidth when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{fullWidth:!0,children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("fullWidth")})}),e.describe("Custom className",()=>{e.it("accepts a custom className",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{className:"custom-class",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("custom-class"),e.globalExpect(n.firstChild).toHaveClass("buttonGroup")})}),e.describe("ARIA and accessibility",()=>{e.it("has role='group' by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("role","group")}),e.it("accepts custom role",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{role:"toolbar",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("role","toolbar")}),e.it("supports aria-label",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{"aria-label":"Actions",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("aria-label","Actions")})}),e.describe("HTML attributes",()=>{e.it("supports data attributes",()=>{e.render(t.jsx(o.ButtonGroup,{"data-testid":"my-group",children:t.jsx("button",{children:"One"})})),e.globalExpect(e.screen.getByTestId("my-group")).toBeInTheDocument()}),e.it("supports id attribute",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{id:"button-group-1",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.querySelector("#button-group-1")).toBeInTheDocument()}),e.it("supports onClick on container",()=>{const n=e.vi.fn(),{container:i}=e.render(t.jsx(o.ButtonGroup,{onClick:n,children:t.jsx("button",{children:"One"})}));e.fireEvent.click(i.firstChild),e.globalExpect(n).toHaveBeenCalledTimes(1)})}),e.describe("Combined props",()=>{e.it("combines orientation, alignment, and size",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{orientation:"vertical",alignment:"center",spacing:"lg",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("vertical"),e.globalExpect(n.firstChild).toHaveClass("center"),e.globalExpect(n.firstChild).toHaveClass("lg")}),e.it("combines all props",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{orientation:"horizontal",alignment:"right",spacing:"sm",fullWidth:!0,className:"custom",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("horizontal"),e.globalExpect(n.firstChild).toHaveClass("right"),e.globalExpect(n.firstChild).toHaveClass("sm"),e.globalExpect(n.firstChild).toHaveClass("fullWidth"),e.globalExpect(n.firstChild).toHaveClass("custom")})}),e.describe("Edge cases",()=>{e.it("handles single child",()=>{e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"Only One"})})),e.globalExpect(e.screen.getByText("Only One")).toBeInTheDocument()}),e.it("handles many children",()=>{e.render(t.jsx(o.ButtonGroup,{children:Array.from({length:10},(n,i)=>t.jsxs("button",{children:["Button ",i+1]},i))})),e.globalExpect(e.screen.getByText("Button 1")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Button 10")).toBeInTheDocument()})})});
|
|
@@ -62,12 +62,12 @@ r("ButtonGroup", () => {
|
|
|
62
62
|
n(e.firstChild).toHaveClass("md");
|
|
63
63
|
}), i("applies sm size when specified", () => {
|
|
64
64
|
const { container: e } = o(
|
|
65
|
-
/* @__PURE__ */ t(l, {
|
|
65
|
+
/* @__PURE__ */ t(l, { spacing: "sm", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
66
66
|
);
|
|
67
67
|
n(e.firstChild).toHaveClass("sm");
|
|
68
68
|
}), i("applies lg size when specified", () => {
|
|
69
69
|
const { container: e } = o(
|
|
70
|
-
/* @__PURE__ */ t(l, {
|
|
70
|
+
/* @__PURE__ */ t(l, { spacing: "lg", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
71
71
|
);
|
|
72
72
|
n(e.firstChild).toHaveClass("lg");
|
|
73
73
|
});
|
|
@@ -129,7 +129,7 @@ r("ButtonGroup", () => {
|
|
|
129
129
|
}), r("Combined props", () => {
|
|
130
130
|
i("combines orientation, alignment, and size", () => {
|
|
131
131
|
const { container: e } = o(
|
|
132
|
-
/* @__PURE__ */ t(l, { orientation: "vertical", alignment: "center",
|
|
132
|
+
/* @__PURE__ */ t(l, { orientation: "vertical", alignment: "center", spacing: "lg", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
133
133
|
);
|
|
134
134
|
n(e.firstChild).toHaveClass("vertical"), n(e.firstChild).toHaveClass("center"), n(e.firstChild).toHaveClass("lg");
|
|
135
135
|
}), i("combines all props", () => {
|
|
@@ -139,7 +139,7 @@ r("ButtonGroup", () => {
|
|
|
139
139
|
{
|
|
140
140
|
orientation: "horizontal",
|
|
141
141
|
alignment: "right",
|
|
142
|
-
|
|
142
|
+
spacing: "sm",
|
|
143
143
|
fullWidth: !0,
|
|
144
144
|
className: "custom",
|
|
145
145
|
children: /* @__PURE__ */ t("button", { children: "One" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index33.css');const g=require("react/jsx-runtime"),u="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index33.css');const g=require("react/jsx-runtime"),m="_buttonGroup_1gm2z_1",u="_horizontal_1gm2z_9",a="_vertical_1gm2z_14",z="_left_1gm2z_20",h="_center_1gm2z_24",d="_right_1gm2z_28",f="_sm_1gm2z_33",p="_md_1gm2z_37",$="_lg_1gm2z_41",v="_fullWidth_1gm2z_46",t={buttonGroup:m,horizontal:u,vertical:a,left:z,center:h,right:d,sm:f,md:p,lg:$,fullWidth:v},b={left:t.left,center:t.center,right:t.right},G={sm:t.sm,md:t.md,lg:t.lg};function W({children:o,className:n,alignment:l="left",orientation:r="horizontal",spacing:e="md",role:s="group",fullWidth:i=!1,...c}){const _=r==="vertical"?t.vertical:t.horizontal;return g.jsx("div",{className:`${t.buttonGroup} ${_} ${b[l]} ${G[e]} ${i?t.fullWidth:""} ${n??""}`.trim(),role:s,...c,children:o})}exports.ButtonGroup=W;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../../index33.css';const
|
|
3
|
-
buttonGroup:
|
|
4
|
-
horizontal:
|
|
5
|
-
vertical:
|
|
6
|
-
left:
|
|
7
|
-
center:
|
|
8
|
-
right:
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import '../../../index33.css';const g = "_buttonGroup_1gm2z_1", a = "_horizontal_1gm2z_9", u = "_vertical_1gm2z_14", z = "_left_1gm2z_20", h = "_center_1gm2z_24", f = "_right_1gm2z_28", d = "_sm_1gm2z_33", p = "_md_1gm2z_37", v = "_lg_1gm2z_41", $ = "_fullWidth_1gm2z_46", t = {
|
|
3
|
+
buttonGroup: g,
|
|
4
|
+
horizontal: a,
|
|
5
|
+
vertical: u,
|
|
6
|
+
left: z,
|
|
7
|
+
center: h,
|
|
8
|
+
right: f,
|
|
9
9
|
sm: d,
|
|
10
10
|
md: p,
|
|
11
11
|
lg: v,
|
|
12
|
-
fullWidth:
|
|
13
|
-
},
|
|
12
|
+
fullWidth: $
|
|
13
|
+
}, G = {
|
|
14
14
|
left: t.left,
|
|
15
15
|
center: t.center,
|
|
16
16
|
right: t.right
|
|
17
|
-
},
|
|
17
|
+
}, b = {
|
|
18
18
|
sm: t.sm,
|
|
19
19
|
md: t.md,
|
|
20
20
|
lg: t.lg
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function C({
|
|
23
23
|
children: o,
|
|
24
|
-
className:
|
|
25
|
-
alignment:
|
|
26
|
-
orientation:
|
|
27
|
-
|
|
28
|
-
role:
|
|
29
|
-
fullWidth:
|
|
30
|
-
...
|
|
24
|
+
className: n,
|
|
25
|
+
alignment: l = "left",
|
|
26
|
+
orientation: r = "horizontal",
|
|
27
|
+
spacing: s = "md",
|
|
28
|
+
role: _ = "group",
|
|
29
|
+
fullWidth: e = !1,
|
|
30
|
+
...c
|
|
31
31
|
}) {
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
const i = r === "vertical" ? t.vertical : t.horizontal;
|
|
33
|
+
return /* @__PURE__ */ m(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className: `${t.buttonGroup} ${
|
|
37
|
-
role:
|
|
38
|
-
...
|
|
36
|
+
className: `${t.buttonGroup} ${i} ${G[l]} ${b[s]} ${e ? t.fullWidth : ""} ${n ?? ""}`.trim(),
|
|
37
|
+
role: _,
|
|
38
|
+
...c,
|
|
39
39
|
children: o
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
C as ButtonGroup
|
|
45
45
|
};
|
package/dist/core.d.ts
CHANGED
|
@@ -175,23 +175,23 @@ declare type BreakpointColumns = {
|
|
|
175
175
|
|
|
176
176
|
export declare function Button({ variant, size, displayType, imageSrc, imageAlt, ImageComponent, icon, iconAlignment, className, children, disabled, ...restProps }: ButtonProps): JSX.Element;
|
|
177
177
|
|
|
178
|
-
export declare function ButtonGroup({ children, className, alignment, orientation,
|
|
178
|
+
export declare function ButtonGroup({ children, className, alignment, orientation, spacing, role, fullWidth, ...restProps }: ButtonGroupProps): JSX.Element;
|
|
179
179
|
|
|
180
180
|
declare type ButtonGroupProps = {
|
|
181
181
|
children: default_2.ReactNode;
|
|
182
182
|
className?: string;
|
|
183
183
|
alignment?: Alignment;
|
|
184
184
|
orientation?: Orientation;
|
|
185
|
-
|
|
185
|
+
spacing?: ButtonGroupSpacing;
|
|
186
186
|
role?: string;
|
|
187
187
|
fullWidth?: boolean;
|
|
188
188
|
} & default_2.HTMLAttributes<HTMLDivElement>;
|
|
189
189
|
|
|
190
|
-
declare type
|
|
190
|
+
declare type ButtonGroupSpacing = keyof typeof spacingClassMap;
|
|
191
191
|
|
|
192
192
|
export declare type ButtonProps = BaseProps & (AnchorTypeProps | ButtonTypeProps | ScrollTypeProps);
|
|
193
193
|
|
|
194
|
-
declare type ButtonSize = keyof typeof
|
|
194
|
+
declare type ButtonSize = keyof typeof sizeClassMap;
|
|
195
195
|
|
|
196
196
|
declare type ButtonTypeProps = {
|
|
197
197
|
as?: "button";
|
|
@@ -380,7 +380,7 @@ export declare type DrawerProps = {
|
|
|
380
380
|
className?: string;
|
|
381
381
|
};
|
|
382
382
|
|
|
383
|
-
export declare type DrawerSize = keyof typeof
|
|
383
|
+
export declare type DrawerSize = keyof typeof sizeClassMap_2;
|
|
384
384
|
|
|
385
385
|
declare type FABPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
386
386
|
|
|
@@ -1161,7 +1161,7 @@ declare type ProgressBarProps = {
|
|
|
1161
1161
|
style?: CSSProperties;
|
|
1162
1162
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1163
1163
|
|
|
1164
|
-
declare type ProgressBarSize = keyof typeof
|
|
1164
|
+
declare type ProgressBarSize = keyof typeof sizeClassMap_4;
|
|
1165
1165
|
|
|
1166
1166
|
declare type ProgressBarVariant = keyof typeof variantClassMap_6;
|
|
1167
1167
|
|
|
@@ -1297,7 +1297,7 @@ declare type SidebarProps = {
|
|
|
1297
1297
|
style?: CSSProperties;
|
|
1298
1298
|
} & Omit<default_2.HTMLAttributes<HTMLElement>, "style">;
|
|
1299
1299
|
|
|
1300
|
-
declare type Size = keyof typeof
|
|
1300
|
+
declare type Size = keyof typeof sizeClassMap_3;
|
|
1301
1301
|
|
|
1302
1302
|
declare const sizeClassMap: {
|
|
1303
1303
|
readonly sm: string;
|
|
@@ -1309,13 +1309,13 @@ declare const sizeClassMap_2: {
|
|
|
1309
1309
|
readonly sm: string;
|
|
1310
1310
|
readonly md: string;
|
|
1311
1311
|
readonly lg: string;
|
|
1312
|
+
readonly full: string;
|
|
1312
1313
|
};
|
|
1313
1314
|
|
|
1314
1315
|
declare const sizeClassMap_3: {
|
|
1315
1316
|
readonly sm: string;
|
|
1316
1317
|
readonly md: string;
|
|
1317
1318
|
readonly lg: string;
|
|
1318
|
-
readonly full: string;
|
|
1319
1319
|
};
|
|
1320
1320
|
|
|
1321
1321
|
declare const sizeClassMap_4: {
|
|
@@ -1325,12 +1325,6 @@ declare const sizeClassMap_4: {
|
|
|
1325
1325
|
};
|
|
1326
1326
|
|
|
1327
1327
|
declare const sizeClassMap_5: {
|
|
1328
|
-
readonly sm: string;
|
|
1329
|
-
readonly md: string;
|
|
1330
|
-
readonly lg: string;
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
declare const sizeClassMap_6: {
|
|
1334
1328
|
readonly xs: string;
|
|
1335
1329
|
readonly sm: string;
|
|
1336
1330
|
readonly md: string;
|
|
@@ -1339,7 +1333,7 @@ declare const sizeClassMap_6: {
|
|
|
1339
1333
|
readonly "2xl": string;
|
|
1340
1334
|
};
|
|
1341
1335
|
|
|
1342
|
-
declare const
|
|
1336
|
+
declare const sizeClassMap_6: {
|
|
1343
1337
|
readonly xs: string;
|
|
1344
1338
|
readonly sm: string;
|
|
1345
1339
|
readonly md: string;
|
|
@@ -1374,7 +1368,13 @@ declare type SpacerProps = {
|
|
|
1374
1368
|
style?: CSSProperties;
|
|
1375
1369
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1376
1370
|
|
|
1377
|
-
declare type SpacerSize = keyof typeof
|
|
1371
|
+
declare type SpacerSize = keyof typeof sizeClassMap_5;
|
|
1372
|
+
|
|
1373
|
+
declare const spacingClassMap: {
|
|
1374
|
+
readonly sm: string;
|
|
1375
|
+
readonly md: string;
|
|
1376
|
+
readonly lg: string;
|
|
1377
|
+
};
|
|
1378
1378
|
|
|
1379
1379
|
export declare function Spinner({ size, variant, label, fullScreen, className, style, ...restProps }: SpinnerProps): JSX.Element;
|
|
1380
1380
|
|
|
@@ -1387,7 +1387,7 @@ declare type SpinnerProps = {
|
|
|
1387
1387
|
style?: CSSProperties;
|
|
1388
1388
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1389
1389
|
|
|
1390
|
-
declare type SpinnerSize = keyof typeof
|
|
1390
|
+
declare type SpinnerSize = keyof typeof sizeClassMap_6;
|
|
1391
1391
|
|
|
1392
1392
|
declare type SpinnerVariant = keyof typeof variantClassMap_8;
|
|
1393
1393
|
|
package/dist/index33.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._buttonGroup_1gm2z_1{display:flex;gap:var(--spacing-sm);align-items:center;width:fit-content}._horizontal_1gm2z_9{flex-direction:row;flex-wrap:wrap}._vertical_1gm2z_14{flex-direction:column;align-items:stretch}._left_1gm2z_20{justify-content:flex-start}._center_1gm2z_24{justify-content:center}._right_1gm2z_28{justify-content:flex-end}._sm_1gm2z_33{gap:var(--spacing-sm)}._md_1gm2z_37{gap:var(--spacing-md)}._lg_1gm2z_41{gap:var(--spacing-lg)}._fullWidth_1gm2z_46{width:100%}._fullWidth_1gm2z_46._horizontal_1gm2z_9>*{flex:1}._fullWidth_1gm2z_46._vertical_1gm2z_14{align-items:stretch}@media (max-width: 480px){._buttonGroup_1gm2z_1{width:100%}._horizontal_1gm2z_9{flex-direction:column;align-items:stretch}}
|
package/dist/main.d.ts
CHANGED
|
@@ -282,23 +282,23 @@ declare type BreakpointColumns = {
|
|
|
282
282
|
|
|
283
283
|
export declare function Button({ variant, size, displayType, imageSrc, imageAlt, ImageComponent, icon, iconAlignment, className, children, disabled, ...restProps }: ButtonProps): JSX.Element;
|
|
284
284
|
|
|
285
|
-
export declare function ButtonGroup({ children, className, alignment, orientation,
|
|
285
|
+
export declare function ButtonGroup({ children, className, alignment, orientation, spacing, role, fullWidth, ...restProps }: ButtonGroupProps): JSX.Element;
|
|
286
286
|
|
|
287
287
|
declare type ButtonGroupProps = {
|
|
288
288
|
children: default_2.ReactNode;
|
|
289
289
|
className?: string;
|
|
290
290
|
alignment?: Alignment;
|
|
291
291
|
orientation?: Orientation;
|
|
292
|
-
|
|
292
|
+
spacing?: ButtonGroupSpacing;
|
|
293
293
|
role?: string;
|
|
294
294
|
fullWidth?: boolean;
|
|
295
295
|
} & default_2.HTMLAttributes<HTMLDivElement>;
|
|
296
296
|
|
|
297
|
-
declare type
|
|
297
|
+
declare type ButtonGroupSpacing = keyof typeof spacingClassMap;
|
|
298
298
|
|
|
299
299
|
export declare type ButtonProps = BaseProps & (AnchorTypeProps | ButtonTypeProps | ScrollTypeProps);
|
|
300
300
|
|
|
301
|
-
declare type ButtonSize = keyof typeof
|
|
301
|
+
declare type ButtonSize = keyof typeof sizeClassMap;
|
|
302
302
|
|
|
303
303
|
declare type ButtonTypeProps = {
|
|
304
304
|
as?: "button";
|
|
@@ -544,7 +544,7 @@ export declare type DrawerProps = {
|
|
|
544
544
|
className?: string;
|
|
545
545
|
};
|
|
546
546
|
|
|
547
|
-
export declare type DrawerSize = keyof typeof
|
|
547
|
+
export declare type DrawerSize = keyof typeof sizeClassMap_2;
|
|
548
548
|
|
|
549
549
|
/**
|
|
550
550
|
* Extracts plain text from a PortableText block array.
|
|
@@ -1411,7 +1411,7 @@ declare type ProgressBarProps = {
|
|
|
1411
1411
|
style?: CSSProperties;
|
|
1412
1412
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1413
1413
|
|
|
1414
|
-
declare type ProgressBarSize = keyof typeof
|
|
1414
|
+
declare type ProgressBarSize = keyof typeof sizeClassMap_4;
|
|
1415
1415
|
|
|
1416
1416
|
declare type ProgressBarVariant = keyof typeof variantClassMap_6;
|
|
1417
1417
|
|
|
@@ -1498,7 +1498,7 @@ declare type RangeSize = "sm" | "md" | "lg";
|
|
|
1498
1498
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1499
1499
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1500
1500
|
*/
|
|
1501
|
-
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1501
|
+
export declare function renderCallToAction({ alignment, spacing, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1502
1502
|
|
|
1503
1503
|
export { RenderCallToActionProps }
|
|
1504
1504
|
|
|
@@ -1659,7 +1659,7 @@ export { SingletonBlockProps }
|
|
|
1659
1659
|
|
|
1660
1660
|
export { SiteSettings }
|
|
1661
1661
|
|
|
1662
|
-
declare type Size = keyof typeof
|
|
1662
|
+
declare type Size = keyof typeof sizeClassMap_3;
|
|
1663
1663
|
|
|
1664
1664
|
declare const sizeClassMap: {
|
|
1665
1665
|
readonly sm: string;
|
|
@@ -1671,13 +1671,13 @@ declare const sizeClassMap_2: {
|
|
|
1671
1671
|
readonly sm: string;
|
|
1672
1672
|
readonly md: string;
|
|
1673
1673
|
readonly lg: string;
|
|
1674
|
+
readonly full: string;
|
|
1674
1675
|
};
|
|
1675
1676
|
|
|
1676
1677
|
declare const sizeClassMap_3: {
|
|
1677
1678
|
readonly sm: string;
|
|
1678
1679
|
readonly md: string;
|
|
1679
1680
|
readonly lg: string;
|
|
1680
|
-
readonly full: string;
|
|
1681
1681
|
};
|
|
1682
1682
|
|
|
1683
1683
|
declare const sizeClassMap_4: {
|
|
@@ -1687,12 +1687,6 @@ declare const sizeClassMap_4: {
|
|
|
1687
1687
|
};
|
|
1688
1688
|
|
|
1689
1689
|
declare const sizeClassMap_5: {
|
|
1690
|
-
readonly sm: string;
|
|
1691
|
-
readonly md: string;
|
|
1692
|
-
readonly lg: string;
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
declare const sizeClassMap_6: {
|
|
1696
1690
|
readonly xs: string;
|
|
1697
1691
|
readonly sm: string;
|
|
1698
1692
|
readonly md: string;
|
|
@@ -1701,7 +1695,7 @@ declare const sizeClassMap_6: {
|
|
|
1701
1695
|
readonly "2xl": string;
|
|
1702
1696
|
};
|
|
1703
1697
|
|
|
1704
|
-
declare const
|
|
1698
|
+
declare const sizeClassMap_6: {
|
|
1705
1699
|
readonly xs: string;
|
|
1706
1700
|
readonly sm: string;
|
|
1707
1701
|
readonly md: string;
|
|
@@ -1736,7 +1730,13 @@ declare type SpacerProps = {
|
|
|
1736
1730
|
style?: CSSProperties;
|
|
1737
1731
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1738
1732
|
|
|
1739
|
-
declare type SpacerSize = keyof typeof
|
|
1733
|
+
declare type SpacerSize = keyof typeof sizeClassMap_5;
|
|
1734
|
+
|
|
1735
|
+
declare const spacingClassMap: {
|
|
1736
|
+
readonly sm: string;
|
|
1737
|
+
readonly md: string;
|
|
1738
|
+
readonly lg: string;
|
|
1739
|
+
};
|
|
1740
1740
|
|
|
1741
1741
|
export declare function Spinner({ size, variant, label, fullScreen, className, style, ...restProps }: SpinnerProps): JSX.Element;
|
|
1742
1742
|
|
|
@@ -1749,7 +1749,7 @@ declare type SpinnerProps = {
|
|
|
1749
1749
|
style?: CSSProperties;
|
|
1750
1750
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1751
1751
|
|
|
1752
|
-
declare type SpinnerSize = keyof typeof
|
|
1752
|
+
declare type SpinnerSize = keyof typeof sizeClassMap_6;
|
|
1753
1753
|
|
|
1754
1754
|
declare type SpinnerVariant = keyof typeof variantClassMap_8;
|
|
1755
1755
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),B=require("next/image"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),B=require("next/image"),z=require("../../../core/components/ButtonGroup/index.cjs"),l=require("../../../index-D0ylyll7.cjs"),I=require("../../../core/components/Modal/index.cjs"),C=require("../../utils/resolveLinkUrl.cjs"),G=require("../../../core/context/ThemeContext.cjs"),H=require("../../hooks/useMediaQuery.cjs");function Q({items:r,alignment:M,spacing:R,className:P}){const[S,$]=U.useState([]),{mode:t}=G.useTheme(),g=H.useMediaQuery("(max-width: 767px)");return U.useEffect(()=>{if(!(r!=null&&r.length)||!C.resolveLinkURL)return;async function e(){const o=await Promise.all(r.map(a=>C.resolveLinkURL(a)));$(o)}e()},[r]),r!=null&&r.length?n.jsx(z.ButtonGroup,{className:P,alignment:M,spacing:R,children:r.slice(0,3).map((e,o)=>{var m,d,p,c,h,b,f,y,v,x,_,k,j,T,A,w,q,L;const a=S[o]??"#",i={};if(i.height="auto",((m=e.image)==null?void 0:m.layout)==="cover")i.objectFit="cover",(d=e.image)!=null&&d.position&&(i.objectPosition=g?"top":(p=e.image)==null?void 0:p.position);else if(((c=e.image)==null?void 0:c.layout)==="contain"){if(i.objectFit="contain",((h=e.image)==null?void 0:h.sizing)==="half"?i.width=g?"100%":"50%":((b=e.image)==null?void 0:b.sizing)==="inset"?(i.width="100%",i.maxWidth=e.image.maxWidth??"unset"):i.width="100%",(f=e.image)!=null&&f.aspectRatio){const[F,O]=(y=e.image)==null?void 0:y.aspectRatio.split(":").map(Number);i.aspectRatio=`${F}/${O}`}}else i.objectFit="none";let s;(v=e.image)!=null&&v.imageUrls&&(s=t==="dark"&&((x=e.image.imageUrls.dark)==null?void 0:x.medium)||e.image.imageUrls.default.medium);let u=((j=(k=(_=e.image)==null?void 0:_[t==="dark"?"darkImage":"defaultImage"])==null?void 0:k.asset)==null?void 0:j.altText)||((w=(A=(T=e.image)==null?void 0:T[t==="dark"?"darkImage":"defaultImage"])==null?void 0:A.asset)==null?void 0:w.description)||"Card image";switch(e.type){case"link":return n.jsx(l.Button,{as:"a",variant:e.variant,href:a,target:((q=e.linkOptions)==null?void 0:q.linkType)==="external"?"_blank":"_self",rel:((L=e.linkOptions)==null?void 0:L.linkType)==="external"?"noopener noreferrer":"","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",displayType:e.displayType,ImageComponent:n.jsx(B,{src:s??"",alt:u,width:600,height:658,priority:!1,style:i}),children:e.label},o);case"scroll":return n.jsx(l.Button,{as:"scroll",variant:e.variant,scrollTarget:e.scrollTarget??"","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",displayType:e.displayType,ImageComponent:n.jsx(B,{src:s??"",alt:u,width:600,height:658,priority:!1,style:i}),children:e.label},o);case"modal":return n.jsx(I.Modal,{trigger:n.jsx(l.Button,{as:"button",variant:e.variant??"primary",icon:e.icon,iconAlignment:e.iconAlignment??"right","aria-label":e.ariaLabel||e.label,children:e.label}),content:e.modalContent},o);case"video":return n.jsx(I.Modal,{trigger:n.jsx(l.Button,{as:"button",variant:e.variant??"primary",icon:e.icon,iconAlignment:e.iconAlignment??"right","aria-label":e.ariaLabel||e.label,children:e.label}),content:n.jsx("video",{src:e.videoUrl,controls:!0,autoPlay:!0})},o);case"download":return n.jsx(l.Button,{as:"a",variant:e.variant??"primary",href:a,download:!0,target:"_blank",rel:"noopener noreferrer","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",children:e.label},o)}})}):null}exports.CallToAction=Q;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as S, useEffect as W } from "react";
|
|
3
3
|
import C from "next/image";
|
|
4
|
-
import { ButtonGroup as
|
|
4
|
+
import { ButtonGroup as $ } from "../../../core/components/ButtonGroup/index.mjs";
|
|
5
5
|
import { B as a } from "../../../index-CnlJ2RgH.js";
|
|
6
6
|
import { Modal as R } from "../../../core/components/Modal/index.mjs";
|
|
7
7
|
import { resolveLinkURL as B } from "../../utils/resolveLinkUrl.mjs";
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import { useMediaQuery as
|
|
10
|
-
function
|
|
8
|
+
import { useTheme as E } from "../../../core/context/ThemeContext.mjs";
|
|
9
|
+
import { useMediaQuery as G } from "../../hooks/useMediaQuery.mjs";
|
|
10
|
+
function Z({
|
|
11
11
|
items: n,
|
|
12
12
|
alignment: F,
|
|
13
|
-
|
|
13
|
+
spacing: M,
|
|
14
|
+
className: P
|
|
14
15
|
}) {
|
|
15
|
-
const [
|
|
16
|
-
return
|
|
16
|
+
const [_, z] = S([]), { mode: t } = E(), s = G("(max-width: 767px)");
|
|
17
|
+
return W(() => {
|
|
17
18
|
if (!(n != null && n.length) || !B) return;
|
|
18
19
|
async function e() {
|
|
19
20
|
const l = await Promise.all(
|
|
20
21
|
n.map((o) => B(o))
|
|
21
22
|
);
|
|
22
|
-
|
|
23
|
+
z(l);
|
|
23
24
|
}
|
|
24
25
|
e();
|
|
25
|
-
}, [n]), n != null && n.length ? /* @__PURE__ */ r(
|
|
26
|
+
}, [n]), n != null && n.length ? /* @__PURE__ */ r($, { className: P, alignment: F, spacing: M, children: n.slice(0, 3).map((e, l) => {
|
|
26
27
|
var p, d, u, f, h, b, y, v, c, k, A, T, w, I, L, U, j, x;
|
|
27
|
-
const o =
|
|
28
|
+
const o = _[l] ?? "#", i = {};
|
|
28
29
|
if (i.height = "auto", ((p = e.image) == null ? void 0 : p.layout) === "cover")
|
|
29
30
|
i.objectFit = "cover", (d = e.image) != null && d.position && (i.objectPosition = s ? "top" : (u = e.image) == null ? void 0 : u.position);
|
|
30
31
|
else if (((f = e.image) == null ? void 0 : f.layout) === "contain") {
|
|
31
32
|
if (i.objectFit = "contain", ((h = e.image) == null ? void 0 : h.sizing) === "half" ? i.width = s ? "100%" : "50%" : ((b = e.image) == null ? void 0 : b.sizing) === "inset" ? (i.width = "100%", i.maxWidth = e.image.maxWidth ?? "unset") : i.width = "100%", (y = e.image) != null && y.aspectRatio) {
|
|
32
|
-
const [
|
|
33
|
-
i.aspectRatio = `${
|
|
33
|
+
const [H, O] = (v = e.image) == null ? void 0 : v.aspectRatio.split(":").map(Number);
|
|
34
|
+
i.aspectRatio = `${H}/${O}`;
|
|
34
35
|
}
|
|
35
36
|
} else
|
|
36
37
|
i.objectFit = "none";
|
|
@@ -151,5 +152,5 @@ function Y({
|
|
|
151
152
|
}) }) : null;
|
|
152
153
|
}
|
|
153
154
|
export {
|
|
154
|
-
|
|
155
|
+
Z as CallToAction
|
|
155
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("../ui/PortableTextRenderer/index.cjs"),l=require("../ui/CallToAction/index.cjs");function o(e){return e.flatMap(r=>r.children??[]).map(r=>r.text??"").join("")}function x({blocks:e,className:r,textOverride:n,animateText:t}){return e!=null&&e.length?i.jsx(u.RichText,{blocks:e,className:r,textOverride:n,animateText:t}):null}function c({alignment:e,spacing:r,items:n,className:t}){return n!=null&&n.length?i.jsx(l.CallToAction,{alignment:e,items:n,className:t,spacing:r}):null}exports.extractText=o;exports.renderCallToAction=c;exports.renderRichText=x;
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { RichText as u } from "../ui/PortableTextRenderer/index.mjs";
|
|
3
3
|
import { CallToAction as f } from "../ui/CallToAction/index.mjs";
|
|
4
|
-
function a(
|
|
5
|
-
return
|
|
4
|
+
function a(r) {
|
|
5
|
+
return r.flatMap((n) => n.children ?? []).map((n) => n.text ?? "").join("");
|
|
6
6
|
}
|
|
7
7
|
function p({
|
|
8
|
-
blocks:
|
|
9
|
-
className:
|
|
8
|
+
blocks: r,
|
|
9
|
+
className: n,
|
|
10
10
|
textOverride: t,
|
|
11
|
-
animateText:
|
|
11
|
+
animateText: e
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
13
|
+
return r != null && r.length ? /* @__PURE__ */ o(
|
|
14
14
|
u,
|
|
15
15
|
{
|
|
16
|
-
blocks:
|
|
17
|
-
className:
|
|
16
|
+
blocks: r,
|
|
17
|
+
className: n,
|
|
18
18
|
textOverride: t,
|
|
19
|
-
animateText:
|
|
19
|
+
animateText: e
|
|
20
20
|
}
|
|
21
21
|
) : null;
|
|
22
22
|
}
|
|
23
23
|
function h({
|
|
24
|
-
alignment:
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
alignment: r,
|
|
25
|
+
spacing: n,
|
|
26
|
+
items: t,
|
|
27
|
+
className: e
|
|
27
28
|
}) {
|
|
28
|
-
return
|
|
29
|
+
return t != null && t.length ? /* @__PURE__ */ o(
|
|
30
|
+
f,
|
|
31
|
+
{
|
|
32
|
+
alignment: r,
|
|
33
|
+
items: t,
|
|
34
|
+
className: e,
|
|
35
|
+
spacing: n
|
|
36
|
+
}
|
|
37
|
+
) : null;
|
|
29
38
|
}
|
|
30
39
|
export {
|
|
31
40
|
a as extractText,
|
package/dist/next.d.ts
CHANGED
|
@@ -244,7 +244,7 @@ export { QuoteBlockProps }
|
|
|
244
244
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
245
245
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
246
246
|
*/
|
|
247
|
-
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
247
|
+
export declare function renderCallToAction({ alignment, spacing, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* Drop-in `renderRichText` prop for all QuirkUI blocks.
|