@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.
- package/dist/3d-model-viewer.cjs +25 -421
- package/dist/3d-model-viewer.js +20 -416
- package/dist/accordion.cjs +3 -10
- package/dist/accordion.js +2 -10
- package/dist/advanced-navigation-bar.cjs +5 -401
- package/dist/advanced-navigation-bar.js +5 -401
- package/dist/ai-agents.cjs +45 -890
- package/dist/ai-agents.js +8 -834
- package/dist/ai-assistant.cjs +13 -740
- package/dist/ai-assistant.js +10 -738
- package/dist/ai-chat.cjs +24 -770
- package/dist/ai-chat.js +18 -765
- package/dist/ai-code.cjs +67 -923
- package/dist/ai-code.js +49 -905
- package/dist/ai-playground.cjs +25 -801
- package/dist/ai-playground.js +18 -795
- package/dist/ai-tools.cjs +22 -767
- package/dist/ai-tools.js +15 -761
- package/dist/ai-vision.cjs +41 -993
- package/dist/ai-vision.js +30 -983
- package/dist/ai-voice-settings.cjs +35 -1006
- package/dist/ai-voice-settings.js +32 -1004
- package/dist/ai-voice.cjs +51 -1024
- package/dist/ai-voice.js +9 -963
- package/dist/alert.cjs +11 -129
- package/dist/alert.js +8 -127
- package/dist/announcement.cjs +6 -402
- package/dist/announcement.js +6 -402
- package/dist/app-switcher-navigation-bar.cjs +5 -401
- package/dist/app-switcher-navigation-bar.js +5 -401
- package/dist/apple-cards-carousel.cjs +84 -480
- package/dist/apple-cards-carousel.js +19 -415
- package/dist/auth.cjs +10 -387
- package/dist/auth.js +7 -385
- package/dist/avatar.cjs +2 -9
- package/dist/avatar.js +2 -10
- package/dist/badge.cjs +8 -228
- package/dist/badge.js +5 -210
- package/dist/button.cjs +14 -67
- package/dist/button.js +12 -65
- package/dist/chrome.cjs +29 -493
- package/dist/chrome.js +9 -474
- package/dist/code-block.cjs +16 -664
- package/dist/code-block.js +13 -662
- package/dist/code-compare.cjs +28 -1302
- package/dist/code-compare.js +18 -1293
- package/dist/code-diff.cjs +21 -669
- package/dist/code-diff.js +17 -666
- package/dist/code-editor.cjs +13 -409
- package/dist/code-editor.js +12 -408
- package/dist/code-explorer.cjs +14 -456
- package/dist/code-explorer.js +13 -456
- package/dist/code-preview.cjs +31 -983
- package/dist/code-preview.js +23 -976
- package/dist/code-snippet.cjs +19 -667
- package/dist/code-snippet.js +14 -663
- package/dist/code-terminal.cjs +24 -485
- package/dist/code-terminal.js +19 -481
- package/dist/collapsible.cjs +13 -347
- package/dist/collapsible.js +11 -330
- package/dist/color-picker.cjs +8 -450
- package/dist/color-picker.js +7 -450
- package/dist/combobox.cjs +6 -402
- package/dist/combobox.js +6 -402
- package/dist/communication-navigation-bar.cjs +7 -403
- package/dist/communication-navigation-bar.js +5 -401
- package/dist/dashboard-navigation-bar.cjs +6 -402
- package/dist/dashboard-navigation-bar.js +5 -401
- package/dist/dialog-stack.cjs +5 -401
- package/dist/dialog-stack.js +5 -401
- package/dist/dialog.cjs +13 -70
- package/dist/dialog.js +13 -70
- package/dist/drawer.cjs +23 -99
- package/dist/drawer.js +19 -96
- package/dist/e-commerce-navigation-bar.cjs +7 -403
- package/dist/e-commerce-navigation-bar.js +5 -401
- package/dist/editor.cjs +9 -405
- package/dist/editor.js +6 -402
- package/dist/iam.cjs +2 -123
- package/dist/iam.js +1 -122
- package/dist/icon-button.cjs +2 -56
- package/dist/icon-button.js +1 -55
- package/dist/identity.cjs +28 -242
- package/dist/identity.js +20 -235
- package/dist/image-crop.cjs +10 -406
- package/dist/image-crop.js +7 -403
- package/dist/image.cjs +14 -83
- package/dist/image.js +13 -67
- package/dist/index.cjs +1868 -38770
- package/dist/index.js +174 -38320
- package/dist/input-group.cjs +3 -10
- package/dist/input-group.js +2 -10
- package/dist/item.cjs +2 -27
- package/dist/item.js +1 -22
- package/dist/kanban.cjs +25 -751
- package/dist/kanban.js +15 -742
- package/dist/limelight-nav.cjs +10 -452
- package/dist/limelight-nav.js +9 -452
- package/dist/link.cjs +11 -80
- package/dist/link.js +6 -60
- package/dist/lux.config.cjs +14 -32
- package/dist/lux.config.js +3 -26
- package/dist/menu.cjs +5 -13
- package/dist/menu.js +1 -9
- package/dist/message-dock.cjs +5 -401
- package/dist/message-dock.js +5 -401
- package/dist/mini-calendar.cjs +7 -403
- package/dist/mini-calendar.js +6 -402
- package/dist/music-player.cjs +30 -528
- package/dist/music-player.js +22 -520
- package/dist/next.cjs +8 -89
- package/dist/next.js +3 -86
- package/dist/popover.cjs +17 -74
- package/dist/popover.js +16 -73
- package/dist/progress-circle.cjs +3 -10
- package/dist/progress-circle.js +2 -10
- package/dist/provider.cjs +7 -176
- package/dist/provider.js +4 -174
- package/dist/select.cjs +36 -89
- package/dist/select.js +35 -88
- package/dist/sidebar.cjs +22 -493
- package/dist/sidebar.js +17 -489
- package/dist/site/commerce/ui/context.cjs +9 -214
- package/dist/site/commerce/ui/context.js +6 -215
- package/dist/site/components/analytics.cjs +2 -42
- package/dist/site/components/analytics.js +1 -37
- package/dist/site/components/auth/callback.cjs +2 -8
- package/dist/site/components/auth/callback.js +1 -7
- package/dist/site/components/auth/login-panel.cjs +15 -74
- package/dist/site/components/auth/login-panel.js +12 -73
- package/dist/site/components/auth/login.cjs +2 -6
- package/dist/site/components/auth/login.js +1 -5
- package/dist/site/components/auth/widget.cjs +2 -6
- package/dist/site/components/auth/widget.js +1 -5
- package/dist/site/components/commerce/bag-button.cjs +2 -3
- package/dist/site/components/commerce/bag-button.js +2 -3
- package/dist/site/components/commerce/buy-button.cjs +2 -11
- package/dist/site/components/commerce/buy-button.js +1 -10
- package/dist/site/components/commerce/checkout-button.cjs +2 -3
- package/dist/site/components/commerce/checkout-button.js +2 -3
- package/dist/site/components/commerce/checkout-panel/desktop-cp.cjs +15 -173
- package/dist/site/components/commerce/checkout-panel/desktop-cp.js +14 -174
- package/dist/site/components/commerce/checkout-panel/index.cjs +9 -400
- package/dist/site/components/commerce/checkout-panel/index.js +10 -403
- package/dist/site/components/commerce/checkout-panel/mobile-cp.cjs +15 -236
- package/dist/site/components/commerce/checkout-panel/mobile-cp.js +13 -237
- package/dist/site/components/commerce/desktop-bag-popup.cjs +7 -8
- package/dist/site/components/commerce/desktop-bag-popup.js +3 -8
- package/dist/site/components/commerce/drawer/index.cjs +15 -289
- package/dist/site/components/commerce/drawer/index.js +10 -290
- package/dist/site/components/commerce/drawer/micro.cjs +8 -115
- package/dist/site/components/commerce/drawer/micro.js +4 -115
- package/dist/site/components/commerce/drawer/shell.cjs +2 -10
- package/dist/site/components/commerce/drawer/shell.js +2 -10
- package/dist/site/components/contact-dialog/index.cjs +6 -69
- package/dist/site/components/contact-dialog/index.js +7 -71
- package/dist/site/components/drawer-margin.cjs +2 -10
- package/dist/site/components/drawer-margin.js +2 -10
- package/dist/site/components/footer.cjs +11 -81
- package/dist/site/components/footer.js +8 -80
- package/dist/site/components/header/desktop.cjs +18 -374
- package/dist/site/components/header/desktop.js +12 -355
- package/dist/site/components/header/index.cjs +9 -674
- package/dist/site/components/header/index.js +8 -657
- package/dist/site/components/header/mobile-bag-drawer.cjs +6 -71
- package/dist/site/components/header/mobile-bag-drawer.js +5 -74
- package/dist/site/components/header/mobile-nav-menu-ai.cjs +25 -28
- package/dist/site/components/header/mobile-nav-menu-ai.js +24 -27
- package/dist/site/components/header/mobile-nav-menu-item.cjs +6 -60
- package/dist/site/components/header/mobile-nav-menu-item.js +6 -61
- package/dist/site/components/header/mobile-nav-menu.cjs +7 -110
- package/dist/site/components/header/mobile-nav-menu.js +7 -112
- package/dist/site/components/header/mobile.cjs +48 -330
- package/dist/site/components/header/mobile.js +42 -330
- package/dist/site/components/icons/index.cjs +34 -35
- package/dist/site/components/icons/index.js +5 -33
- package/dist/site/components/index.cjs +118 -1961
- package/dist/site/components/index.js +23 -1951
- package/dist/site/components/mini-chart/index.cjs +7 -90
- package/dist/site/components/mini-chart/index.js +1 -92
- package/dist/site/components/mini-chart/wrapper.cjs +7 -76
- package/dist/site/components/mini-chart/wrapper.js +4 -77
- package/dist/site/components/not-found/index.cjs +9 -819
- package/dist/site/components/not-found/index.js +8 -802
- package/dist/site/components/security/index.cjs +9 -819
- package/dist/site/components/security/index.js +8 -802
- package/dist/site/next/analytics/index.cjs +16 -49
- package/dist/site/next/analytics/index.js +3 -49
- package/dist/site/next/analytics/pixel-analytics.cjs +23 -8
- package/dist/site/next/analytics/pixel-analytics.js +4 -8
- package/dist/site/next/index.cjs +13 -140
- package/dist/site/next/index.js +2 -140
- package/dist/site/root-layout/index.cjs +12 -1435
- package/dist/site/root-layout/index.css +0 -133
- package/dist/site/root-layout/index.js +12 -1416
- package/dist/site/site-def/footer/community.cjs +11 -27
- package/dist/site/site-def/footer/community.js +2 -18
- package/dist/site/site-def/footer/index.cjs +38 -218
- package/dist/site/site-def/footer/index.js +14 -215
- package/dist/site/site-def/index.cjs +28 -620
- package/dist/site/site-def/index.js +3 -624
- package/dist/table.cjs +20 -338
- package/dist/table.js +19 -338
- package/dist/tabs.cjs +3 -10
- package/dist/tabs.js +1 -9
- package/dist/tag.cjs +9 -270
- package/dist/tag.js +6 -268
- package/dist/tags.cjs +6 -314
- package/dist/tags.js +5 -314
- package/dist/textarea.cjs +4 -50
- package/dist/textarea.js +3 -49
- package/dist/tooltip.cjs +15 -34
- package/dist/tooltip.js +13 -33
- package/dist/vite.cjs +3 -82
- package/dist/vite.js +1 -80
- package/package.json +1 -1
- package/dist/index.css +0 -132
- package/dist/site/components/auth/login-panel.css +0 -4
- package/dist/site/components/commerce/bag-button.css +0 -4
- package/dist/site/components/commerce/checkout-button.css +0 -4
- package/dist/site/components/commerce/checkout-panel/desktop-cp.css +0 -132
- package/dist/site/components/commerce/checkout-panel/index.css +0 -132
- package/dist/site/components/commerce/checkout-panel/mobile-cp.css +0 -132
- package/dist/site/components/commerce/desktop-bag-popup.css +0 -4
- package/dist/site/components/commerce/drawer/index.css +0 -132
- package/dist/site/components/commerce/drawer/micro.css +0 -4
- package/dist/site/components/header/desktop.css +0 -4
- package/dist/site/components/header/index.css +0 -132
- package/dist/site/components/header/mobile-bag-drawer.css +0 -4
- package/dist/site/components/header/mobile-nav-menu-ai.css +0 -132
- package/dist/site/components/header/mobile-nav-menu-item.css +0 -132
- package/dist/site/components/header/mobile-nav-menu.css +0 -132
- package/dist/site/components/header/mobile.css +0 -132
- package/dist/site/components/icons/index.css +0 -4
- package/dist/site/components/index.css +0 -132
- package/dist/site/components/not-found/index.css +0 -132
- package/dist/site/components/security/index.css +0 -132
- package/dist/site/site-def/footer/community.css +0 -4
- package/dist/site/site-def/footer/index.css +0 -4
- 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
|
|
9
|
-
var
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
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
|
-
|
|
107
|
+
CheckoutButton__default.default,
|
|
215
108
|
{
|
|
216
109
|
handleCheckout,
|
|
217
110
|
variant: "primary",
|
|
@@ -1,123 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { observer
|
|
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
|
|
7
|
-
import {
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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 {
|
|
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
|
|
7
|
-
var
|
|
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
|
|
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(
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
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
|
|
3
|
-
import { Dialog, DialogTrigger, Button, DialogContent, DialogHeader, DialogTitle, DialogDescription
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
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(
|
|
101
|
-
/* @__PURE__ */ jsx("div", { className: "text-muted-1 text-xs mt-4", children: /* @__PURE__ */ jsx(
|
|
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
|
|
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 {
|
|
4
|
-
import {
|
|
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
|
}) => {
|