@enadhq/enad-react-sdk 1.1.0 → 1.3.0
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/client/cart/components/cart-drawer.mjs +3 -3
- package/dist/client/cart/components/cart-drawer.mjs.map +1 -1
- package/dist/client/cart/components/cart-trigger.mjs +1 -1
- package/dist/client/cart/components/cart-trigger.mjs.map +1 -1
- package/dist/client/storefront/blocks/card-video.mjs +1 -1
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -1
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -1
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +13 -5
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -1
- package/dist/client/storefront/blocks/gallery.d.ts +10 -1
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -1
- package/dist/client/storefront/blocks/gallery.mjs +51 -27
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -1
- package/dist/client/storefront/blocks/hero.d.ts +12 -1
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -1
- package/dist/client/storefront/blocks/hero.mjs +143 -145
- package/dist/client/storefront/blocks/hero.mjs.map +1 -1
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -1
- package/dist/client/storefront/blocks/link-block-small.mjs +1 -1
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -1
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -1
- package/dist/client/storefront/blocks/link-block.mjs +4 -4
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-card-parts.d.ts +1 -1
- package/dist/client/storefront/blocks/product-card-parts.d.ts.map +1 -1
- package/dist/client/storefront/blocks/product-card-parts.mjs +2 -2
- package/dist/client/storefront/blocks/product-card-parts.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-card.d.ts +10 -1
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -1
- package/dist/client/storefront/blocks/product-card.mjs +122 -116
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-image.mjs +2 -2
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -1
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +14 -1
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -1
- package/dist/client/storefront/blocks/text-content-with-image.mjs +141 -164
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -1
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +5 -1
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -1
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +2 -1
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -1
- package/dist/client/storefront/checkout/cart-summary.mjs +1 -1
- package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -1
- package/dist/client/storefront/components/language-selector.d.ts.map +1 -1
- package/dist/client/storefront/components/language-selector.mjs +1 -1
- package/dist/client/storefront/components/language-selector.mjs.map +1 -1
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -1
- package/dist/client/storefront/components/product-recommendations.mjs +29 -37
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -1
- package/dist/client/storefront/filters/filter-chip.d.ts +5 -2
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -1
- package/dist/client/storefront/filters/filter-chip.mjs +6 -4
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -1
- package/dist/client/storefront/filters/filter-panel.mjs +2 -2
- package/dist/client/storefront/filters/filter-panel.mjs.map +1 -1
- package/dist/client/storefront/filters/toggle-list-view.mjs +1 -1
- package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -1
- package/dist/client/storefront/index.d.ts +12 -1
- package/dist/client/storefront/index.mjs +12 -1
- package/dist/client/storefront/layout/header.d.ts.map +1 -1
- package/dist/client/storefront/layout/header.mjs +1 -1
- package/dist/client/storefront/layout/header.mjs.map +1 -1
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +1 -1
- package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -1
- package/dist/client/storefront/layout/promotion-bar.mjs +3 -3
- package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -1
- package/dist/client/storefront/primitives/block-heading.d.ts +40 -0
- package/dist/client/storefront/primitives/block-heading.d.ts.map +1 -0
- package/dist/client/storefront/primitives/block-heading.mjs +43 -0
- package/dist/client/storefront/primitives/block-heading.mjs.map +1 -0
- package/dist/client/storefront/primitives/button.d.ts +2 -2
- package/dist/client/storefront/primitives/button.d.ts.map +1 -1
- package/dist/client/storefront/primitives/button.mjs +4 -4
- package/dist/client/storefront/primitives/button.mjs.map +1 -1
- package/dist/client/storefront/primitives/cta-group.d.ts +25 -0
- package/dist/client/storefront/primitives/cta-group.d.ts.map +1 -0
- package/dist/client/storefront/primitives/cta-group.mjs +27 -0
- package/dist/client/storefront/primitives/cta-group.mjs.map +1 -0
- package/dist/client/storefront/primitives/image-with-hover.d.ts +18 -0
- package/dist/client/storefront/primitives/image-with-hover.d.ts.map +1 -0
- package/dist/client/storefront/primitives/image-with-hover.mjs +16 -0
- package/dist/client/storefront/primitives/image-with-hover.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +4 -1
- package/dist/client/storefront/primitives/index.mjs +4 -1
- package/dist/client/storefront/primitives/input.d.ts +1 -1
- package/dist/client/storefront/primitives/input.mjs.map +1 -1
- package/dist/client/storefront/primitives/pagination.mjs +2 -2
- package/dist/client/storefront/primitives/pagination.mjs.map +1 -1
- package/dist/client/storefront/product/quantity-picker.mjs +2 -2
- package/dist/client/storefront/product/quantity-picker.mjs.map +1 -1
- package/dist/client/storefront/types.d.ts +1 -1
- package/dist/client/storefront/types.d.ts.map +1 -1
- package/dist/client/storefront/types.mjs.map +1 -1
- package/dist/client/theme/apply.d.ts +1 -1
- package/dist/client/theme/apply.d.ts.map +1 -1
- package/dist/client/theme/apply.mjs +0 -12
- package/dist/client/theme/apply.mjs.map +1 -1
- package/dist/client/theme/cli.mjs +0 -16
- package/dist/client/theme/cli.mjs.map +1 -1
- package/dist/client/theme/codec.d.ts.map +1 -1
- package/dist/client/theme/codec.mjs +0 -2
- package/dist/client/theme/codec.mjs.map +1 -1
- package/dist/client/theme/defaults.d.ts +0 -2
- package/dist/client/theme/defaults.mjs +0 -2
- package/dist/client/theme/defaults.mjs.map +1 -1
- package/dist/client/ui/accordion.d.ts +12 -1
- package/dist/client/ui/accordion.d.ts.map +1 -1
- package/dist/client/ui/accordion.mjs +23 -5
- package/dist/client/ui/accordion.mjs.map +1 -1
- package/dist/client/ui/alert.d.ts +16 -7
- package/dist/client/ui/alert.d.ts.map +1 -1
- package/dist/client/ui/alert.mjs +21 -8
- package/dist/client/ui/alert.mjs.map +1 -1
- package/dist/client/ui/avatar.d.ts +10 -1
- package/dist/client/ui/avatar.d.ts.map +1 -1
- package/dist/client/ui/avatar.mjs +18 -4
- package/dist/client/ui/avatar.mjs.map +1 -1
- package/dist/client/ui/breadcrumb.d.ts +13 -1
- package/dist/client/ui/breadcrumb.d.ts.map +1 -1
- package/dist/client/ui/breadcrumb.mjs +27 -7
- package/dist/client/ui/breadcrumb.mjs.map +1 -1
- package/dist/client/ui/button.d.ts +28 -10
- package/dist/client/ui/button.d.ts.map +1 -1
- package/dist/client/ui/button.mjs +45 -20
- package/dist/client/ui/button.mjs.map +1 -1
- package/dist/client/ui/card.d.ts +20 -1
- package/dist/client/ui/card.d.ts.map +1 -1
- package/dist/client/ui/card.mjs +36 -8
- package/dist/client/ui/card.mjs.map +1 -1
- package/dist/client/ui/carousel.d.ts +9 -1
- package/dist/client/ui/carousel.d.ts.map +1 -1
- package/dist/client/ui/carousel.mjs +20 -4
- package/dist/client/ui/carousel.mjs.map +1 -1
- package/dist/client/ui/checkbox.d.ts +9 -1
- package/dist/client/ui/checkbox.d.ts.map +1 -1
- package/dist/client/ui/checkbox.mjs +12 -3
- package/dist/client/ui/checkbox.mjs.map +1 -1
- package/dist/client/ui/dialog.d.ts +13 -1
- package/dist/client/ui/dialog.d.ts.map +1 -1
- package/dist/client/ui/dialog.mjs +27 -7
- package/dist/client/ui/dialog.mjs.map +1 -1
- package/dist/client/ui/hover-card.d.ts +6 -1
- package/dist/client/ui/hover-card.d.ts.map +1 -1
- package/dist/client/ui/hover-card.mjs +4 -2
- package/dist/client/ui/hover-card.mjs.map +1 -1
- package/dist/client/ui/input.d.ts +20 -7
- package/dist/client/ui/input.d.ts.map +1 -1
- package/dist/client/ui/input.mjs +33 -9
- package/dist/client/ui/input.mjs.map +1 -1
- package/dist/client/ui/label.d.ts +6 -1
- package/dist/client/ui/label.d.ts.map +1 -1
- package/dist/client/ui/label.mjs +4 -2
- package/dist/client/ui/label.mjs.map +1 -1
- package/dist/client/ui/navigation-menu.d.ts +20 -3
- package/dist/client/ui/navigation-menu.d.ts.map +1 -1
- package/dist/client/ui/navigation-menu.mjs +34 -12
- package/dist/client/ui/navigation-menu.mjs.map +1 -1
- package/dist/client/ui/pagination.d.ts.map +1 -1
- package/dist/client/ui/pagination.mjs +3 -3
- package/dist/client/ui/pagination.mjs.map +1 -1
- package/dist/client/ui/popover.d.ts +11 -1
- package/dist/client/ui/popover.d.ts.map +1 -1
- package/dist/client/ui/popover.mjs +21 -5
- package/dist/client/ui/popover.mjs.map +1 -1
- package/dist/client/ui/progress.d.ts +9 -1
- package/dist/client/ui/progress.d.ts.map +1 -1
- package/dist/client/ui/progress.mjs +12 -3
- package/dist/client/ui/progress.mjs.map +1 -1
- package/dist/client/ui/select.d.ts +14 -2
- package/dist/client/ui/select.d.ts.map +1 -1
- package/dist/client/ui/select.mjs +35 -9
- package/dist/client/ui/select.mjs.map +1 -1
- package/dist/client/ui/separator.d.ts +6 -1
- package/dist/client/ui/separator.d.ts.map +1 -1
- package/dist/client/ui/separator.mjs +4 -2
- package/dist/client/ui/separator.mjs.map +1 -1
- package/dist/client/ui/sheet.d.ts +13 -1
- package/dist/client/ui/sheet.d.ts.map +1 -1
- package/dist/client/ui/sheet.mjs +35 -7
- package/dist/client/ui/sheet.mjs.map +1 -1
- package/dist/client/ui/slot-wrapper.d.ts +28 -0
- package/dist/client/ui/slot-wrapper.d.ts.map +1 -0
- package/dist/client/ui/slot-wrapper.mjs +38 -0
- package/dist/client/ui/slot-wrapper.mjs.map +1 -0
- package/dist/client/ui/tabs.d.ts +11 -1
- package/dist/client/ui/tabs.d.ts.map +1 -1
- package/dist/client/ui/tabs.mjs +21 -5
- package/dist/client/ui/tabs.mjs.map +1 -1
- package/dist/client/ui/toggle-group.d.ts +7 -4
- package/dist/client/ui/toggle-group.d.ts.map +1 -1
- package/dist/client/ui/toggle-group.mjs +4 -4
- package/dist/client/ui/toggle-group.mjs.map +1 -1
- package/dist/client/ui/toggle.d.ts +17 -8
- package/dist/client/ui/toggle.d.ts.map +1 -1
- package/dist/client/ui/toggle.mjs +11 -9
- package/dist/client/ui/toggle.mjs.map +1 -1
- package/dist/client/ui/tooltip.d.ts +6 -1
- package/dist/client/ui/tooltip.d.ts.map +1 -1
- package/dist/client/ui/tooltip.mjs +4 -2
- package/dist/client/ui/tooltip.mjs.map +1 -1
- package/dist/client/ui-resolver/button.d.ts +3 -4
- package/dist/client/ui-resolver/button.d.ts.map +1 -1
- package/dist/client/ui-resolver/button.mjs +2 -2
- package/dist/client/ui-resolver/button.mjs.map +1 -1
- package/dist/client/ui-resolver/card.d.ts +14 -1
- package/dist/client/ui-resolver/card.d.ts.map +1 -1
- package/dist/client/ui-resolver/card.mjs +3 -2
- package/dist/client/ui-resolver/card.mjs.map +1 -1
- package/dist/client/ui-resolver/context.mjs +1 -1
- package/dist/client/ui-resolver/context.mjs.map +1 -1
- package/dist/client/ui-resolver/index.d.ts +7 -4
- package/dist/client/ui-resolver/index.mjs +8 -6
- package/dist/client/ui-resolver/input.d.ts +3 -4
- package/dist/client/ui-resolver/input.d.ts.map +1 -1
- package/dist/client/ui-resolver/input.mjs +2 -2
- package/dist/client/ui-resolver/input.mjs.map +1 -1
- package/dist/client/ui-resolver/navigation-menu.d.ts +1 -2
- package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -1
- package/dist/client/ui-resolver/recipe.d.ts +95 -0
- package/dist/client/ui-resolver/recipe.d.ts.map +1 -0
- package/dist/client/ui-resolver/recipe.mjs +134 -0
- package/dist/client/ui-resolver/recipe.mjs.map +1 -0
- package/dist/client/ui-resolver/toggle.d.ts +2 -2
- package/dist/client/ui-resolver/toggle.mjs +2 -2
- package/dist/client/ui-resolver/toggle.mjs.map +1 -1
- package/dist/client/ui-resolver/types.d.ts +14 -0
- package/dist/client/ui-resolver/types.d.ts.map +1 -0
- package/dist/client/ui-resolver/types.mjs +1 -0
- package/dist/client/wishlist/wishlist-drawer.mjs +4 -4
- package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../ui/utils.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/client/storefront/primitives/block-heading.tsx
|
|
6
|
+
const headingStyle = {
|
|
7
|
+
fontWeight: "var(--enad-heading-weight)",
|
|
8
|
+
letterSpacing: "var(--enad-heading-tracking)",
|
|
9
|
+
textTransform: "var(--enad-heading-transform)"
|
|
10
|
+
};
|
|
11
|
+
const headingSizeClasses = {
|
|
12
|
+
sm: "text-xl font-heading md:text-2xl",
|
|
13
|
+
md: "text-2xl font-heading md:text-3xl",
|
|
14
|
+
lg: "text-3xl font-heading md:text-4xl lg:text-5xl",
|
|
15
|
+
xl: "text-3xl font-heading md:text-5xl lg:text-6xl"
|
|
16
|
+
};
|
|
17
|
+
function BlockHeading({ preheader, heading, body, dark = false, align = "left", headingClamp, headingTag: Tag = "h2", headingSize = "md", preheaderColor, headingColor, bodyColor, bodyMaxWidth, className }) {
|
|
18
|
+
const resolvedPreheaderColor = preheaderColor ?? (dark ? "text-white/70" : "text-muted-foreground");
|
|
19
|
+
const resolvedHeadingColor = headingColor ?? (dark ? "text-white" : "text-foreground");
|
|
20
|
+
const resolvedBodyColor = bodyColor ?? (dark ? "text-white/80" : "text-muted-foreground");
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: cn("flex min-w-0 flex-col", align === "center" && "items-center text-center", align === "right" && "items-end text-end", align === "left" && "items-start text-start", className),
|
|
23
|
+
children: [
|
|
24
|
+
preheader && /* @__PURE__ */ jsx("p", {
|
|
25
|
+
className: cn("mb-2 text-sm uppercase tracking-widest", resolvedPreheaderColor),
|
|
26
|
+
children: preheader
|
|
27
|
+
}),
|
|
28
|
+
heading && /* @__PURE__ */ jsx(Tag, {
|
|
29
|
+
className: cn(headingSizeClasses[headingSize], resolvedHeadingColor, headingClamp),
|
|
30
|
+
style: headingStyle,
|
|
31
|
+
children: heading
|
|
32
|
+
}),
|
|
33
|
+
body && /* @__PURE__ */ jsx("p", {
|
|
34
|
+
className: cn("mt-4 text-base leading-relaxed", resolvedBodyColor, bodyMaxWidth),
|
|
35
|
+
children: body
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { BlockHeading };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=block-heading.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-heading.mjs","names":[],"sources":["../../../../src/client/storefront/primitives/block-heading.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\n\nconst headingStyle = {\n fontWeight: \"var(--enad-heading-weight)\",\n letterSpacing: \"var(--enad-heading-tracking)\",\n textTransform: \"var(--enad-heading-transform)\",\n} as unknown as React.CSSProperties;\n\ninterface BlockHeadingProps {\n preheader?: string;\n heading?: string;\n body?: string;\n dark?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n headingClamp?: string;\n headingTag?: \"h1\" | \"h2\" | \"h3\";\n headingSize?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n /** Override classes for preheader color */\n preheaderColor?: string;\n /** Override classes for heading color */\n headingColor?: string;\n /** Override classes for body color */\n bodyColor?: string;\n /** Max width constraint for body text */\n bodyMaxWidth?: string;\n className?: string;\n}\n\nconst headingSizeClasses = {\n sm: \"text-xl font-heading md:text-2xl\",\n md: \"text-2xl font-heading md:text-3xl\",\n lg: \"text-3xl font-heading md:text-4xl lg:text-5xl\",\n xl: \"text-3xl font-heading md:text-5xl lg:text-6xl\",\n} as const;\n\nfunction BlockHeading({\n preheader,\n heading,\n body,\n dark = false,\n align = \"left\",\n headingClamp,\n headingTag: Tag = \"h2\",\n headingSize = \"md\",\n preheaderColor,\n headingColor,\n bodyColor,\n bodyMaxWidth,\n className,\n}: BlockHeadingProps) {\n const resolvedPreheaderColor =\n preheaderColor ?? (dark ? \"text-white/70\" : \"text-muted-foreground\");\n const resolvedHeadingColor = headingColor ?? (dark ? \"text-white\" : \"text-foreground\");\n const resolvedBodyColor = bodyColor ?? (dark ? \"text-white/80\" : \"text-muted-foreground\");\n\n return (\n <div\n className={cn(\n \"flex min-w-0 flex-col\",\n align === \"center\" && \"items-center text-center\",\n align === \"right\" && \"items-end text-end\",\n align === \"left\" && \"items-start text-start\",\n className,\n )}\n >\n {preheader && (\n <p className={cn(\"mb-2 text-sm uppercase tracking-widest\", resolvedPreheaderColor)}>\n {preheader}\n </p>\n )}\n {heading && (\n <Tag\n className={cn(headingSizeClasses[headingSize], resolvedHeadingColor, headingClamp)}\n style={headingStyle}\n >\n {heading}\n </Tag>\n )}\n {body && (\n <p className={cn(\"mt-4 text-base leading-relaxed\", resolvedBodyColor, bodyMaxWidth)}>\n {body}\n </p>\n )}\n </div>\n );\n}\n\nexport { BlockHeading, type BlockHeadingProps };\n"],"mappings":";;;;;AAKA,MAAM,eAAe;CACnB,YAAY;CACZ,eAAe;CACf,eAAe;CAChB;AAsBD,MAAM,qBAAqB;CACzB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,SAAS,aAAa,EACpB,WACA,SACA,MACA,OAAO,OACP,QAAQ,QACR,cACA,YAAY,MAAM,MAClB,cAAc,MACd,gBACA,cACA,WACA,cACA,aACoB;CACpB,MAAM,yBACJ,mBAAmB,OAAO,kBAAkB;CAC9C,MAAM,uBAAuB,iBAAiB,OAAO,eAAe;CACpE,MAAM,oBAAoB,cAAc,OAAO,kBAAkB;AAEjE,QACE,qBAAC,OAAD;EACE,WAAW,GACT,yBACA,UAAU,YAAY,4BACtB,UAAU,WAAW,sBACrB,UAAU,UAAU,0BACpB,UACD;YAPH;GASG,aACC,oBAAC,KAAD;IAAG,WAAW,GAAG,0CAA0C,uBAAuB;cAC/E;IACC,CAAA;GAEL,WACC,oBAAC,KAAD;IACE,WAAW,GAAG,mBAAmB,cAAc,sBAAsB,aAAa;IAClF,OAAO;cAEN;IACG,CAAA;GAEP,QACC,oBAAC,KAAD;IAAG,WAAW,GAAG,kCAAkC,mBAAmB,aAAa;cAChF;IACC,CAAA;GAEF"}
|
|
@@ -3,8 +3,8 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/client/storefront/primitives/button.d.ts
|
|
5
5
|
type StorefrontButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "link" | "soft" | "inverse";
|
|
6
|
-
type StorefrontButtonSize = "sm" | "
|
|
7
|
-
interface StorefrontButtonProps extends Omit<React$1.ComponentProps<"button">, "ref"> {
|
|
6
|
+
type StorefrontButtonSize = "sm" | "md" | "lg";
|
|
7
|
+
interface StorefrontButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "color"> {
|
|
8
8
|
variant?: StorefrontButtonVariant;
|
|
9
9
|
size?: StorefrontButtonSize;
|
|
10
10
|
href?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../../src/client/storefront/primitives/button.tsx"],"mappings":";;;;KAMK,uBAAA;AAAA,KAQA,oBAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../../src/client/storefront/primitives/button.tsx"],"mappings":";;;;KAMK,uBAAA;AAAA,KAQA,oBAAA;AAAA,UAYK,qBAAA,SAA8B,IAAA,CAAK,OAAA,CAAM,cAAA;EACjD,OAAA,GAAU,uBAAA;EACV,IAAA,GAAO,oBAAA;EACP,IAAA;EACA,OAAA;AAAA;AAAA,iBAGO,gBAAA,CAAA;EACP,OAAA;EACA,IAAA;EACA,IAAA;EACA,SAAA;EACA,QAAA;EACA,QAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,qBAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -5,15 +5,15 @@ import "react";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/client/storefront/primitives/button.tsx
|
|
7
7
|
const variantMap = {
|
|
8
|
-
primary: "
|
|
8
|
+
primary: "solid",
|
|
9
9
|
secondary: "secondary",
|
|
10
|
-
outline: "
|
|
11
|
-
ghost: "
|
|
10
|
+
outline: "outlined",
|
|
11
|
+
ghost: "plain",
|
|
12
12
|
link: "link",
|
|
13
13
|
soft: "soft",
|
|
14
14
|
inverse: "inverse"
|
|
15
15
|
};
|
|
16
|
-
function StorefrontButton({ variant = "primary", size = "
|
|
16
|
+
function StorefrontButton({ variant = "primary", size = "md", href, className, children, disabled, asChild, ...props }) {
|
|
17
17
|
const mappedVariant = variantMap[variant];
|
|
18
18
|
if (href && !disabled) return /* @__PURE__ */ jsx(Button, {
|
|
19
19
|
variant: mappedVariant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","names":["BaseButton"],"sources":["../../../../src/client/storefront/primitives/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Button as BaseButton } from \"../../ui-resolver/button\";\nimport { cn } from \"../../ui/utils\";\n\ntype StorefrontButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"outline\"\n | \"ghost\"\n | \"link\"\n | \"soft\"\n | \"inverse\";\ntype StorefrontButtonSize = \"sm\" | \"
|
|
1
|
+
{"version":3,"file":"button.mjs","names":["BaseButton"],"sources":["../../../../src/client/storefront/primitives/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Button as BaseButton, type ButtonVariant } from \"../../ui-resolver/button\";\nimport { cn } from \"../../ui/utils\";\n\ntype StorefrontButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"outline\"\n | \"ghost\"\n | \"link\"\n | \"soft\"\n | \"inverse\";\ntype StorefrontButtonSize = \"sm\" | \"md\" | \"lg\";\n\nconst variantMap: Record<StorefrontButtonVariant, ButtonVariant> = {\n primary: \"solid\",\n secondary: \"secondary\",\n outline: \"outlined\",\n ghost: \"plain\",\n link: \"link\",\n soft: \"soft\",\n inverse: \"inverse\",\n};\n\ninterface StorefrontButtonProps extends Omit<React.ComponentProps<\"button\">, \"ref\" | \"color\"> {\n variant?: StorefrontButtonVariant;\n size?: StorefrontButtonSize;\n href?: string;\n asChild?: boolean;\n}\n\nfunction StorefrontButton({\n variant = \"primary\",\n size = \"md\",\n href,\n className,\n children,\n disabled,\n asChild,\n ...props\n}: StorefrontButtonProps) {\n const mappedVariant = variantMap[variant];\n\n if (href && !disabled) {\n return (\n <BaseButton\n variant={mappedVariant}\n size={size}\n className={cn(\"enad-interactive\", className)}\n asChild\n >\n <a href={href} {...(props as React.ComponentProps<\"a\">)}>\n {children}\n </a>\n </BaseButton>\n );\n }\n\n return (\n <BaseButton\n variant={mappedVariant}\n size={size}\n className={cn(\"enad-interactive\", className)}\n disabled={disabled}\n asChild={asChild}\n {...props}\n >\n {children}\n </BaseButton>\n );\n}\n\nexport {\n StorefrontButton,\n type StorefrontButtonProps,\n type StorefrontButtonVariant,\n type StorefrontButtonSize,\n};\n"],"mappings":";;;;;;AAgBA,MAAM,aAA6D;CACjE,SAAS;CACT,WAAW;CACX,SAAS;CACT,OAAO;CACP,MAAM;CACN,MAAM;CACN,SAAS;CACV;AASD,SAAS,iBAAiB,EACxB,UAAU,WACV,OAAO,MACP,MACA,WACA,UACA,UACA,SACA,GAAG,SACqB;CACxB,MAAM,gBAAgB,WAAW;AAEjC,KAAI,QAAQ,CAAC,SACX,QACE,oBAACA,QAAD;EACE,SAAS;EACH;EACN,WAAW,GAAG,oBAAoB,UAAU;EAC5C,SAAA;YAEA,oBAAC,KAAD;GAAS;GAAM,GAAK;GACjB;GACC,CAAA;EACO,CAAA;AAIjB,QACE,oBAACA,QAAD;EACE,SAAS;EACH;EACN,WAAW,GAAG,oBAAoB,UAAU;EAClC;EACD;EACT,GAAI;EAEH;EACU,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/client/storefront/primitives/cta-group.d.ts
|
|
4
|
+
interface CTAGroupProps {
|
|
5
|
+
buttonLabel?: string;
|
|
6
|
+
buttonHref?: string;
|
|
7
|
+
textLinkLabel?: string;
|
|
8
|
+
textLinkHref?: string;
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
/** Override the button variant (defaults to "outline" when dark, "primary" when light) */
|
|
11
|
+
buttonVariant?: "primary" | "outline";
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function CTAGroup({
|
|
15
|
+
buttonLabel,
|
|
16
|
+
buttonHref,
|
|
17
|
+
textLinkLabel,
|
|
18
|
+
textLinkHref,
|
|
19
|
+
dark,
|
|
20
|
+
buttonVariant,
|
|
21
|
+
className
|
|
22
|
+
}: CTAGroupProps): react_jsx_runtime0.JSX.Element | null;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CTAGroup, type CTAGroupProps };
|
|
25
|
+
//# sourceMappingURL=cta-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cta-group.d.ts","names":[],"sources":["../../../../src/client/storefront/primitives/cta-group.tsx"],"mappings":";;;UAOU,aAAA;EACR,WAAA;EACA,UAAA;EACA,aAAA;EACA,YAAA;EACA,IAAA;EALqB;EAOrB,aAAA;EACA,SAAA;AAAA;AAAA,iBAGO,QAAA,CAAA;EACP,WAAA;EACA,UAAA;EACA,aAAA;EACA,YAAA;EACA,IAAA;EACA,aAAA;EACA;AAAA,GACC,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../ui/utils.mjs";
|
|
3
|
+
import { StorefrontButton } from "./button.mjs";
|
|
4
|
+
import { StorefrontTextLink } from "./text-link.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/client/storefront/primitives/cta-group.tsx
|
|
8
|
+
function CTAGroup({ buttonLabel, buttonHref, textLinkLabel, textLinkHref, dark = false, buttonVariant, className }) {
|
|
9
|
+
if (!buttonLabel && !textLinkLabel) return null;
|
|
10
|
+
const resolvedVariant = buttonVariant ?? (dark ? "outline" : "primary");
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: cn("mt-6 flex flex-wrap items-center gap-4", className),
|
|
13
|
+
children: [buttonLabel && buttonHref && /* @__PURE__ */ jsx(StorefrontButton, {
|
|
14
|
+
href: buttonHref,
|
|
15
|
+
variant: resolvedVariant,
|
|
16
|
+
children: buttonLabel
|
|
17
|
+
}), textLinkLabel && textLinkHref && /* @__PURE__ */ jsx(StorefrontTextLink, {
|
|
18
|
+
href: textLinkHref,
|
|
19
|
+
className: dark ? "text-white" : void 0,
|
|
20
|
+
children: textLinkLabel
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { CTAGroup };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=cta-group.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cta-group.mjs","names":[],"sources":["../../../../src/client/storefront/primitives/cta-group.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\nimport { StorefrontButton } from \"./button\";\nimport { StorefrontTextLink } from \"./text-link\";\n\ninterface CTAGroupProps {\n buttonLabel?: string;\n buttonHref?: string;\n textLinkLabel?: string;\n textLinkHref?: string;\n dark?: boolean;\n /** Override the button variant (defaults to \"outline\" when dark, \"primary\" when light) */\n buttonVariant?: \"primary\" | \"outline\";\n className?: string;\n}\n\nfunction CTAGroup({\n buttonLabel,\n buttonHref,\n textLinkLabel,\n textLinkHref,\n dark = false,\n buttonVariant,\n className,\n}: CTAGroupProps) {\n if (!buttonLabel && !textLinkLabel) return null;\n\n const resolvedVariant = buttonVariant ?? (dark ? \"outline\" : \"primary\");\n\n return (\n <div className={cn(\"mt-6 flex flex-wrap items-center gap-4\", className)}>\n {buttonLabel && buttonHref && (\n <StorefrontButton href={buttonHref} variant={resolvedVariant}>\n {buttonLabel}\n </StorefrontButton>\n )}\n {textLinkLabel && textLinkHref && (\n <StorefrontTextLink href={textLinkHref} className={dark ? \"text-white\" : undefined}>\n {textLinkLabel}\n </StorefrontTextLink>\n )}\n </div>\n );\n}\n\nexport { CTAGroup, type CTAGroupProps };\n"],"mappings":";;;;;;;AAkBA,SAAS,SAAS,EAChB,aACA,YACA,eACA,cACA,OAAO,OACP,eACA,aACgB;AAChB,KAAI,CAAC,eAAe,CAAC,cAAe,QAAO;CAE3C,MAAM,kBAAkB,kBAAkB,OAAO,YAAY;AAE7D,QACE,qBAAC,OAAD;EAAK,WAAW,GAAG,0CAA0C,UAAU;YAAvE,CACG,eAAe,cACd,oBAAC,kBAAD;GAAkB,MAAM;GAAY,SAAS;aAC1C;GACgB,CAAA,EAEpB,iBAAiB,gBAChB,oBAAC,oBAAD;GAAoB,MAAM;GAAc,WAAW,OAAO,eAAe,KAAA;aACtE;GACkB,CAAA,CAEnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/client/storefront/primitives/image-with-hover.d.ts
|
|
5
|
+
interface ImageWithHoverProps extends React$1.ComponentProps<"img"> {
|
|
6
|
+
/** Enable hover scale effect using --enad-image-hover-scale and --enad-image-hover-duration */
|
|
7
|
+
enableHover?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function ImageWithHover({
|
|
10
|
+
enableHover,
|
|
11
|
+
className,
|
|
12
|
+
alt,
|
|
13
|
+
loading,
|
|
14
|
+
...props
|
|
15
|
+
}: ImageWithHoverProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ImageWithHover, type ImageWithHoverProps };
|
|
18
|
+
//# sourceMappingURL=image-with-hover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-with-hover.d.ts","names":[],"sources":["../../../../src/client/storefront/primitives/image-with-hover.tsx"],"mappings":";;;;UAGU,mBAAA,SAA4B,OAAA,CAAM,cAAA;;EAE1C,WAAA;AAAA;AAAA,iBAGO,cAAA,CAAA;EACP,WAAA;EACA,SAAA;EACA,GAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../../ui/utils.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/client/storefront/primitives/image-with-hover.tsx
|
|
5
|
+
function ImageWithHover({ enableHover = true, className, alt = "", loading = "lazy", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("img", {
|
|
7
|
+
alt,
|
|
8
|
+
loading,
|
|
9
|
+
className: cn("size-full object-cover", enableHover && "transition-transform duration-[var(--enad-image-hover-duration)] group-hover:scale-[var(--enad-image-hover-scale)]", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ImageWithHover };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=image-with-hover.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-with-hover.mjs","names":[],"sources":["../../../../src/client/storefront/primitives/image-with-hover.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\n\ninterface ImageWithHoverProps extends React.ComponentProps<\"img\"> {\n /** Enable hover scale effect using --enad-image-hover-scale and --enad-image-hover-duration */\n enableHover?: boolean;\n}\n\nfunction ImageWithHover({\n enableHover = true,\n className,\n alt = \"\",\n loading = \"lazy\",\n ...props\n}: ImageWithHoverProps) {\n return (\n <img\n alt={alt}\n loading={loading}\n className={cn(\n \"size-full object-cover\",\n enableHover &&\n \"transition-transform duration-[var(--enad-image-hover-duration)] group-hover:scale-[var(--enad-image-hover-scale)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { ImageWithHover, type ImageWithHoverProps };\n"],"mappings":";;;;AAQA,SAAS,eAAe,EACtB,cAAc,MACd,WACA,MAAM,IACN,UAAU,QACV,GAAG,SACmB;AACtB,QACE,oBAAC,OAAD;EACO;EACI;EACT,WAAW,GACT,0BACA,eACE,sHACF,UACD;EACD,GAAI;EACJ,CAAA"}
|
|
@@ -8,4 +8,7 @@ import { BreadcrumbItemData, StorefrontBreadcrumbs, StorefrontBreadcrumbsProps }
|
|
|
8
8
|
import { QuickLink, QuickLinks, QuickLinksProps } from "./quick-links.js";
|
|
9
9
|
import { DownloadItem, DownloadItemProps } from "./download-item.js";
|
|
10
10
|
import { SimpleSelect, SimpleSelectOption, SimpleSelectProps } from "../../ui/simple-select.js";
|
|
11
|
-
|
|
11
|
+
import { BlockHeading, BlockHeadingProps } from "./block-heading.js";
|
|
12
|
+
import { CTAGroup, CTAGroupProps } from "./cta-group.js";
|
|
13
|
+
import { ImageWithHover, ImageWithHoverProps } from "./image-with-hover.js";
|
|
14
|
+
export { BlockHeading, type BlockHeadingProps, type BreadcrumbItemData, CTAGroup, type CTAGroupProps, DownloadItem, type DownloadItemProps, ImageWithHover, type ImageWithHoverProps, type QuickLink, QuickLinks, type QuickLinksProps, type SelectOption, SimpleSelect, type SimpleSelectOption, type SimpleSelectProps, StorefrontBreadcrumbs, type StorefrontBreadcrumbsProps, StorefrontButton, type StorefrontButtonProps, type StorefrontButtonSize, type StorefrontButtonVariant, StorefrontCheckbox, type StorefrontCheckboxProps, StorefrontInput, type StorefrontInputProps, StorefrontPagination, type StorefrontPaginationProps, StorefrontSelect, type StorefrontSelectProps, StorefrontTextLink, type StorefrontTextLinkProps };
|
|
@@ -8,4 +8,7 @@ import { StorefrontBreadcrumbs } from "./breadcrumbs.mjs";
|
|
|
8
8
|
import { QuickLinks } from "./quick-links.mjs";
|
|
9
9
|
import { DownloadItem } from "./download-item.mjs";
|
|
10
10
|
import { SimpleSelect } from "../../ui/simple-select.mjs";
|
|
11
|
-
|
|
11
|
+
import { BlockHeading } from "./block-heading.mjs";
|
|
12
|
+
import { CTAGroup } from "./cta-group.mjs";
|
|
13
|
+
import { ImageWithHover } from "./image-with-hover.mjs";
|
|
14
|
+
export { BlockHeading, CTAGroup, DownloadItem, ImageWithHover, QuickLinks, SimpleSelect, StorefrontBreadcrumbs, StorefrontButton, StorefrontCheckbox, StorefrontInput, StorefrontPagination, StorefrontSelect, StorefrontTextLink };
|
|
@@ -7,7 +7,7 @@ interface StorefrontInputProps extends Omit<React$1.ComponentProps<"input">, "re
|
|
|
7
7
|
icon?: React$1.ReactNode;
|
|
8
8
|
onIconClick?: () => void;
|
|
9
9
|
/** Visual variant of the input field */
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "outlined" | "plain";
|
|
11
11
|
/** External error message (from react-hook-form or server validation) */
|
|
12
12
|
error?: string;
|
|
13
13
|
/** Override default validation messages per constraint */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.mjs","names":["React"],"sources":["../../../../src/client/storefront/primitives/input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Input } from \"../../ui-resolver/input\";\nimport { Label } from \"../../ui-resolver/label\";\nimport { cn } from \"../../ui/utils\";\n\nconst defaultMessages: Record<string, string> = {\n email: \"Please enter a valid email address\",\n password: \"Password is required\",\n tel: \"Please enter a valid phone number\",\n url: \"Please enter a valid URL\",\n number: \"Please enter a valid number\",\n};\n\ninterface StorefrontInputProps extends Omit<React.ComponentProps<\"input\">, \"ref\"> {\n label?: string;\n icon?: React.ReactNode;\n onIconClick?: () => void;\n /** Visual variant of the input field */\n variant?: \"
|
|
1
|
+
{"version":3,"file":"input.mjs","names":["React"],"sources":["../../../../src/client/storefront/primitives/input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Input } from \"../../ui-resolver/input\";\nimport { Label } from \"../../ui-resolver/label\";\nimport { cn } from \"../../ui/utils\";\n\nconst defaultMessages: Record<string, string> = {\n email: \"Please enter a valid email address\",\n password: \"Password is required\",\n tel: \"Please enter a valid phone number\",\n url: \"Please enter a valid URL\",\n number: \"Please enter a valid number\",\n};\n\ninterface StorefrontInputProps extends Omit<React.ComponentProps<\"input\">, \"ref\"> {\n label?: string;\n icon?: React.ReactNode;\n onIconClick?: () => void;\n /** Visual variant of the input field */\n variant?: \"outlined\" | \"plain\";\n /** External error message (from react-hook-form or server validation) */\n error?: string;\n /** Override default validation messages per constraint */\n validationMessages?: {\n required?: string;\n email?: string;\n minLength?: string;\n pattern?: string;\n };\n}\n\nfunction StorefrontInput({\n label,\n icon,\n onIconClick,\n variant,\n error: externalError,\n validationMessages,\n className,\n id: idProp,\n disabled,\n required,\n type,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n ...props\n}: StorefrontInputProps) {\n const generatedId = React.useId();\n const id = idProp ?? generatedId;\n const errorId = `${id}-error`;\n\n const [nativeError, setNativeError] = React.useState<string | undefined>();\n const error = externalError ?? nativeError;\n\n const resolveMessage = React.useCallback(\n (validity: ValidityState): string => {\n if (validity.valueMissing) {\n return validationMessages?.required ?? \"This field is required\";\n }\n if (validity.typeMismatch) {\n const typeMsg = type ? (validationMessages?.email ?? defaultMessages[type]) : undefined;\n return typeMsg ?? \"Please enter a valid value\";\n }\n if (validity.tooShort) {\n return validationMessages?.minLength ?? \"Value is too short\";\n }\n if (validity.patternMismatch) {\n return validationMessages?.pattern ?? \"Please match the required format\";\n }\n return \"Please enter a valid value\";\n },\n [type, validationMessages],\n );\n\n const handleInvalid = React.useCallback(\n (e: React.InvalidEvent<HTMLInputElement>) => {\n e.preventDefault();\n setNativeError(resolveMessage(e.target.validity));\n },\n [resolveMessage],\n );\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (nativeError && e.target.validity.valid) {\n setNativeError(undefined);\n }\n onChangeProp?.(e);\n },\n [nativeError, onChangeProp],\n );\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (e.target.value && !e.target.validity.valid) {\n setNativeError(resolveMessage(e.target.validity));\n }\n onBlurProp?.(e);\n },\n [resolveMessage, onBlurProp],\n );\n\n return (\n <div className={cn(\"flex flex-col gap-1.5\", className)}>\n {label && (\n <Label htmlFor={id} className=\"text-xs font-medium uppercase tracking-wide\">\n {label}\n {required && <span className=\"text-(--enad-error-color) ml-0.5\">*</span>}\n </Label>\n )}\n <div className=\"relative\">\n <Input\n id={id}\n type={type}\n variant={variant}\n disabled={disabled}\n required={required}\n aria-invalid={error ? true : undefined}\n aria-describedby={error ? errorId : undefined}\n className={icon ? \"pr-10\" : undefined}\n onInvalid={handleInvalid}\n {...props}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n {icon && (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={disabled}\n onClick={onIconClick}\n className=\"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground disabled:pointer-events-none disabled:opacity-50\"\n >\n {icon}\n </button>\n )}\n </div>\n {error && (\n <p id={errorId} role=\"alert\" className=\"text-(--enad-error-color) text-sm\">\n {error}\n </p>\n )}\n </div>\n );\n}\n\nexport { StorefrontInput, type StorefrontInputProps };\n"],"mappings":";;;;;;;AAOA,MAAM,kBAA0C;CAC9C,OAAO;CACP,UAAU;CACV,KAAK;CACL,KAAK;CACL,QAAQ;CACT;AAmBD,SAAS,gBAAgB,EACvB,OACA,MACA,aACA,SACA,OAAO,eACP,oBACA,WACA,IAAI,QACJ,UACA,UACA,MACA,UAAU,cACV,QAAQ,YACR,GAAG,SACoB;CACvB,MAAM,cAAcA,QAAM,OAAO;CACjC,MAAM,KAAK,UAAU;CACrB,MAAM,UAAU,GAAG,GAAG;CAEtB,MAAM,CAAC,aAAa,kBAAkBA,QAAM,UAA8B;CAC1E,MAAM,QAAQ,iBAAiB;CAE/B,MAAM,iBAAiBA,QAAM,aAC1B,aAAoC;AACnC,MAAI,SAAS,aACX,QAAO,oBAAoB,YAAY;AAEzC,MAAI,SAAS,aAEX,SADgB,OAAQ,oBAAoB,SAAS,gBAAgB,QAAS,KAAA,MAC5D;AAEpB,MAAI,SAAS,SACX,QAAO,oBAAoB,aAAa;AAE1C,MAAI,SAAS,gBACX,QAAO,oBAAoB,WAAW;AAExC,SAAO;IAET,CAAC,MAAM,mBAAmB,CAC3B;CAED,MAAM,gBAAgBA,QAAM,aACzB,MAA4C;AAC3C,IAAE,gBAAgB;AAClB,iBAAe,eAAe,EAAE,OAAO,SAAS,CAAC;IAEnD,CAAC,eAAe,CACjB;CAED,MAAM,eAAeA,QAAM,aACxB,MAA2C;AAC1C,MAAI,eAAe,EAAE,OAAO,SAAS,MACnC,gBAAe,KAAA,EAAU;AAE3B,iBAAe,EAAE;IAEnB,CAAC,aAAa,aAAa,CAC5B;CAED,MAAM,aAAaA,QAAM,aACtB,MAA0C;AACzC,MAAI,EAAE,OAAO,SAAS,CAAC,EAAE,OAAO,SAAS,MACvC,gBAAe,eAAe,EAAE,OAAO,SAAS,CAAC;AAEnD,eAAa,EAAE;IAEjB,CAAC,gBAAgB,WAAW,CAC7B;AAED,QACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAyB,UAAU;YAAtD;GACG,SACC,qBAAC,OAAD;IAAO,SAAS;IAAI,WAAU;cAA9B,CACG,OACA,YAAY,oBAAC,QAAD;KAAM,WAAU;eAAmC;KAAQ,CAAA,CAClE;;GAEV,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,OAAD;KACM;KACE;KACG;KACC;KACA;KACV,gBAAc,QAAQ,OAAO,KAAA;KAC7B,oBAAkB,QAAQ,UAAU,KAAA;KACpC,WAAW,OAAO,UAAU,KAAA;KAC5B,WAAW;KACX,GAAI;KACJ,UAAU;KACV,QAAQ;KACR,CAAA,EACD,QACC,oBAAC,UAAD;KACE,MAAK;KACL,UAAU;KACA;KACV,SAAS;KACT,WAAU;eAET;KACM,CAAA,CAEP;;GACL,SACC,oBAAC,KAAD;IAAG,IAAI;IAAS,MAAK;IAAQ,WAAU;cACpC;IACC,CAAA;GAEF"}
|
|
@@ -22,7 +22,7 @@ function StorefrontPagination({ currentPage, totalPages, onPageChange, className
|
|
|
22
22
|
children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
|
|
23
23
|
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationPrevious, {
|
|
24
24
|
href: "#",
|
|
25
|
-
size: "
|
|
25
|
+
size: "md",
|
|
26
26
|
onClick: (e) => {
|
|
27
27
|
e.preventDefault();
|
|
28
28
|
if (currentPage > 1) onPageChange(currentPage - 1);
|
|
@@ -42,7 +42,7 @@ function StorefrontPagination({ currentPage, totalPages, onPageChange, className
|
|
|
42
42
|
}) }, page)),
|
|
43
43
|
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationNext, {
|
|
44
44
|
href: "#",
|
|
45
|
-
size: "
|
|
45
|
+
size: "md",
|
|
46
46
|
onClick: (e) => {
|
|
47
47
|
e.preventDefault();
|
|
48
48
|
if (currentPage < totalPages) onPageChange(currentPage + 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.mjs","names":[],"sources":["../../../../src/client/storefront/primitives/pagination.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../../ui-resolver/pagination\";\n\ninterface StorefrontPaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nfunction getPageNumbers(current: number, total: number): (number | \"ellipsis\")[] {\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const pages: (number | \"ellipsis\")[] = [1];\n\n if (current > 3) {\n pages.push(\"ellipsis\");\n }\n\n const start = Math.max(2, current - 1);\n const end = Math.min(total - 1, current + 1);\n\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n\n if (current < total - 2) {\n pages.push(\"ellipsis\");\n }\n\n pages.push(total);\n return pages;\n}\n\nfunction StorefrontPagination({\n currentPage,\n totalPages,\n onPageChange,\n className,\n}: StorefrontPaginationProps) {\n if (totalPages <= 1) return null;\n\n const pages = getPageNumbers(currentPage, totalPages);\n\n return (\n <Pagination className={className}>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n href=\"#\"\n size=\"
|
|
1
|
+
{"version":3,"file":"pagination.mjs","names":[],"sources":["../../../../src/client/storefront/primitives/pagination.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../../ui-resolver/pagination\";\n\ninterface StorefrontPaginationProps {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nfunction getPageNumbers(current: number, total: number): (number | \"ellipsis\")[] {\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const pages: (number | \"ellipsis\")[] = [1];\n\n if (current > 3) {\n pages.push(\"ellipsis\");\n }\n\n const start = Math.max(2, current - 1);\n const end = Math.min(total - 1, current + 1);\n\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n\n if (current < total - 2) {\n pages.push(\"ellipsis\");\n }\n\n pages.push(total);\n return pages;\n}\n\nfunction StorefrontPagination({\n currentPage,\n totalPages,\n onPageChange,\n className,\n}: StorefrontPaginationProps) {\n if (totalPages <= 1) return null;\n\n const pages = getPageNumbers(currentPage, totalPages);\n\n return (\n <Pagination className={className}>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n href=\"#\"\n size=\"md\"\n onClick={(e) => {\n e.preventDefault();\n if (currentPage > 1) onPageChange(currentPage - 1);\n }}\n aria-disabled={currentPage <= 1}\n className={currentPage <= 1 ? \"pointer-events-none opacity-50\" : undefined}\n />\n </PaginationItem>\n\n {pages.map((page, i) =>\n page === \"ellipsis\" ? (\n <PaginationItem key={`ellipsis-${i}`}>\n <PaginationEllipsis />\n </PaginationItem>\n ) : (\n <PaginationItem key={page}>\n <PaginationLink\n href=\"#\"\n size=\"icon\"\n isActive={page === currentPage}\n onClick={(e) => {\n e.preventDefault();\n onPageChange(page);\n }}\n >\n {page}\n </PaginationLink>\n </PaginationItem>\n ),\n )}\n\n <PaginationItem>\n <PaginationNext\n href=\"#\"\n size=\"md\"\n onClick={(e) => {\n e.preventDefault();\n if (currentPage < totalPages) onPageChange(currentPage + 1);\n }}\n aria-disabled={currentPage >= totalPages}\n className={currentPage >= totalPages ? \"pointer-events-none opacity-50\" : undefined}\n />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n );\n}\n\nexport { StorefrontPagination, type StorefrontPagin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oBAAC,gBAAD;IACE,MAAK;IACL,MAAK;IACL,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,SAAI,cAAc,WAAY,cAAa,cAAc,EAAE;;IAE7D,iBAAe,eAAe;IAC9B,WAAW,eAAe,aAAa,mCAAmC,KAAA;IAC1E,CAAA,EACa,CAAA;GACC,EAAA,CAAA;EACT,CAAA"}
|
|
@@ -15,7 +15,7 @@ function QuantityPicker({ value, onChange, min = 1, max = 99, size = "default",
|
|
|
15
15
|
className: cn("inline-flex items-center gap-0 rounded-[var(--enad-input-radius)] border border-input", className),
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ jsx(Button, {
|
|
18
|
-
variant: "
|
|
18
|
+
variant: "plain",
|
|
19
19
|
size: "icon",
|
|
20
20
|
onClick: () => onChange(Math.max(min, value - 1)),
|
|
21
21
|
disabled: atMin,
|
|
@@ -30,7 +30,7 @@ function QuantityPicker({ value, onChange, min = 1, max = 99, size = "default",
|
|
|
30
30
|
children: value
|
|
31
31
|
}),
|
|
32
32
|
/* @__PURE__ */ jsx(Button, {
|
|
33
|
-
variant: "
|
|
33
|
+
variant: "plain",
|
|
34
34
|
size: "icon",
|
|
35
35
|
onClick: () => onChange(Math.min(max, value + 1)),
|
|
36
36
|
disabled: atMax,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-picker.mjs","names":[],"sources":["../../../../src/client/storefront/product/quantity-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useIcon } from \"../../icons/icon-context\";\nimport { Button } from \"../../ui/button\";\nimport { cn } from \"../../ui/utils\";\n\ninterface QuantityPickerProps {\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n size?: \"sm\" | \"default\";\n className?: string;\n}\n\nfunction QuantityPicker({\n value,\n onChange,\n min = 1,\n max = 99,\n size = \"default\",\n className,\n}: QuantityPickerProps) {\n const MinusIcon = useIcon(\"minus\");\n const PlusIcon = useIcon(\"plus\");\n const atMin = value <= min;\n const atMax = value >= max;\n\n const compact = size === \"sm\";\n\n return (\n <div\n className={cn(\n \"inline-flex items-center gap-0 rounded-[var(--enad-input-radius)] border border-input\",\n className,\n )}\n >\n <Button\n variant=\"
|
|
1
|
+
{"version":3,"file":"quantity-picker.mjs","names":[],"sources":["../../../../src/client/storefront/product/quantity-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useIcon } from \"../../icons/icon-context\";\nimport { Button } from \"../../ui/button\";\nimport { cn } from \"../../ui/utils\";\n\ninterface QuantityPickerProps {\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n size?: \"sm\" | \"default\";\n className?: string;\n}\n\nfunction QuantityPicker({\n value,\n onChange,\n min = 1,\n max = 99,\n size = \"default\",\n className,\n}: QuantityPickerProps) {\n const MinusIcon = useIcon(\"minus\");\n const PlusIcon = useIcon(\"plus\");\n const atMin = value <= min;\n const atMax = value >= max;\n\n const compact = size === \"sm\";\n\n return (\n <div\n className={cn(\n \"inline-flex items-center gap-0 rounded-[var(--enad-input-radius)] border border-input\",\n className,\n )}\n >\n <Button\n variant=\"plain\"\n size=\"icon\"\n onClick={() => onChange(Math.max(min, value - 1))}\n disabled={atMin}\n aria-label=\"Decrease quantity\"\n className={cn(\n \"rounded-none rounded-l-[var(--enad-input-radius)]\",\n compact ? \"h-5 w-5\" : \"hit-area-y-1\",\n )}\n >\n <MinusIcon className={compact ? \"size-3\" : \"size-4\"} />\n </Button>\n\n <span\n className={cn(\n \"flex items-center justify-center font-medium tabular-nums\",\n compact ? \"h-5 w-8 text-xs\" : \"size-9 text-sm\",\n )}\n aria-live=\"polite\"\n aria-label={`Quantity: ${value}`}\n >\n {value}\n </span>\n\n <Button\n variant=\"plain\"\n size=\"icon\"\n onClick={() => onChange(Math.min(max, value + 1))}\n disabled={atMax}\n aria-label=\"Increase quantity\"\n className={cn(\n \"rounded-none rounded-r-[var(--enad-input-radius)]\",\n compact ? \"h-5 w-5\" : \"hit-area-y-1\",\n )}\n >\n <PlusIcon className={compact ? \"size-3\" : \"size-4\"} />\n </Button>\n </div>\n );\n}\n\nexport { QuantityPicker, type QuantityPickerProps };\n"],"mappings":";;;;;;;AAgBA,SAAS,eAAe,EACtB,OACA,UACA,MAAM,GACN,MAAM,IACN,OAAO,WACP,aACsB;CACtB,MAAM,YAAY,QAAQ,QAAQ;CAClC,MAAM,WAAW,QAAQ,OAAO;CAChC,MAAM,QAAQ,SAAS;CACvB,MAAM,QAAQ,SAAS;CAEvB,MAAM,UAAU,SAAS;AAEzB,QACE,qBAAC,OAAD;EACE,WAAW,GACT,yFACA,UACD;YAJH;GAME,oBAAC,QAAD;IACE,SAAQ;IACR,MAAK;IACL,eAAe,SAAS,KAAK,IAAI,KAAK,QAAQ,EAAE,CAAC;IACjD,UAAU;IACV,cAAW;IACX,WAAW,GACT,qDACA,UAAU,YAAY,eACvB;cAED,oBAAC,WAAD,EAAW,WAAW,UAAU,WAAW,UAAY,CAAA;IAChD,CAAA;GAET,oBAAC,QAAD;IACE,WAAW,GACT,6DACA,UAAU,oBAAoB,iBAC/B;IACD,aAAU;IACV,cAAY,aAAa;cAExB;IACI,CAAA;GAEP,oBAAC,QAAD;IACE,SAAQ;IACR,MAAK;IACL,eAAe,SAAS,KAAK,IAAI,KAAK,QAAQ,EAAE,CAAC;IACjD,UAAU;IACV,cAAW;IACX,WAAW,GACT,qDACA,UAAU,YAAY,eACvB;cAED,oBAAC,UAAD,EAAU,WAAW,UAAU,WAAW,UAAY,CAAA;IAC/C,CAAA;GACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/client/storefront/types.ts"],"mappings":";KAEY,UAAA;EACV,GAAA;EACA,GAAA;EACA,KAAA;AAAA;AAAA,KAGU,QAAA;EACV,IAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,KAKU,eAAA;AAAA,KAIA,UAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"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,CAAM,SAAA;EAChB,SAAA;AAAA;AAAA,UAGe,0BAAA;EACf,OAAA;EACA,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,SAAA;AAAA;AAAA,UAGe,uBAAA;EACf,MAAA,GAAS,UAAA;EACT,SAAA;EACA,OAAA;EACA,IAAA;EACA,YAAA,GAAe,KAAA,CAAM,SAAA;EACrB,MAAA;EACA,UAAA,GAAa,UAAA;EACb,SAAA;AAAA;AAAA,UAGe,gCAAA;EACf,KAAA,GAAQ,UAAA;EACR,SAAA;EACA,OAAA;EACA,IAAA;EACA,IAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA,GAAe,KAAA,CAAM,SAAA;EACrB,SAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/client/storefront/types.ts"],"sourcesContent":["/* ─── Asset & Link primitives ─── */\n\nexport type ImageAsset = {\n src: string
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../src/client/storefront/types.ts"],"sourcesContent":["/* ─── Asset & Link primitives ─── */\n\nexport type ImageAsset = {\n src: string;\n alt?: string;\n title?: string;\n};\n\nexport type LinkItem = {\n href: string;\n label?: string;\n target?: \"_blank\" | \"_self\";\n};\n\n/* ─── Rich text (pre-rendered HTML) ─── */\n\nexport type RichTextContent = string;\n\n/* ─── Color themes (semantic — mapped to shadcn CSS variables) ─── */\n\nexport type ColorTheme = \"default\" | \"muted\" | \"primary\" | \"secondary\" | \"accent\" | \"inverse\";\n\nconst themeClasses: Record<ColorTheme, string> = {\n default: \"bg-background text-foreground\",\n muted: \"bg-muted text-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n accent: \"bg-accent text-accent-foreground\",\n inverse: \"bg-foreground text-background\",\n};\n\nexport function colorThemeClasses(theme?: ColorTheme): string {\n if (!theme) return \"\";\n return themeClasses[theme] ?? \"\";\n}\n\nexport function isThemeDark(theme?: ColorTheme): boolean {\n return theme === \"primary\" || theme === \"inverse\";\n}\n\n/* ─── Navigation ─── */\n\nexport type NavChild = {\n label: string;\n href: string;\n};\n\nexport type MegaMenuCategory = {\n id?: string;\n title: string;\n href: string;\n items?: NavChild[];\n stackWithPrevious?: boolean;\n};\n\nexport type MegaMenuFeatured = {\n id?: string;\n label: string;\n href: string;\n image?: ImageAsset;\n};\n\nexport type NavItem = {\n id?: string;\n label: string;\n href?: string;\n megaMenuCategories?: MegaMenuCategory[];\n megaMenuFeatured?: MegaMenuFeatured[];\n};\n\n/* ─── Layout prop types ─── */\n\nexport interface HeaderProps {\n variant?: \"default\" | \"transparent\" | \"overlay\";\n navItems?: NavItem[];\n utilityLinks?: NavChild[];\n promotionEnabled?: boolean;\n promotionMessages?: string[];\n logo?: React.ReactNode;\n onSearchClick?: () => void;\n onCartClick?: () => void;\n cartHref?: string;\n labels?: {\n search?: string;\n cart?: string;\n menu?: string;\n closeMenu?: string;\n changeLanguage?: string;\n };\n className?: string;\n}\n\nexport interface MobileMenuDrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n items: {\n label: string;\n href: string;\n children?: NavChild[];\n }[];\n labels?: {\n close?: string;\n back?: string;\n };\n className?: string;\n}\n\nexport interface FooterProps {\n columns: { title?: string; links: NavChild[] }[];\n bottomLinks?: NavChild[];\n logo?: React.ReactNode;\n paymentIcons?: React.ReactNode;\n newsletterSlot?: React.ReactNode;\n copyright?: string;\n className?: string;\n}\n\nexport interface PromotionBarProps {\n enabled?: boolean;\n messages?: string[];\n onDismiss?: () => void;\n className?: string;\n}\n\n/* ─── Language selector ─── */\n\nexport type LanguageOption = {\n code: string;\n label: string;\n icon?: React.ReactNode;\n};\n\nexport interface LanguageSelectorProps {\n languages: LanguageOption[];\n value: string;\n onValueChange: (code: string) => void;\n variant?: \"code\" | \"full\" | \"icon\";\n size?: \"sm\" | \"md\";\n className?: string;\n labels?: {\n changeLanguage?: string;\n };\n}\n\n/* ─── Block prop types ─── */\n\nexport type AspectRatio = \"1:1\" | \"4:5\" | \"3:4\" | \"9:16\" | \"16:9\" | \"4:3\" | \"2:1\";\n\nexport interface SpacerProps {\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport interface ImageBlockProps {\n image?: ImageAsset;\n aspectRatio?: \"4:5\" | \"16:9\" | \"1:1\";\n caption?: string;\n className?: string;\n}\n\nexport interface CardImageWithCaptionProps {\n image?: ImageAsset;\n title?: string;\n caption?: string;\n className?: string;\n}\n\nexport type TextContentVariant = \"default\" | \"pull-quote\" | \"columns\";\n\nexport interface TextContentProps {\n preheader?: string;\n heading?: string;\n body?: string;\n variant?: TextContentVariant;\n layout?: \"default\" | \"text-indent\" | \"wide\";\n buttonLabel?: string;\n buttonHref?: string;\n textLinkLabel?: string;\n textLinkHref?: string;\n colorTheme?: ColorTheme;\n className?: string;\n}\n\nexport interface VariableTextContentProps {\n html: RichTextContent;\n className?: string;\n}\n\nexport type TextContentWithImageVariant = \"side-by-side\" | \"stacked\" | \"overlap\";\n\nexport interface TextContentWithImageProps {\n image?: ImageAsset;\n imagePosition?: \"first\" | \"last\";\n fullWidth?: boolean;\n variant?: TextContentWithImageVariant;\n preheader?: string;\n heading?: string;\n body?: string;\n buttonLabel?: string;\n buttonHref?: string;\n textLinkLabel?: string;\n textLinkHref?: string;\n colorTheme?: ColorTheme;\n className?: string;\n}\n\nexport type LinkBlockVariant = \"overlay\" | \"card\" | \"text-only\";\n\nexport interface LinkBlockProps {\n image?: ImageAsset;\n eyebrow?: string;\n title?: string;\n variant?: LinkBlockVariant;\n buttonLabel?: string;\n buttonHref?: string;\n colorTheme?: ColorTheme;\n className?: string;\n}\n\nexport interface LinkBlockSmallProps {\n image?: ImageAsset;\n title?: string;\n href?: string;\n className?: string;\n}\n\nexport interface CardVideoProps {\n thumbnail?: ImageAsset;\n videoUrl?: string;\n title?: string;\n caption?: string;\n aspectRatio?: \"4:3\" | \"1:1\" | \"16:9\";\n className?: string;\n}\n\nexport interface AccordionBlockProps {\n items: {\n id?: string;\n title: string;\n content: RichTextContent;\n variant?: \"standard\" | \"technical-data\" | \"downloads\";\n children?: React.ReactNode;\n }[];\n defaultValue?: string;\n className?: string;\n}\n\nexport interface TruncatedTextProps {\n html: RichTextContent;\n visibleLines?: number;\n labels?: {\n showMore?: string;\n showLess?: string;\n };\n className?: string;\n}\n\nexport type HeroLayout = \"overlay\" | \"split\" | \"image-only\" | \"minimal\" | \"banner\";\n\nexport type HeroContentPosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"center-left\"\n | \"center-center\"\n | \"center-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\nexport type HeroContentWidth = \"sm\" | \"md\" | \"lg\";\n\nexport type HeroTextAlign = \"left\" | \"center\" | \"right\";\n\nexport interface HeroProps {\n image?: ImageAsset;\n aspectRatio?: \"9:16\" | \"4:5\" | \"1:1\" | \"16:9\";\n layout?: HeroLayout;\n contentPosition?: HeroContentPosition;\n contentWidth?: HeroContentWidth;\n textAlign?: HeroTextAlign;\n preheader?: string;\n heading?: string;\n buttonLabel?: string;\n buttonHref?: string;\n textLinkLabel?: string;\n textLinkHref?: string;\n colorTheme?: ColorTheme;\n className?: string;\n}\n\nexport interface ProductCardProps {\n images?: ImageAsset[];\n title?: string;\n subtitle?: string;\n price?: string;\n tag?: string;\n href?: string;\n layout?: \"gallery\" | \"list\" | \"stripped\" | \"horizontal\" | \"minimal\";\n showFavorites?: boolean;\n showPaginationDots?: boolean;\n onFavoriteClick?: () => void;\n className?: string;\n}\n\nexport interface ProductImageProps {\n images: ImageAsset[];\n aspectRatio?: \"1:1\" | \"4:5\";\n showZoom?: boolean;\n /** 'inset' — arrows float over the image edges; 'outset' — arrows sit outside the image bounds */\n arrows?: \"inset\" | \"outset\";\n showDots?: boolean;\n showThumbnails?: boolean;\n className?: string;\n}\n\nexport type GalleryVariant = \"grid\" | \"masonry\" | \"filmstrip\";\n\nexport interface GalleryProps {\n heading?: string;\n variant?: GalleryVariant;\n children: React.ReactNode;\n className?: string;\n}\n\nexport interface GalleryWithCaptionProps {\n heading?: string;\n indent?: boolean;\n colorTheme?: ColorTheme;\n children: React.ReactNode;\n className?: string;\n}\n\nexport interface GalleryWithLinkBlocksProps {\n heading?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport interface ContentWithGalleryProps {\n images?: ImageAsset[];\n preheader?: string;\n heading?: string;\n body?: string;\n productCards?: React.ReactNode;\n layout?: \"image-above\" | \"side-by-side\";\n colorTheme?: ColorTheme;\n className?: string;\n}\n\nexport interface ContentWithImageProductDataProps {\n image?: ImageAsset;\n preheader?: string;\n heading?: string;\n body?: string;\n usps?: string[];\n buttonLabel?: string;\n buttonHref?: string;\n productCards?: React.ReactNode;\n className?: string;\n}\n"],"mappings":";AAsBA,MAAM,eAA2C;CAC/C,SAAS;CACT,OAAO;CACP,SAAS;CACT,WAAW;CACX,QAAQ;CACR,SAAS;CACV;AAED,SAAgB,kBAAkB,OAA4B;AAC5D,KAAI,CAAC,MAAO,QAAO;AACnB,QAAO,aAAa,UAAU;;AAGhC,SAAgB,YAAY,OAA6B;AACvD,QAAO,UAAU,aAAa,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","names":[],"sources":["../../../src/client/theme/apply.ts"],"mappings":";;;UAGiB,eAAA;EACf,UAAA;AAAA;;;;;
|
|
1
|
+
{"version":3,"file":"apply.d.ts","names":[],"sources":["../../../src/client/theme/apply.ts"],"mappings":";;;UAGiB,eAAA;EACf,UAAA;AAAA;;;;;iBAsHc,gBAAA,CAAiB,IAAA,EAAM,SAAA,EAAW,QAAA,GAAU,eAAA;AAAA,cAsB/C,YAAA;AAAA,cACA,UAAA;;;;;iBAMG,eAAA,CAAgB,WAAA,UAAqB,QAAA"}
|
|
@@ -110,18 +110,6 @@ function buildTokenSections(hash) {
|
|
|
110
110
|
TOKEN_DEFAULTS.overlayToOpacity
|
|
111
111
|
]
|
|
112
112
|
]
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
comment: "Motion",
|
|
116
|
-
entries: [[
|
|
117
|
-
"--enad-image-hover-scale",
|
|
118
|
-
hash.imageHoverScale,
|
|
119
|
-
TOKEN_DEFAULTS.imageHoverScale
|
|
120
|
-
], [
|
|
121
|
-
"--enad-image-hover-duration",
|
|
122
|
-
hash.imageHoverDuration,
|
|
123
|
-
TOKEN_DEFAULTS.imageHoverDuration
|
|
124
|
-
]]
|
|
125
113
|
}
|
|
126
114
|
];
|
|
127
115
|
for (const section of tokenSections) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.mjs","names":[],"sources":["../../../src/client/theme/apply.ts"],"sourcesContent":["import type { ThemeHash } from
|
|
1
|
+
{"version":3,"file":"apply.mjs","names":[],"sources":["../../../src/client/theme/apply.ts"],"sourcesContent":["import type { ThemeHash } from \"./codec\";\nimport { SDK_DEFAULTS, TOKEN_DEFAULTS } from \"./defaults\";\n\nexport interface GenerateOptions {\n colorSpace?: \"hsl\" | \"oklch\";\n}\n\nfunction buildLightColorDiffs(hash: ThemeHash): string[] {\n const lightOverrides = (hash.lightColors ?? {}) as Record<string, string>;\n const diffs: string[] = [];\n for (const [token, value] of Object.entries(lightOverrides)) {\n if (value !== SDK_DEFAULTS.light[token]) {\n diffs.push(` ${token}: ${value};`);\n }\n }\n return diffs;\n}\n\nfunction buildBaseTokenDiffs(hash: ThemeHash): string[] {\n const diffs: string[] = [];\n\n const radius = hash.radius as number | undefined;\n if (radius != null && radius !== 0.75) {\n diffs.push(` --radius: ${radius}rem;`);\n }\n\n const fontBody = hash.fontBody as string | undefined;\n if (fontBody && fontBody !== \"Inter\") {\n diffs.push(` --font-sans: \"${fontBody}\", sans-serif;`);\n }\n\n const fontHeading = hash.fontHeading as string | undefined;\n if (fontHeading && fontHeading !== fontBody && fontHeading !== \"Inter\") {\n diffs.push(` --font-heading: \"${fontHeading}\", sans-serif;`);\n }\n\n return diffs;\n}\n\nfunction buildDarkColorDiffs(hash: ThemeHash): string[] {\n const darkOverrides = (hash.darkColors ?? {}) as Record<string, string>;\n const diffs: string[] = [];\n for (const [token, value] of Object.entries(darkOverrides)) {\n if (value !== SDK_DEFAULTS.dark[token]) {\n diffs.push(` ${token}: ${value};`);\n }\n }\n return diffs;\n}\n\nfunction buildTokenSections(hash: ThemeHash): string[] {\n const lines: string[] = [];\n\n const tokenSections: Array<{ comment: string; entries: Array<[string, string, string]> }> = [\n {\n comment: \"Shape\",\n entries: [\n [\"--enad-button-radius\", hash.buttonRadius as string, TOKEN_DEFAULTS.buttonRadius],\n [\"--enad-card-radius\", hash.cardRadius as string, TOKEN_DEFAULTS.cardRadius],\n [\"--enad-input-radius\", hash.inputRadius as string, TOKEN_DEFAULTS.inputRadius],\n [\"--enad-image-radius\", hash.imageRadius as string, TOKEN_DEFAULTS.imageRadius],\n ],\n },\n {\n comment: \"Depth\",\n entries: [[\"--enad-shadow-color\", hash.shadowColor as string, TOKEN_DEFAULTS.shadowColor]],\n },\n {\n comment: \"Typography\",\n entries: [\n [\"--enad-heading-weight\", hash.headingWeight as string, TOKEN_DEFAULTS.headingWeight],\n [\"--enad-heading-tracking\", hash.headingTracking as string, TOKEN_DEFAULTS.headingTracking],\n [\"--enad-body-weight\", hash.bodyWeight as string, TOKEN_DEFAULTS.bodyWeight],\n [\n \"--enad-heading-transform\",\n hash.headingTransform as string,\n TOKEN_DEFAULTS.headingTransform,\n ],\n ],\n },\n {\n comment: \"Borders\",\n entries: [[\"--enad-border-width\", hash.borderWidth as string, TOKEN_DEFAULTS.borderWidth]],\n },\n {\n comment: \"Overlay\",\n entries: [\n [\"--enad-overlay-color\", hash.overlayColor as string, TOKEN_DEFAULTS.overlayColor],\n [\n \"--enad-overlay-from-opacity\",\n hash.overlayFromOpacity as string,\n TOKEN_DEFAULTS.overlayFromOpacity,\n ],\n [\n \"--enad-overlay-to-opacity\",\n hash.overlayToOpacity as string,\n TOKEN_DEFAULTS.overlayToOpacity,\n ],\n ],\n },\n ];\n\n for (const section of tokenSections) {\n const sectionLines: string[] = [];\n for (const [varName, value, defaultValue] of section.entries) {\n if (value != null && value !== defaultValue) {\n sectionLines.push(` ${varName}: ${value};`);\n }\n }\n if (sectionLines.length > 0) {\n lines.push(\"\", `/* ${section.comment} */`, \":root {\", ...sectionLines, \"}\");\n }\n }\n\n return lines;\n}\n\n/**\n * Generate CSS variable declarations from a decoded theme hash.\n * Merges the hash onto SDK defaults and only emits values that differ.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function generateThemeCSS(hash: ThemeHash, _options: GenerateOptions = {}): string {\n const lines: string[] = [\"/* Generated by enad-theme */\"];\n\n // --- Light color diffs + base tokens ---\n const lightDiffs = [...buildLightColorDiffs(hash), ...buildBaseTokenDiffs(hash)];\n if (lightDiffs.length > 0) {\n lines.push(\"\", \":root {\", ...lightDiffs, \"}\");\n }\n\n // --- Dark color diffs ---\n const darkDiffs = buildDarkColorDiffs(hash);\n if (darkDiffs.length > 0) {\n lines.push(\"\", \".dark {\", ...darkDiffs, \"}\");\n }\n\n // --- Token sections ---\n lines.push(...buildTokenSections(hash));\n\n return lines.join(\"\\n\");\n}\n\n// Sentinel markers for idempotent file writes\nexport const MARKER_START = \"/* === enad-theme:start === */\";\nexport const MARKER_END = \"/* === enad-theme:end === */\";\n\n/**\n * Insert or replace a theme block in a CSS file's content.\n * Returns the updated file content.\n */\nexport function applyThemeBlock(fileContent: string, cssBlock: string): string {\n const startIdx = fileContent.indexOf(MARKER_START);\n const endIdx = fileContent.indexOf(MARKER_END);\n\n const block = `${MARKER_START}\\n${cssBlock}\\n${MARKER_END}`;\n\n if (startIdx !== -1 && endIdx !== -1) {\n return fileContent.slice(0, startIdx) + block + fileContent.slice(endIdx + MARKER_END.length);\n }\n\n // Append with a blank line separator\n const separator = fileContent.length > 0 && !fileContent.endsWith(\"\\n\") ? \"\\n\" : \"\";\n return fileContent + separator + \"\\n\" + block + \"\\n\";\n}\n"],"mappings":";;AAO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gB,aAAqB,UAA0B;CAC7E,MAAM,WAAW,YAAY,QAAQ,aAAa;CAClD,MAAM,SAAS,YAAY,QAAQ,WAAW;CAE9C,MAAM,QAAQ,GAAG,aAAa,IAAI,SAAS,IAAI;AAE/C,KAAI,aAAa,MAAM,WAAW,GAChC,QAAO,YAAY,MAAM,GAAG,SAAS,GAAG,QAAQ,YAAY,MAAM,SAAS,GAAkB;AAK/F,QAAO,eADW,YAAY,SAAS,KAAK,CAAC,YAAY,SAAS,KAAK,GAAG,OAAO,MAChD,OAAO,QAAQ"}
|
|
@@ -32,8 +32,6 @@ const KEY_MAP = {
|
|
|
32
32
|
oc: "overlayColor",
|
|
33
33
|
of: "overlayFromOpacity",
|
|
34
34
|
ot: "overlayToOpacity",
|
|
35
|
-
hs: "imageHoverScale",
|
|
36
|
-
hd: "imageHoverDuration",
|
|
37
35
|
v: "variants",
|
|
38
36
|
xs: "componentSet"
|
|
39
37
|
};
|
|
@@ -149,8 +147,6 @@ const TOKEN_DEFAULTS = {
|
|
|
149
147
|
overlayColor: "black",
|
|
150
148
|
overlayFromOpacity: "0.5",
|
|
151
149
|
overlayToOpacity: "0",
|
|
152
|
-
imageHoverScale: "1.05",
|
|
153
|
-
imageHoverDuration: "300ms",
|
|
154
150
|
variants: {
|
|
155
151
|
hero: "overlay",
|
|
156
152
|
linkBlock: "overlay",
|
|
@@ -272,18 +268,6 @@ function buildTokenSections(hash) {
|
|
|
272
268
|
TOKEN_DEFAULTS.overlayToOpacity
|
|
273
269
|
]
|
|
274
270
|
]
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
comment: "Motion",
|
|
278
|
-
entries: [[
|
|
279
|
-
"--enad-image-hover-scale",
|
|
280
|
-
hash.imageHoverScale,
|
|
281
|
-
TOKEN_DEFAULTS.imageHoverScale
|
|
282
|
-
], [
|
|
283
|
-
"--enad-image-hover-duration",
|
|
284
|
-
hash.imageHoverDuration,
|
|
285
|
-
TOKEN_DEFAULTS.imageHoverDuration
|
|
286
|
-
]]
|
|
287
271
|
}
|
|
288
272
|
];
|
|
289
273
|
for (const section of tokenSections) {
|