@drawbridge/components 0.0.74 → 0.0.76
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/advertisement.js +130 -92
- package/dist/advertisement.mjs +2 -2
- package/dist/{chunk-W2NXIBPS.mjs → chunk-TFZRXJYH.mjs} +1 -1
- package/dist/chunk-TSVDDA5K.mjs +122 -0
- package/dist/input-group.js +86 -28
- package/dist/input-group.mjs +3 -1
- package/dist/input-name.js +87 -49
- package/dist/input-name.mjs +1 -1
- package/dist/input-phone.js +5 -1
- package/dist/input-phone.mjs +5 -1
- package/dist/product.js +130 -92
- package/dist/product.mjs +2 -2
- package/package.json +1 -1
- package/types/input-group.d.ts +4 -0
- package/dist/chunk-IIP5OKPN.mjs +0 -83
package/dist/advertisement.js
CHANGED
|
@@ -36,11 +36,14 @@ module.exports = __toCommonJS(advertisement_exports);
|
|
|
36
36
|
var import_cdn2 = require("@drawbridge/drawbridge-utils/cdn");
|
|
37
37
|
|
|
38
38
|
// components/product.js
|
|
39
|
-
var
|
|
39
|
+
var import_react5 = require("react");
|
|
40
40
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
41
41
|
var import_cdn = require("@drawbridge/shopify/cdn");
|
|
42
42
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
43
43
|
|
|
44
|
+
// components/input-group.js
|
|
45
|
+
var import_react2 = require("react");
|
|
46
|
+
|
|
44
47
|
// components/input-group-error.js
|
|
45
48
|
var import_react = require("react");
|
|
46
49
|
|
|
@@ -148,17 +151,70 @@ var InputGroupError = ({
|
|
|
148
151
|
};
|
|
149
152
|
var input_group_error_default = InputGroupError;
|
|
150
153
|
|
|
154
|
+
// components/styles.js
|
|
155
|
+
var WHITE = "rgb( 255, 255, 255 )";
|
|
156
|
+
var BLACK = "rgb( 0, 0, 0 )";
|
|
157
|
+
var bgColor = (style) => {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
160
|
+
};
|
|
161
|
+
var textColor = (style) => {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
164
|
+
};
|
|
165
|
+
var DEFAULT_FAMILY = "Roboto Flex";
|
|
166
|
+
var FONT_FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
167
|
+
var toFontFamily = (family) => '"' + (family || DEFAULT_FAMILY) + '", ' + FONT_FALLBACK;
|
|
168
|
+
var toFontWeight = (variant) => {
|
|
169
|
+
var _a;
|
|
170
|
+
if (!variant) return void 0;
|
|
171
|
+
if (variant.includes("italic")) return (_a = variant.match(/^\d+/)) == null ? void 0 : _a[0];
|
|
172
|
+
if (variant.includes("regular")) return "normal";
|
|
173
|
+
return variant;
|
|
174
|
+
};
|
|
175
|
+
var toFontStyle = (variant) => (variant == null ? void 0 : variant.includes("italic")) ? "italic" : void 0;
|
|
176
|
+
var buttonStyle = (style) => {
|
|
177
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
178
|
+
return {
|
|
179
|
+
backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || textColor(style),
|
|
180
|
+
borderColor: ((_f = (_e = (_d = style == null ? void 0 : style.button) == null ? void 0 : _d.background) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb) || textColor(style),
|
|
181
|
+
borderRadius: ((_g = style == null ? void 0 : style.button) == null ? void 0 : _g.radius) != null ? style.button.radius / 4 + "px" : void 0,
|
|
182
|
+
color: ((_j = (_i = (_h = style == null ? void 0 : style.button) == null ? void 0 : _h.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb) || bgColor(style)
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
var headerStyle = (style) => {
|
|
186
|
+
var _a, _b, _c, _d;
|
|
187
|
+
return {
|
|
188
|
+
fontFamily: toFontFamily((_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family),
|
|
189
|
+
fontWeight: toFontWeight((_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight),
|
|
190
|
+
fontStyle: toFontStyle((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.weight),
|
|
191
|
+
textTransform: (_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.transform
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
var inputStyle = (style) => {
|
|
195
|
+
var _a;
|
|
196
|
+
return {
|
|
197
|
+
backgroundColor: bgColor(style),
|
|
198
|
+
borderColor: textColor(style),
|
|
199
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
200
|
+
color: textColor(style)
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
|
|
151
204
|
// components/input-group.js
|
|
152
|
-
var import_jsx_runtime3 = (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
205
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
206
|
+
var Addon = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
207
|
+
"span",
|
|
208
|
+
{
|
|
209
|
+
...{
|
|
210
|
+
className: typeof children === "string" ? "flex items-center shrink-0 px-3 font-mono text-sm opacity-60 whitespace-nowrap select-none" : "flex items-center shrink-0 px-2"
|
|
211
|
+
},
|
|
212
|
+
children
|
|
213
|
+
}
|
|
160
214
|
);
|
|
161
215
|
var InputGroup = ({
|
|
216
|
+
after,
|
|
217
|
+
before,
|
|
162
218
|
className,
|
|
163
219
|
error,
|
|
164
220
|
input,
|
|
@@ -167,6 +223,31 @@ var InputGroup = ({
|
|
|
167
223
|
style = {},
|
|
168
224
|
...rest
|
|
169
225
|
}) => {
|
|
226
|
+
const generated = (0, import_react2.useId)();
|
|
227
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
228
|
+
const named = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
229
|
+
const addons = after != null || before != null;
|
|
230
|
+
const control = addons && (0, import_react2.isValidElement)(named) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
...{
|
|
234
|
+
className: "input flex items-center overflow-hidden",
|
|
235
|
+
style: {
|
|
236
|
+
...inputStyle(style),
|
|
237
|
+
// Inline, not `p-0`: see InputNumber — share's unlayered `.input`
|
|
238
|
+
// padding beats a layered utility, an inline style beats both.
|
|
239
|
+
padding: 0
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
children: [
|
|
243
|
+
before != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: before }),
|
|
244
|
+
(0, import_react2.cloneElement)(named, {
|
|
245
|
+
className: [named.props.className, "!border-0 !rounded-none !ring-0 !shadow-none flex-1 min-w-0"].filter(Boolean).join(" ")
|
|
246
|
+
}),
|
|
247
|
+
after != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: after })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
) : named;
|
|
170
251
|
const classes = [
|
|
171
252
|
"input-group"
|
|
172
253
|
];
|
|
@@ -187,26 +268,33 @@ var InputGroup = ({
|
|
|
187
268
|
}
|
|
188
269
|
},
|
|
189
270
|
children: [
|
|
190
|
-
label ?
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
271
|
+
label ? (
|
|
272
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
273
|
+
// screen readers, clicking the text focuses the control, and
|
|
274
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
275
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
277
|
+
"label",
|
|
278
|
+
{
|
|
279
|
+
...{
|
|
280
|
+
className: "space-y-2 block",
|
|
281
|
+
htmlFor: id
|
|
282
|
+
},
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
285
|
+
"span",
|
|
286
|
+
{
|
|
287
|
+
...{
|
|
288
|
+
className: "block"
|
|
289
|
+
},
|
|
290
|
+
children: label
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
control
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
) : control,
|
|
210
298
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
211
299
|
input_group_error_default,
|
|
212
300
|
{
|
|
@@ -225,7 +313,7 @@ var InputGroup = ({
|
|
|
225
313
|
var input_group_default = InputGroup;
|
|
226
314
|
|
|
227
315
|
// components/input-select.js
|
|
228
|
-
var
|
|
316
|
+
var import_react3 = require("react");
|
|
229
317
|
|
|
230
318
|
// components/icons/chevron-down.js
|
|
231
319
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -253,56 +341,6 @@ var ChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
|
253
341
|
);
|
|
254
342
|
var chevron_down_default = ChevronDown;
|
|
255
343
|
|
|
256
|
-
// components/styles.js
|
|
257
|
-
var WHITE = "rgb( 255, 255, 255 )";
|
|
258
|
-
var BLACK = "rgb( 0, 0, 0 )";
|
|
259
|
-
var bgColor = (style) => {
|
|
260
|
-
var _a, _b;
|
|
261
|
-
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
262
|
-
};
|
|
263
|
-
var textColor = (style) => {
|
|
264
|
-
var _a, _b;
|
|
265
|
-
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
266
|
-
};
|
|
267
|
-
var DEFAULT_FAMILY = "Roboto Flex";
|
|
268
|
-
var FONT_FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
269
|
-
var toFontFamily = (family) => '"' + (family || DEFAULT_FAMILY) + '", ' + FONT_FALLBACK;
|
|
270
|
-
var toFontWeight = (variant) => {
|
|
271
|
-
var _a;
|
|
272
|
-
if (!variant) return void 0;
|
|
273
|
-
if (variant.includes("italic")) return (_a = variant.match(/^\d+/)) == null ? void 0 : _a[0];
|
|
274
|
-
if (variant.includes("regular")) return "normal";
|
|
275
|
-
return variant;
|
|
276
|
-
};
|
|
277
|
-
var toFontStyle = (variant) => (variant == null ? void 0 : variant.includes("italic")) ? "italic" : void 0;
|
|
278
|
-
var buttonStyle = (style) => {
|
|
279
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
280
|
-
return {
|
|
281
|
-
backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || textColor(style),
|
|
282
|
-
borderColor: ((_f = (_e = (_d = style == null ? void 0 : style.button) == null ? void 0 : _d.background) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb) || textColor(style),
|
|
283
|
-
borderRadius: ((_g = style == null ? void 0 : style.button) == null ? void 0 : _g.radius) != null ? style.button.radius / 4 + "px" : void 0,
|
|
284
|
-
color: ((_j = (_i = (_h = style == null ? void 0 : style.button) == null ? void 0 : _h.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb) || bgColor(style)
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
var headerStyle = (style) => {
|
|
288
|
-
var _a, _b, _c, _d;
|
|
289
|
-
return {
|
|
290
|
-
fontFamily: toFontFamily((_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family),
|
|
291
|
-
fontWeight: toFontWeight((_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight),
|
|
292
|
-
fontStyle: toFontStyle((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.weight),
|
|
293
|
-
textTransform: (_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.transform
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
var inputStyle = (style) => {
|
|
297
|
-
var _a;
|
|
298
|
-
return {
|
|
299
|
-
backgroundColor: bgColor(style),
|
|
300
|
-
borderColor: textColor(style),
|
|
301
|
-
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
302
|
-
color: textColor(style)
|
|
303
|
-
};
|
|
304
|
-
};
|
|
305
|
-
|
|
306
344
|
// components/input-select.js
|
|
307
345
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
308
346
|
var InputSelect = ({
|
|
@@ -312,8 +350,8 @@ var InputSelect = ({
|
|
|
312
350
|
value,
|
|
313
351
|
...rest
|
|
314
352
|
}) => {
|
|
315
|
-
const [keyboard, setKeyboard] = (0,
|
|
316
|
-
(0,
|
|
353
|
+
const [keyboard, setKeyboard] = (0, import_react3.useState)(false);
|
|
354
|
+
(0, import_react3.useEffect)(() => {
|
|
317
355
|
const down = (e) => {
|
|
318
356
|
if (e.key === "Tab") setKeyboard(true);
|
|
319
357
|
};
|
|
@@ -391,9 +429,9 @@ var InputSelect = ({
|
|
|
391
429
|
var input_select_default = InputSelect;
|
|
392
430
|
|
|
393
431
|
// components/wrapper-gradient.js
|
|
394
|
-
var
|
|
432
|
+
var import_react4 = require("react");
|
|
395
433
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
396
|
-
var WrapperGradientContext = (0,
|
|
434
|
+
var WrapperGradientContext = (0, import_react4.createContext)(null);
|
|
397
435
|
var WrapperGradient = ({
|
|
398
436
|
children,
|
|
399
437
|
className,
|
|
@@ -451,14 +489,14 @@ var WrapperGradient = ({
|
|
|
451
489
|
left: "linear-gradient( to right, " + color + " 0%, transparent 100% )",
|
|
452
490
|
right: "linear-gradient( to left, " + color + " 0%, transparent 100% )"
|
|
453
491
|
};
|
|
454
|
-
const containerRef = (0,
|
|
455
|
-
const [scroll, setScroll] = (0,
|
|
492
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
493
|
+
const [scroll, setScroll] = (0, import_react4.useState)({
|
|
456
494
|
top: 0,
|
|
457
495
|
left: 0,
|
|
458
496
|
atBottom: true,
|
|
459
497
|
atRight: true
|
|
460
498
|
});
|
|
461
|
-
(0,
|
|
499
|
+
(0, import_react4.useEffect)(
|
|
462
500
|
() => {
|
|
463
501
|
const container = containerRef.current;
|
|
464
502
|
const handleScroll = () => {
|
|
@@ -508,7 +546,7 @@ var WrapperGradient = ({
|
|
|
508
546
|
},
|
|
509
547
|
[horizontal]
|
|
510
548
|
);
|
|
511
|
-
const contextValue = (0,
|
|
549
|
+
const contextValue = (0, import_react4.useMemo)(
|
|
512
550
|
() => ({
|
|
513
551
|
atBottom: scroll.atBottom,
|
|
514
552
|
atRight: scroll.atRight
|
|
@@ -679,14 +717,14 @@ var Product = ({
|
|
|
679
717
|
}
|
|
680
718
|
};
|
|
681
719
|
const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
|
|
682
|
-
const available = (0,
|
|
720
|
+
const available = (0, import_react5.useMemo)(
|
|
683
721
|
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
684
722
|
[product]
|
|
685
723
|
);
|
|
686
|
-
const [activeImage, setActiveImage] = (0,
|
|
724
|
+
const [activeImage, setActiveImage] = (0, import_react5.useState)(0);
|
|
687
725
|
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)();
|
|
688
726
|
const selectedVariant = available.find((v) => v.id === variant) || available[0] || null;
|
|
689
|
-
const images = (0,
|
|
727
|
+
const images = (0, import_react5.useMemo)(
|
|
690
728
|
() => {
|
|
691
729
|
const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
|
|
692
730
|
const result = [];
|
|
@@ -711,7 +749,7 @@ var Product = ({
|
|
|
711
749
|
},
|
|
712
750
|
[product]
|
|
713
751
|
);
|
|
714
|
-
(0,
|
|
752
|
+
(0, import_react5.useEffect)(
|
|
715
753
|
() => {
|
|
716
754
|
if (!emblaApi) return;
|
|
717
755
|
const onSelect = () => {
|
package/dist/advertisement.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
product_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TFZRXJYH.mjs";
|
|
5
5
|
import "./chunk-PT7UR6AO.mjs";
|
|
6
6
|
import "./chunk-7GRIGQDC.mjs";
|
|
7
7
|
import "./chunk-FYA7EAMR.mjs";
|
|
8
8
|
import "./chunk-2ZYGRSSA.mjs";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-TSVDDA5K.mjs";
|
|
10
10
|
import "./chunk-OHJMWJAQ.mjs";
|
|
11
11
|
import "./chunk-Q3UIVGPQ.mjs";
|
|
12
12
|
import {
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
input_group_error_default
|
|
3
|
+
} from "./chunk-OHJMWJAQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
inputStyle
|
|
6
|
+
} from "./chunk-6F23WKP2.mjs";
|
|
7
|
+
|
|
8
|
+
// components/input-group.js
|
|
9
|
+
import { cloneElement, isValidElement, useId } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var Addon = ({ children }) => /* @__PURE__ */ jsx(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
...{
|
|
15
|
+
className: typeof children === "string" ? "flex items-center shrink-0 px-3 font-mono text-sm opacity-60 whitespace-nowrap select-none" : "flex items-center shrink-0 px-2"
|
|
16
|
+
},
|
|
17
|
+
children
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
var InputGroup = ({
|
|
21
|
+
after,
|
|
22
|
+
before,
|
|
23
|
+
className,
|
|
24
|
+
error,
|
|
25
|
+
input,
|
|
26
|
+
label,
|
|
27
|
+
message,
|
|
28
|
+
style = {},
|
|
29
|
+
...rest
|
|
30
|
+
}) => {
|
|
31
|
+
const generated = useId();
|
|
32
|
+
const id = isValidElement(input) ? input.props.id || generated : generated;
|
|
33
|
+
const named = isValidElement(input) && !input.props.id ? cloneElement(input, { id }) : input;
|
|
34
|
+
const addons = after != null || before != null;
|
|
35
|
+
const control = addons && isValidElement(named) ? /* @__PURE__ */ jsxs(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
...{
|
|
39
|
+
className: "input flex items-center overflow-hidden",
|
|
40
|
+
style: {
|
|
41
|
+
...inputStyle(style),
|
|
42
|
+
// Inline, not `p-0`: see InputNumber — share's unlayered `.input`
|
|
43
|
+
// padding beats a layered utility, an inline style beats both.
|
|
44
|
+
padding: 0
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
before != null && /* @__PURE__ */ jsx(Addon, { children: before }),
|
|
49
|
+
cloneElement(named, {
|
|
50
|
+
className: [named.props.className, "!border-0 !rounded-none !ring-0 !shadow-none flex-1 min-w-0"].filter(Boolean).join(" ")
|
|
51
|
+
}),
|
|
52
|
+
after != null && /* @__PURE__ */ jsx(Addon, { children: after })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) : named;
|
|
56
|
+
const classes = [
|
|
57
|
+
"input-group"
|
|
58
|
+
];
|
|
59
|
+
if (className) {
|
|
60
|
+
classes.push(className);
|
|
61
|
+
}
|
|
62
|
+
if (error) {
|
|
63
|
+
classes.push("error");
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
...{
|
|
69
|
+
className: classes.join(" "),
|
|
70
|
+
"aria-live": "polite",
|
|
71
|
+
...(rest == null ? void 0 : rest["data-guide"]) && {
|
|
72
|
+
"data-guide": rest["data-guide"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
label ? (
|
|
77
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
78
|
+
// screen readers, clicking the text focuses the control, and
|
|
79
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
80
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
81
|
+
/* @__PURE__ */ jsxs(
|
|
82
|
+
"label",
|
|
83
|
+
{
|
|
84
|
+
...{
|
|
85
|
+
className: "space-y-2 block",
|
|
86
|
+
htmlFor: id
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
...{
|
|
93
|
+
className: "block"
|
|
94
|
+
},
|
|
95
|
+
children: label
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
control
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
) : control,
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
input_group_error_default,
|
|
105
|
+
{
|
|
106
|
+
...{
|
|
107
|
+
error,
|
|
108
|
+
label,
|
|
109
|
+
message,
|
|
110
|
+
style
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
var input_group_default = InputGroup;
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
input_group_default
|
|
122
|
+
};
|
package/dist/input-group.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -22,6 +23,7 @@ __export(input_group_exports, {
|
|
|
22
23
|
default: () => input_group_default
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(input_group_exports);
|
|
26
|
+
var import_react2 = require("react");
|
|
25
27
|
|
|
26
28
|
// components/input-group-error.js
|
|
27
29
|
var import_react = require("react");
|
|
@@ -130,17 +132,41 @@ var InputGroupError = ({
|
|
|
130
132
|
};
|
|
131
133
|
var input_group_error_default = InputGroupError;
|
|
132
134
|
|
|
135
|
+
// components/styles.js
|
|
136
|
+
var WHITE = "rgb( 255, 255, 255 )";
|
|
137
|
+
var BLACK = "rgb( 0, 0, 0 )";
|
|
138
|
+
var bgColor = (style) => {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
141
|
+
};
|
|
142
|
+
var textColor = (style) => {
|
|
143
|
+
var _a, _b;
|
|
144
|
+
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
145
|
+
};
|
|
146
|
+
var inputStyle = (style) => {
|
|
147
|
+
var _a;
|
|
148
|
+
return {
|
|
149
|
+
backgroundColor: bgColor(style),
|
|
150
|
+
borderColor: textColor(style),
|
|
151
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
152
|
+
color: textColor(style)
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
133
156
|
// components/input-group.js
|
|
134
|
-
var import_jsx_runtime3 = (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
158
|
+
var Addon = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
159
|
+
"span",
|
|
160
|
+
{
|
|
161
|
+
...{
|
|
162
|
+
className: typeof children === "string" ? "flex items-center shrink-0 px-3 font-mono text-sm opacity-60 whitespace-nowrap select-none" : "flex items-center shrink-0 px-2"
|
|
163
|
+
},
|
|
164
|
+
children
|
|
165
|
+
}
|
|
142
166
|
);
|
|
143
167
|
var InputGroup = ({
|
|
168
|
+
after,
|
|
169
|
+
before,
|
|
144
170
|
className,
|
|
145
171
|
error,
|
|
146
172
|
input,
|
|
@@ -149,6 +175,31 @@ var InputGroup = ({
|
|
|
149
175
|
style = {},
|
|
150
176
|
...rest
|
|
151
177
|
}) => {
|
|
178
|
+
const generated = (0, import_react2.useId)();
|
|
179
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
180
|
+
const named = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
181
|
+
const addons = after != null || before != null;
|
|
182
|
+
const control = addons && (0, import_react2.isValidElement)(named) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
...{
|
|
186
|
+
className: "input flex items-center overflow-hidden",
|
|
187
|
+
style: {
|
|
188
|
+
...inputStyle(style),
|
|
189
|
+
// Inline, not `p-0`: see InputNumber — share's unlayered `.input`
|
|
190
|
+
// padding beats a layered utility, an inline style beats both.
|
|
191
|
+
padding: 0
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
children: [
|
|
195
|
+
before != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: before }),
|
|
196
|
+
(0, import_react2.cloneElement)(named, {
|
|
197
|
+
className: [named.props.className, "!border-0 !rounded-none !ring-0 !shadow-none flex-1 min-w-0"].filter(Boolean).join(" ")
|
|
198
|
+
}),
|
|
199
|
+
after != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: after })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
) : named;
|
|
152
203
|
const classes = [
|
|
153
204
|
"input-group"
|
|
154
205
|
];
|
|
@@ -169,26 +220,33 @@ var InputGroup = ({
|
|
|
169
220
|
}
|
|
170
221
|
},
|
|
171
222
|
children: [
|
|
172
|
-
label ?
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
label ? (
|
|
224
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
225
|
+
// screen readers, clicking the text focuses the control, and
|
|
226
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
227
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
229
|
+
"label",
|
|
230
|
+
{
|
|
231
|
+
...{
|
|
232
|
+
className: "space-y-2 block",
|
|
233
|
+
htmlFor: id
|
|
234
|
+
},
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
237
|
+
"span",
|
|
238
|
+
{
|
|
239
|
+
...{
|
|
240
|
+
className: "block"
|
|
241
|
+
},
|
|
242
|
+
children: label
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
control
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
) : control,
|
|
192
250
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
193
251
|
input_group_error_default,
|
|
194
252
|
{
|
package/dist/input-group.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
input_group_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TSVDDA5K.mjs";
|
|
4
5
|
import "./chunk-OHJMWJAQ.mjs";
|
|
5
6
|
import "./chunk-Q3UIVGPQ.mjs";
|
|
7
|
+
import "./chunk-6F23WKP2.mjs";
|
|
6
8
|
export {
|
|
7
9
|
input_group_default as default
|
|
8
10
|
};
|
package/dist/input-name.js
CHANGED
|
@@ -23,6 +23,9 @@ __export(input_name_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(input_name_exports);
|
|
25
25
|
|
|
26
|
+
// components/input-group.js
|
|
27
|
+
var import_react2 = require("react");
|
|
28
|
+
|
|
26
29
|
// components/input-group-error.js
|
|
27
30
|
var import_react = require("react");
|
|
28
31
|
|
|
@@ -130,17 +133,41 @@ var InputGroupError = ({
|
|
|
130
133
|
};
|
|
131
134
|
var input_group_error_default = InputGroupError;
|
|
132
135
|
|
|
136
|
+
// components/styles.js
|
|
137
|
+
var WHITE = "rgb( 255, 255, 255 )";
|
|
138
|
+
var BLACK = "rgb( 0, 0, 0 )";
|
|
139
|
+
var bgColor = (style) => {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
142
|
+
};
|
|
143
|
+
var textColor = (style) => {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
146
|
+
};
|
|
147
|
+
var inputStyle = (style) => {
|
|
148
|
+
var _a;
|
|
149
|
+
return {
|
|
150
|
+
backgroundColor: bgColor(style),
|
|
151
|
+
borderColor: textColor(style),
|
|
152
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
153
|
+
color: textColor(style)
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
133
157
|
// components/input-group.js
|
|
134
|
-
var import_jsx_runtime3 = (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
159
|
+
var Addon = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
...{
|
|
163
|
+
className: typeof children === "string" ? "flex items-center shrink-0 px-3 font-mono text-sm opacity-60 whitespace-nowrap select-none" : "flex items-center shrink-0 px-2"
|
|
164
|
+
},
|
|
165
|
+
children
|
|
166
|
+
}
|
|
142
167
|
);
|
|
143
168
|
var InputGroup = ({
|
|
169
|
+
after,
|
|
170
|
+
before,
|
|
144
171
|
className,
|
|
145
172
|
error,
|
|
146
173
|
input,
|
|
@@ -149,6 +176,31 @@ var InputGroup = ({
|
|
|
149
176
|
style = {},
|
|
150
177
|
...rest
|
|
151
178
|
}) => {
|
|
179
|
+
const generated = (0, import_react2.useId)();
|
|
180
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
181
|
+
const named = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
182
|
+
const addons = after != null || before != null;
|
|
183
|
+
const control = addons && (0, import_react2.isValidElement)(named) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
...{
|
|
187
|
+
className: "input flex items-center overflow-hidden",
|
|
188
|
+
style: {
|
|
189
|
+
...inputStyle(style),
|
|
190
|
+
// Inline, not `p-0`: see InputNumber — share's unlayered `.input`
|
|
191
|
+
// padding beats a layered utility, an inline style beats both.
|
|
192
|
+
padding: 0
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
before != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: before }),
|
|
197
|
+
(0, import_react2.cloneElement)(named, {
|
|
198
|
+
className: [named.props.className, "!border-0 !rounded-none !ring-0 !shadow-none flex-1 min-w-0"].filter(Boolean).join(" ")
|
|
199
|
+
}),
|
|
200
|
+
after != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: after })
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
) : named;
|
|
152
204
|
const classes = [
|
|
153
205
|
"input-group"
|
|
154
206
|
];
|
|
@@ -169,26 +221,33 @@ var InputGroup = ({
|
|
|
169
221
|
}
|
|
170
222
|
},
|
|
171
223
|
children: [
|
|
172
|
-
label ?
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
224
|
+
label ? (
|
|
225
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
226
|
+
// screen readers, clicking the text focuses the control, and
|
|
227
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
228
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
230
|
+
"label",
|
|
231
|
+
{
|
|
232
|
+
...{
|
|
233
|
+
className: "space-y-2 block",
|
|
234
|
+
htmlFor: id
|
|
235
|
+
},
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
238
|
+
"span",
|
|
239
|
+
{
|
|
240
|
+
...{
|
|
241
|
+
className: "block"
|
|
242
|
+
},
|
|
243
|
+
children: label
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
control
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
) : control,
|
|
192
251
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
193
252
|
input_group_error_default,
|
|
194
253
|
{
|
|
@@ -206,27 +265,6 @@ var InputGroup = ({
|
|
|
206
265
|
};
|
|
207
266
|
var input_group_default = InputGroup;
|
|
208
267
|
|
|
209
|
-
// components/styles.js
|
|
210
|
-
var WHITE = "rgb( 255, 255, 255 )";
|
|
211
|
-
var BLACK = "rgb( 0, 0, 0 )";
|
|
212
|
-
var bgColor = (style) => {
|
|
213
|
-
var _a, _b;
|
|
214
|
-
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
215
|
-
};
|
|
216
|
-
var textColor = (style) => {
|
|
217
|
-
var _a, _b;
|
|
218
|
-
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
219
|
-
};
|
|
220
|
-
var inputStyle = (style) => {
|
|
221
|
-
var _a;
|
|
222
|
-
return {
|
|
223
|
-
backgroundColor: bgColor(style),
|
|
224
|
-
borderColor: textColor(style),
|
|
225
|
-
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
226
|
-
color: textColor(style)
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
|
|
230
268
|
// components/input-text.js
|
|
231
269
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
232
270
|
var InputText = ({
|
package/dist/input-name.mjs
CHANGED
package/dist/input-phone.js
CHANGED
|
@@ -96,7 +96,10 @@ var InputPhone = ({
|
|
|
96
96
|
countries = [],
|
|
97
97
|
onChange,
|
|
98
98
|
style,
|
|
99
|
-
value = {}
|
|
99
|
+
value = {},
|
|
100
|
+
// Reaches the number field, not the country select. InputGroup names its
|
|
101
|
+
// control by id, and the number is the field the label means.
|
|
102
|
+
...rest
|
|
100
103
|
}) => {
|
|
101
104
|
var _a, _b;
|
|
102
105
|
const [country, setCountry] = (0, import_react.useState)((value == null ? void 0 : value.country) || (countries == null ? void 0 : countries[0]));
|
|
@@ -225,6 +228,7 @@ var InputPhone = ({
|
|
|
225
228
|
import_input.default,
|
|
226
229
|
{
|
|
227
230
|
...{
|
|
231
|
+
...rest,
|
|
228
232
|
"aria-label": "Phone Number",
|
|
229
233
|
className: "input w-full border-none focus:outline-none focus:ring-0 focus:border-inherit",
|
|
230
234
|
onChange: (val) => {
|
package/dist/input-phone.mjs
CHANGED
|
@@ -19,7 +19,10 @@ var InputPhone = ({
|
|
|
19
19
|
countries = [],
|
|
20
20
|
onChange,
|
|
21
21
|
style,
|
|
22
|
-
value = {}
|
|
22
|
+
value = {},
|
|
23
|
+
// Reaches the number field, not the country select. InputGroup names its
|
|
24
|
+
// control by id, and the number is the field the label means.
|
|
25
|
+
...rest
|
|
23
26
|
}) => {
|
|
24
27
|
var _a, _b;
|
|
25
28
|
const [country, setCountry] = useState((value == null ? void 0 : value.country) || (countries == null ? void 0 : countries[0]));
|
|
@@ -148,6 +151,7 @@ var InputPhone = ({
|
|
|
148
151
|
Input,
|
|
149
152
|
{
|
|
150
153
|
...{
|
|
154
|
+
...rest,
|
|
151
155
|
"aria-label": "Phone Number",
|
|
152
156
|
className: "input w-full border-none focus:outline-none focus:ring-0 focus:border-inherit",
|
|
153
157
|
onChange: (val) => {
|
package/dist/product.js
CHANGED
|
@@ -33,11 +33,14 @@ __export(product_exports, {
|
|
|
33
33
|
default: () => product_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(product_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_react5 = require("react");
|
|
37
37
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
38
38
|
var import_cdn = require("@drawbridge/shopify/cdn");
|
|
39
39
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
40
40
|
|
|
41
|
+
// components/input-group.js
|
|
42
|
+
var import_react2 = require("react");
|
|
43
|
+
|
|
41
44
|
// components/input-group-error.js
|
|
42
45
|
var import_react = require("react");
|
|
43
46
|
|
|
@@ -145,17 +148,70 @@ var InputGroupError = ({
|
|
|
145
148
|
};
|
|
146
149
|
var input_group_error_default = InputGroupError;
|
|
147
150
|
|
|
151
|
+
// components/styles.js
|
|
152
|
+
var WHITE = "rgb( 255, 255, 255 )";
|
|
153
|
+
var BLACK = "rgb( 0, 0, 0 )";
|
|
154
|
+
var bgColor = (style) => {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
157
|
+
};
|
|
158
|
+
var textColor = (style) => {
|
|
159
|
+
var _a, _b;
|
|
160
|
+
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
161
|
+
};
|
|
162
|
+
var DEFAULT_FAMILY = "Roboto Flex";
|
|
163
|
+
var FONT_FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
164
|
+
var toFontFamily = (family) => '"' + (family || DEFAULT_FAMILY) + '", ' + FONT_FALLBACK;
|
|
165
|
+
var toFontWeight = (variant) => {
|
|
166
|
+
var _a;
|
|
167
|
+
if (!variant) return void 0;
|
|
168
|
+
if (variant.includes("italic")) return (_a = variant.match(/^\d+/)) == null ? void 0 : _a[0];
|
|
169
|
+
if (variant.includes("regular")) return "normal";
|
|
170
|
+
return variant;
|
|
171
|
+
};
|
|
172
|
+
var toFontStyle = (variant) => (variant == null ? void 0 : variant.includes("italic")) ? "italic" : void 0;
|
|
173
|
+
var buttonStyle = (style) => {
|
|
174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
175
|
+
return {
|
|
176
|
+
backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || textColor(style),
|
|
177
|
+
borderColor: ((_f = (_e = (_d = style == null ? void 0 : style.button) == null ? void 0 : _d.background) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb) || textColor(style),
|
|
178
|
+
borderRadius: ((_g = style == null ? void 0 : style.button) == null ? void 0 : _g.radius) != null ? style.button.radius / 4 + "px" : void 0,
|
|
179
|
+
color: ((_j = (_i = (_h = style == null ? void 0 : style.button) == null ? void 0 : _h.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb) || bgColor(style)
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
var headerStyle = (style) => {
|
|
183
|
+
var _a, _b, _c, _d;
|
|
184
|
+
return {
|
|
185
|
+
fontFamily: toFontFamily((_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family),
|
|
186
|
+
fontWeight: toFontWeight((_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight),
|
|
187
|
+
fontStyle: toFontStyle((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.weight),
|
|
188
|
+
textTransform: (_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.transform
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
var inputStyle = (style) => {
|
|
192
|
+
var _a;
|
|
193
|
+
return {
|
|
194
|
+
backgroundColor: bgColor(style),
|
|
195
|
+
borderColor: textColor(style),
|
|
196
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
197
|
+
color: textColor(style)
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
148
201
|
// components/input-group.js
|
|
149
|
-
var import_jsx_runtime3 = (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
202
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
203
|
+
var Addon = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
...{
|
|
207
|
+
className: typeof children === "string" ? "flex items-center shrink-0 px-3 font-mono text-sm opacity-60 whitespace-nowrap select-none" : "flex items-center shrink-0 px-2"
|
|
208
|
+
},
|
|
209
|
+
children
|
|
210
|
+
}
|
|
157
211
|
);
|
|
158
212
|
var InputGroup = ({
|
|
213
|
+
after,
|
|
214
|
+
before,
|
|
159
215
|
className,
|
|
160
216
|
error,
|
|
161
217
|
input,
|
|
@@ -164,6 +220,31 @@ var InputGroup = ({
|
|
|
164
220
|
style = {},
|
|
165
221
|
...rest
|
|
166
222
|
}) => {
|
|
223
|
+
const generated = (0, import_react2.useId)();
|
|
224
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
225
|
+
const named = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
226
|
+
const addons = after != null || before != null;
|
|
227
|
+
const control = addons && (0, import_react2.isValidElement)(named) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
...{
|
|
231
|
+
className: "input flex items-center overflow-hidden",
|
|
232
|
+
style: {
|
|
233
|
+
...inputStyle(style),
|
|
234
|
+
// Inline, not `p-0`: see InputNumber — share's unlayered `.input`
|
|
235
|
+
// padding beats a layered utility, an inline style beats both.
|
|
236
|
+
padding: 0
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
children: [
|
|
240
|
+
before != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: before }),
|
|
241
|
+
(0, import_react2.cloneElement)(named, {
|
|
242
|
+
className: [named.props.className, "!border-0 !rounded-none !ring-0 !shadow-none flex-1 min-w-0"].filter(Boolean).join(" ")
|
|
243
|
+
}),
|
|
244
|
+
after != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Addon, { children: after })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
) : named;
|
|
167
248
|
const classes = [
|
|
168
249
|
"input-group"
|
|
169
250
|
];
|
|
@@ -184,26 +265,33 @@ var InputGroup = ({
|
|
|
184
265
|
}
|
|
185
266
|
},
|
|
186
267
|
children: [
|
|
187
|
-
label ?
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
268
|
+
label ? (
|
|
269
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
270
|
+
// screen readers, clicking the text focuses the control, and
|
|
271
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
272
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
273
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
274
|
+
"label",
|
|
275
|
+
{
|
|
276
|
+
...{
|
|
277
|
+
className: "space-y-2 block",
|
|
278
|
+
htmlFor: id
|
|
279
|
+
},
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
282
|
+
"span",
|
|
283
|
+
{
|
|
284
|
+
...{
|
|
285
|
+
className: "block"
|
|
286
|
+
},
|
|
287
|
+
children: label
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
control
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
) : control,
|
|
207
295
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
208
296
|
input_group_error_default,
|
|
209
297
|
{
|
|
@@ -222,7 +310,7 @@ var InputGroup = ({
|
|
|
222
310
|
var input_group_default = InputGroup;
|
|
223
311
|
|
|
224
312
|
// components/input-select.js
|
|
225
|
-
var
|
|
313
|
+
var import_react3 = require("react");
|
|
226
314
|
|
|
227
315
|
// components/icons/chevron-down.js
|
|
228
316
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -250,56 +338,6 @@ var ChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
|
250
338
|
);
|
|
251
339
|
var chevron_down_default = ChevronDown;
|
|
252
340
|
|
|
253
|
-
// components/styles.js
|
|
254
|
-
var WHITE = "rgb( 255, 255, 255 )";
|
|
255
|
-
var BLACK = "rgb( 0, 0, 0 )";
|
|
256
|
-
var bgColor = (style) => {
|
|
257
|
-
var _a, _b;
|
|
258
|
-
return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
|
|
259
|
-
};
|
|
260
|
-
var textColor = (style) => {
|
|
261
|
-
var _a, _b;
|
|
262
|
-
return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
|
|
263
|
-
};
|
|
264
|
-
var DEFAULT_FAMILY = "Roboto Flex";
|
|
265
|
-
var FONT_FALLBACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
|
|
266
|
-
var toFontFamily = (family) => '"' + (family || DEFAULT_FAMILY) + '", ' + FONT_FALLBACK;
|
|
267
|
-
var toFontWeight = (variant) => {
|
|
268
|
-
var _a;
|
|
269
|
-
if (!variant) return void 0;
|
|
270
|
-
if (variant.includes("italic")) return (_a = variant.match(/^\d+/)) == null ? void 0 : _a[0];
|
|
271
|
-
if (variant.includes("regular")) return "normal";
|
|
272
|
-
return variant;
|
|
273
|
-
};
|
|
274
|
-
var toFontStyle = (variant) => (variant == null ? void 0 : variant.includes("italic")) ? "italic" : void 0;
|
|
275
|
-
var buttonStyle = (style) => {
|
|
276
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
277
|
-
return {
|
|
278
|
-
backgroundColor: ((_c = (_b = (_a = style == null ? void 0 : style.button) == null ? void 0 : _a.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) || textColor(style),
|
|
279
|
-
borderColor: ((_f = (_e = (_d = style == null ? void 0 : style.button) == null ? void 0 : _d.background) == null ? void 0 : _e.color) == null ? void 0 : _f.rgb) || textColor(style),
|
|
280
|
-
borderRadius: ((_g = style == null ? void 0 : style.button) == null ? void 0 : _g.radius) != null ? style.button.radius / 4 + "px" : void 0,
|
|
281
|
-
color: ((_j = (_i = (_h = style == null ? void 0 : style.button) == null ? void 0 : _h.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb) || bgColor(style)
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
var headerStyle = (style) => {
|
|
285
|
-
var _a, _b, _c, _d;
|
|
286
|
-
return {
|
|
287
|
-
fontFamily: toFontFamily((_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family),
|
|
288
|
-
fontWeight: toFontWeight((_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight),
|
|
289
|
-
fontStyle: toFontStyle((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.weight),
|
|
290
|
-
textTransform: (_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.transform
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
var inputStyle = (style) => {
|
|
294
|
-
var _a;
|
|
295
|
-
return {
|
|
296
|
-
backgroundColor: bgColor(style),
|
|
297
|
-
borderColor: textColor(style),
|
|
298
|
-
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
|
|
299
|
-
color: textColor(style)
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
|
|
303
341
|
// components/input-select.js
|
|
304
342
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
305
343
|
var InputSelect = ({
|
|
@@ -309,8 +347,8 @@ var InputSelect = ({
|
|
|
309
347
|
value,
|
|
310
348
|
...rest
|
|
311
349
|
}) => {
|
|
312
|
-
const [keyboard, setKeyboard] = (0,
|
|
313
|
-
(0,
|
|
350
|
+
const [keyboard, setKeyboard] = (0, import_react3.useState)(false);
|
|
351
|
+
(0, import_react3.useEffect)(() => {
|
|
314
352
|
const down = (e) => {
|
|
315
353
|
if (e.key === "Tab") setKeyboard(true);
|
|
316
354
|
};
|
|
@@ -388,9 +426,9 @@ var InputSelect = ({
|
|
|
388
426
|
var input_select_default = InputSelect;
|
|
389
427
|
|
|
390
428
|
// components/wrapper-gradient.js
|
|
391
|
-
var
|
|
429
|
+
var import_react4 = require("react");
|
|
392
430
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
393
|
-
var WrapperGradientContext = (0,
|
|
431
|
+
var WrapperGradientContext = (0, import_react4.createContext)(null);
|
|
394
432
|
var WrapperGradient = ({
|
|
395
433
|
children,
|
|
396
434
|
className,
|
|
@@ -448,14 +486,14 @@ var WrapperGradient = ({
|
|
|
448
486
|
left: "linear-gradient( to right, " + color + " 0%, transparent 100% )",
|
|
449
487
|
right: "linear-gradient( to left, " + color + " 0%, transparent 100% )"
|
|
450
488
|
};
|
|
451
|
-
const containerRef = (0,
|
|
452
|
-
const [scroll, setScroll] = (0,
|
|
489
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
490
|
+
const [scroll, setScroll] = (0, import_react4.useState)({
|
|
453
491
|
top: 0,
|
|
454
492
|
left: 0,
|
|
455
493
|
atBottom: true,
|
|
456
494
|
atRight: true
|
|
457
495
|
});
|
|
458
|
-
(0,
|
|
496
|
+
(0, import_react4.useEffect)(
|
|
459
497
|
() => {
|
|
460
498
|
const container = containerRef.current;
|
|
461
499
|
const handleScroll = () => {
|
|
@@ -505,7 +543,7 @@ var WrapperGradient = ({
|
|
|
505
543
|
},
|
|
506
544
|
[horizontal]
|
|
507
545
|
);
|
|
508
|
-
const contextValue = (0,
|
|
546
|
+
const contextValue = (0, import_react4.useMemo)(
|
|
509
547
|
() => ({
|
|
510
548
|
atBottom: scroll.atBottom,
|
|
511
549
|
atRight: scroll.atRight
|
|
@@ -676,14 +714,14 @@ var Product = ({
|
|
|
676
714
|
}
|
|
677
715
|
};
|
|
678
716
|
const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
|
|
679
|
-
const available = (0,
|
|
717
|
+
const available = (0, import_react5.useMemo)(
|
|
680
718
|
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
681
719
|
[product]
|
|
682
720
|
);
|
|
683
|
-
const [activeImage, setActiveImage] = (0,
|
|
721
|
+
const [activeImage, setActiveImage] = (0, import_react5.useState)(0);
|
|
684
722
|
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)();
|
|
685
723
|
const selectedVariant = available.find((v) => v.id === variant) || available[0] || null;
|
|
686
|
-
const images = (0,
|
|
724
|
+
const images = (0, import_react5.useMemo)(
|
|
687
725
|
() => {
|
|
688
726
|
const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
|
|
689
727
|
const result = [];
|
|
@@ -708,7 +746,7 @@ var Product = ({
|
|
|
708
746
|
},
|
|
709
747
|
[product]
|
|
710
748
|
);
|
|
711
|
-
(0,
|
|
749
|
+
(0, import_react5.useEffect)(
|
|
712
750
|
() => {
|
|
713
751
|
if (!emblaApi) return;
|
|
714
752
|
const onSelect = () => {
|
package/dist/product.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
product_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TFZRXJYH.mjs";
|
|
5
5
|
import "./chunk-PT7UR6AO.mjs";
|
|
6
6
|
import "./chunk-7GRIGQDC.mjs";
|
|
7
7
|
import "./chunk-FYA7EAMR.mjs";
|
|
8
8
|
import "./chunk-2ZYGRSSA.mjs";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-TSVDDA5K.mjs";
|
|
10
10
|
import "./chunk-OHJMWJAQ.mjs";
|
|
11
11
|
import "./chunk-Q3UIVGPQ.mjs";
|
|
12
12
|
import "./chunk-6F23WKP2.mjs";
|
package/package.json
CHANGED
package/types/input-group.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import { BrandStyle } from './styles';
|
|
3
3
|
|
|
4
4
|
export interface InputGroupProps {
|
|
5
|
+
/** Rendered inside the field's border after the control: a string reads as a fixed half of the value, a node renders as given. */
|
|
6
|
+
after?: ReactNode;
|
|
7
|
+
/** Rendered inside the field's border before the control. */
|
|
8
|
+
before?: ReactNode;
|
|
5
9
|
className?: string;
|
|
6
10
|
error?: ReactNode;
|
|
7
11
|
input?: ReactNode;
|
package/dist/chunk-IIP5OKPN.mjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
input_group_error_default
|
|
3
|
-
} from "./chunk-OHJMWJAQ.mjs";
|
|
4
|
-
|
|
5
|
-
// components/input-group.js
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
var InputGroup = ({
|
|
8
|
-
className,
|
|
9
|
-
error,
|
|
10
|
-
input,
|
|
11
|
-
label,
|
|
12
|
-
message,
|
|
13
|
-
style = {},
|
|
14
|
-
...rest
|
|
15
|
-
}) => {
|
|
16
|
-
const classes = [
|
|
17
|
-
"input-group"
|
|
18
|
-
];
|
|
19
|
-
if (className) {
|
|
20
|
-
classes.push(className);
|
|
21
|
-
}
|
|
22
|
-
if (error) {
|
|
23
|
-
classes.push("error");
|
|
24
|
-
}
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
...{
|
|
29
|
-
className: classes.join(" "),
|
|
30
|
-
"aria-live": "polite",
|
|
31
|
-
...(rest == null ? void 0 : rest["data-guide"]) && {
|
|
32
|
-
"data-guide": rest["data-guide"]
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
children: [
|
|
36
|
-
label ? (
|
|
37
|
-
// A real <label> wrapping the control (not a bare <span>) so the label
|
|
38
|
-
// is programmatically associated with the input — screen readers
|
|
39
|
-
// announce the field name, clicking the text focuses the input, and
|
|
40
|
-
// getByLabel()/role queries can find it. Wrapping gives the association
|
|
41
|
-
// implicitly, so it works for any control passed via `input` without
|
|
42
|
-
// having to thread an id through every input component.
|
|
43
|
-
/* @__PURE__ */ jsxs(
|
|
44
|
-
"label",
|
|
45
|
-
{
|
|
46
|
-
...{
|
|
47
|
-
className: "space-y-2 block"
|
|
48
|
-
},
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx(
|
|
51
|
-
"span",
|
|
52
|
-
{
|
|
53
|
-
...{
|
|
54
|
-
className: "block"
|
|
55
|
-
},
|
|
56
|
-
children: label
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
input
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
) : input,
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
input_group_error_default,
|
|
66
|
-
{
|
|
67
|
-
...{
|
|
68
|
-
error,
|
|
69
|
-
label,
|
|
70
|
-
message,
|
|
71
|
-
style
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
var input_group_default = InputGroup;
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
input_group_default
|
|
83
|
-
};
|