@luxfi/ui 8.2.7 → 8.2.8

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 (240) hide show
  1. package/dist/3d-model-viewer.cjs +25 -421
  2. package/dist/3d-model-viewer.js +20 -416
  3. package/dist/accordion.cjs +3 -10
  4. package/dist/accordion.js +2 -10
  5. package/dist/advanced-navigation-bar.cjs +5 -401
  6. package/dist/advanced-navigation-bar.js +5 -401
  7. package/dist/ai-agents.cjs +45 -890
  8. package/dist/ai-agents.js +8 -834
  9. package/dist/ai-assistant.cjs +13 -740
  10. package/dist/ai-assistant.js +10 -738
  11. package/dist/ai-chat.cjs +24 -770
  12. package/dist/ai-chat.js +18 -765
  13. package/dist/ai-code.cjs +67 -923
  14. package/dist/ai-code.js +49 -905
  15. package/dist/ai-playground.cjs +25 -801
  16. package/dist/ai-playground.js +18 -795
  17. package/dist/ai-tools.cjs +22 -767
  18. package/dist/ai-tools.js +15 -761
  19. package/dist/ai-vision.cjs +41 -993
  20. package/dist/ai-vision.js +30 -983
  21. package/dist/ai-voice-settings.cjs +35 -1006
  22. package/dist/ai-voice-settings.js +32 -1004
  23. package/dist/ai-voice.cjs +51 -1024
  24. package/dist/ai-voice.js +9 -963
  25. package/dist/alert.cjs +11 -129
  26. package/dist/alert.js +8 -127
  27. package/dist/announcement.cjs +6 -402
  28. package/dist/announcement.js +6 -402
  29. package/dist/app-switcher-navigation-bar.cjs +5 -401
  30. package/dist/app-switcher-navigation-bar.js +5 -401
  31. package/dist/apple-cards-carousel.cjs +84 -480
  32. package/dist/apple-cards-carousel.js +19 -415
  33. package/dist/auth.cjs +10 -387
  34. package/dist/auth.js +7 -385
  35. package/dist/avatar.cjs +2 -9
  36. package/dist/avatar.js +2 -10
  37. package/dist/badge.cjs +8 -228
  38. package/dist/badge.js +5 -210
  39. package/dist/button.cjs +14 -67
  40. package/dist/button.js +12 -65
  41. package/dist/chrome.cjs +29 -493
  42. package/dist/chrome.js +9 -474
  43. package/dist/code-block.cjs +16 -664
  44. package/dist/code-block.js +13 -662
  45. package/dist/code-compare.cjs +28 -1302
  46. package/dist/code-compare.js +18 -1293
  47. package/dist/code-diff.cjs +21 -669
  48. package/dist/code-diff.js +17 -666
  49. package/dist/code-editor.cjs +13 -409
  50. package/dist/code-editor.js +12 -408
  51. package/dist/code-explorer.cjs +14 -456
  52. package/dist/code-explorer.js +13 -456
  53. package/dist/code-preview.cjs +31 -983
  54. package/dist/code-preview.js +23 -976
  55. package/dist/code-snippet.cjs +19 -667
  56. package/dist/code-snippet.js +14 -663
  57. package/dist/code-terminal.cjs +24 -485
  58. package/dist/code-terminal.js +19 -481
  59. package/dist/collapsible.cjs +13 -347
  60. package/dist/collapsible.js +11 -330
  61. package/dist/color-picker.cjs +8 -450
  62. package/dist/color-picker.js +7 -450
  63. package/dist/combobox.cjs +6 -402
  64. package/dist/combobox.js +6 -402
  65. package/dist/communication-navigation-bar.cjs +7 -403
  66. package/dist/communication-navigation-bar.js +5 -401
  67. package/dist/dashboard-navigation-bar.cjs +6 -402
  68. package/dist/dashboard-navigation-bar.js +5 -401
  69. package/dist/dialog-stack.cjs +5 -401
  70. package/dist/dialog-stack.js +5 -401
  71. package/dist/dialog.cjs +13 -70
  72. package/dist/dialog.js +13 -70
  73. package/dist/drawer.cjs +23 -99
  74. package/dist/drawer.js +19 -96
  75. package/dist/e-commerce-navigation-bar.cjs +7 -403
  76. package/dist/e-commerce-navigation-bar.js +5 -401
  77. package/dist/editor.cjs +9 -405
  78. package/dist/editor.js +6 -402
  79. package/dist/iam.cjs +2 -123
  80. package/dist/iam.js +1 -122
  81. package/dist/icon-button.cjs +2 -56
  82. package/dist/icon-button.js +1 -55
  83. package/dist/identity.cjs +28 -242
  84. package/dist/identity.js +20 -235
  85. package/dist/image-crop.cjs +10 -406
  86. package/dist/image-crop.js +7 -403
  87. package/dist/image.cjs +14 -83
  88. package/dist/image.js +13 -67
  89. package/dist/index.cjs +1868 -38770
  90. package/dist/index.js +174 -38320
  91. package/dist/input-group.cjs +3 -10
  92. package/dist/input-group.js +2 -10
  93. package/dist/item.cjs +2 -27
  94. package/dist/item.js +1 -22
  95. package/dist/kanban.cjs +25 -751
  96. package/dist/kanban.js +15 -742
  97. package/dist/limelight-nav.cjs +10 -452
  98. package/dist/limelight-nav.js +9 -452
  99. package/dist/link.cjs +11 -80
  100. package/dist/link.js +6 -60
  101. package/dist/lux.config.cjs +14 -32
  102. package/dist/lux.config.js +3 -26
  103. package/dist/menu.cjs +5 -13
  104. package/dist/menu.js +1 -9
  105. package/dist/message-dock.cjs +5 -401
  106. package/dist/message-dock.js +5 -401
  107. package/dist/mini-calendar.cjs +7 -403
  108. package/dist/mini-calendar.js +6 -402
  109. package/dist/music-player.cjs +30 -528
  110. package/dist/music-player.js +22 -520
  111. package/dist/next.cjs +8 -89
  112. package/dist/next.js +3 -86
  113. package/dist/popover.cjs +17 -74
  114. package/dist/popover.js +16 -73
  115. package/dist/progress-circle.cjs +3 -10
  116. package/dist/progress-circle.js +2 -10
  117. package/dist/provider.cjs +7 -176
  118. package/dist/provider.js +4 -174
  119. package/dist/select.cjs +36 -89
  120. package/dist/select.js +35 -88
  121. package/dist/sidebar.cjs +22 -493
  122. package/dist/sidebar.js +17 -489
  123. package/dist/site/commerce/ui/context.cjs +9 -214
  124. package/dist/site/commerce/ui/context.js +6 -215
  125. package/dist/site/components/analytics.cjs +2 -42
  126. package/dist/site/components/analytics.js +1 -37
  127. package/dist/site/components/auth/callback.cjs +2 -8
  128. package/dist/site/components/auth/callback.js +1 -7
  129. package/dist/site/components/auth/login-panel.cjs +15 -74
  130. package/dist/site/components/auth/login-panel.js +12 -73
  131. package/dist/site/components/auth/login.cjs +2 -6
  132. package/dist/site/components/auth/login.js +1 -5
  133. package/dist/site/components/auth/widget.cjs +2 -6
  134. package/dist/site/components/auth/widget.js +1 -5
  135. package/dist/site/components/commerce/bag-button.cjs +2 -3
  136. package/dist/site/components/commerce/bag-button.js +2 -3
  137. package/dist/site/components/commerce/buy-button.cjs +2 -11
  138. package/dist/site/components/commerce/buy-button.js +1 -10
  139. package/dist/site/components/commerce/checkout-button.cjs +2 -3
  140. package/dist/site/components/commerce/checkout-button.js +2 -3
  141. package/dist/site/components/commerce/checkout-panel/desktop-cp.cjs +15 -173
  142. package/dist/site/components/commerce/checkout-panel/desktop-cp.js +14 -174
  143. package/dist/site/components/commerce/checkout-panel/index.cjs +9 -400
  144. package/dist/site/components/commerce/checkout-panel/index.js +10 -403
  145. package/dist/site/components/commerce/checkout-panel/mobile-cp.cjs +15 -236
  146. package/dist/site/components/commerce/checkout-panel/mobile-cp.js +13 -237
  147. package/dist/site/components/commerce/desktop-bag-popup.cjs +7 -8
  148. package/dist/site/components/commerce/desktop-bag-popup.js +3 -8
  149. package/dist/site/components/commerce/drawer/index.cjs +15 -289
  150. package/dist/site/components/commerce/drawer/index.js +10 -290
  151. package/dist/site/components/commerce/drawer/micro.cjs +8 -115
  152. package/dist/site/components/commerce/drawer/micro.js +4 -115
  153. package/dist/site/components/commerce/drawer/shell.cjs +2 -10
  154. package/dist/site/components/commerce/drawer/shell.js +2 -10
  155. package/dist/site/components/contact-dialog/index.cjs +6 -69
  156. package/dist/site/components/contact-dialog/index.js +7 -71
  157. package/dist/site/components/drawer-margin.cjs +2 -10
  158. package/dist/site/components/drawer-margin.js +2 -10
  159. package/dist/site/components/footer.cjs +11 -81
  160. package/dist/site/components/footer.js +8 -80
  161. package/dist/site/components/header/desktop.cjs +18 -374
  162. package/dist/site/components/header/desktop.js +12 -355
  163. package/dist/site/components/header/index.cjs +9 -674
  164. package/dist/site/components/header/index.js +8 -657
  165. package/dist/site/components/header/mobile-bag-drawer.cjs +6 -71
  166. package/dist/site/components/header/mobile-bag-drawer.js +5 -74
  167. package/dist/site/components/header/mobile-nav-menu-ai.cjs +25 -28
  168. package/dist/site/components/header/mobile-nav-menu-ai.js +24 -27
  169. package/dist/site/components/header/mobile-nav-menu-item.cjs +6 -60
  170. package/dist/site/components/header/mobile-nav-menu-item.js +6 -61
  171. package/dist/site/components/header/mobile-nav-menu.cjs +7 -110
  172. package/dist/site/components/header/mobile-nav-menu.js +7 -112
  173. package/dist/site/components/header/mobile.cjs +48 -330
  174. package/dist/site/components/header/mobile.js +42 -330
  175. package/dist/site/components/icons/index.cjs +34 -35
  176. package/dist/site/components/icons/index.js +5 -33
  177. package/dist/site/components/index.cjs +118 -1961
  178. package/dist/site/components/index.js +23 -1951
  179. package/dist/site/components/mini-chart/index.cjs +7 -90
  180. package/dist/site/components/mini-chart/index.js +1 -92
  181. package/dist/site/components/mini-chart/wrapper.cjs +7 -76
  182. package/dist/site/components/mini-chart/wrapper.js +4 -77
  183. package/dist/site/components/not-found/index.cjs +9 -819
  184. package/dist/site/components/not-found/index.js +8 -802
  185. package/dist/site/components/security/index.cjs +9 -819
  186. package/dist/site/components/security/index.js +8 -802
  187. package/dist/site/next/analytics/index.cjs +16 -49
  188. package/dist/site/next/analytics/index.js +3 -49
  189. package/dist/site/next/analytics/pixel-analytics.cjs +23 -8
  190. package/dist/site/next/analytics/pixel-analytics.js +4 -8
  191. package/dist/site/next/index.cjs +13 -140
  192. package/dist/site/next/index.js +2 -140
  193. package/dist/site/root-layout/index.cjs +12 -1435
  194. package/dist/site/root-layout/index.css +0 -133
  195. package/dist/site/root-layout/index.js +12 -1416
  196. package/dist/site/site-def/footer/community.cjs +11 -27
  197. package/dist/site/site-def/footer/community.js +2 -18
  198. package/dist/site/site-def/footer/index.cjs +38 -218
  199. package/dist/site/site-def/footer/index.js +14 -215
  200. package/dist/site/site-def/index.cjs +28 -620
  201. package/dist/site/site-def/index.js +3 -624
  202. package/dist/table.cjs +20 -338
  203. package/dist/table.js +19 -338
  204. package/dist/tabs.cjs +3 -10
  205. package/dist/tabs.js +1 -9
  206. package/dist/tag.cjs +9 -270
  207. package/dist/tag.js +6 -268
  208. package/dist/tags.cjs +6 -314
  209. package/dist/tags.js +5 -314
  210. package/dist/textarea.cjs +4 -50
  211. package/dist/textarea.js +3 -49
  212. package/dist/tooltip.cjs +15 -34
  213. package/dist/tooltip.js +13 -33
  214. package/dist/vite.cjs +3 -82
  215. package/dist/vite.js +1 -80
  216. package/package.json +1 -1
  217. package/dist/index.css +0 -132
  218. package/dist/site/components/auth/login-panel.css +0 -4
  219. package/dist/site/components/commerce/bag-button.css +0 -4
  220. package/dist/site/components/commerce/checkout-button.css +0 -4
  221. package/dist/site/components/commerce/checkout-panel/desktop-cp.css +0 -132
  222. package/dist/site/components/commerce/checkout-panel/index.css +0 -132
  223. package/dist/site/components/commerce/checkout-panel/mobile-cp.css +0 -132
  224. package/dist/site/components/commerce/desktop-bag-popup.css +0 -4
  225. package/dist/site/components/commerce/drawer/index.css +0 -132
  226. package/dist/site/components/commerce/drawer/micro.css +0 -4
  227. package/dist/site/components/header/desktop.css +0 -4
  228. package/dist/site/components/header/index.css +0 -132
  229. package/dist/site/components/header/mobile-bag-drawer.css +0 -4
  230. package/dist/site/components/header/mobile-nav-menu-ai.css +0 -132
  231. package/dist/site/components/header/mobile-nav-menu-item.css +0 -132
  232. package/dist/site/components/header/mobile-nav-menu.css +0 -132
  233. package/dist/site/components/header/mobile.css +0 -132
  234. package/dist/site/components/icons/index.css +0 -4
  235. package/dist/site/components/index.css +0 -132
  236. package/dist/site/components/not-found/index.css +0 -132
  237. package/dist/site/components/security/index.css +0 -132
  238. package/dist/site/site-def/footer/community.css +0 -4
  239. package/dist/site/site-def/footer/index.css +0 -4
  240. package/dist/site/site-def/index.css +0 -4
@@ -5,121 +5,14 @@ var mobxReactLite = require('mobx-react-lite');
5
5
  var primitives = require('@hanzo/ui/primitives');
6
6
  var ui = require('@hanzo/ui');
7
7
  var commerce = require('@hanzo/commerce');
8
- var react = require('react');
9
- var mobx = require('mobx');
8
+ var CheckoutButton = require('../checkout-button.js');
9
+ var context_js = require('../../../commerce/ui/context.js');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
- require('next/navigation');
12
- require('usehooks-ts');
13
11
 
14
- var BagIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: "none", viewBox: "0 0 1019 1281", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m977.243 365.553h-175.407v-90.629c0-151.923-131.968-274.924-292.334-274.924-160.367 0-292.337 123.002-292.337 274.924v90.629h-175.4023c-23.3886 0-41.7627 17.051-41.7627 38.756v775.121c0 55.8 48.4456 100.76 108.582 100.76h801.84c60.138 0 108.578-44.96 108.578-100.76v-775.121c0-21.705-18.37-38.756-41.757-38.756zm-676.553-90.629c0-108.517 93.546-196.9408 208.812-196.9408 115.265 0 208.813 88.4218 208.813 196.9408v89.08h-417.625z", fill: "currentColor" }) });
15
- var bag_icon_default = BagIcon;
16
- var IconAndQuantity = mobxReactLite.observer(({
17
- animateOnQuantityChange = false,
18
- showArrow = true,
19
- showQuantity = true,
20
- clx = "",
21
- iconClx = "",
22
- digitClx = ""
23
- }) => {
24
- const cmmc = commerce.useCommerce();
25
- const wiggleRef = react.useRef(mobx.observable.box("none"));
26
- react.useEffect(() => (
27
- // return IReactionDisposer
28
- animateOnQuantityChange ? mobx.reaction(
29
- () => cmmc.cartQuantity,
30
- (curr, prev) => {
31
- if (curr > prev) {
32
- mobx.runInAction(() => {
33
- wiggleRef.current.set("more");
34
- });
35
- } else {
36
- mobx.runInAction(() => {
37
- wiggleRef.current.set("less");
38
- });
39
- }
40
- setTimeout(() => {
41
- mobx.runInAction(() => {
42
- wiggleRef.current.set("none");
43
- });
44
- }, 800);
45
- }
46
- ) : void 0
47
- ), []);
48
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: ui.cn("flex items-center justify-center", clx), children: [
49
- showQuantity && /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: ui.cn(
50
- "relative flex items-center justify-center mr-1",
51
- wiggleRef.current.get() === "more" ? "item-added-to-cart-animation" : wiggleRef.current.get() === "less" ? "item-removed-from-cart-animation" : ""
52
- ), children: [
53
- cmmc.cartQuantity > 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: ui.cn(
54
- "z-above-content flex flex-col justify-center items-center",
55
- "absolute left-0 right-0 top-0 bottom-0",
56
- digitClx
57
- ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
58
- /* color: 'white' tailwind bug? ,*/
59
- fontSize: "11px",
60
- position: "relative",
61
- top: "1px"
62
- }, children: cmmc.cartQuantity }) }),
63
- /* @__PURE__ */ jsxRuntime.jsx(bag_icon_default, { width: "19", height: "24", className: ui.cn("relative -top-[3px] opacity-70", iconClx), "aria-hidden": "true" })
64
- ] }),
65
- showArrow && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "17px" }, children: "\u203A" })
66
- ] });
67
- });
68
- var CheckoutButton = ({
69
- handleCheckout,
70
- variant = "primary",
71
- rounded = "lg",
72
- className,
73
- showQuantity = true,
74
- showArrow = true,
75
- animateOnQuantityChange = true,
76
- centerText = true,
77
- children,
78
- ...rest
79
- }) => {
80
- return /* @__PURE__ */ jsxRuntime.jsxs(
81
- primitives.Button,
82
- {
83
- ...rest,
84
- onClick: handleCheckout,
85
- variant,
86
- className: ui.cn(`rounded-${rounded}`, ui.cn(
87
- "flex justify-between items-stretch group",
88
- showQuantity ? centerText ? "px-1.5" : "pl-2.5 pr-1.5" : "",
89
- className
90
- )),
91
- children: [
92
- centerText && // must scale this one too, as it effects layout
93
- /* @__PURE__ */ jsxRuntime.jsx(
94
- IconAndQuantity,
95
- {
96
- showArrow,
97
- showQuantity,
98
- clx: "invisible group-hover:scale-105 transition-scale transition-duration-300"
99
- }
100
- ),
101
- children ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center", children: "Checkout" }),
102
- /* @__PURE__ */ jsxRuntime.jsx(
103
- IconAndQuantity,
104
- {
105
- clx: "group-hover:scale-105 transition-scale transition-duration-300",
106
- animateOnQuantityChange,
107
- showArrow,
108
- showQuantity,
109
- iconClx: "fill-background",
110
- digitClx: "text-foreground group-hover:opacity-80 leading-none font-bold font-sans"
111
- }
112
- )
113
- ]
114
- }
115
- );
116
- };
117
- var checkout_button_default = CheckoutButton;
118
- mobxReactLite.enableStaticRendering(typeof window === "undefined");
119
- var CommerceUIContext = react.createContext(void 0);
120
- var useCommerceDrawer = () => {
121
- return react.useContext(CommerceUIContext);
122
- };
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
+ var CheckoutButton__default = /*#__PURE__*/_interopDefault(CheckoutButton);
15
+
123
16
  var CN = {
124
17
  // h: mind padding!
125
18
  mobile: { w: 36, h: 32 },
@@ -161,7 +54,7 @@ var Micro = mobxReactLite.observer(({
161
54
  handleCheckout,
162
55
  handleItemClicked
163
56
  }) => {
164
- const drawer = useCommerceDrawer();
57
+ const drawer = context_js.useCommerceDrawer();
165
58
  const cmmc = commerce.useCommerce();
166
59
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: ui.cn(
167
60
  drawer.showRecent ? "grid grid-cols-2" : "flex justify-center items-center ",
@@ -211,7 +104,7 @@ var Micro = mobxReactLite.observer(({
211
104
  ), children: [
212
105
  drawer.showRecent && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "invisible text-muted text-xxs md:text-xs leading-none pl-1 self-start", children: "for layout" }),
213
106
  /* @__PURE__ */ jsxRuntime.jsx(
214
- checkout_button_default,
107
+ CheckoutButton__default.default,
215
108
  {
216
109
  handleCheckout,
217
110
  variant: "primary",
@@ -1,123 +1,12 @@
1
1
  'use client';
2
- import { observer, enableStaticRendering } from 'mobx-react-lite';
2
+ import { observer } from 'mobx-react-lite';
3
3
  import { Button } from '@hanzo/ui/primitives';
4
4
  import { Box, cn, MediaStack } from '@hanzo/ui';
5
5
  import { useCommerce, formatCurrencyValue } from '@hanzo/commerce';
6
- import { useRef, useEffect, createContext, useContext } from 'react';
7
- import { observable, reaction, runInAction } from 'mobx';
6
+ import CheckoutButton from '../checkout-button.js';
7
+ import { useCommerceDrawer } from '../../../commerce/ui/context.js';
8
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
- import 'next/navigation';
10
- import 'usehooks-ts';
11
9
 
12
- var BagIcon = (props) => /* @__PURE__ */ jsx("svg", { fill: "none", viewBox: "0 0 1019 1281", ...props, children: /* @__PURE__ */ jsx("path", { d: "m977.243 365.553h-175.407v-90.629c0-151.923-131.968-274.924-292.334-274.924-160.367 0-292.337 123.002-292.337 274.924v90.629h-175.4023c-23.3886 0-41.7627 17.051-41.7627 38.756v775.121c0 55.8 48.4456 100.76 108.582 100.76h801.84c60.138 0 108.578-44.96 108.578-100.76v-775.121c0-21.705-18.37-38.756-41.757-38.756zm-676.553-90.629c0-108.517 93.546-196.9408 208.812-196.9408 115.265 0 208.813 88.4218 208.813 196.9408v89.08h-417.625z", fill: "currentColor" }) });
13
- var bag_icon_default = BagIcon;
14
- var IconAndQuantity = observer(({
15
- animateOnQuantityChange = false,
16
- showArrow = true,
17
- showQuantity = true,
18
- clx = "",
19
- iconClx = "",
20
- digitClx = ""
21
- }) => {
22
- const cmmc = useCommerce();
23
- const wiggleRef = useRef(observable.box("none"));
24
- useEffect(() => (
25
- // return IReactionDisposer
26
- animateOnQuantityChange ? reaction(
27
- () => cmmc.cartQuantity,
28
- (curr, prev) => {
29
- if (curr > prev) {
30
- runInAction(() => {
31
- wiggleRef.current.set("more");
32
- });
33
- } else {
34
- runInAction(() => {
35
- wiggleRef.current.set("less");
36
- });
37
- }
38
- setTimeout(() => {
39
- runInAction(() => {
40
- wiggleRef.current.set("none");
41
- });
42
- }, 800);
43
- }
44
- ) : void 0
45
- ), []);
46
- return /* @__PURE__ */ jsxs(Box, { className: cn("flex items-center justify-center", clx), children: [
47
- showQuantity && /* @__PURE__ */ jsxs(Box, { className: cn(
48
- "relative flex items-center justify-center mr-1",
49
- wiggleRef.current.get() === "more" ? "item-added-to-cart-animation" : wiggleRef.current.get() === "less" ? "item-removed-from-cart-animation" : ""
50
- ), children: [
51
- cmmc.cartQuantity > 0 && /* @__PURE__ */ jsx(Box, { className: cn(
52
- "z-above-content flex flex-col justify-center items-center",
53
- "absolute left-0 right-0 top-0 bottom-0",
54
- digitClx
55
- ), children: /* @__PURE__ */ jsx("div", { style: {
56
- /* color: 'white' tailwind bug? ,*/
57
- fontSize: "11px",
58
- position: "relative",
59
- top: "1px"
60
- }, children: cmmc.cartQuantity }) }),
61
- /* @__PURE__ */ jsx(bag_icon_default, { width: "19", height: "24", className: cn("relative -top-[3px] opacity-70", iconClx), "aria-hidden": "true" })
62
- ] }),
63
- showArrow && /* @__PURE__ */ jsx("span", { style: { fontSize: "17px" }, children: "\u203A" })
64
- ] });
65
- });
66
- var CheckoutButton = ({
67
- handleCheckout,
68
- variant = "primary",
69
- rounded = "lg",
70
- className,
71
- showQuantity = true,
72
- showArrow = true,
73
- animateOnQuantityChange = true,
74
- centerText = true,
75
- children,
76
- ...rest
77
- }) => {
78
- return /* @__PURE__ */ jsxs(
79
- Button,
80
- {
81
- ...rest,
82
- onClick: handleCheckout,
83
- variant,
84
- className: cn(`rounded-${rounded}`, cn(
85
- "flex justify-between items-stretch group",
86
- showQuantity ? centerText ? "px-1.5" : "pl-2.5 pr-1.5" : "",
87
- className
88
- )),
89
- children: [
90
- centerText && // must scale this one too, as it effects layout
91
- /* @__PURE__ */ jsx(
92
- IconAndQuantity,
93
- {
94
- showArrow,
95
- showQuantity,
96
- clx: "invisible group-hover:scale-105 transition-scale transition-duration-300"
97
- }
98
- ),
99
- children ?? /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center", children: "Checkout" }),
100
- /* @__PURE__ */ jsx(
101
- IconAndQuantity,
102
- {
103
- clx: "group-hover:scale-105 transition-scale transition-duration-300",
104
- animateOnQuantityChange,
105
- showArrow,
106
- showQuantity,
107
- iconClx: "fill-background",
108
- digitClx: "text-foreground group-hover:opacity-80 leading-none font-bold font-sans"
109
- }
110
- )
111
- ]
112
- }
113
- );
114
- };
115
- var checkout_button_default = CheckoutButton;
116
- enableStaticRendering(typeof window === "undefined");
117
- var CommerceUIContext = createContext(void 0);
118
- var useCommerceDrawer = () => {
119
- return useContext(CommerceUIContext);
120
- };
121
10
  var CN = {
122
11
  // h: mind padding!
123
12
  mobile: { w: 36, h: 32 },
@@ -209,7 +98,7 @@ var Micro = observer(({
209
98
  ), children: [
210
99
  drawer.showRecent && /* @__PURE__ */ jsx("p", { className: "invisible text-muted text-xxs md:text-xs leading-none pl-1 self-start", children: "for layout" }),
211
100
  /* @__PURE__ */ jsx(
212
- checkout_button_default,
101
+ CheckoutButton,
213
102
  {
214
103
  handleCheckout,
215
104
  variant: "primary",
@@ -4,24 +4,16 @@
4
4
  var mobxReactLite = require('mobx-react-lite');
5
5
  var primitives = require('@hanzo/ui/primitives');
6
6
  var ui = require('@hanzo/ui');
7
- var react = require('react');
8
- require('next/navigation');
9
- require('usehooks-ts');
10
- require('@hanzo/commerce');
7
+ var context_js = require('../../../commerce/ui/context.js');
11
8
  var jsxRuntime = require('react/jsx-runtime');
12
9
 
13
- mobxReactLite.enableStaticRendering(typeof window === "undefined");
14
- var CommerceUIContext = react.createContext(void 0);
15
- var useCommerceDrawer = () => {
16
- return react.useContext(CommerceUIContext);
17
- };
18
10
  var CommerceDrawer = mobxReactLite.observer(({
19
11
  children,
20
12
  handleHandleClicked,
21
13
  drawerClx = "",
22
14
  ...rest
23
15
  }) => {
24
- const drawer = useCommerceDrawer();
16
+ const drawer = context_js.useCommerceDrawer();
25
17
  return /* @__PURE__ */ jsxRuntime.jsx(
26
18
  primitives.Drawer,
27
19
  {
@@ -1,18 +1,10 @@
1
1
  'use client';
2
- import { enableStaticRendering, observer } from 'mobx-react-lite';
2
+ import { observer } from 'mobx-react-lite';
3
3
  import { Drawer, DrawerContent, DrawerHandle } from '@hanzo/ui/primitives';
4
4
  import { cn, Box } from '@hanzo/ui';
5
- import { createContext, useContext } from 'react';
6
- import 'next/navigation';
7
- import 'usehooks-ts';
8
- import '@hanzo/commerce';
5
+ import { useCommerceDrawer } from '../../../commerce/ui/context.js';
9
6
  import { jsx, jsxs } from 'react/jsx-runtime';
10
7
 
11
- enableStaticRendering(typeof window === "undefined");
12
- var CommerceUIContext = createContext(void 0);
13
- var useCommerceDrawer = () => {
14
- return useContext(CommerceUIContext);
15
- };
16
8
  var CommerceDrawer = observer(({
17
9
  children,
18
10
  handleHandleClicked,
@@ -3,78 +3,15 @@
3
3
 
4
4
  var react = require('react');
5
5
  var primitives = require('@hanzo/ui/primitives');
6
- var reactHookForm = require('react-hook-form');
7
- var zod = require('zod');
8
- var zod$1 = require('@hookform/resolvers/zod');
9
- var validator = require('validator');
10
- var lucideReact = require('lucide-react');
11
- var ui = require('@hanzo/ui');
6
+ var ContactForm = require('./contact-form.js');
7
+ var Disclaimer = require('./disclaimer.js');
12
8
  var jsxRuntime = require('react/jsx-runtime');
13
9
 
14
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
11
 
16
- var validator__default = /*#__PURE__*/_interopDefault(validator);
12
+ var ContactForm__default = /*#__PURE__*/_interopDefault(ContactForm);
13
+ var Disclaimer__default = /*#__PURE__*/_interopDefault(Disclaimer);
17
14
 
18
- var ContactFormSchema = zod.z.object({
19
- email: zod.z.string().min(1, { message: "Email must be provided." }).email("Invalid email."),
20
- phone: zod.z.string().min(1, { message: "Telephone must be provided." }).refine(validator__default.default.isMobilePhone, { message: "Invalid format." })
21
- });
22
- var ContactForm = ({
23
- onSubmit: _onSubmit,
24
- enclosure
25
- }) => {
26
- const form = reactHookForm.useForm({
27
- resolver: zod$1.zodResolver(ContactFormSchema),
28
- defaultValues: {
29
- email: "",
30
- phone: ""
31
- }
32
- });
33
- const [isPending, startTransition] = react.useTransition();
34
- const onSubmit = (data) => {
35
- startTransition(async () => {
36
- await _onSubmit(data, enclosure);
37
- });
38
- };
39
- const MyFormItem = ({
40
- field,
41
- placeholder
42
- }) => /* @__PURE__ */ jsxRuntime.jsxs(ui.FormItem, { className: "space-y-0", children: [
43
- /* @__PURE__ */ jsxRuntime.jsx(ui.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(primitives.Input, { placeholder, ...field, className: "mt-0 text-foreground" }) }),
44
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { className: "flex flex-row justify-start items-stretch gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.FormMessage, {}) })
45
- ] });
46
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Form, { ...form, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { tag: "form", onSubmit: form.handleSubmit(onSubmit), className: "w-3/4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col justify-start items-stretch mt-4", children: [
47
- /* @__PURE__ */ jsxRuntime.jsx(
48
- ui.FormField,
49
- {
50
- control: form.control,
51
- name: "email",
52
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(MyFormItem, { field, placeholder: "email" })
53
- }
54
- ),
55
- /* @__PURE__ */ jsxRuntime.jsx(
56
- ui.FormField,
57
- {
58
- control: form.control,
59
- name: "phone",
60
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(MyFormItem, { field, placeholder: "phone" })
61
- }
62
- ),
63
- /* @__PURE__ */ jsxRuntime.jsx(primitives.Button, { disabled: isPending, type: "submit", className: "bg-primary text-primary-fg hover:bg-primary-hover", children: isPending ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
64
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { style: ui.css("mr-2 h-4 w-4 animate-spin") }),
65
- "Please wait"
66
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "Submit" }) })
67
- ] }) }) });
68
- };
69
- var contact_form_default = ContactForm;
70
- var Disclaimer = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
71
- "By entering your mobile number and submitting, you consent to receive text messages from Lux at the number provided. Message and data rates may apply. Message frequency varies. You can unsubscribe at any time by replying STOP. View our ",
72
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/privacy", children: "Privacy Policy" }),
73
- " and ",
74
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/terms", children: "Terms & conditions" }),
75
- "."
76
- ] });
77
- var disclaimer_default = Disclaimer;
78
15
  var ContactDialog = ({
79
16
  open,
80
17
  onOpenChange,
@@ -103,8 +40,8 @@ var ContactDialog = ({
103
40
  ] })
104
41
  ] }),
105
42
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-8 pb-8 rounded-e-lg flex flex-col justify-start items-center", children: [
106
- success ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: actionEnclosure?.reply }) : /* @__PURE__ */ jsxRuntime.jsx(contact_form_default, { onSubmit, enclosure: actionEnclosure }),
107
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(disclaimer_default, {}) })
43
+ success ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: actionEnclosure?.reply }) : /* @__PURE__ */ jsxRuntime.jsx(ContactForm__default.default, { onSubmit, enclosure: actionEnclosure }),
44
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(Disclaimer__default.default, {}) })
108
45
  ] })
109
46
  ] })
110
47
  ] });
@@ -1,74 +1,10 @@
1
1
  'use client';
2
- import { useState, useTransition } from 'react';
3
- import { Dialog, DialogTrigger, Button, DialogContent, DialogHeader, DialogTitle, DialogDescription, Input } from '@hanzo/ui/primitives';
4
- import { useForm } from 'react-hook-form';
5
- import { z } from 'zod';
6
- import { zodResolver } from '@hookform/resolvers/zod';
7
- import validator from 'validator';
8
- import { Loader2 } from 'lucide-react';
9
- import { Form, Box, FormField, css, FormItem, FormControl, FormMessage } from '@hanzo/ui';
10
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { Dialog, DialogTrigger, Button, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@hanzo/ui/primitives';
4
+ import ContactForm from './contact-form.js';
5
+ import Disclaimer from './disclaimer.js';
6
+ import { jsxs, jsx } from 'react/jsx-runtime';
11
7
 
12
- var ContactFormSchema = z.object({
13
- email: z.string().min(1, { message: "Email must be provided." }).email("Invalid email."),
14
- phone: z.string().min(1, { message: "Telephone must be provided." }).refine(validator.isMobilePhone, { message: "Invalid format." })
15
- });
16
- var ContactForm = ({
17
- onSubmit: _onSubmit,
18
- enclosure
19
- }) => {
20
- const form = useForm({
21
- resolver: zodResolver(ContactFormSchema),
22
- defaultValues: {
23
- email: "",
24
- phone: ""
25
- }
26
- });
27
- const [isPending, startTransition] = useTransition();
28
- const onSubmit = (data) => {
29
- startTransition(async () => {
30
- await _onSubmit(data, enclosure);
31
- });
32
- };
33
- const MyFormItem = ({
34
- field,
35
- placeholder
36
- }) => /* @__PURE__ */ jsxs(FormItem, { className: "space-y-0", children: [
37
- /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { placeholder, ...field, className: "mt-0 text-foreground" }) }),
38
- /* @__PURE__ */ jsx(Box, { className: "flex flex-row justify-start items-stretch gap-2", children: /* @__PURE__ */ jsx(FormMessage, {}) })
39
- ] });
40
- return /* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsx(Box, { tag: "form", onSubmit: form.handleSubmit(onSubmit), className: "w-3/4", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-start items-stretch mt-4", children: [
41
- /* @__PURE__ */ jsx(
42
- FormField,
43
- {
44
- control: form.control,
45
- name: "email",
46
- render: ({ field }) => /* @__PURE__ */ jsx(MyFormItem, { field, placeholder: "email" })
47
- }
48
- ),
49
- /* @__PURE__ */ jsx(
50
- FormField,
51
- {
52
- control: form.control,
53
- name: "phone",
54
- render: ({ field }) => /* @__PURE__ */ jsx(MyFormItem, { field, placeholder: "phone" })
55
- }
56
- ),
57
- /* @__PURE__ */ jsx(Button, { disabled: isPending, type: "submit", className: "bg-primary text-primary-fg hover:bg-primary-hover", children: isPending ? /* @__PURE__ */ jsxs(Fragment, { children: [
58
- /* @__PURE__ */ jsx(Loader2, { style: css("mr-2 h-4 w-4 animate-spin") }),
59
- "Please wait"
60
- ] }) : /* @__PURE__ */ jsx(Fragment, { children: "Submit" }) })
61
- ] }) }) });
62
- };
63
- var contact_form_default = ContactForm;
64
- var Disclaimer = () => /* @__PURE__ */ jsxs("div", { children: [
65
- "By entering your mobile number and submitting, you consent to receive text messages from Lux at the number provided. Message and data rates may apply. Message frequency varies. You can unsubscribe at any time by replying STOP. View our ",
66
- /* @__PURE__ */ jsx("a", { href: "/privacy", children: "Privacy Policy" }),
67
- " and ",
68
- /* @__PURE__ */ jsx("a", { href: "/terms", children: "Terms & conditions" }),
69
- "."
70
- ] });
71
- var disclaimer_default = Disclaimer;
72
8
  var ContactDialog = ({
73
9
  open,
74
10
  onOpenChange,
@@ -97,8 +33,8 @@ var ContactDialog = ({
97
33
  ] })
98
34
  ] }),
99
35
  /* @__PURE__ */ jsxs("div", { className: "px-8 pb-8 rounded-e-lg flex flex-col justify-start items-center", children: [
100
- success ? /* @__PURE__ */ jsx("p", { children: actionEnclosure?.reply }) : /* @__PURE__ */ jsx(contact_form_default, { onSubmit, enclosure: actionEnclosure }),
101
- /* @__PURE__ */ jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsx(disclaimer_default, {}) })
36
+ success ? /* @__PURE__ */ jsx("p", { children: actionEnclosure?.reply }) : /* @__PURE__ */ jsx(ContactForm, { onSubmit, enclosure: actionEnclosure }),
37
+ /* @__PURE__ */ jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsx(Disclaimer, {}) })
102
38
  ] })
103
39
  ] })
104
40
  ] });
@@ -2,22 +2,14 @@
2
2
  'use strict';
3
3
 
4
4
  var ui = require('@hanzo/ui');
5
- var react = require('react');
5
+ var context_js = require('../commerce/ui/context.js');
6
6
  var mobxReactLite = require('mobx-react-lite');
7
- require('next/navigation');
8
- require('usehooks-ts');
9
- require('@hanzo/commerce');
10
7
  var jsxRuntime = require('react/jsx-runtime');
11
8
 
12
- mobxReactLite.enableStaticRendering(typeof window === "undefined");
13
- var CommerceUIContext = react.createContext(void 0);
14
- var useCommerceDrawer = () => {
15
- return react.useContext(CommerceUIContext);
16
- };
17
9
  var DrawerMargin = mobxReactLite.observer(({
18
10
  clx = ""
19
11
  }) => {
20
- const drawer = useCommerceDrawer();
12
+ const drawer = context_js.useCommerceDrawer();
21
13
  if (!drawer) {
22
14
  throw new Error("DrawerMargin must be used with a CommerceUIContext!");
23
15
  }
@@ -1,17 +1,9 @@
1
1
  'use client';
2
2
  import { Box, cn } from '@hanzo/ui';
3
- import { createContext, useContext } from 'react';
4
- import { enableStaticRendering, observer } from 'mobx-react-lite';
5
- import 'next/navigation';
6
- import 'usehooks-ts';
7
- import '@hanzo/commerce';
3
+ import { useCommerceDrawer } from '../commerce/ui/context.js';
4
+ import { observer } from 'mobx-react-lite';
8
5
  import { jsx } from 'react/jsx-runtime';
9
6
 
10
- enableStaticRendering(typeof window === "undefined");
11
- var CommerceUIContext = createContext(void 0);
12
- var useCommerceDrawer = () => {
13
- return useContext(CommerceUIContext);
14
- };
15
7
  var DrawerMargin = observer(({
16
8
  clx = ""
17
9
  }) => {