@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
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { cn } from "./utils.mjs";
|
|
2
|
+
import { defineRecipe } from "../ui-resolver/recipe.mjs";
|
|
2
3
|
import "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
5
|
import { Toggle as Toggle$1 } from "radix-ui";
|
|
6
6
|
//#region src/client/ui/toggle.tsx
|
|
7
|
-
const
|
|
7
|
+
const toggleRecipe = defineRecipe({
|
|
8
|
+
base: "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
9
|
variants: {
|
|
9
10
|
variant: {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
plain: "bg-transparent",
|
|
12
|
+
outlined: "border border-input bg-transparent shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground"
|
|
12
13
|
},
|
|
13
14
|
size: {
|
|
14
|
-
default: "h-9 min-w-9 px-2",
|
|
15
15
|
sm: "h-8 min-w-8 px-1.5",
|
|
16
|
+
md: "h-9 min-w-9 px-2",
|
|
16
17
|
lg: "h-10 min-w-10 px-2.5"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
defaultVariants: {
|
|
20
|
-
variant: "
|
|
21
|
-
size: "
|
|
21
|
+
variant: "plain",
|
|
22
|
+
size: "md"
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
function Toggle({ className, variant, size, ...props }) {
|
|
25
26
|
return /* @__PURE__ */ jsx(Toggle$1.Root, {
|
|
26
27
|
"data-slot": "toggle",
|
|
27
|
-
className: cn(
|
|
28
|
+
className: cn(toggleRecipe({
|
|
28
29
|
variant,
|
|
29
30
|
size,
|
|
30
31
|
className
|
|
@@ -32,7 +33,8 @@ function Toggle({ className, variant, size, ...props }) {
|
|
|
32
33
|
...props
|
|
33
34
|
});
|
|
34
35
|
}
|
|
36
|
+
const toggleVariants = toggleRecipe;
|
|
35
37
|
//#endregion
|
|
36
|
-
export { Toggle, toggleVariants };
|
|
38
|
+
export { Toggle, toggleRecipe, toggleVariants };
|
|
37
39
|
|
|
38
40
|
//# sourceMappingURL=toggle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.mjs","names":["TogglePrimitive"],"sources":["../../../src/client/ui/toggle.tsx"],"sourcesContent":["import * as React from \"react\"
|
|
1
|
+
{"version":3,"file":"toggle.mjs","names":["TogglePrimitive"],"sources":["../../../src/client/ui/toggle.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Toggle as TogglePrimitive } from \"radix-ui\";\n\nimport { defineRecipe } from \"../ui-resolver/recipe\";\nimport { cn } from \"./utils\";\n\nconst toggleRecipe = defineRecipe({\n base: \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n variants: {\n variant: {\n plain: \"bg-transparent\",\n outlined:\n \"border border-input bg-transparent shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground\",\n },\n size: {\n sm: \"h-8 min-w-8 px-1.5\",\n md: \"h-9 min-w-9 px-2\",\n lg: \"h-10 min-w-10 px-2.5\",\n },\n },\n defaultVariants: {\n variant: \"plain\",\n size: \"md\",\n },\n});\n\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> & {\n variant?: \"plain\" | \"outlined\";\n size?: \"sm\" | \"md\" | \"lg\";\n}) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleRecipe({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Toggle, toggleRecipe };\n\n// Backward compat\nconst toggleVariants = toggleRecipe;\nexport { toggleVariants };\n"],"mappings":";;;;;;AAMA,MAAM,eAAe,aAAa;CAChC,MAAM;CACN,UAAU;EACR,SAAS;GACP,OAAO;GACP,UACE;GACH;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CAAC;AAEF,SAAS,OAAO,EACd,WACA,SACA,MACA,GAAG,SAIF;AACD,QACE,oBAACA,SAAgB,MAAjB;EACE,aAAU;EACV,WAAW,GAAG,aAAa;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EACzD,GAAI;EACJ,CAAA;;AAON,MAAM,iBAAiB"}
|
|
@@ -3,6 +3,11 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
3
3
|
import { Tooltip as Tooltip$1 } from "radix-ui";
|
|
4
4
|
|
|
5
5
|
//#region src/client/ui/tooltip.d.ts
|
|
6
|
+
declare const tooltipContentRecipe: (props?: ({
|
|
7
|
+
[x: string]: string | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
className?: string;
|
|
10
|
+
}) | undefined) => string;
|
|
6
11
|
declare function TooltipProvider({
|
|
7
12
|
delayDuration,
|
|
8
13
|
...props
|
|
@@ -20,5 +25,5 @@ declare function TooltipContent({
|
|
|
20
25
|
...props
|
|
21
26
|
}: React$1.ComponentProps<typeof Tooltip$1.Content>): react_jsx_runtime0.JSX.Element;
|
|
22
27
|
//#endregion
|
|
23
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
28
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, tooltipContentRecipe };
|
|
24
29
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","names":[],"sources":["../../../src/client/ui/tooltip.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","names":[],"sources":["../../../src/client/ui/tooltip.tsx"],"mappings":";;;;;cAQM,oBAAA,GAAoB,KAAA;EAAA;;;;iBAIjB,eAAA,CAAA;EACP,aAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,SAAA,CAAiB,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAUhD,OAAA,CAAA;EAAA,GAAa;AAAA,GAAS,OAAA,CAAM,cAAA,QAAsB,SAAA,CAAiB,IAAA,IAAK,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQxE,cAAA,CAAA;EAAA,GAAoB;AAAA,GAAS,OAAA,CAAM,cAAA,QAAsB,SAAA,CAAiB,OAAA,IAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAIlF,cAAA,CAAA;EACP,SAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,SAAA,CAAiB,OAAA,IAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils.mjs";
|
|
3
|
+
import { defineRecipe } from "../ui-resolver/recipe.mjs";
|
|
3
4
|
import "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Tooltip as Tooltip$1 } from "radix-ui";
|
|
6
7
|
//#region src/client/ui/tooltip.tsx
|
|
8
|
+
const tooltipContentRecipe = defineRecipe({ base: "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-[var(--enad-button-radius)] bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2" });
|
|
7
9
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
8
10
|
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
9
11
|
"data-slot": "tooltip-provider",
|
|
@@ -27,12 +29,12 @@ function TooltipContent({ className, sideOffset = 4, children, ...props }) {
|
|
|
27
29
|
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(Tooltip$1.Content, {
|
|
28
30
|
"data-slot": "tooltip-content",
|
|
29
31
|
sideOffset,
|
|
30
|
-
className: cn(
|
|
32
|
+
className: cn(tooltipContentRecipe({ className })),
|
|
31
33
|
...props,
|
|
32
34
|
children: [children, /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
|
|
33
35
|
}) });
|
|
34
36
|
}
|
|
35
37
|
//#endregion
|
|
36
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
38
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, tooltipContentRecipe };
|
|
37
39
|
|
|
38
40
|
//# sourceMappingURL=tooltip.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.mjs","names":["TooltipPrimitive"],"sources":["../../../src/client/ui/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\n\nimport { cn } from \"./utils\";\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(
|
|
1
|
+
{"version":3,"file":"tooltip.mjs","names":["TooltipPrimitive"],"sources":["../../../src/client/ui/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\n\nimport { defineRecipe } from \"../ui-resolver/recipe\";\nimport { cn } from \"./utils\";\n\nconst tooltipContentRecipe = defineRecipe({\n base: \"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-[var(--enad-button-radius)] bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n});\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(tooltipContentRecipe({ className }))}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, tooltipContentRecipe };\n"],"mappings":";;;;;;;AAQA,MAAM,uBAAuB,aAAa,EACxC,MAAM,sbACP,CAAC;AAEF,SAAS,gBAAgB,EACvB,gBAAgB,GAChB,GAAG,SACsD;AACzD,QACE,oBAACA,UAAiB,UAAlB;EACE,aAAU;EACK;EACf,GAAI;EACJ,CAAA;;AAIN,SAAS,QAAQ,EAAE,GAAG,SAA6D;AACjF,QACE,oBAAC,iBAAD,EAAA,UACE,oBAACA,UAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;EAAS,CAAA,EACxC,CAAA;;AAItB,SAAS,eAAe,EAAE,GAAG,SAAgE;AAC3F,QAAO,oBAACA,UAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;EAAS,CAAA;;AAG5E,SAAS,eAAe,EACtB,WACA,aAAa,GACb,UACA,GAAG,SACqD;AACxD,QACE,oBAACA,UAAiB,QAAlB,EAAA,UACE,qBAACA,UAAiB,SAAlB;EACE,aAAU;EACE;EACZ,WAAW,GAAG,qBAAqB,EAAE,WAAW,CAAC,CAAC;EAClD,GAAI;YAJN,CAMG,UACD,oBAACA,UAAiB,OAAlB,EAAwB,WAAU,qFAAsF,CAAA,CAC/F;KACH,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as React$1 from "react";
|
|
1
|
+
import { ButtonProps, ButtonSize, ButtonVariant, buttonRecipe, buttonVariants } from "../ui/button.js";
|
|
3
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
3
|
|
|
5
4
|
//#region src/client/ui-resolver/button.d.ts
|
|
6
5
|
declare function Button({
|
|
7
6
|
...props
|
|
8
|
-
}:
|
|
7
|
+
}: ButtonProps): react_jsx_runtime0.JSX.Element;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { Button, buttonVariants };
|
|
9
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, buttonRecipe, buttonVariants };
|
|
11
10
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../src/client/ui-resolver/button.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../src/client/ui-resolver/button.tsx"],"mappings":";;;;iBAaS,MAAA,CAAA;EAAA,GAAY;AAAA,GAAS,WAAA,GAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Button as Button$1, buttonVariants } from "../ui/button.mjs";
|
|
2
|
+
import { Button as Button$1, buttonRecipe, buttonVariants } from "../ui/button.mjs";
|
|
3
3
|
import { useCustomComponent } from "./context.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -10,6 +10,6 @@ function Button({ ...props }) {
|
|
|
10
10
|
return /* @__PURE__ */ jsx(Button$1, { ...props });
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export { Button, buttonVariants };
|
|
13
|
+
export { Button, buttonRecipe, buttonVariants };
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","names":["DefaultButton"],"sources":["../../../src/client/ui-resolver/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"button.mjs","names":["DefaultButton"],"sources":["../../../src/client/ui-resolver/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as DefaultButton,\n buttonRecipe,\n buttonVariants,\n type ButtonProps,\n type ButtonVariant,\n type ButtonSize,\n} from \"../ui/button\";\nimport { useCustomComponent } from \"./context\";\n\nfunction Button({ ...props }: ButtonProps) {\n const Custom = useCustomComponent(\"button\");\n if (Custom) return <Custom {...props} />;\n return <DefaultButton {...props} />;\n}\n\nexport {\n Button,\n buttonRecipe,\n buttonVariants,\n type ButtonProps,\n type ButtonVariant,\n type ButtonSize,\n};\n"],"mappings":";;;;;;AAaA,SAAS,OAAO,EAAE,GAAG,SAAsB;CACzC,MAAM,SAAS,mBAAmB,SAAS;AAC3C,KAAI,OAAQ,QAAO,oBAAC,QAAD,EAAQ,GAAI,OAAS,CAAA;AACxC,QAAO,oBAACA,UAAD,EAAe,GAAI,OAAS,CAAA"}
|
|
@@ -12,6 +12,19 @@ declare const CardTitle: typeof CardTitle$1;
|
|
|
12
12
|
declare const CardAction: typeof CardAction$1;
|
|
13
13
|
declare const CardDescription: typeof CardDescription$1;
|
|
14
14
|
declare const CardContent: typeof CardContent$1;
|
|
15
|
+
declare const cardRecipe: (props?: ({
|
|
16
|
+
[x: string]: string | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
className?: Partial<Record<"root" | "content" | "title" | "description" | "header" | "action" | "footer", string>> | undefined;
|
|
19
|
+
}) | undefined) => {
|
|
20
|
+
root: string;
|
|
21
|
+
content: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
header: string;
|
|
25
|
+
action: string;
|
|
26
|
+
footer: string;
|
|
27
|
+
};
|
|
15
28
|
//#endregion
|
|
16
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
29
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe };
|
|
17
30
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","names":[],"sources":["../../../src/client/ui-resolver/card.tsx"],"mappings":";;;;;iBAMS,IAAA,CAAA;EAAA,GAAU;AAAA,GAAS,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAiB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAMnE,UAAA,SAAU,YAAA;AAAA,cACV,UAAA,SAAU,YAAA;AAAA,cACV,SAAA,SAAS,WAAA;AAAA,cACT,UAAA,SAAU,YAAA;AAAA,cACV,eAAA,SAAe,iBAAA;AAAA,cACf,WAAA,SAAW,aAAA"}
|
|
1
|
+
{"version":3,"file":"card.d.ts","names":[],"sources":["../../../src/client/ui-resolver/card.tsx"],"mappings":";;;;;iBAMS,IAAA,CAAA;EAAA,GAAU;AAAA,GAAS,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAiB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAMnE,UAAA,SAAU,YAAA;AAAA,cACV,UAAA,SAAU,YAAA;AAAA,cACV,SAAA,SAAS,WAAA;AAAA,cACT,UAAA,SAAU,YAAA;AAAA,cACV,eAAA,SAAe,iBAAA;AAAA,cACf,WAAA,SAAW,aAAA;AAAA,cAEX,UAAA,GAAU,KAAA;EAAA;;cAAyB,OAAA,CAAA,MAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCustomComponent } from "./context.mjs";
|
|
3
|
-
import { Card as Card$1, CardAction as CardAction$1, CardContent as CardContent$1, CardDescription as CardDescription$1, CardFooter as CardFooter$1, CardHeader as CardHeader$1, CardTitle as CardTitle$1 } from "../ui/card.mjs";
|
|
3
|
+
import { Card as Card$1, CardAction as CardAction$1, CardContent as CardContent$1, CardDescription as CardDescription$1, CardFooter as CardFooter$1, CardHeader as CardHeader$1, CardTitle as CardTitle$1, cardRecipe as cardRecipe$1 } from "../ui/card.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/client/ui-resolver/card.tsx
|
|
@@ -15,7 +15,8 @@ const CardTitle = CardTitle$1;
|
|
|
15
15
|
const CardAction = CardAction$1;
|
|
16
16
|
const CardDescription = CardDescription$1;
|
|
17
17
|
const CardContent = CardContent$1;
|
|
18
|
+
const cardRecipe = cardRecipe$1;
|
|
18
19
|
//#endregion
|
|
19
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
20
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=card.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.mjs","names":["DefaultCard.Card","DefaultCard.CardHeader","DefaultCard.CardFooter","DefaultCard.CardTitle","DefaultCard.CardAction","DefaultCard.CardDescription","DefaultCard.CardContent"],"sources":["../../../src/client/ui-resolver/card.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DefaultCard from \"../ui/card\";\nimport { useCustomComponent } from \"./context\";\n\nfunction Card({ ...props }: React.ComponentProps<typeof DefaultCard.Card>) {\n const Custom = useCustomComponent(\"card\");\n if (Custom) return <Custom {...props} />;\n return <DefaultCard.Card {...props} />;\n}\n\nconst CardHeader = DefaultCard.CardHeader;\nconst CardFooter = DefaultCard.CardFooter;\nconst CardTitle = DefaultCard.CardTitle;\nconst CardAction = DefaultCard.CardAction;\nconst CardDescription = DefaultCard.CardDescription;\nconst CardContent = DefaultCard.CardContent;\n\nexport {
|
|
1
|
+
{"version":3,"file":"card.mjs","names":["DefaultCard.Card","DefaultCard.CardHeader","DefaultCard.CardFooter","DefaultCard.CardTitle","DefaultCard.CardAction","DefaultCard.CardDescription","DefaultCard.CardContent","DefaultCard.cardRecipe"],"sources":["../../../src/client/ui-resolver/card.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DefaultCard from \"../ui/card\";\nimport { useCustomComponent } from \"./context\";\n\nfunction Card({ ...props }: React.ComponentProps<typeof DefaultCard.Card>) {\n const Custom = useCustomComponent(\"card\");\n if (Custom) return <Custom {...props} />;\n return <DefaultCard.Card {...props} />;\n}\n\nconst CardHeader = DefaultCard.CardHeader;\nconst CardFooter = DefaultCard.CardFooter;\nconst CardTitle = DefaultCard.CardTitle;\nconst CardAction = DefaultCard.CardAction;\nconst CardDescription = DefaultCard.CardDescription;\nconst CardContent = DefaultCard.CardContent;\n\nconst cardRecipe = DefaultCard.cardRecipe;\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n cardRecipe,\n};\n"],"mappings":";;;;;;AAMA,SAAS,KAAK,EAAE,GAAG,SAAwD;CACzE,MAAM,SAAS,mBAAmB,OAAO;AACzC,KAAI,OAAQ,QAAO,oBAAC,QAAD,EAAQ,GAAI,OAAS,CAAA;AACxC,QAAO,oBAACA,QAAD,EAAkB,GAAI,OAAS,CAAA;;AAGxC,MAAM,aAAaC;AACnB,MAAM,aAAaC;AACnB,MAAM,YAAYC;AAClB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,MAAM,cAAcC;AAEpB,MAAM,aAAaC"}
|
|
@@ -47,7 +47,7 @@ function useComponentSet(component, inline) {
|
|
|
47
47
|
* in which case the component should use its own default.
|
|
48
48
|
*/
|
|
49
49
|
function useVariantDefault(component) {
|
|
50
|
-
return SET_VARIANT_DEFAULTS[useContext(ComponentSetContext).base][component];
|
|
50
|
+
return SET_VARIANT_DEFAULTS[useContext(ComponentSetContext).base]?.[component];
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Returns the custom component override for the given slot, or undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/client/ui-resolver/context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport type ComponentSet = \"default\" | \"brutalist\" | \"editorial\" | \"organic\" | \"minimal\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type CustomComponentMap = Partial<Record<ComponentName, React.ComponentType<any>>>;\n\nexport type ComponentName =\n | \"accordion\"\n | \"alert\"\n | \"avatar\"\n | \"breadcrumb\"\n | \"button\"\n | \"card\"\n | \"carousel\"\n | \"checkbox\"\n | \"collapsible\"\n | \"dialog\"\n | \"hover-card\"\n | \"input\"\n | \"label\"\n | \"navigation-menu\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"select\"\n | \"separator\"\n | \"sheet\"\n | \"stepper\"\n | \"tabs\"\n | \"toggle\"\n | \"toggle-group\"\n | \"tooltip\";\n\nexport type ComponentOverrides = Partial<Record<ComponentName, ComponentSet>>;\n\nexport type VariantDefaults = {\n hero?: \"overlay\" | \"split\" | \"image-only\" | \"minimal\" | \"banner\";\n productCard?: \"gallery\" | \"horizontal\" | \"minimal\" | \"list\" | \"stripped\";\n gallery?: \"grid\" | \"masonry\" | \"filmstrip\";\n};\n\nconst SET_VARIANT_DEFAULTS: Record<ComponentSet, VariantDefaults> = {\n default: {},\n brutalist: { hero: \"banner\", productCard: \"horizontal\" },\n editorial: { gallery: \"masonry\" },\n organic: {},\n minimal: { hero: \"minimal\", productCard: \"stripped\", gallery: \"filmstrip\" },\n};\n\ninterface ComponentSetConfig {\n base: ComponentSet;\n overrides: ComponentOverrides;\n}\n\nconst ComponentSetContext = createContext<ComponentSetConfig>({\n base: \"default\",\n overrides: {},\n});\n\nconst CustomComponentContext = createContext<CustomComponentMap>({});\n\nexport function ComponentSetProvider({\n value,\n overrides,\n customComponents,\n children,\n}: {\n value: ComponentSet;\n overrides?: ComponentOverrides;\n customComponents?: CustomComponentMap;\n children: React.ReactNode;\n}) {\n const config = useMemo(() => ({ base: value, overrides: overrides ?? {} }), [value, overrides]);\n const components = useMemo(() => customComponents ?? {}, [customComponents]);\n return (\n <ComponentSetContext.Provider value={config}>\n <CustomComponentContext.Provider value={components}>\n {children}\n </CustomComponentContext.Provider>\n </ComponentSetContext.Provider>\n );\n}\n\nexport function useComponentSet(component?: ComponentName, inline?: ComponentSet): ComponentSet {\n const config = useContext(ComponentSetContext);\n if (inline) return inline;\n if (component && config.overrides[component]) {\n return config.overrides[component];\n }\n return config.base;\n}\n\n/**\n * Returns the preferred variant for a given component slot based on the\n * active component set. Returns undefined if the set has no preference,\n * in which case the component should use its own default.\n */\nexport function useVariantDefault<K extends keyof VariantDefaults>(\n component: K,\n): VariantDefaults[K] | undefined {\n const config = useContext(ComponentSetContext);\n return SET_VARIANT_DEFAULTS[config.base][component];\n}\n\n/**\n * Returns the custom component override for the given slot, or undefined\n * if no override was provided via `EnadProvider`'s `components` prop.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useCustomComponent<T extends React.ComponentType<any> = React.ComponentType<any>>(\n name: ComponentName,\n): T | undefined {\n const map = useContext(CustomComponentContext);\n return map[name] as T | undefined;\n}\n"],"mappings":";;;;AA4CA,MAAM,uBAA8D;CAClE,SAAS,EAAE;CACX,WAAW;EAAE,MAAM;EAAU,aAAa;EAAc;CACxD,WAAW,EAAE,SAAS,WAAW;CACjC,SAAS,EAAE;CACX,SAAS;EAAE,MAAM;EAAW,aAAa;EAAY,SAAS;EAAa;CAC5E;AAOD,MAAM,sBAAsB,cAAkC;CAC5D,MAAM;CACN,WAAW,EAAE;CACd,CAAC;AAEF,MAAM,yBAAyB,cAAkC,EAAE,CAAC;AAEpE,SAAgB,qBAAqB,EACnC,OACA,WACA,kBACA,YAMC;CACD,MAAM,SAAS,eAAe;EAAE,MAAM;EAAO,WAAW,aAAa,EAAE;EAAE,GAAG,CAAC,OAAO,UAAU,CAAC;CAC/F,MAAM,aAAa,cAAc,oBAAoB,EAAE,EAAE,CAAC,iBAAiB,CAAC;AAC5E,QACE,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;YACnC,oBAAC,uBAAuB,UAAxB;GAAiC,OAAO;GACrC;GAC+B,CAAA;EACL,CAAA;;AAInC,SAAgB,gBAAgB,WAA2B,QAAqC;CAC9F,MAAM,SAAS,WAAW,oBAAoB;AAC9C,KAAI,OAAQ,QAAO;AACnB,KAAI,aAAa,OAAO,UAAU,WAChC,QAAO,OAAO,UAAU;AAE1B,QAAO,OAAO;;;;;;;AAQhB,SAAgB,kBACd,WACgC;AAEhC,QAAO,qBADQ,WAAW,oBAAoB,CACX,
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/client/ui-resolver/context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport type ComponentSet = \"default\" | \"brutalist\" | \"editorial\" | \"organic\" | \"minimal\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type CustomComponentMap = Partial<Record<ComponentName, React.ComponentType<any>>>;\n\nexport type ComponentName =\n | \"accordion\"\n | \"alert\"\n | \"avatar\"\n | \"breadcrumb\"\n | \"button\"\n | \"card\"\n | \"carousel\"\n | \"checkbox\"\n | \"collapsible\"\n | \"dialog\"\n | \"hover-card\"\n | \"input\"\n | \"label\"\n | \"navigation-menu\"\n | \"pagination\"\n | \"popover\"\n | \"progress\"\n | \"select\"\n | \"separator\"\n | \"sheet\"\n | \"stepper\"\n | \"tabs\"\n | \"toggle\"\n | \"toggle-group\"\n | \"tooltip\";\n\nexport type ComponentOverrides = Partial<Record<ComponentName, ComponentSet>>;\n\nexport type VariantDefaults = {\n hero?: \"overlay\" | \"split\" | \"image-only\" | \"minimal\" | \"banner\";\n productCard?: \"gallery\" | \"horizontal\" | \"minimal\" | \"list\" | \"stripped\";\n gallery?: \"grid\" | \"masonry\" | \"filmstrip\";\n};\n\nconst SET_VARIANT_DEFAULTS: Record<ComponentSet, VariantDefaults> = {\n default: {},\n brutalist: { hero: \"banner\", productCard: \"horizontal\" },\n editorial: { gallery: \"masonry\" },\n organic: {},\n minimal: { hero: \"minimal\", productCard: \"stripped\", gallery: \"filmstrip\" },\n};\n\ninterface ComponentSetConfig {\n base: ComponentSet;\n overrides: ComponentOverrides;\n}\n\nconst ComponentSetContext = createContext<ComponentSetConfig>({\n base: \"default\",\n overrides: {},\n});\n\nconst CustomComponentContext = createContext<CustomComponentMap>({});\n\nexport function ComponentSetProvider({\n value,\n overrides,\n customComponents,\n children,\n}: {\n value: ComponentSet;\n overrides?: ComponentOverrides;\n customComponents?: CustomComponentMap;\n children: React.ReactNode;\n}) {\n const config = useMemo(() => ({ base: value, overrides: overrides ?? {} }), [value, overrides]);\n const components = useMemo(() => customComponents ?? {}, [customComponents]);\n return (\n <ComponentSetContext.Provider value={config}>\n <CustomComponentContext.Provider value={components}>\n {children}\n </CustomComponentContext.Provider>\n </ComponentSetContext.Provider>\n );\n}\n\nexport function useComponentSet(component?: ComponentName, inline?: ComponentSet): ComponentSet {\n const config = useContext(ComponentSetContext);\n if (inline) return inline;\n if (component && config.overrides[component]) {\n return config.overrides[component];\n }\n return config.base;\n}\n\n/**\n * Returns the preferred variant for a given component slot based on the\n * active component set. Returns undefined if the set has no preference,\n * in which case the component should use its own default.\n */\nexport function useVariantDefault<K extends keyof VariantDefaults>(\n component: K,\n): VariantDefaults[K] | undefined {\n const config = useContext(ComponentSetContext);\n return SET_VARIANT_DEFAULTS[config.base]?.[component];\n}\n\n/**\n * Returns the custom component override for the given slot, or undefined\n * if no override was provided via `EnadProvider`'s `components` prop.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function useCustomComponent<T extends React.ComponentType<any> = React.ComponentType<any>>(\n name: ComponentName,\n): T | undefined {\n const map = useContext(CustomComponentContext);\n return map[name] as T | undefined;\n}\n"],"mappings":";;;;AA4CA,MAAM,uBAA8D;CAClE,SAAS,EAAE;CACX,WAAW;EAAE,MAAM;EAAU,aAAa;EAAc;CACxD,WAAW,EAAE,SAAS,WAAW;CACjC,SAAS,EAAE;CACX,SAAS;EAAE,MAAM;EAAW,aAAa;EAAY,SAAS;EAAa;CAC5E;AAOD,MAAM,sBAAsB,cAAkC;CAC5D,MAAM;CACN,WAAW,EAAE;CACd,CAAC;AAEF,MAAM,yBAAyB,cAAkC,EAAE,CAAC;AAEpE,SAAgB,qBAAqB,EACnC,OACA,WACA,kBACA,YAMC;CACD,MAAM,SAAS,eAAe;EAAE,MAAM;EAAO,WAAW,aAAa,EAAE;EAAE,GAAG,CAAC,OAAO,UAAU,CAAC;CAC/F,MAAM,aAAa,cAAc,oBAAoB,EAAE,EAAE,CAAC,iBAAiB,CAAC;AAC5E,QACE,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;YACnC,oBAAC,uBAAuB,UAAxB;GAAiC,OAAO;GACrC;GAC+B,CAAA;EACL,CAAA;;AAInC,SAAgB,gBAAgB,WAA2B,QAAqC;CAC9F,MAAM,SAAS,WAAW,oBAAoB;AAC9C,KAAI,OAAQ,QAAO;AACnB,KAAI,aAAa,OAAO,UAAU,WAChC,QAAO,OAAO,UAAU;AAE1B,QAAO,OAAO;;;;;;;AAQhB,SAAgB,kBACd,WACgC;AAEhC,QAAO,qBADQ,WAAW,oBAAoB,CACX,QAAQ;;;;;;AAQ7C,SAAgB,mBACd,MACe;AAEf,QADY,WAAW,uBAAuB,CACnC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { ComponentName, ComponentOverrides, ComponentSet, ComponentSetProvider, CustomComponentMap, VariantDefaults, useComponentSet, useCustomComponent, useVariantDefault } from "./context.js";
|
|
2
|
+
import { SemanticColor, Size, Variant } from "./types.js";
|
|
3
|
+
import { ButtonProps, ButtonSize, ButtonVariant, buttonRecipe, buttonVariants } from "../ui/button.js";
|
|
2
4
|
import { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger } from "./accordion.js";
|
|
3
5
|
import { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
4
6
|
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
5
7
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
6
|
-
import { buttonVariants } from "../ui/button.js";
|
|
7
8
|
import { Button } from "./button.js";
|
|
8
|
-
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
9
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe } from "./card.js";
|
|
9
10
|
import { Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "./carousel.js";
|
|
10
11
|
import { Checkbox } from "./checkbox.js";
|
|
11
12
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
|
|
12
13
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./dialog.js";
|
|
13
14
|
import { HoverCard, HoverCardContent, HoverCardTrigger } from "./hover-card.js";
|
|
15
|
+
import { defineRecipe, defineSlotRecipe } from "./recipe.js";
|
|
16
|
+
import { InputProps, inputRecipe } from "../ui/input.js";
|
|
14
17
|
import { Input } from "./input.js";
|
|
15
18
|
import { Label } from "./label.js";
|
|
16
19
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./select.js";
|
|
@@ -19,11 +22,11 @@ import { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, Navigat
|
|
|
19
22
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
20
23
|
import { Separator } from "./separator.js";
|
|
21
24
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet.js";
|
|
22
|
-
import { toggleVariants } from "../ui/toggle.js";
|
|
25
|
+
import { toggleRecipe, toggleVariants } from "../ui/toggle.js";
|
|
23
26
|
import { Toggle } from "./toggle.js";
|
|
24
27
|
import { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
|
|
25
28
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
26
29
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
27
30
|
import { Progress } from "./progress.js";
|
|
28
31
|
import { Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle } from "./stepper.js";
|
|
29
|
-
export { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentName, type ComponentOverrides, type ComponentSet, ComponentSetProvider, type CustomComponentMap, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle, Tabs, TabsContent, TabsList, TabsTrigger, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type VariantDefaults, buttonVariants, navigationMenuTriggerStyle, toggleVariants, useComponentSet, useCustomComponent, useVariantDefault };
|
|
32
|
+
export { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentName, type ComponentOverrides, type ComponentSet, ComponentSetProvider, type CustomComponentMap, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, type InputProps, Label, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, type SemanticColor, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, type Size, Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle, Tabs, TabsContent, TabsList, TabsTrigger, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type Variant, type VariantDefaults, buttonRecipe, buttonVariants, cardRecipe, defineRecipe, defineSlotRecipe, inputRecipe, navigationMenuTriggerStyle, toggleRecipe, toggleVariants, useComponentSet, useCustomComponent, useVariantDefault };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineRecipe, defineSlotRecipe } from "./recipe.mjs";
|
|
2
|
+
import { buttonRecipe, buttonVariants } from "../ui/button.mjs";
|
|
3
|
+
import { inputRecipe } from "../ui/input.mjs";
|
|
2
4
|
import { ComponentSetProvider, useComponentSet, useCustomComponent, useVariantDefault } from "./context.mjs";
|
|
3
5
|
import { Button } from "./button.mjs";
|
|
4
6
|
import { Input } from "./input.mjs";
|
|
@@ -8,22 +10,22 @@ import { Checkbox } from "./checkbox.mjs";
|
|
|
8
10
|
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "./pagination.mjs";
|
|
9
11
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.mjs";
|
|
10
12
|
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "./popover.mjs";
|
|
11
|
-
import {
|
|
13
|
+
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "./carousel.mjs";
|
|
14
|
+
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet.mjs";
|
|
15
|
+
import { toggleRecipe, toggleVariants } from "../ui/toggle.mjs";
|
|
12
16
|
import { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger } from "./accordion.mjs";
|
|
13
17
|
import { Alert, AlertDescription, AlertTitle } from "./alert.mjs";
|
|
14
18
|
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.mjs";
|
|
15
|
-
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.mjs";
|
|
16
|
-
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "./carousel.mjs";
|
|
19
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe } from "./card.mjs";
|
|
17
20
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.mjs";
|
|
18
21
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./dialog.mjs";
|
|
19
22
|
import { HoverCard, HoverCardContent, HoverCardTrigger } from "./hover-card.mjs";
|
|
20
23
|
import { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle } from "./navigation-menu.mjs";
|
|
21
24
|
import { Separator } from "./separator.mjs";
|
|
22
|
-
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./sheet.mjs";
|
|
23
25
|
import { Toggle } from "./toggle.mjs";
|
|
24
26
|
import { ToggleGroup, ToggleGroupItem } from "./toggle-group.mjs";
|
|
25
27
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.mjs";
|
|
26
28
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.mjs";
|
|
27
29
|
import { Progress } from "./progress.mjs";
|
|
28
30
|
import { Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle } from "./stepper.mjs";
|
|
29
|
-
export { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ComponentSetProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle, Tabs, TabsContent, TabsList, TabsTrigger, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, navigationMenuTriggerStyle, toggleVariants, useComponentSet, useCustomComponent, useVariantDefault };
|
|
31
|
+
export { Accordion, AccordionContent, AccordionGroup, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, ComponentSetProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Stepper, StepperDescription, StepperItem, StepperSeparator, StepperTitle, Tabs, TabsContent, TabsList, TabsTrigger, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonRecipe, buttonVariants, cardRecipe, defineRecipe, defineSlotRecipe, inputRecipe, navigationMenuTriggerStyle, toggleRecipe, toggleVariants, useComponentSet, useCustomComponent, useVariantDefault };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as React$1 from "react";
|
|
1
|
+
import { InputProps, inputRecipe } from "../ui/input.js";
|
|
3
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
3
|
|
|
5
4
|
//#region src/client/ui-resolver/input.d.ts
|
|
6
5
|
declare function Input({
|
|
7
6
|
...props
|
|
8
|
-
}:
|
|
7
|
+
}: InputProps): react_jsx_runtime0.JSX.Element;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { Input };
|
|
9
|
+
export { Input, type InputProps, inputRecipe };
|
|
11
10
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/client/ui-resolver/input.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","names":[],"sources":["../../../src/client/ui-resolver/input.tsx"],"mappings":";;;;iBAMS,KAAA,CAAA;EAAA,GAAW;AAAA,GAAS,UAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Input as Input$1 } from "../ui/input.mjs";
|
|
2
|
+
import { Input as Input$1, inputRecipe } from "../ui/input.mjs";
|
|
3
3
|
import { useCustomComponent } from "./context.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -10,6 +10,6 @@ function Input({ ...props }) {
|
|
|
10
10
|
return /* @__PURE__ */ jsx(Input$1, { ...props });
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export { Input };
|
|
13
|
+
export { Input, inputRecipe };
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.mjs","names":["DefaultInput"],"sources":["../../../src/client/ui-resolver/input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Input as DefaultInput } from \"../ui/input\";\nimport { useCustomComponent } from \"./context\";\n\nfunction Input({ ...props }:
|
|
1
|
+
{"version":3,"file":"input.mjs","names":["DefaultInput"],"sources":["../../../src/client/ui-resolver/input.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Input as DefaultInput, inputRecipe, type InputProps } from \"../ui/input\";\nimport { useCustomComponent } from \"./context\";\n\nfunction Input({ ...props }: InputProps) {\n const Custom = useCustomComponent(\"input\");\n if (Custom) return <Custom {...props} />;\n return <DefaultInput {...props} />;\n}\n\nexport { Input, inputRecipe, type InputProps };\n"],"mappings":";;;;;;AAMA,SAAS,MAAM,EAAE,GAAG,SAAqB;CACvC,MAAM,SAAS,mBAAmB,QAAQ;AAC1C,KAAI,OAAQ,QAAO,oBAAC,QAAD,EAAQ,GAAI,OAAS,CAAA;AACxC,QAAO,oBAACA,SAAD,EAAc,GAAI,OAAS,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NavigationMenu as NavigationMenu$1, NavigationMenuContent as NavigationMenuContent$1, NavigationMenuIndicator as NavigationMenuIndicator$1, NavigationMenuItem as NavigationMenuItem$1, NavigationMenuLink as NavigationMenuLink$1, NavigationMenuList as NavigationMenuList$1, NavigationMenuTrigger as NavigationMenuTrigger$1, NavigationMenuViewport as NavigationMenuViewport$1 } from "../ui/navigation-menu.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
4
|
|
|
6
5
|
//#region src/client/ui-resolver/navigation-menu.d.ts
|
|
7
6
|
declare function NavigationMenu({
|
|
@@ -14,7 +13,7 @@ declare const NavigationMenuTrigger: typeof NavigationMenuTrigger$1;
|
|
|
14
13
|
declare const NavigationMenuLink: typeof NavigationMenuLink$1;
|
|
15
14
|
declare const NavigationMenuIndicator: typeof NavigationMenuIndicator$1;
|
|
16
15
|
declare const NavigationMenuViewport: typeof NavigationMenuViewport$1;
|
|
17
|
-
declare const navigationMenuTriggerStyle: (
|
|
16
|
+
declare const navigationMenuTriggerStyle: () => string;
|
|
18
17
|
//#endregion
|
|
19
18
|
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|
|
20
19
|
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/client/ui-resolver/navigation-menu.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/client/ui-resolver/navigation-menu.tsx"],"mappings":";;;;;iBAMS,cAAA,CAAA;EAAA,GAAoB;AAAA,GAAS,OAAA,CAAM,cAAA,QAAsB,gBAAA,IAA0B,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAMtF,kBAAA,SAAkB,oBAAA;AAAA,cAClB,kBAAA,SAAkB,oBAAA;AAAA,cAClB,qBAAA,SAAqB,uBAAA;AAAA,cACrB,qBAAA,SAAqB,uBAAA;AAAA,cACrB,kBAAA,SAAkB,oBAAA;AAAA,cAClB,uBAAA,SAAuB,yBAAA;AAAA,cACvB,sBAAA,SAAsB,wBAAA;AAAA,cACtB,0BAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/client/ui-resolver/recipe.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind-native slot recipe system for compound components.
|
|
4
|
+
*
|
|
5
|
+
* Slot recipes coordinate variant styles across multiple parts of a compound
|
|
6
|
+
* component. Each slot gets its own class string, and variants can target
|
|
7
|
+
* specific slots or all slots at once.
|
|
8
|
+
*
|
|
9
|
+
* CSS variable contract:
|
|
10
|
+
* instance style → [data-component-set] CSS → :root token → hardcoded fallback
|
|
11
|
+
*
|
|
12
|
+
* Component sets override CSS variables in their [data-component-set="..."]
|
|
13
|
+
* blocks. Recipes consume those variables via Tailwind arbitrary values
|
|
14
|
+
* (e.g. h-[var(--enad-button-height)]), so changing the set changes the
|
|
15
|
+
* component's dimensions without touching JS.
|
|
16
|
+
*/
|
|
17
|
+
type SlotClassMap<S extends string> = Partial<Record<S, string>>;
|
|
18
|
+
interface SlotRecipeConfig<S extends string, V extends Record<string, Record<string, SlotClassMap<S>>>> {
|
|
19
|
+
slots: readonly S[];
|
|
20
|
+
base: SlotClassMap<S>;
|
|
21
|
+
variants?: V;
|
|
22
|
+
defaultVariants?: { [K in keyof V]?: keyof V[K] };
|
|
23
|
+
compoundVariants?: Array<{ [K in keyof V]?: keyof V[K] | Array<keyof V[K]> } & {
|
|
24
|
+
css: SlotClassMap<S>;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
type VariantProps<V extends Record<string, Record<string, unknown>>> = { [K in keyof V]?: keyof V[K] };
|
|
28
|
+
type SlotRecipeResult<S extends string> = Record<S, string>;
|
|
29
|
+
interface RecipeConfig<V extends Record<string, Record<string, string>>> {
|
|
30
|
+
base?: string;
|
|
31
|
+
variants?: V;
|
|
32
|
+
defaultVariants?: { [K in keyof V]?: keyof V[K] };
|
|
33
|
+
compoundVariants?: Array<{ [K in keyof V]?: keyof V[K] | Array<keyof V[K]> } & {
|
|
34
|
+
css: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a slot recipe for compound components.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const cardRecipe = defineSlotRecipe({
|
|
43
|
+
* slots: ["root", "header", "content", "footer"] as const,
|
|
44
|
+
* base: {
|
|
45
|
+
* root: "flex flex-col rounded-lg border",
|
|
46
|
+
* header: "grid items-start",
|
|
47
|
+
* content: "px-6",
|
|
48
|
+
* footer: "flex items-center px-6",
|
|
49
|
+
* },
|
|
50
|
+
* variants: {
|
|
51
|
+
* size: {
|
|
52
|
+
* sm: { root: "text-sm", content: "px-4" },
|
|
53
|
+
* md: { root: "text-base" },
|
|
54
|
+
* lg: { root: "text-lg", content: "px-8" },
|
|
55
|
+
* },
|
|
56
|
+
* },
|
|
57
|
+
* defaultVariants: { size: "md" },
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* const classes = cardRecipe({ size: "sm" });
|
|
61
|
+
* // classes.root → "flex flex-col rounded-lg border text-sm"
|
|
62
|
+
* // classes.content → "px-4" (merged via tailwind-merge)
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare function defineSlotRecipe<S extends string, V extends Record<string, Record<string, SlotClassMap<S>>>>(config: SlotRecipeConfig<S, V>): (props?: VariantProps<V> & {
|
|
66
|
+
className?: SlotClassMap<S>;
|
|
67
|
+
}) => SlotRecipeResult<S>;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a single-slot recipe for simple components.
|
|
70
|
+
* Thin wrapper around defineSlotRecipe with a single "root" slot.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const badgeRecipe = defineRecipe({
|
|
75
|
+
* base: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold",
|
|
76
|
+
* variants: {
|
|
77
|
+
* variant: {
|
|
78
|
+
* solid: "bg-primary text-primary-foreground",
|
|
79
|
+
* soft: "bg-primary/10 text-primary",
|
|
80
|
+
* outlined: "border border-current",
|
|
81
|
+
* },
|
|
82
|
+
* },
|
|
83
|
+
* defaultVariants: { variant: "solid" },
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* const classes = badgeRecipe({ variant: "soft" });
|
|
87
|
+
* // → "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold bg-primary/10 text-primary"
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function defineRecipe<V extends Record<string, Record<string, string>>>(config: RecipeConfig<V>): (props?: VariantProps<V> & {
|
|
91
|
+
className?: string;
|
|
92
|
+
}) => string;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { defineRecipe, defineSlotRecipe };
|
|
95
|
+
//# sourceMappingURL=recipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe.d.ts","names":[],"sources":["../../../src/client/ui-resolver/recipe.ts"],"mappings":";;;;;;;;;;;;;;;;KAsBK,YAAA,qBAAiC,OAAA,CAAQ,MAAA,CAAO,CAAA;AAAA,UAE3C,gBAAA,6BAEE,MAAA,SAAe,MAAA,SAAe,YAAA,CAAa,CAAA;EAErD,KAAA,WAAgB,CAAA;EAChB,IAAA,EAAM,YAAA,CAAa,CAAA;EACnB,QAAA,GAAW,CAAA;EACX,eAAA,iBACc,CAAA,UAAW,CAAA,CAAE,CAAA;EAE3B,gBAAA,GAAmB,KAAA,eAEH,CAAA,UAAW,CAAA,CAAE,CAAA,IAAK,KAAA,OAAY,CAAA,CAAE,CAAA;IAE5C,GAAA,EAAK,YAAA,CAAa,CAAA;EAAA;AAAA;AAAA,KAKnB,YAAA,WAAuB,MAAA,SAAe,MAAA,oCAC7B,CAAA,UAAW,CAAA,CAAE,CAAA;AAAA,KAGtB,gBAAA,qBAAqC,MAAA,CAAO,CAAA;AAAA,UAEvC,YAAA,WAAuB,MAAA,SAAe,MAAA;EAC9C,IAAA;EACA,QAAA,GAAW,CAAA;EACX,eAAA,iBACc,CAAA,UAAW,CAAA,CAAE,CAAA;EAE3B,gBAAA,GAAmB,KAAA,eAEH,CAAA,UAAW,CAAA,CAAE,CAAA,IAAK,KAAA,OAAY,CAAA,CAAE,CAAA;IAE5C,GAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArBmB;iBA+ET,gBAAA,6BAEJ,MAAA,SAAe,MAAA,SAAe,YAAA,CAAa,CAAA,IAAA,CACrD,MAAA,EAAQ,gBAAA,CAAiB,CAAA,EAAG,CAAA,KAI1B,KAAA,GAAQ,YAAA,CAAa,CAAA;EAAO,SAAA,GAAY,YAAA,CAAa,CAAA;AAAA,MACpD,gBAAA,CAAiB,CAAA;;;;;;;;;;;;;;;;AAjFM;;;;;;;iBAuKZ,YAAA,WAAuB,MAAA,SAAe,MAAA,kBAAA,CACpD,MAAA,EAAQ,YAAA,CAAa,CAAA,KAIQ,KAAA,GAAQ,YAAA,CAAa,CAAA;EAAO,SAAA;AAAA"}
|