@drawbridge/components 0.0.73 → 0.0.75
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 +28 -23
- package/dist/advertisement.mjs +2 -2
- package/dist/{chunk-IIP5OKPN.mjs → chunk-MKBY26H7.mjs} +12 -9
- package/dist/{chunk-W2NXIBPS.mjs → chunk-PURM4QR2.mjs} +1 -1
- package/dist/input-group.js +13 -9
- package/dist/input-group.mjs +2 -1
- package/dist/input-name.js +14 -9
- package/dist/input-name.mjs +1 -1
- package/dist/input-number.js +11 -1
- package/dist/input-number.mjs +11 -1
- package/dist/input-phone.js +5 -1
- package/dist/input-phone.mjs +5 -1
- package/dist/product.js +28 -23
- package/dist/product.mjs +2 -2
- package/package.json +2 -2
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
|
|
|
@@ -150,12 +153,10 @@ var input_group_error_default = InputGroupError;
|
|
|
150
153
|
|
|
151
154
|
// components/input-group.js
|
|
152
155
|
var import_jsx_runtime3 = (
|
|
153
|
-
// A real <label>
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
// implicitly, so it works for any control passed via `input` without
|
|
158
|
-
// having to thread an id through every input component.
|
|
156
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
157
|
+
// screen readers, clicking the text focuses the control, and
|
|
158
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
159
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
159
160
|
require("react/jsx-runtime")
|
|
160
161
|
);
|
|
161
162
|
var InputGroup = ({
|
|
@@ -167,6 +168,9 @@ var InputGroup = ({
|
|
|
167
168
|
style = {},
|
|
168
169
|
...rest
|
|
169
170
|
}) => {
|
|
171
|
+
const generated = (0, import_react2.useId)();
|
|
172
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
173
|
+
const control = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
170
174
|
const classes = [
|
|
171
175
|
"input-group"
|
|
172
176
|
];
|
|
@@ -191,7 +195,8 @@ var InputGroup = ({
|
|
|
191
195
|
"label",
|
|
192
196
|
{
|
|
193
197
|
...{
|
|
194
|
-
className: "space-y-2 block"
|
|
198
|
+
className: "space-y-2 block",
|
|
199
|
+
htmlFor: id
|
|
195
200
|
},
|
|
196
201
|
children: [
|
|
197
202
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -203,10 +208,10 @@ var InputGroup = ({
|
|
|
203
208
|
children: label
|
|
204
209
|
}
|
|
205
210
|
),
|
|
206
|
-
|
|
211
|
+
control
|
|
207
212
|
]
|
|
208
213
|
}
|
|
209
|
-
) :
|
|
214
|
+
) : control,
|
|
210
215
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
211
216
|
input_group_error_default,
|
|
212
217
|
{
|
|
@@ -225,7 +230,7 @@ var InputGroup = ({
|
|
|
225
230
|
var input_group_default = InputGroup;
|
|
226
231
|
|
|
227
232
|
// components/input-select.js
|
|
228
|
-
var
|
|
233
|
+
var import_react3 = require("react");
|
|
229
234
|
|
|
230
235
|
// components/icons/chevron-down.js
|
|
231
236
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -312,8 +317,8 @@ var InputSelect = ({
|
|
|
312
317
|
value,
|
|
313
318
|
...rest
|
|
314
319
|
}) => {
|
|
315
|
-
const [keyboard, setKeyboard] = (0,
|
|
316
|
-
(0,
|
|
320
|
+
const [keyboard, setKeyboard] = (0, import_react3.useState)(false);
|
|
321
|
+
(0, import_react3.useEffect)(() => {
|
|
317
322
|
const down = (e) => {
|
|
318
323
|
if (e.key === "Tab") setKeyboard(true);
|
|
319
324
|
};
|
|
@@ -391,9 +396,9 @@ var InputSelect = ({
|
|
|
391
396
|
var input_select_default = InputSelect;
|
|
392
397
|
|
|
393
398
|
// components/wrapper-gradient.js
|
|
394
|
-
var
|
|
399
|
+
var import_react4 = require("react");
|
|
395
400
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
396
|
-
var WrapperGradientContext = (0,
|
|
401
|
+
var WrapperGradientContext = (0, import_react4.createContext)(null);
|
|
397
402
|
var WrapperGradient = ({
|
|
398
403
|
children,
|
|
399
404
|
className,
|
|
@@ -451,14 +456,14 @@ var WrapperGradient = ({
|
|
|
451
456
|
left: "linear-gradient( to right, " + color + " 0%, transparent 100% )",
|
|
452
457
|
right: "linear-gradient( to left, " + color + " 0%, transparent 100% )"
|
|
453
458
|
};
|
|
454
|
-
const containerRef = (0,
|
|
455
|
-
const [scroll, setScroll] = (0,
|
|
459
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
460
|
+
const [scroll, setScroll] = (0, import_react4.useState)({
|
|
456
461
|
top: 0,
|
|
457
462
|
left: 0,
|
|
458
463
|
atBottom: true,
|
|
459
464
|
atRight: true
|
|
460
465
|
});
|
|
461
|
-
(0,
|
|
466
|
+
(0, import_react4.useEffect)(
|
|
462
467
|
() => {
|
|
463
468
|
const container = containerRef.current;
|
|
464
469
|
const handleScroll = () => {
|
|
@@ -508,7 +513,7 @@ var WrapperGradient = ({
|
|
|
508
513
|
},
|
|
509
514
|
[horizontal]
|
|
510
515
|
);
|
|
511
|
-
const contextValue = (0,
|
|
516
|
+
const contextValue = (0, import_react4.useMemo)(
|
|
512
517
|
() => ({
|
|
513
518
|
atBottom: scroll.atBottom,
|
|
514
519
|
atRight: scroll.atRight
|
|
@@ -679,14 +684,14 @@ var Product = ({
|
|
|
679
684
|
}
|
|
680
685
|
};
|
|
681
686
|
const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
|
|
682
|
-
const available = (0,
|
|
687
|
+
const available = (0, import_react5.useMemo)(
|
|
683
688
|
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
684
689
|
[product]
|
|
685
690
|
);
|
|
686
|
-
const [activeImage, setActiveImage] = (0,
|
|
691
|
+
const [activeImage, setActiveImage] = (0, import_react5.useState)(0);
|
|
687
692
|
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)();
|
|
688
693
|
const selectedVariant = available.find((v) => v.id === variant) || available[0] || null;
|
|
689
|
-
const images = (0,
|
|
694
|
+
const images = (0, import_react5.useMemo)(
|
|
690
695
|
() => {
|
|
691
696
|
const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
|
|
692
697
|
const result = [];
|
|
@@ -711,7 +716,7 @@ var Product = ({
|
|
|
711
716
|
},
|
|
712
717
|
[product]
|
|
713
718
|
);
|
|
714
|
-
(0,
|
|
719
|
+
(0, import_react5.useEffect)(
|
|
715
720
|
() => {
|
|
716
721
|
if (!emblaApi) return;
|
|
717
722
|
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-PURM4QR2.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-MKBY26H7.mjs";
|
|
10
10
|
import "./chunk-OHJMWJAQ.mjs";
|
|
11
11
|
import "./chunk-Q3UIVGPQ.mjs";
|
|
12
12
|
import {
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-OHJMWJAQ.mjs";
|
|
4
4
|
|
|
5
5
|
// components/input-group.js
|
|
6
|
+
import { cloneElement, isValidElement, useId } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
var InputGroup = ({
|
|
8
9
|
className,
|
|
@@ -13,6 +14,9 @@ var InputGroup = ({
|
|
|
13
14
|
style = {},
|
|
14
15
|
...rest
|
|
15
16
|
}) => {
|
|
17
|
+
const generated = useId();
|
|
18
|
+
const id = isValidElement(input) ? input.props.id || generated : generated;
|
|
19
|
+
const control = isValidElement(input) && !input.props.id ? cloneElement(input, { id }) : input;
|
|
16
20
|
const classes = [
|
|
17
21
|
"input-group"
|
|
18
22
|
];
|
|
@@ -34,17 +38,16 @@ var InputGroup = ({
|
|
|
34
38
|
},
|
|
35
39
|
children: [
|
|
36
40
|
label ? (
|
|
37
|
-
// A real <label>
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// implicitly, so it works for any control passed via `input` without
|
|
42
|
-
// having to thread an id through every input component.
|
|
41
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
42
|
+
// screen readers, clicking the text focuses the control, and
|
|
43
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
44
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
43
45
|
/* @__PURE__ */ jsxs(
|
|
44
46
|
"label",
|
|
45
47
|
{
|
|
46
48
|
...{
|
|
47
|
-
className: "space-y-2 block"
|
|
49
|
+
className: "space-y-2 block",
|
|
50
|
+
htmlFor: id
|
|
48
51
|
},
|
|
49
52
|
children: [
|
|
50
53
|
/* @__PURE__ */ jsx(
|
|
@@ -56,11 +59,11 @@ var InputGroup = ({
|
|
|
56
59
|
children: label
|
|
57
60
|
}
|
|
58
61
|
),
|
|
59
|
-
|
|
62
|
+
control
|
|
60
63
|
]
|
|
61
64
|
}
|
|
62
65
|
)
|
|
63
|
-
) :
|
|
66
|
+
) : control,
|
|
64
67
|
/* @__PURE__ */ jsx(
|
|
65
68
|
input_group_error_default,
|
|
66
69
|
{
|
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");
|
|
@@ -132,12 +134,10 @@ var input_group_error_default = InputGroupError;
|
|
|
132
134
|
|
|
133
135
|
// components/input-group.js
|
|
134
136
|
var import_jsx_runtime3 = (
|
|
135
|
-
// A real <label>
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
// implicitly, so it works for any control passed via `input` without
|
|
140
|
-
// having to thread an id through every input component.
|
|
137
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
138
|
+
// screen readers, clicking the text focuses the control, and
|
|
139
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
140
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
141
141
|
require("react/jsx-runtime")
|
|
142
142
|
);
|
|
143
143
|
var InputGroup = ({
|
|
@@ -149,6 +149,9 @@ var InputGroup = ({
|
|
|
149
149
|
style = {},
|
|
150
150
|
...rest
|
|
151
151
|
}) => {
|
|
152
|
+
const generated = (0, import_react2.useId)();
|
|
153
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
154
|
+
const control = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
152
155
|
const classes = [
|
|
153
156
|
"input-group"
|
|
154
157
|
];
|
|
@@ -173,7 +176,8 @@ var InputGroup = ({
|
|
|
173
176
|
"label",
|
|
174
177
|
{
|
|
175
178
|
...{
|
|
176
|
-
className: "space-y-2 block"
|
|
179
|
+
className: "space-y-2 block",
|
|
180
|
+
htmlFor: id
|
|
177
181
|
},
|
|
178
182
|
children: [
|
|
179
183
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -185,10 +189,10 @@ var InputGroup = ({
|
|
|
185
189
|
children: label
|
|
186
190
|
}
|
|
187
191
|
),
|
|
188
|
-
|
|
192
|
+
control
|
|
189
193
|
]
|
|
190
194
|
}
|
|
191
|
-
) :
|
|
195
|
+
) : control,
|
|
192
196
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
193
197
|
input_group_error_default,
|
|
194
198
|
{
|
package/dist/input-group.mjs
CHANGED
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
|
|
|
@@ -132,12 +135,10 @@ var input_group_error_default = InputGroupError;
|
|
|
132
135
|
|
|
133
136
|
// components/input-group.js
|
|
134
137
|
var import_jsx_runtime3 = (
|
|
135
|
-
// A real <label>
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
// implicitly, so it works for any control passed via `input` without
|
|
140
|
-
// having to thread an id through every input component.
|
|
138
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
139
|
+
// screen readers, clicking the text focuses the control, and
|
|
140
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
141
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
141
142
|
require("react/jsx-runtime")
|
|
142
143
|
);
|
|
143
144
|
var InputGroup = ({
|
|
@@ -149,6 +150,9 @@ var InputGroup = ({
|
|
|
149
150
|
style = {},
|
|
150
151
|
...rest
|
|
151
152
|
}) => {
|
|
153
|
+
const generated = (0, import_react2.useId)();
|
|
154
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
155
|
+
const control = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
152
156
|
const classes = [
|
|
153
157
|
"input-group"
|
|
154
158
|
];
|
|
@@ -173,7 +177,8 @@ var InputGroup = ({
|
|
|
173
177
|
"label",
|
|
174
178
|
{
|
|
175
179
|
...{
|
|
176
|
-
className: "space-y-2 block"
|
|
180
|
+
className: "space-y-2 block",
|
|
181
|
+
htmlFor: id
|
|
177
182
|
},
|
|
178
183
|
children: [
|
|
179
184
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -185,10 +190,10 @@ var InputGroup = ({
|
|
|
185
190
|
children: label
|
|
186
191
|
}
|
|
187
192
|
),
|
|
188
|
-
|
|
193
|
+
control
|
|
189
194
|
]
|
|
190
195
|
}
|
|
191
|
-
) :
|
|
196
|
+
) : control,
|
|
192
197
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
193
198
|
input_group_error_default,
|
|
194
199
|
{
|
package/dist/input-name.mjs
CHANGED
package/dist/input-number.js
CHANGED
|
@@ -268,9 +268,19 @@ var InputNumber = ({
|
|
|
268
268
|
// the utility could render zero-width. inputStyle supplies the color.
|
|
269
269
|
style: {
|
|
270
270
|
...inputStyle(style),
|
|
271
|
-
...inline
|
|
271
|
+
...inline ? {
|
|
272
272
|
borderStyle: "solid",
|
|
273
273
|
borderWidth: 1
|
|
274
|
+
} : {
|
|
275
|
+
// The `p-0` above cannot be trusted to cancel `.input`'s padding.
|
|
276
|
+
// share defines `.input` UNLAYERED after `@import 'tailwindcss'`,
|
|
277
|
+
// and v4 emits every utility inside `@layer utilities` — unlayered
|
|
278
|
+
// rules beat layered ones at any specificity, so `.input`'s
|
|
279
|
+
// py-2/px-3 won and the stepper row rendered 60px tall with the
|
|
280
|
+
// buttons inset from the border. An inline style outranks both
|
|
281
|
+
// layers; app-web (v3, `.input` in @layer base, where `p-0`
|
|
282
|
+
// already wins) is unchanged.
|
|
283
|
+
padding: 0
|
|
274
284
|
}
|
|
275
285
|
}
|
|
276
286
|
},
|
package/dist/input-number.mjs
CHANGED
|
@@ -178,9 +178,19 @@ var InputNumber = ({
|
|
|
178
178
|
// the utility could render zero-width. inputStyle supplies the color.
|
|
179
179
|
style: {
|
|
180
180
|
...inputStyle(style),
|
|
181
|
-
...inline
|
|
181
|
+
...inline ? {
|
|
182
182
|
borderStyle: "solid",
|
|
183
183
|
borderWidth: 1
|
|
184
|
+
} : {
|
|
185
|
+
// The `p-0` above cannot be trusted to cancel `.input`'s padding.
|
|
186
|
+
// share defines `.input` UNLAYERED after `@import 'tailwindcss'`,
|
|
187
|
+
// and v4 emits every utility inside `@layer utilities` — unlayered
|
|
188
|
+
// rules beat layered ones at any specificity, so `.input`'s
|
|
189
|
+
// py-2/px-3 won and the stepper row rendered 60px tall with the
|
|
190
|
+
// buttons inset from the border. An inline style outranks both
|
|
191
|
+
// layers; app-web (v3, `.input` in @layer base, where `p-0`
|
|
192
|
+
// already wins) is unchanged.
|
|
193
|
+
padding: 0
|
|
184
194
|
}
|
|
185
195
|
}
|
|
186
196
|
},
|
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
|
|
|
@@ -147,12 +150,10 @@ var input_group_error_default = InputGroupError;
|
|
|
147
150
|
|
|
148
151
|
// components/input-group.js
|
|
149
152
|
var import_jsx_runtime3 = (
|
|
150
|
-
// A real <label>
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
// implicitly, so it works for any control passed via `input` without
|
|
155
|
-
// having to thread an id through every input component.
|
|
153
|
+
// A real <label> (not a bare <span>) so the field name is announced by
|
|
154
|
+
// screen readers, clicking the text focuses the control, and
|
|
155
|
+
// getByLabel()/role queries can find it. The association comes from
|
|
156
|
+
// `htmlFor`, never from the wrapping — see the note above the id.
|
|
156
157
|
require("react/jsx-runtime")
|
|
157
158
|
);
|
|
158
159
|
var InputGroup = ({
|
|
@@ -164,6 +165,9 @@ var InputGroup = ({
|
|
|
164
165
|
style = {},
|
|
165
166
|
...rest
|
|
166
167
|
}) => {
|
|
168
|
+
const generated = (0, import_react2.useId)();
|
|
169
|
+
const id = (0, import_react2.isValidElement)(input) ? input.props.id || generated : generated;
|
|
170
|
+
const control = (0, import_react2.isValidElement)(input) && !input.props.id ? (0, import_react2.cloneElement)(input, { id }) : input;
|
|
167
171
|
const classes = [
|
|
168
172
|
"input-group"
|
|
169
173
|
];
|
|
@@ -188,7 +192,8 @@ var InputGroup = ({
|
|
|
188
192
|
"label",
|
|
189
193
|
{
|
|
190
194
|
...{
|
|
191
|
-
className: "space-y-2 block"
|
|
195
|
+
className: "space-y-2 block",
|
|
196
|
+
htmlFor: id
|
|
192
197
|
},
|
|
193
198
|
children: [
|
|
194
199
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -200,10 +205,10 @@ var InputGroup = ({
|
|
|
200
205
|
children: label
|
|
201
206
|
}
|
|
202
207
|
),
|
|
203
|
-
|
|
208
|
+
control
|
|
204
209
|
]
|
|
205
210
|
}
|
|
206
|
-
) :
|
|
211
|
+
) : control,
|
|
207
212
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
208
213
|
input_group_error_default,
|
|
209
214
|
{
|
|
@@ -222,7 +227,7 @@ var InputGroup = ({
|
|
|
222
227
|
var input_group_default = InputGroup;
|
|
223
228
|
|
|
224
229
|
// components/input-select.js
|
|
225
|
-
var
|
|
230
|
+
var import_react3 = require("react");
|
|
226
231
|
|
|
227
232
|
// components/icons/chevron-down.js
|
|
228
233
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -309,8 +314,8 @@ var InputSelect = ({
|
|
|
309
314
|
value,
|
|
310
315
|
...rest
|
|
311
316
|
}) => {
|
|
312
|
-
const [keyboard, setKeyboard] = (0,
|
|
313
|
-
(0,
|
|
317
|
+
const [keyboard, setKeyboard] = (0, import_react3.useState)(false);
|
|
318
|
+
(0, import_react3.useEffect)(() => {
|
|
314
319
|
const down = (e) => {
|
|
315
320
|
if (e.key === "Tab") setKeyboard(true);
|
|
316
321
|
};
|
|
@@ -388,9 +393,9 @@ var InputSelect = ({
|
|
|
388
393
|
var input_select_default = InputSelect;
|
|
389
394
|
|
|
390
395
|
// components/wrapper-gradient.js
|
|
391
|
-
var
|
|
396
|
+
var import_react4 = require("react");
|
|
392
397
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
393
|
-
var WrapperGradientContext = (0,
|
|
398
|
+
var WrapperGradientContext = (0, import_react4.createContext)(null);
|
|
394
399
|
var WrapperGradient = ({
|
|
395
400
|
children,
|
|
396
401
|
className,
|
|
@@ -448,14 +453,14 @@ var WrapperGradient = ({
|
|
|
448
453
|
left: "linear-gradient( to right, " + color + " 0%, transparent 100% )",
|
|
449
454
|
right: "linear-gradient( to left, " + color + " 0%, transparent 100% )"
|
|
450
455
|
};
|
|
451
|
-
const containerRef = (0,
|
|
452
|
-
const [scroll, setScroll] = (0,
|
|
456
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
457
|
+
const [scroll, setScroll] = (0, import_react4.useState)({
|
|
453
458
|
top: 0,
|
|
454
459
|
left: 0,
|
|
455
460
|
atBottom: true,
|
|
456
461
|
atRight: true
|
|
457
462
|
});
|
|
458
|
-
(0,
|
|
463
|
+
(0, import_react4.useEffect)(
|
|
459
464
|
() => {
|
|
460
465
|
const container = containerRef.current;
|
|
461
466
|
const handleScroll = () => {
|
|
@@ -505,7 +510,7 @@ var WrapperGradient = ({
|
|
|
505
510
|
},
|
|
506
511
|
[horizontal]
|
|
507
512
|
);
|
|
508
|
-
const contextValue = (0,
|
|
513
|
+
const contextValue = (0, import_react4.useMemo)(
|
|
509
514
|
() => ({
|
|
510
515
|
atBottom: scroll.atBottom,
|
|
511
516
|
atRight: scroll.atRight
|
|
@@ -676,14 +681,14 @@ var Product = ({
|
|
|
676
681
|
}
|
|
677
682
|
};
|
|
678
683
|
const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
|
|
679
|
-
const available = (0,
|
|
684
|
+
const available = (0, import_react5.useMemo)(
|
|
680
685
|
() => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
|
|
681
686
|
[product]
|
|
682
687
|
);
|
|
683
|
-
const [activeImage, setActiveImage] = (0,
|
|
688
|
+
const [activeImage, setActiveImage] = (0, import_react5.useState)(0);
|
|
684
689
|
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)();
|
|
685
690
|
const selectedVariant = available.find((v) => v.id === variant) || available[0] || null;
|
|
686
|
-
const images = (0,
|
|
691
|
+
const images = (0, import_react5.useMemo)(
|
|
687
692
|
() => {
|
|
688
693
|
const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
|
|
689
694
|
const result = [];
|
|
@@ -708,7 +713,7 @@ var Product = ({
|
|
|
708
713
|
},
|
|
709
714
|
[product]
|
|
710
715
|
);
|
|
711
|
-
(0,
|
|
716
|
+
(0, import_react5.useEffect)(
|
|
712
717
|
() => {
|
|
713
718
|
if (!emblaApi) return;
|
|
714
719
|
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-PURM4QR2.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-MKBY26H7.mjs";
|
|
10
10
|
import "./chunk-OHJMWJAQ.mjs";
|
|
11
11
|
import "./chunk-Q3UIVGPQ.mjs";
|
|
12
12
|
import "./chunk-6F23WKP2.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawbridge/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.75",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./advertisement": {
|
|
6
6
|
"types": "./types/advertisement.d.ts",
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
"devDependencies": {
|
|
416
416
|
"@types/react": "18.0.0",
|
|
417
417
|
"tsup": "8.5.1",
|
|
418
|
-
"@drawbridge/drawbridge-agents": "0.1.
|
|
418
|
+
"@drawbridge/drawbridge-agents": "0.1.47"
|
|
419
419
|
},
|
|
420
420
|
"dependencies": {
|
|
421
421
|
"embla-carousel-fade": "8.6.0",
|