@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.
Files changed (232) hide show
  1. package/dist/client/cart/components/cart-drawer.mjs +3 -3
  2. package/dist/client/cart/components/cart-drawer.mjs.map +1 -1
  3. package/dist/client/cart/components/cart-trigger.mjs +1 -1
  4. package/dist/client/cart/components/cart-trigger.mjs.map +1 -1
  5. package/dist/client/storefront/blocks/card-video.mjs +1 -1
  6. package/dist/client/storefront/blocks/card-video.mjs.map +1 -1
  7. package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -1
  8. package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +13 -5
  9. package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -1
  10. package/dist/client/storefront/blocks/gallery.d.ts +10 -1
  11. package/dist/client/storefront/blocks/gallery.d.ts.map +1 -1
  12. package/dist/client/storefront/blocks/gallery.mjs +51 -27
  13. package/dist/client/storefront/blocks/gallery.mjs.map +1 -1
  14. package/dist/client/storefront/blocks/hero.d.ts +12 -1
  15. package/dist/client/storefront/blocks/hero.d.ts.map +1 -1
  16. package/dist/client/storefront/blocks/hero.mjs +143 -145
  17. package/dist/client/storefront/blocks/hero.mjs.map +1 -1
  18. package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -1
  19. package/dist/client/storefront/blocks/link-block-small.mjs +1 -1
  20. package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -1
  21. package/dist/client/storefront/blocks/link-block.d.ts.map +1 -1
  22. package/dist/client/storefront/blocks/link-block.mjs +4 -4
  23. package/dist/client/storefront/blocks/link-block.mjs.map +1 -1
  24. package/dist/client/storefront/blocks/product-card-parts.d.ts +1 -1
  25. package/dist/client/storefront/blocks/product-card-parts.d.ts.map +1 -1
  26. package/dist/client/storefront/blocks/product-card-parts.mjs +2 -2
  27. package/dist/client/storefront/blocks/product-card-parts.mjs.map +1 -1
  28. package/dist/client/storefront/blocks/product-card.d.ts +10 -1
  29. package/dist/client/storefront/blocks/product-card.d.ts.map +1 -1
  30. package/dist/client/storefront/blocks/product-card.mjs +122 -116
  31. package/dist/client/storefront/blocks/product-card.mjs.map +1 -1
  32. package/dist/client/storefront/blocks/product-image.mjs +2 -2
  33. package/dist/client/storefront/blocks/product-image.mjs.map +1 -1
  34. package/dist/client/storefront/blocks/text-content-with-image.d.ts +14 -1
  35. package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -1
  36. package/dist/client/storefront/blocks/text-content-with-image.mjs +141 -164
  37. package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -1
  38. package/dist/client/storefront/carousel/swipeable-carousel.d.ts +5 -1
  39. package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -1
  40. package/dist/client/storefront/carousel/swipeable-carousel.mjs +2 -1
  41. package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -1
  42. package/dist/client/storefront/checkout/cart-summary.mjs +1 -1
  43. package/dist/client/storefront/checkout/cart-summary.mjs.map +1 -1
  44. package/dist/client/storefront/components/language-selector.d.ts.map +1 -1
  45. package/dist/client/storefront/components/language-selector.mjs +1 -1
  46. package/dist/client/storefront/components/language-selector.mjs.map +1 -1
  47. package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -1
  48. package/dist/client/storefront/components/product-recommendations.mjs +29 -37
  49. package/dist/client/storefront/components/product-recommendations.mjs.map +1 -1
  50. package/dist/client/storefront/filters/filter-chip.d.ts +5 -2
  51. package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -1
  52. package/dist/client/storefront/filters/filter-chip.mjs +6 -4
  53. package/dist/client/storefront/filters/filter-chip.mjs.map +1 -1
  54. package/dist/client/storefront/filters/filter-panel.mjs +2 -2
  55. package/dist/client/storefront/filters/filter-panel.mjs.map +1 -1
  56. package/dist/client/storefront/filters/toggle-list-view.mjs +1 -1
  57. package/dist/client/storefront/filters/toggle-list-view.mjs.map +1 -1
  58. package/dist/client/storefront/index.d.ts +12 -1
  59. package/dist/client/storefront/index.mjs +12 -1
  60. package/dist/client/storefront/layout/header.d.ts.map +1 -1
  61. package/dist/client/storefront/layout/header.mjs +1 -1
  62. package/dist/client/storefront/layout/header.mjs.map +1 -1
  63. package/dist/client/storefront/layout/mobile-menu-drawer.mjs +1 -1
  64. package/dist/client/storefront/layout/promotion-bar.d.ts.map +1 -1
  65. package/dist/client/storefront/layout/promotion-bar.mjs +3 -3
  66. package/dist/client/storefront/layout/promotion-bar.mjs.map +1 -1
  67. package/dist/client/storefront/primitives/block-heading.d.ts +40 -0
  68. package/dist/client/storefront/primitives/block-heading.d.ts.map +1 -0
  69. package/dist/client/storefront/primitives/block-heading.mjs +43 -0
  70. package/dist/client/storefront/primitives/block-heading.mjs.map +1 -0
  71. package/dist/client/storefront/primitives/button.d.ts +2 -2
  72. package/dist/client/storefront/primitives/button.d.ts.map +1 -1
  73. package/dist/client/storefront/primitives/button.mjs +4 -4
  74. package/dist/client/storefront/primitives/button.mjs.map +1 -1
  75. package/dist/client/storefront/primitives/cta-group.d.ts +25 -0
  76. package/dist/client/storefront/primitives/cta-group.d.ts.map +1 -0
  77. package/dist/client/storefront/primitives/cta-group.mjs +27 -0
  78. package/dist/client/storefront/primitives/cta-group.mjs.map +1 -0
  79. package/dist/client/storefront/primitives/image-with-hover.d.ts +18 -0
  80. package/dist/client/storefront/primitives/image-with-hover.d.ts.map +1 -0
  81. package/dist/client/storefront/primitives/image-with-hover.mjs +16 -0
  82. package/dist/client/storefront/primitives/image-with-hover.mjs.map +1 -0
  83. package/dist/client/storefront/primitives/index.d.ts +4 -1
  84. package/dist/client/storefront/primitives/index.mjs +4 -1
  85. package/dist/client/storefront/primitives/input.d.ts +1 -1
  86. package/dist/client/storefront/primitives/input.mjs.map +1 -1
  87. package/dist/client/storefront/primitives/pagination.mjs +2 -2
  88. package/dist/client/storefront/primitives/pagination.mjs.map +1 -1
  89. package/dist/client/storefront/product/quantity-picker.mjs +2 -2
  90. package/dist/client/storefront/product/quantity-picker.mjs.map +1 -1
  91. package/dist/client/storefront/types.d.ts +1 -1
  92. package/dist/client/storefront/types.d.ts.map +1 -1
  93. package/dist/client/storefront/types.mjs.map +1 -1
  94. package/dist/client/theme/apply.d.ts +1 -1
  95. package/dist/client/theme/apply.d.ts.map +1 -1
  96. package/dist/client/theme/apply.mjs +0 -12
  97. package/dist/client/theme/apply.mjs.map +1 -1
  98. package/dist/client/theme/cli.mjs +0 -16
  99. package/dist/client/theme/cli.mjs.map +1 -1
  100. package/dist/client/theme/codec.d.ts.map +1 -1
  101. package/dist/client/theme/codec.mjs +0 -2
  102. package/dist/client/theme/codec.mjs.map +1 -1
  103. package/dist/client/theme/defaults.d.ts +0 -2
  104. package/dist/client/theme/defaults.mjs +0 -2
  105. package/dist/client/theme/defaults.mjs.map +1 -1
  106. package/dist/client/ui/accordion.d.ts +12 -1
  107. package/dist/client/ui/accordion.d.ts.map +1 -1
  108. package/dist/client/ui/accordion.mjs +23 -5
  109. package/dist/client/ui/accordion.mjs.map +1 -1
  110. package/dist/client/ui/alert.d.ts +16 -7
  111. package/dist/client/ui/alert.d.ts.map +1 -1
  112. package/dist/client/ui/alert.mjs +21 -8
  113. package/dist/client/ui/alert.mjs.map +1 -1
  114. package/dist/client/ui/avatar.d.ts +10 -1
  115. package/dist/client/ui/avatar.d.ts.map +1 -1
  116. package/dist/client/ui/avatar.mjs +18 -4
  117. package/dist/client/ui/avatar.mjs.map +1 -1
  118. package/dist/client/ui/breadcrumb.d.ts +13 -1
  119. package/dist/client/ui/breadcrumb.d.ts.map +1 -1
  120. package/dist/client/ui/breadcrumb.mjs +27 -7
  121. package/dist/client/ui/breadcrumb.mjs.map +1 -1
  122. package/dist/client/ui/button.d.ts +28 -10
  123. package/dist/client/ui/button.d.ts.map +1 -1
  124. package/dist/client/ui/button.mjs +45 -20
  125. package/dist/client/ui/button.mjs.map +1 -1
  126. package/dist/client/ui/card.d.ts +20 -1
  127. package/dist/client/ui/card.d.ts.map +1 -1
  128. package/dist/client/ui/card.mjs +36 -8
  129. package/dist/client/ui/card.mjs.map +1 -1
  130. package/dist/client/ui/carousel.d.ts +9 -1
  131. package/dist/client/ui/carousel.d.ts.map +1 -1
  132. package/dist/client/ui/carousel.mjs +20 -4
  133. package/dist/client/ui/carousel.mjs.map +1 -1
  134. package/dist/client/ui/checkbox.d.ts +9 -1
  135. package/dist/client/ui/checkbox.d.ts.map +1 -1
  136. package/dist/client/ui/checkbox.mjs +12 -3
  137. package/dist/client/ui/checkbox.mjs.map +1 -1
  138. package/dist/client/ui/dialog.d.ts +13 -1
  139. package/dist/client/ui/dialog.d.ts.map +1 -1
  140. package/dist/client/ui/dialog.mjs +27 -7
  141. package/dist/client/ui/dialog.mjs.map +1 -1
  142. package/dist/client/ui/hover-card.d.ts +6 -1
  143. package/dist/client/ui/hover-card.d.ts.map +1 -1
  144. package/dist/client/ui/hover-card.mjs +4 -2
  145. package/dist/client/ui/hover-card.mjs.map +1 -1
  146. package/dist/client/ui/input.d.ts +20 -7
  147. package/dist/client/ui/input.d.ts.map +1 -1
  148. package/dist/client/ui/input.mjs +33 -9
  149. package/dist/client/ui/input.mjs.map +1 -1
  150. package/dist/client/ui/label.d.ts +6 -1
  151. package/dist/client/ui/label.d.ts.map +1 -1
  152. package/dist/client/ui/label.mjs +4 -2
  153. package/dist/client/ui/label.mjs.map +1 -1
  154. package/dist/client/ui/navigation-menu.d.ts +20 -3
  155. package/dist/client/ui/navigation-menu.d.ts.map +1 -1
  156. package/dist/client/ui/navigation-menu.mjs +34 -12
  157. package/dist/client/ui/navigation-menu.mjs.map +1 -1
  158. package/dist/client/ui/pagination.d.ts.map +1 -1
  159. package/dist/client/ui/pagination.mjs +3 -3
  160. package/dist/client/ui/pagination.mjs.map +1 -1
  161. package/dist/client/ui/popover.d.ts +11 -1
  162. package/dist/client/ui/popover.d.ts.map +1 -1
  163. package/dist/client/ui/popover.mjs +21 -5
  164. package/dist/client/ui/popover.mjs.map +1 -1
  165. package/dist/client/ui/progress.d.ts +9 -1
  166. package/dist/client/ui/progress.d.ts.map +1 -1
  167. package/dist/client/ui/progress.mjs +12 -3
  168. package/dist/client/ui/progress.mjs.map +1 -1
  169. package/dist/client/ui/select.d.ts +14 -2
  170. package/dist/client/ui/select.d.ts.map +1 -1
  171. package/dist/client/ui/select.mjs +35 -9
  172. package/dist/client/ui/select.mjs.map +1 -1
  173. package/dist/client/ui/separator.d.ts +6 -1
  174. package/dist/client/ui/separator.d.ts.map +1 -1
  175. package/dist/client/ui/separator.mjs +4 -2
  176. package/dist/client/ui/separator.mjs.map +1 -1
  177. package/dist/client/ui/sheet.d.ts +13 -1
  178. package/dist/client/ui/sheet.d.ts.map +1 -1
  179. package/dist/client/ui/sheet.mjs +35 -7
  180. package/dist/client/ui/sheet.mjs.map +1 -1
  181. package/dist/client/ui/slot-wrapper.d.ts +28 -0
  182. package/dist/client/ui/slot-wrapper.d.ts.map +1 -0
  183. package/dist/client/ui/slot-wrapper.mjs +38 -0
  184. package/dist/client/ui/slot-wrapper.mjs.map +1 -0
  185. package/dist/client/ui/tabs.d.ts +11 -1
  186. package/dist/client/ui/tabs.d.ts.map +1 -1
  187. package/dist/client/ui/tabs.mjs +21 -5
  188. package/dist/client/ui/tabs.mjs.map +1 -1
  189. package/dist/client/ui/toggle-group.d.ts +7 -4
  190. package/dist/client/ui/toggle-group.d.ts.map +1 -1
  191. package/dist/client/ui/toggle-group.mjs +4 -4
  192. package/dist/client/ui/toggle-group.mjs.map +1 -1
  193. package/dist/client/ui/toggle.d.ts +17 -8
  194. package/dist/client/ui/toggle.d.ts.map +1 -1
  195. package/dist/client/ui/toggle.mjs +11 -9
  196. package/dist/client/ui/toggle.mjs.map +1 -1
  197. package/dist/client/ui/tooltip.d.ts +6 -1
  198. package/dist/client/ui/tooltip.d.ts.map +1 -1
  199. package/dist/client/ui/tooltip.mjs +4 -2
  200. package/dist/client/ui/tooltip.mjs.map +1 -1
  201. package/dist/client/ui-resolver/button.d.ts +3 -4
  202. package/dist/client/ui-resolver/button.d.ts.map +1 -1
  203. package/dist/client/ui-resolver/button.mjs +2 -2
  204. package/dist/client/ui-resolver/button.mjs.map +1 -1
  205. package/dist/client/ui-resolver/card.d.ts +14 -1
  206. package/dist/client/ui-resolver/card.d.ts.map +1 -1
  207. package/dist/client/ui-resolver/card.mjs +3 -2
  208. package/dist/client/ui-resolver/card.mjs.map +1 -1
  209. package/dist/client/ui-resolver/context.mjs +1 -1
  210. package/dist/client/ui-resolver/context.mjs.map +1 -1
  211. package/dist/client/ui-resolver/index.d.ts +7 -4
  212. package/dist/client/ui-resolver/index.mjs +8 -6
  213. package/dist/client/ui-resolver/input.d.ts +3 -4
  214. package/dist/client/ui-resolver/input.d.ts.map +1 -1
  215. package/dist/client/ui-resolver/input.mjs +2 -2
  216. package/dist/client/ui-resolver/input.mjs.map +1 -1
  217. package/dist/client/ui-resolver/navigation-menu.d.ts +1 -2
  218. package/dist/client/ui-resolver/navigation-menu.d.ts.map +1 -1
  219. package/dist/client/ui-resolver/recipe.d.ts +95 -0
  220. package/dist/client/ui-resolver/recipe.d.ts.map +1 -0
  221. package/dist/client/ui-resolver/recipe.mjs +134 -0
  222. package/dist/client/ui-resolver/recipe.mjs.map +1 -0
  223. package/dist/client/ui-resolver/toggle.d.ts +2 -2
  224. package/dist/client/ui-resolver/toggle.mjs +2 -2
  225. package/dist/client/ui-resolver/toggle.mjs.map +1 -1
  226. package/dist/client/ui-resolver/types.d.ts +14 -0
  227. package/dist/client/ui-resolver/types.d.ts.map +1 -0
  228. package/dist/client/ui-resolver/types.mjs +1 -0
  229. package/dist/client/wishlist/wishlist-drawer.mjs +4 -4
  230. package/dist/client/wishlist/wishlist-drawer.mjs.map +1 -1
  231. package/dist/styles.css +1 -1
  232. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.d.ts","names":[],"sources":["../../../src/client/ui/breadcrumb.tsx"],"mappings":";;;;iBAMS,UAAA,CAAA;EA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CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,SAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAMlE,cAAA,CAAA;EACP,OAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA;EAAwB,OAAA;AAAA,IAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQ3C,cAAA,CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,WAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAWpE,mBAAA,CAAA;EAAsB,QAAA;EAAU,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,SAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAcjF,kBAAA,CAAA;EAAqB,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,WAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,9 +1,29 @@
1
1
  import { useIcon } from "../icons/icon-context.mjs";
2
2
  import { cn } from "./utils.mjs";
3
+ import { defineSlotRecipe } from "../ui-resolver/recipe.mjs";
3
4
  import "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { Slot } from "radix-ui";
6
7
  //#region src/client/ui/breadcrumb.tsx
8
+ const breadcrumbRecipe = defineSlotRecipe({
9
+ slots: [
10
+ "list",
11
+ "item",
12
+ "link",
13
+ "page",
14
+ "separator",
15
+ "ellipsis"
16
+ ],
17
+ base: {
18
+ list: "flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",
19
+ item: "inline-flex items-center gap-1.5",
20
+ link: "transition-colors hover:text-foreground",
21
+ page: "font-normal text-foreground",
22
+ separator: "[&>svg]:size-3.5",
23
+ ellipsis: "flex size-9 items-center justify-center"
24
+ }
25
+ });
26
+ const defaultClasses = breadcrumbRecipe();
7
27
  function Breadcrumb({ ...props }) {
8
28
  return /* @__PURE__ */ jsx("nav", {
9
29
  "aria-label": "breadcrumb",
@@ -14,21 +34,21 @@ function Breadcrumb({ ...props }) {
14
34
  function BreadcrumbList({ className, ...props }) {
15
35
  return /* @__PURE__ */ jsx("ol", {
16
36
  "data-slot": "breadcrumb-list",
17
- className: cn("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5", className),
37
+ className: cn(defaultClasses.list, className),
18
38
  ...props
19
39
  });
20
40
  }
21
41
  function BreadcrumbItem({ className, ...props }) {
22
42
  return /* @__PURE__ */ jsx("li", {
23
43
  "data-slot": "breadcrumb-item",
24
- className: cn("inline-flex items-center gap-1.5", className),
44
+ className: cn(defaultClasses.item, className),
25
45
  ...props
26
46
  });
27
47
  }
28
48
  function BreadcrumbLink({ asChild, className, ...props }) {
29
49
  return /* @__PURE__ */ jsx(asChild ? Slot.Root : "a", {
30
50
  "data-slot": "breadcrumb-link",
31
- className: cn("transition-colors hover:text-foreground", className),
51
+ className: cn(defaultClasses.link, className),
32
52
  ...props
33
53
  });
34
54
  }
@@ -36,7 +56,7 @@ function BreadcrumbPage({ className, ...props }) {
36
56
  return /* @__PURE__ */ jsx("span", {
37
57
  "data-slot": "breadcrumb-page",
38
58
  "aria-current": "page",
39
- className: cn("font-normal text-foreground", className),
59
+ className: cn(defaultClasses.page, className),
40
60
  ...props
41
61
  });
42
62
  }
@@ -45,7 +65,7 @@ function BreadcrumbSeparator({ children, className, ...props }) {
45
65
  "data-slot": "breadcrumb-separator",
46
66
  role: "presentation",
47
67
  "aria-hidden": "true",
48
- className: cn("[&>svg]:size-3.5", className),
68
+ className: cn(defaultClasses.separator, className),
49
69
  ...props,
50
70
  children: children ?? "/"
51
71
  });
@@ -56,7 +76,7 @@ function BreadcrumbEllipsis({ className, ...props }) {
56
76
  "data-slot": "breadcrumb-ellipsis",
57
77
  role: "presentation",
58
78
  "aria-hidden": "true",
59
- className: cn("flex size-9 items-center justify-center", className),
79
+ className: cn(defaultClasses.ellipsis, className),
60
80
  ...props,
61
81
  children: [/* @__PURE__ */ jsx(MoreIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
62
82
  className: "sr-only",
@@ -65,6 +85,6 @@ function BreadcrumbEllipsis({ className, ...props }) {
65
85
  });
66
86
  }
67
87
  //#endregion
68
- export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
88
+ export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, breadcrumbRecipe };
69
89
 
70
90
  //# sourceMappingURL=breadcrumb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.mjs","names":[],"sources":["../../../src/client/ui/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useIcon } from \"../icons/icon-context\";\nimport { Slot } from \"radix-ui\";\n\nimport { cn } from \"./utils\";\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />;\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbLink({\n asChild,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : \"a\";\n\n return (\n <Comp\n data-slot=\"breadcrumb-link\"\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? \"/\"}\n </li>\n );\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<\"span\">) {\n const MoreIcon = useIcon(\"more\");\n\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreIcon className=\"size-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n );\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n"],"mappings":";;;;;;AAMA,SAAS,WAAW,EAAE,GAAG,SAAsC;AAC7D,QAAO,oBAAC,OAAD;EAAK,cAAW;EAAa,aAAU;EAAa,GAAI;EAAS,CAAA;;AAG1E,SAAS,eAAe,EAAE,WAAW,GAAG,SAAqC;AAC3E,QACE,oBAAC,MAAD;EACE,aAAU;EACV,WAAW,GACT,4FACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,eAAe,EAAE,WAAW,GAAG,SAAqC;AAC3E,QACE,oBAAC,MAAD;EACE,aAAU;EACV,WAAW,GAAG,oCAAoC,UAAU;EAC5D,GAAI;EACJ,CAAA;;AAIN,SAAS,eAAe,EACtB,SACA,WACA,GAAG,SAGF;AAGD,QACE,oBAHW,UAAU,KAAK,OAAO,KAGjC;EACE,aAAU;EACV,WAAW,GAAG,2CAA2C,UAAU;EACnE,GAAI;EACJ,CAAA;;AAIN,SAAS,eAAe,EAAE,WAAW,GAAG,SAAuC;AAC7E,QACE,oBAAC,QAAD;EACE,aAAU;EACV,gBAAa;EACb,WAAW,GAAG,+BAA+B,UAAU;EACvD,GAAI;EACJ,CAAA;;AAIN,SAAS,oBAAoB,EAAE,UAAU,WAAW,GAAG,SAAqC;AAC1F,QACE,oBAAC,MAAD;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,GAAG,oBAAoB,UAAU;EAC5C,GAAI;YAEH,YAAY;EACV,CAAA;;AAIT,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAuC;CACjF,MAAM,WAAW,QAAQ,OAAO;AAEhC,QACE,qBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,eAAY;EACZ,WAAW,GAAG,2CAA2C,UAAU;EACnE,GAAI;YALN,CAOE,oBAAC,UAAD,EAAU,WAAU,UAAW,CAAA,EAC/B,oBAAC,QAAD;GAAM,WAAU;aAAU;GAAW,CAAA,CAChC"}
1
+ {"version":3,"file":"breadcrumb.mjs","names":[],"sources":["../../../src/client/ui/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useIcon } from \"../icons/icon-context\";\nimport { Slot } from \"radix-ui\";\n\nimport { defineSlotRecipe } from \"../ui-resolver/recipe\";\nimport { cn } from \"./utils\";\n\nconst breadcrumbRecipe = defineSlotRecipe({\n slots: [\"list\", \"item\", \"link\", \"page\", \"separator\", \"ellipsis\"] as const,\n base: {\n list: \"flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5\",\n item: \"inline-flex items-center gap-1.5\",\n link: \"transition-colors hover:text-foreground\",\n page: \"font-normal text-foreground\",\n separator: \"[&>svg]:size-3.5\",\n ellipsis: \"flex size-9 items-center justify-center\",\n },\n});\n\nconst defaultClasses = breadcrumbRecipe();\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />;\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol data-slot=\"breadcrumb-list\" className={cn(defaultClasses.list, className)} {...props} />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li data-slot=\"breadcrumb-item\" className={cn(defaultClasses.item, className)} {...props} />\n );\n}\n\nfunction BreadcrumbLink({\n asChild,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & { asChild?: boolean }) {\n const Comp = asChild ? Slot.Root : \"a\";\n\n return (\n <Comp data-slot=\"breadcrumb-link\" className={cn(defaultClasses.link, className)} {...props} />\n );\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n className={cn(defaultClasses.page, className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(defaultClasses.separator, className)}\n {...props}\n >\n {children ?? \"/\"}\n </li>\n );\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<\"span\">) {\n const MoreIcon = useIcon(\"more\");\n\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(defaultClasses.ellipsis, className)}\n {...props}\n >\n <MoreIcon className=\"size-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n );\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n breadcrumbRecipe,\n};\n"],"mappings":";;;;;;;AAOA,MAAM,mBAAmB,iBAAiB;CACxC,OAAO;EAAC;EAAQ;EAAQ;EAAQ;EAAQ;EAAa;EAAW;CAChE,MAAM;EACJ,MAA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AAA,EAC/B,oBAAC,QAAD;GAAM,WAAU;aAAU;GAAW,CAAA,CAChC"}
@@ -1,22 +1,40 @@
1
+ import { SemanticColor, Variant } from "../ui-resolver/types.js";
1
2
  import * as React$1 from "react";
2
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { VariantProps } from "class-variance-authority";
4
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
4
 
6
5
  //#region src/client/ui/button.d.ts
7
- declare const buttonVariants: (props?: ({
8
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "soft" | "inverse" | "link" | null | undefined;
9
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
6
+ declare const buttonRecipe: (props?: ({
7
+ variant?: "destructive" | "link" | "solid" | "soft" | "outlined" | "plain" | "secondary" | "inverse" | undefined;
8
+ size?: "xs" | "sm" | "md" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | undefined;
9
+ } & {
10
+ className?: string;
11
+ }) | undefined) => string;
12
+ type ButtonVariant = Variant | "destructive" | "secondary" | "inverse" | "link";
13
+ type ButtonSize = "xs" | "sm" | "md" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
14
+ interface ButtonProps extends Omit<React$1.ComponentProps<"button">, "color"> {
15
+ variant?: ButtonVariant;
16
+ size?: ButtonSize;
17
+ color?: SemanticColor;
18
+ asChild?: boolean;
19
+ startSlot?: React$1.ReactNode;
20
+ endSlot?: React$1.ReactNode;
21
+ }
11
22
  declare function Button({
12
23
  className,
13
24
  variant,
14
25
  size,
15
26
  asChild,
27
+ startSlot,
28
+ endSlot,
29
+ children,
16
30
  ...props
17
- }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
18
- asChild?: boolean;
19
- }): react_jsx_runtime0.JSX.Element;
31
+ }: ButtonProps): react_jsx_runtime0.JSX.Element;
32
+ declare const buttonVariants: (props?: ({
33
+ variant?: "destructive" | "link" | "solid" | "soft" | "outlined" | "plain" | "secondary" | "inverse" | undefined;
34
+ size?: "xs" | "sm" | "md" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | undefined;
35
+ } & {
36
+ className?: string;
37
+ }) | undefined) => string;
20
38
  //#endregion
21
- export { Button, buttonVariants };
39
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, buttonRecipe, buttonVariants };
22
40
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","names":[],"sources":["../../../src/client/ui/button.tsx"],"mappings":";;;;;;cAMM,cAAA,GAAc,KAAA;;;IAmCnB,+BAAA,CAAA,SAAA;AAAA,iBAEQ,MAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,aACP,YAAA,QAAoB,cAAA;EAClB,OAAA;AAAA,IACD,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"button.d.ts","names":[],"sources":["../../../src/client/ui/button.tsx"],"mappings":";;;;;cAOM,YAAA,GAAY,KAAA;;;;;;KAkCb,aAAA,GAAgB,OAAA;AAAA,KAChB,UAAA;AAAA,UAEK,WAAA,SAAoB,IAAA,CAAK,OAAA,CAAM,cAAA;EACvC,OAAA,GAAU,aAAA;EACV,IAAA,GAAO,UAAA;EACP,KAAA,GAAQ,aAAA;EACR,OAAA;EACA,SAAA,GAAY,OAAA,CAAM,SAAA;EAClB,OAAA,GAAU,OAAA,CAAM,SAAA;AAAA;AAAA,iBAGT,MAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EACA,OAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,WAAA,GAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAsCR,cAAA,GAAc,KAAA"}
@@ -1,51 +1,76 @@
1
1
  import { cn } from "./utils.mjs";
2
+ import { defineRecipe } from "../ui-resolver/recipe.mjs";
2
3
  import "react";
3
- import { jsx } from "react/jsx-runtime";
4
- import { cva } from "class-variance-authority";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Slot } from "radix-ui";
6
6
  //#region src/client/ui/button.tsx
7
- const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-[var(--enad-button-radius)] text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none 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 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ const buttonRecipe = defineRecipe({
8
+ base: "inline-flex shrink-0 items-center justify-center gap-[var(--enad-button-gap)] rounded-[var(--enad-button-radius)] text-[length:var(--enad-button-font-size)] font-medium whitespace-nowrap transition-[color,box-shadow] outline-none 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 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
- default: "bg-primary text-primary-foreground hover:bg-primary-hover",
11
+ solid: "bg-primary text-primary-foreground hover:bg-primary-hover",
12
+ soft: "bg-muted text-foreground hover:bg-primary-hover hover:text-primary-foreground",
13
+ outlined: "border bg-background text-foreground shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
14
+ plain: "hover:bg-accent-muted hover:text-accent-muted-foreground dark:hover:bg-accent-muted/50",
11
15
  destructive: "bg-destructive text-white hover:bg-destructive-hover focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
12
- outline: "border bg-background text-foreground shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
13
16
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover",
14
- ghost: "hover:bg-accent-muted hover:text-accent-muted-foreground dark:hover:bg-accent-muted/50",
15
- soft: "bg-muted text-foreground hover:bg-primary-hover hover:text-primary-foreground",
16
17
  inverse: "bg-foreground text-background hover:bg-primary-hover hover:text-primary-foreground",
17
18
  link: "text-primary underline-offset-4 hover:underline"
18
19
  },
19
20
  size: {
20
- default: "h-[var(--enad-control-height)] px-4 py-2 has-[>svg]:px-3",
21
21
  xs: "h-[var(--enad-control-height-xs)] gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
22
22
  sm: "h-[var(--enad-control-height-sm)] gap-1.5 px-3 has-[>svg]:px-2.5",
23
+ md: "h-[var(--enad-button-height)] px-[var(--enad-button-px)] py-2 has-[>svg]:px-3",
23
24
  lg: "h-[var(--enad-control-height-lg)] px-6 has-[>svg]:px-4",
24
- icon: "size-[var(--enad-control-height)]",
25
+ icon: "size-[var(--enad-button-height)]",
25
26
  "icon-xs": "relative size-[var(--enad-control-height-xs)] hit-area-3 [&_svg:not([class*='size-'])]:size-3",
26
27
  "icon-sm": "size-[var(--enad-control-height-sm)]",
27
28
  "icon-lg": "size-[var(--enad-control-height-lg)]"
28
29
  }
29
30
  },
30
31
  defaultVariants: {
31
- variant: "default",
32
- size: "default"
32
+ variant: "solid",
33
+ size: "md"
33
34
  }
34
35
  });
35
- function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
36
- return /* @__PURE__ */ jsx(asChild ? Slot.Root : "button", {
36
+ function Button({ className, variant = "solid", size = "md", asChild = false, startSlot, endSlot, children, ...props }) {
37
+ const Comp = asChild ? Slot.Root : "button";
38
+ const classes = cn(buttonRecipe({
39
+ variant,
40
+ size,
41
+ className
42
+ }));
43
+ if (asChild) return /* @__PURE__ */ jsx(Comp, {
44
+ "data-slot": "button",
45
+ "data-variant": variant,
46
+ "data-size": size,
47
+ className: classes,
48
+ ...props,
49
+ children
50
+ });
51
+ return /* @__PURE__ */ jsxs(Comp, {
37
52
  "data-slot": "button",
38
53
  "data-variant": variant,
39
54
  "data-size": size,
40
- className: cn(buttonVariants({
41
- variant,
42
- size,
43
- className
44
- })),
45
- ...props
55
+ className: classes,
56
+ ...props,
57
+ children: [
58
+ startSlot && /* @__PURE__ */ jsx("span", {
59
+ "aria-hidden": "true",
60
+ className: "shrink-0 [&_svg]:size-[var(--slot-icon-size,1em)]",
61
+ children: startSlot
62
+ }),
63
+ children,
64
+ endSlot && /* @__PURE__ */ jsx("span", {
65
+ "aria-hidden": "true",
66
+ className: "shrink-0 [&_svg]:size-[var(--slot-icon-size,1em)]",
67
+ children: endSlot
68
+ })
69
+ ]
46
70
  });
47
71
  }
72
+ const buttonVariants = buttonRecipe;
48
73
  //#endregion
49
- export { Button, buttonVariants };
74
+ export { Button, buttonRecipe, buttonVariants };
50
75
 
51
76
  //# sourceMappingURL=button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.mjs","names":[],"sources":["../../../src/client/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\n\nimport { cn } from \"./utils\";\n\nconst buttonVariants = cva(\n \"inline-flex shrink-0 items-center justify-center gap-2 rounded-[var(--enad-button-radius)] text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none 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 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive-hover focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40\",\n outline:\n \"border bg-background text-foreground shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent-muted hover:text-accent-muted-foreground dark:hover:bg-accent-muted/50\",\n soft: \"bg-muted text-foreground hover:bg-primary-hover hover:text-primary-foreground\",\n inverse:\n \"bg-foreground text-background hover:bg-primary-hover hover:text-primary-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-[var(--enad-control-height)] px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-[var(--enad-control-height-xs)] gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-[var(--enad-control-height-sm)] gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-[var(--enad-control-height-lg)] px-6 has-[>svg]:px-4\",\n icon: \"size-[var(--enad-control-height)]\",\n \"icon-xs\":\n \"relative size-[var(--enad-control-height-xs)] hit-area-3 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-[var(--enad-control-height-sm)]\",\n \"icon-lg\": \"size-[var(--enad-control-height-lg)]\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot.Root : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAMA,MAAM,iBAAiB,IACrB,ueACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,aACE;GACF,SACE;GACF,WAAW;GACX,OACE;GACF,MAAM;GACN,SACE;GACF,MAAM;GACP;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WACE;GACF,WAAW;GACX,WAAW;GACZ;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAED,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,GAAG,SAIA;AAGH,QACE,oBAHW,UAAU,KAAK,OAAO,UAGjC;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EAC3D,GAAI;EACJ,CAAA"}
1
+ {"version":3,"file":"button.mjs","names":[],"sources":["../../../src/client/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"radix-ui\";\n\nimport { defineRecipe } from \"../ui-resolver/recipe\";\nimport type { SemanticColor, Variant } from \"../ui-resolver/types\";\nimport { cn } from \"./utils\";\n\nconst buttonRecipe = defineRecipe({\n base: \"inline-flex shrink-0 items-center justify-center gap-[var(--enad-button-gap)] rounded-[var(--enad-button-radius)] text-[length:var(--enad-button-font-size)] font-medium whitespace-nowrap transition-[color,box-shadow] outline-none 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 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n variants: {\n variant: {\n solid: \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n soft: \"bg-muted text-foreground hover:bg-primary-hover hover:text-primary-foreground\",\n outlined:\n \"border bg-background text-foreground shadow-xs hover:bg-accent-muted hover:text-accent-muted-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n plain:\n \"hover:bg-accent-muted hover:text-accent-muted-foreground dark:hover:bg-accent-muted/50\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive-hover focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n inverse: \"bg-foreground text-background hover:bg-primary-hover hover:text-primary-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n xs: \"h-[var(--enad-control-height-xs)] gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-[var(--enad-control-height-sm)] gap-1.5 px-3 has-[>svg]:px-2.5\",\n md: \"h-[var(--enad-button-height)] px-[var(--enad-button-px)] py-2 has-[>svg]:px-3\",\n lg: \"h-[var(--enad-control-height-lg)] px-6 has-[>svg]:px-4\",\n icon: \"size-[var(--enad-button-height)]\",\n \"icon-xs\":\n \"relative size-[var(--enad-control-height-xs)] hit-area-3 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-[var(--enad-control-height-sm)]\",\n \"icon-lg\": \"size-[var(--enad-control-height-lg)]\",\n },\n },\n defaultVariants: {\n variant: \"solid\",\n size: \"md\",\n },\n});\n\ntype ButtonVariant = Variant | \"destructive\" | \"secondary\" | \"inverse\" | \"link\";\ntype ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"icon\" | \"icon-xs\" | \"icon-sm\" | \"icon-lg\";\n\ninterface ButtonProps extends Omit<React.ComponentProps<\"button\">, \"color\"> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n color?: SemanticColor;\n asChild?: boolean;\n startSlot?: React.ReactNode;\n endSlot?: React.ReactNode;\n}\n\nfunction Button({\n className,\n variant = \"solid\",\n size = \"md\",\n asChild = false,\n startSlot,\n endSlot,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n const classes = cn(buttonRecipe({ variant, size, className }));\n\n if (asChild) {\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={classes}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp data-slot=\"button\" data-variant={variant} data-size={size} className={classes} {...props}>\n {startSlot && (\n <span aria-hidden=\"true\" className=\"shrink-0 [&_svg]:size-[var(--slot-icon-size,1em)]\">\n {startSlot}\n </span>\n )}\n {children}\n {endSlot && (\n <span aria-hidden=\"true\" className=\"shrink-0 [&_svg]:size-[var(--slot-icon-size,1em)]\">\n {endSlot}\n </span>\n )}\n </Comp>\n );\n}\n\nexport { Button, buttonRecipe, type ButtonProps, type ButtonVariant, type ButtonSize };\n\n// Backward compat: export buttonVariants as an alias for buttonRecipe\nconst buttonVariants = buttonRecipe;\nexport { buttonVariants };\n"],"mappings":";;;;;;AAOA,MAAM,eAAe,aAAa;CAChC,MAAM;CACN,UAAU;EACR,SAAS;GACP,OAAO;GACP,MAAM;GACN,UACE;GACF,OACE;GACF,aACE;GACF,WAAW;GACX,SAAS;GACT,MAAM;GACP;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WACE;GACF,WAAW;GACX,WAAW;GACZ;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CAAC;AAcF,SAAS,OAAO,EACd,WACA,UAAU,SACV,OAAO,MACP,UAAU,OACV,WACA,SACA,UACA,GAAG,SACW;CACd,MAAM,OAAO,UAAU,KAAK,OAAO;CACnC,MAAM,UAAU,GAAG,aAAa;EAAE;EAAS;EAAM;EAAW,CAAC,CAAC;AAE9D,KAAI,QACF,QACE,oBAAC,MAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW;EACX,GAAI;EAEH;EACI,CAAA;AAIX,QACE,qBAAC,MAAD;EAAM,aAAU;EAAS,gBAAc;EAAS,aAAW;EAAM,WAAW;EAAS,GAAI;YAAzF;GACG,aACC,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;cAChC;IACI,CAAA;GAER;GACA,WACC,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;cAChC;IACI,CAAA;GAEJ;;;AAOX,MAAM,iBAAiB"}
@@ -2,6 +2,25 @@ import * as React$1 from "react";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/client/ui/card.d.ts
5
+ /**
6
+ * Card recipe with 7 slots. Base classes produce the same output as the
7
+ * previous inline implementation. CSS variable references use the new
8
+ * component-level tokens (--enad-card-px, --enad-card-py) which fall
9
+ * back to --enad-card-padding for backward compatibility.
10
+ */
11
+ declare const cardRecipe: (props?: ({
12
+ [x: string]: string | undefined;
13
+ } & {
14
+ className?: Partial<Record<"root" | "content" | "title" | "description" | "header" | "action" | "footer", string>> | undefined;
15
+ }) | undefined) => {
16
+ root: string;
17
+ content: string;
18
+ title: string;
19
+ description: string;
20
+ header: string;
21
+ action: string;
22
+ footer: string;
23
+ };
5
24
  declare function Card({
6
25
  className,
7
26
  ...props
@@ -31,5 +50,5 @@ declare function CardFooter({
31
50
  ...props
32
51
  }: React$1.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
33
52
  //#endregion
34
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
53
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe };
35
54
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","names":[],"sources":["../../../src/client/ui/card.tsx"],"mappings":";;;;iBAIS,IAAA,CAAA;EAAO,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAazD,UAAA,CAAA;EAAa,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAa/D,SAAA,CAAA;EAAY,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CA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UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAM/D,WAAA,CAAA;EAAc,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAMhE,UAAA,CAAA;EAAa,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,57 +1,85 @@
1
1
  import { cn } from "./utils.mjs";
2
+ import { defineSlotRecipe } from "../ui-resolver/recipe.mjs";
2
3
  import "react";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/client/ui/card.tsx
6
+ /**
7
+ * Card recipe with 7 slots. Base classes produce the same output as the
8
+ * previous inline implementation. CSS variable references use the new
9
+ * component-level tokens (--enad-card-px, --enad-card-py) which fall
10
+ * back to --enad-card-padding for backward compatibility.
11
+ */
12
+ const cardRecipe = defineSlotRecipe({
13
+ slots: [
14
+ "root",
15
+ "header",
16
+ "title",
17
+ "description",
18
+ "action",
19
+ "content",
20
+ "footer"
21
+ ],
22
+ base: {
23
+ root: "flex flex-col gap-[var(--enad-card-gap)] rounded-[var(--enad-card-radius)] border bg-card py-[var(--enad-card-py)] text-card-foreground shadow-[var(--enad-shadow-sm)]",
24
+ header: "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-[var(--enad-card-header-gap)] px-[var(--enad-card-px)] has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-[var(--enad-card-py)]",
25
+ title: "leading-none font-semibold",
26
+ description: "text-sm text-muted-foreground",
27
+ action: "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
28
+ content: "px-[var(--enad-card-px)]",
29
+ footer: "flex items-center px-[var(--enad-card-px)] [.border-t]:pt-[var(--enad-card-py)]"
30
+ }
31
+ });
32
+ const defaultClasses = cardRecipe();
5
33
  function Card({ className, ...props }) {
6
34
  return /* @__PURE__ */ jsx("div", {
7
35
  "data-slot": "card",
8
- className: cn("flex flex-col gap-[var(--enad-card-gap)] rounded-[var(--enad-card-radius)] border bg-card py-[var(--enad-card-padding)] text-card-foreground shadow-[var(--enad-shadow-sm)]", className),
36
+ className: cn(defaultClasses.root, className),
9
37
  ...props
10
38
  });
11
39
  }
12
40
  function CardHeader({ className, ...props }) {
13
41
  return /* @__PURE__ */ jsx("div", {
14
42
  "data-slot": "card-header",
15
- className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-[var(--enad-card-header-gap)] px-[var(--enad-card-padding)] has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-[var(--enad-card-padding)]", className),
43
+ className: cn(defaultClasses.header, className),
16
44
  ...props
17
45
  });
18
46
  }
19
47
  function CardTitle({ className, ...props }) {
20
48
  return /* @__PURE__ */ jsx("div", {
21
49
  "data-slot": "card-title",
22
- className: cn("leading-none font-semibold", className),
50
+ className: cn(defaultClasses.title, className),
23
51
  ...props
24
52
  });
25
53
  }
26
54
  function CardDescription({ className, ...props }) {
27
55
  return /* @__PURE__ */ jsx("div", {
28
56
  "data-slot": "card-description",
29
- className: cn("text-sm text-muted-foreground", className),
57
+ className: cn(defaultClasses.description, className),
30
58
  ...props
31
59
  });
32
60
  }
33
61
  function CardAction({ className, ...props }) {
34
62
  return /* @__PURE__ */ jsx("div", {
35
63
  "data-slot": "card-action",
36
- className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
64
+ className: cn(defaultClasses.action, className),
37
65
  ...props
38
66
  });
39
67
  }
40
68
  function CardContent({ className, ...props }) {
41
69
  return /* @__PURE__ */ jsx("div", {
42
70
  "data-slot": "card-content",
43
- className: cn("px-[var(--enad-card-padding)]", className),
71
+ className: cn(defaultClasses.content, className),
44
72
  ...props
45
73
  });
46
74
  }
47
75
  function CardFooter({ className, ...props }) {
48
76
  return /* @__PURE__ */ jsx("div", {
49
77
  "data-slot": "card-footer",
50
- className: cn("flex items-center px-[var(--enad-card-padding)] [.border-t]:pt-[var(--enad-card-padding)]", className),
78
+ className: cn(defaultClasses.footer, className),
51
79
  ...props
52
80
  });
53
81
  }
54
82
  //#endregion
55
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
83
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardRecipe };
56
84
 
57
85
  //# sourceMappingURL=card.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.mjs","names":[],"sources":["../../../src/client/ui/card.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"flex flex-col gap-[var(--enad-card-gap)] rounded-[var(--enad-card-radius)] border bg-card py-[var(--enad-card-padding)] text-card-foreground shadow-[var(--enad-shadow-sm)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-[var(--enad-card-header-gap)] px-[var(--enad-card-padding)] has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-[var(--enad-card-padding)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-[var(--enad-card-padding)]\", className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n \"flex items-center px-[var(--enad-card-padding)] [.border-t]:pt-[var(--enad-card-padding)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n"],"mappings":";;;;AAIA,SAAS,KAAK,EAAE,WAAW,GAAG,SAAsC;AAClE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,+KACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,0OACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;AACvE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,8BAA8B,UAAU;EACtD,GAAI;EACJ,CAAA;;AAIN,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;AAC7E,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,UAAU;EACzD,GAAI;EACJ,CAAA;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,kEAAkE,UAAU;EAC1F,GAAI;EACJ,CAAA;;AAIN,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,UAAU;EACzD,GAAI;EACJ,CAAA;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,6FACA,UACD;EACD,GAAI;EACJ,CAAA"}
1
+ {"version":3,"file":"card.mjs","names":[],"sources":["../../../src/client/ui/card.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { defineSlotRecipe } from \"../ui-resolver/recipe\";\nimport { cn } from \"./utils\";\n\n/**\n * Card recipe with 7 slots. Base classes produce the same output as the\n * previous inline implementation. CSS variable references use the new\n * component-level tokens (--enad-card-px, --enad-card-py) which fall\n * back to --enad-card-padding for backward compatibility.\n */\nconst cardRecipe = defineSlotRecipe({\n slots: [\"root\", \"header\", \"title\", \"description\", \"action\", \"content\", \"footer\"] as const,\n base: {\n root: \"flex flex-col gap-[var(--enad-card-gap)] rounded-[var(--enad-card-radius)] border bg-card py-[var(--enad-card-py)] text-card-foreground shadow-[var(--enad-shadow-sm)]\",\n header:\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-[var(--enad-card-header-gap)] px-[var(--enad-card-px)] has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-[var(--enad-card-py)]\",\n title: \"leading-none font-semibold\",\n description: \"text-sm text-muted-foreground\",\n action: \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n content: \"px-[var(--enad-card-px)]\",\n footer: \"flex items-center px-[var(--enad-card-px)] [.border-t]:pt-[var(--enad-card-py)]\",\n },\n});\n\nconst defaultClasses = cardRecipe();\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card\" className={cn(defaultClasses.root, className)} {...props} />;\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"card-header\" className={cn(defaultClasses.header, className)} {...props} />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-title\" className={cn(defaultClasses.title, className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(defaultClasses.description, className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"card-action\" className={cn(defaultClasses.action, className)} {...props} />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"card-content\" className={cn(defaultClasses.content, className)} {...props} />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"card-footer\" className={cn(defaultClasses.footer, className)} {...props} />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n cardRecipe,\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,aAAa,iBAAiB;CAClC,OAAO;EAAC;EAAQ;EAAU;EAAS;EAAe;EAAU;EAAW;EAAS;CAChF,MAAM;EACJ,MAAM;EACN,QACE;EACF,OAAO;EACP,aAAa;EACb,QAAQ;EACR,SAAS;EACT,QAAQ;EACT;CACF,CAAC;AAEF,MAAM,iBAAiB,YAAY;AAEnC,SAAS,KAAK,EAAE,WAAW,GAAG,SAAsC;AAClE,QAAO,oBAAC,OAAD;EAAK,aAAU;EAAO,WAAW,GAAG,eAAe,MAAM,UAAU;EAAE,GAAI;EAAS,CAAA;;AAG3F,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,eAAe,QAAQ,UAAU;EAAE,GAAI;EAAS,CAAA;;AAI/F,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;AACvE,QAAO,oBAAC,OAAD;EAAK,aAAU;EAAa,WAAW,GAAG,eAAe,OAAO,UAAU;EAAE,GAAI;EAAS,CAAA;;AAGlG,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;AAC7E,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,eAAe,aAAa,UAAU;EACpD,GAAI;EACJ,CAAA;;AAIN,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,eAAe,QAAQ,UAAU;EAAE,GAAI;EAAS,CAAA;;AAI/F,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,QACE,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,eAAe,SAAS,UAAU;EAAE,GAAI;EAAS,CAAA;;AAIjG,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;AACxE,QACE,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,eAAe,QAAQ,UAAU;EAAE,GAAI;EAAS,CAAA"}
@@ -8,10 +8,17 @@ type CarouselApi = UseEmblaCarouselType[1];
8
8
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
9
9
  type CarouselOptions = UseCarouselParameters[0];
10
10
  type CarouselPlugin = UseCarouselParameters[1];
11
+ type CarouselWheelAxis = "vertical" | "horizontal" | "both" | false;
11
12
  type CarouselProps = {
12
13
  opts?: CarouselOptions;
13
14
  plugins?: CarouselPlugin;
14
15
  orientation?: "horizontal" | "vertical";
16
+ /** Controls which wheel/trackpad axes scroll the carousel.
17
+ * - `"vertical"` — vertical scroll hijacks carousel (default, mouse-wheel-friendly)
18
+ * - `"horizontal"` — horizontal trackpad swipes scroll carousel, vertical passes through
19
+ * - `"both"` — both axes scroll the carousel
20
+ * - `false` — no wheel gestures (touch drag still works) */
21
+ wheelAxis?: CarouselWheelAxis;
15
22
  setApi?: (api: CarouselApi) => void;
16
23
  };
17
24
  declare function Carousel({
@@ -19,6 +26,7 @@ declare function Carousel({
19
26
  opts,
20
27
  setApi,
21
28
  plugins,
29
+ wheelAxis,
22
30
  className,
23
31
  children,
24
32
  ...props
@@ -44,5 +52,5 @@ declare function CarouselNext({
44
52
  ...props
45
53
  }: React$1.ComponentProps<typeof Button>): react_jsx_runtime0.JSX.Element;
46
54
  //#endregion
47
- export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
55
+ export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CarouselWheelAxis };
48
56
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","names":[],"sources":["../../../src/client/ui/carousel.tsx"],"mappings":";;;;;;KAWK,WAAA,GAAc,oBAAA;AAAA,KACd,qBAAA,GAAwB,UAAA,QAAkB,gBAAA;AAAA,KAC1C,eAAA,GAAkB,qBAAA;AAAA,KAClB,cAAA,GAAiB,qBAAA;AAAA,KAEjB,aAAA;EACH,IAAA,GAAO,eAAA;EACP,OAAA,GAAU,cAAA;EACV,WAAA;EACA,MAAA,IAAU,GAAA,EAAK,WAAA;AAAA;AAAA,iBAwBR,QAAA,CAAA;EACP,WAAA;EACA,IAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,UAAwB,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkFrC,eAAA,CAAA;EAAkB,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAqBpE,YAAA,CAAA;EAAe,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkBjE,gBAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA0B7B,YAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"carousel.d.ts","names":[],"sources":["../../../src/client/ui/carousel.tsx"],"mappings":";;;;;;KAUK,WAAA,GAAc,oBAAA;AAAA,KACd,qBAAA,GAAwB,UAAA,QAAkB,gBAAA;AAAA,KAC1C,eAAA,GAAkB,qBAAA;AAAA,KAClB,cAAA,GAAiB,qBAAA;AAAA,KAEjB,iBAAA;AAAA,KAEA,aAAA;EACH,IAAA,GAAO,eAAA;EACP,OAAA,GAAU,cAAA;EACV,WAAA;EATwB;;;;AAAqC;EAe7D,SAAA,GAAY,iBAAA;EACZ,MAAA,IAAU,GAAA,EAAK,WAAA;AAAA;AAAA,iBAwBR,QAAA,CAAA;EACP,WAAA;EACA,IAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,SAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,UAAwB,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAwGrC,eAAA,CAAA;EAAkB,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAapE,YAAA,CAAA;EAAe,SAAA;EAAA,GAAc;AAAA,GAAS,OAAA,CAAM,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkBjE,gBAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA0B7B,YAAA,CAAA;EACP,SAAA;EACA,OAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -5,6 +5,7 @@ import { Button } from "./button.mjs";
5
5
  import * as React$1 from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import useEmblaCarousel from "embla-carousel-react";
8
+ import { WheelGesturesPlugin } from "embla-carousel-wheel-gestures";
8
9
  //#region src/client/ui/carousel.tsx
9
10
  const CarouselContext = React$1.createContext(null);
10
11
  function useCarousel() {
@@ -12,11 +13,26 @@ function useCarousel() {
12
13
  if (!context) throw new Error("useCarousel must be used within a <Carousel />");
13
14
  return context;
14
15
  }
15
- function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
16
+ function Carousel({ orientation = "horizontal", opts, setApi, plugins, wheelAxis = "vertical", className, children, ...props }) {
17
+ const allPlugins = React$1.useMemo(() => {
18
+ if (orientation !== "horizontal" || wheelAxis === false) return [...plugins ?? []];
19
+ const wheel = [];
20
+ if (wheelAxis === "vertical" || wheelAxis === "both") wheel.push(WheelGesturesPlugin({ forceWheelAxis: "y" }));
21
+ if (wheelAxis === "horizontal" || wheelAxis === "both") {
22
+ const horizontal = WheelGesturesPlugin();
23
+ if (wheelAxis === "both") horizontal.name = "wheelGesturesHorizontal";
24
+ wheel.push(horizontal);
25
+ }
26
+ return [...wheel, ...plugins ?? []];
27
+ }, [
28
+ orientation,
29
+ plugins,
30
+ wheelAxis
31
+ ]);
16
32
  const [carouselRef, api] = useEmblaCarousel({
17
33
  ...opts,
18
34
  axis: orientation === "horizontal" ? "x" : "y"
19
- }, plugins);
35
+ }, allPlugins);
20
36
  const [canScrollPrev, setCanScrollPrev] = React$1.useState(false);
21
37
  const [canScrollNext, setCanScrollNext] = React$1.useState(false);
22
38
  const onSelect = React$1.useCallback((api) => {
@@ -96,7 +112,7 @@ function CarouselItem({ className, ...props }) {
96
112
  ...props
97
113
  });
98
114
  }
99
- function CarouselPrevious({ className, variant = "outline", size = "icon", ...props }) {
115
+ function CarouselPrevious({ className, variant = "outlined", size = "icon", ...props }) {
100
116
  const { orientation, scrollPrev, canScrollPrev } = useCarousel();
101
117
  const ArrowLeftIcon = useIcon("arrowLeft");
102
118
  return /* @__PURE__ */ jsxs(Button, {
@@ -113,7 +129,7 @@ function CarouselPrevious({ className, variant = "outline", size = "icon", ...pr
113
129
  })]
114
130
  });
115
131
  }
116
- function CarouselNext({ className, variant = "outline", size = "icon", ...props }) {
132
+ function CarouselNext({ className, variant = "outlined", size = "icon", ...props }) {
117
133
  const { orientation, scrollNext, canScrollNext } = useCarousel();
118
134
  const ArrowRightIcon = useIcon("arrowRight");
119
135
  return /* @__PURE__ */ jsxs(Button, {
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.mjs","names":["React"],"sources":["../../../src/client/ui/carousel.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\"\nimport { useIcon } from \"../icons/icon-context\"\n\nimport { cn } from \"./utils\"\nimport { Button } from \"./button\"\n\ntype CarouselApi = UseEmblaCarouselType[1]\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\ntype CarouselProps = {\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: \"horizontal\" | \"vertical\"\n setApi?: (api: CarouselApi) => void\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\")\n }\n\n return context\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on(\"reInit\", onSelect)\n api.on(\"select\", onSelect)\n\n return () => {\n api?.off(\"select\", onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel()\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n const ArrowLeftIcon = useIcon(\"arrowLeft\")\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n const ArrowRightIcon = useIcon(\"arrowRight\")\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n}\n"],"mappings":";;;;;;;;AAgCA,MAAM,kBAAkBA,QAAM,cAA2C,KAAK;AAE9E,SAAS,cAAc;CACrB,MAAM,UAAUA,QAAM,WAAW,gBAAgB;AAEjD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iDAAiD;AAGnE,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bN,CAeE,oBAAC,gBAAD,EAAkB,CAAA,EAClB,oBAAC,QAAD;GAAM,WAAU;aAAU;GAAiB,CAAA,CACpC"}
1
+ {"version":3,"file":"carousel.mjs","names":["React"],"sources":["../../../src/client/ui/carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { WheelGesturesPlugin } from \"embla-carousel-wheel-gestures\";\nimport { useIcon } from \"../icons/icon-context\";\n\nimport { cn } from \"./utils\";\nimport { Button } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselWheelAxis = \"vertical\" | \"horizontal\" | \"both\" | false;\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n /** Controls which wheel/trackpad axes scroll the carousel.\n * - `\"vertical\"` — vertical scroll hijacks carousel (default, mouse-wheel-friendly)\n * - `\"horizontal\"` — horizontal trackpad swipes scroll carousel, vertical passes through\n * - `\"both\"` — both axes scroll the carousel\n * - `false` — no wheel gestures (touch drag still works) */\n wheelAxis?: CarouselWheelAxis;\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n wheelAxis = \"vertical\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const allPlugins = React.useMemo(() => {\n if (orientation !== \"horizontal\" || wheelAxis === false) {\n return [...(plugins ?? [])];\n }\n\n const wheel: ReturnType<typeof WheelGesturesPlugin>[] = [];\n\n if (wheelAxis === \"vertical\" || wheelAxis === \"both\") {\n wheel.push(WheelGesturesPlugin({ forceWheelAxis: \"y\" }));\n }\n\n if (wheelAxis === \"horizontal\" || wheelAxis === \"both\") {\n const horizontal = WheelGesturesPlugin();\n // Rename so Embla doesn't deduplicate when using both axes\n if (wheelAxis === \"both\") {\n (horizontal as Record<string, unknown>).name = \"wheelGesturesHorizontal\";\n }\n wheel.push(horizontal);\n }\n\n return [...wheel, ...(plugins ?? [])];\n }, [orientation, plugins, wheelAxis]);\n\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n allPlugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outlined\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n const ArrowLeftIcon = useIcon(\"arrowLeft\");\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = \"outlined\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n const ArrowRightIcon = useIcon(\"arrowRight\");\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n type CarouselWheelAxis,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"mappings":";;;;;;;;;AAuCA,MAAM,kBAAkBA,QAAM,cAA2C,KAAK;AAE9E,SAAS,cAAc;CACrB,MAAM,UAAUA,QAAM,WAAW,gBAAgB;AAEjD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iDAAiD;AAGnE,QAAO;;AAGT,SAAS,SAAS,EAChB,cAAc,cACd,MACA,QACA,SACA,YAAY,YACZ,WACA,UACA,GAAG,SAC2C;CAC9C,MAAM,aAAaA,QAAM,cAAc;AACrC,MAAI,gBAAgB,gBAAgB,cAAc,MAChD,QAAO,CAAC,GAAI,WAAW,EAAE,CAAE;EAG7B,MAAM,QAAkD,EAAE;AAE1D,MAAI,cAAc,cAAc,cAAc,OAC5C,OAAM,KAAK,oBAAoB,EAAE,gBAAgB,KAAK,CAAC,CAAC;AAG1D,MAAI,cAAc,gBAAgB,cAAc,QAAQ;GACtD,MAAM,aAAa,qBAAqB;AAExC,OAAI,cAAc,OACf,YAAuC,OAAO;AAEjD,SAAM,KAAK,WAAW;;AAGxB,SAAO,CAAC,GAAG,OAAO,GAAI,WAAW,EAAE,CAAE;IACpC;EAAC;EAAa;EAAS;EAAU,CAAC;CAErC,MAAM,CAAC,aAAa,OAAO,iBACzB;EACE,GAAG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