@drawbridge/components 0.0.46 → 0.0.48
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 +41 -10
- package/dist/advertisement.mjs +1 -1
- package/dist/{chunk-X7CR4JVY.mjs → chunk-FFZY3FQL.mjs} +41 -10
- package/dist/input-number.js +10 -3
- package/dist/input-number.mjs +10 -3
- package/dist/product.js +41 -10
- package/dist/product.mjs +1 -1
- package/package.json +1 -1
package/dist/advertisement.js
CHANGED
|
@@ -572,13 +572,14 @@ var loader_default = Loader;
|
|
|
572
572
|
|
|
573
573
|
// components/product.js
|
|
574
574
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
575
|
-
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
575
|
+
var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
576
576
|
"img",
|
|
577
577
|
{
|
|
578
578
|
...{
|
|
579
579
|
alt,
|
|
580
580
|
className,
|
|
581
|
-
src
|
|
581
|
+
src,
|
|
582
|
+
style
|
|
582
583
|
}
|
|
583
584
|
}
|
|
584
585
|
);
|
|
@@ -672,7 +673,7 @@ var Product = ({
|
|
|
672
673
|
"div",
|
|
673
674
|
{
|
|
674
675
|
...{
|
|
675
|
-
className: "space-y-6
|
|
676
|
+
className: "space-y-6",
|
|
676
677
|
style: {
|
|
677
678
|
backgroundColor: resolved.background.color.rgb,
|
|
678
679
|
color: resolved.text.color.rgb
|
|
@@ -684,7 +685,10 @@ var Product = ({
|
|
|
684
685
|
"div",
|
|
685
686
|
{
|
|
686
687
|
...{
|
|
687
|
-
className: "flex items-center
|
|
688
|
+
className: "flex items-center " + (images.length > 1 ? "pr-12" : ""),
|
|
689
|
+
style: {
|
|
690
|
+
height: "12rem"
|
|
691
|
+
}
|
|
688
692
|
},
|
|
689
693
|
children: [
|
|
690
694
|
images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -698,14 +702,21 @@ var Product = ({
|
|
|
698
702
|
"button",
|
|
699
703
|
{
|
|
700
704
|
...{
|
|
701
|
-
|
|
705
|
+
// Active state: a 2px border in the button (accent) color so
|
|
706
|
+
// the selected thumbnail reads as uniquely selected. Only the
|
|
707
|
+
// border color is set inline — never a full inputStyle, whose
|
|
708
|
+
// borderRadius would override the `rounded` class and square
|
|
709
|
+
// off the active thumb.
|
|
710
|
+
className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border-2 border-transparent",
|
|
702
711
|
onClick: () => {
|
|
703
712
|
setActiveImage(key);
|
|
704
713
|
emblaApi == null ? void 0 : emblaApi.scrollTo(key);
|
|
705
714
|
},
|
|
706
715
|
type: "button",
|
|
707
716
|
...activeImage === key && {
|
|
708
|
-
style:
|
|
717
|
+
style: {
|
|
718
|
+
borderColor: buttonStyle(resolved).backgroundColor
|
|
719
|
+
}
|
|
709
720
|
}
|
|
710
721
|
},
|
|
711
722
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -717,6 +728,11 @@ var Product = ({
|
|
|
717
728
|
fill: true,
|
|
718
729
|
sizes: "48px",
|
|
719
730
|
src: (0, import_cdn.cdnShopify)(src, "100x100", product == null ? void 0 : product.updatedAt) || src,
|
|
731
|
+
...activeImage === key && {
|
|
732
|
+
style: {
|
|
733
|
+
opacity: 0.6
|
|
734
|
+
}
|
|
735
|
+
},
|
|
720
736
|
unoptimized: true
|
|
721
737
|
}
|
|
722
738
|
}
|
|
@@ -730,20 +746,35 @@ var Product = ({
|
|
|
730
746
|
"div",
|
|
731
747
|
{
|
|
732
748
|
...{
|
|
733
|
-
|
|
734
|
-
|
|
749
|
+
// Dimensions are inline rather than Tailwind size utilities:
|
|
750
|
+
// those sizes live only in this package's dist, and a consuming
|
|
751
|
+
// app's Tailwind scan of node_modules can lag and drop them,
|
|
752
|
+
// silently collapsing the carousel. Inline styles are immune.
|
|
753
|
+
className: "overflow-hidden rounded-3xl m-auto",
|
|
754
|
+
ref: emblaRef,
|
|
755
|
+
style: {
|
|
756
|
+
width: "12rem",
|
|
757
|
+
height: "12rem"
|
|
758
|
+
}
|
|
735
759
|
},
|
|
736
760
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
737
761
|
"div",
|
|
738
762
|
{
|
|
739
763
|
...{
|
|
740
|
-
className: "flex
|
|
764
|
+
className: "flex",
|
|
765
|
+
style: {
|
|
766
|
+
height: "100%"
|
|
767
|
+
}
|
|
741
768
|
},
|
|
742
769
|
children: images.map(({ src }, key) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
743
770
|
"div",
|
|
744
771
|
{
|
|
745
772
|
...{
|
|
746
|
-
className: "min-w-0
|
|
773
|
+
className: "min-w-0 relative bg-gray-100",
|
|
774
|
+
style: {
|
|
775
|
+
flex: "0 0 100%",
|
|
776
|
+
height: "100%"
|
|
777
|
+
}
|
|
747
778
|
},
|
|
748
779
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
749
780
|
ImageComponent,
|
package/dist/advertisement.mjs
CHANGED
|
@@ -21,13 +21,14 @@ import useEmblaCarousel from "embla-carousel-react";
|
|
|
21
21
|
import { cdnShopify } from "@drawbridge/shopify/cdn";
|
|
22
22
|
import { formatCurrency } from "@drawbridge/drawbridge-utils";
|
|
23
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
-
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ jsx(
|
|
24
|
+
var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ jsx(
|
|
25
25
|
"img",
|
|
26
26
|
{
|
|
27
27
|
...{
|
|
28
28
|
alt,
|
|
29
29
|
className,
|
|
30
|
-
src
|
|
30
|
+
src,
|
|
31
|
+
style
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
);
|
|
@@ -121,7 +122,7 @@ var Product = ({
|
|
|
121
122
|
"div",
|
|
122
123
|
{
|
|
123
124
|
...{
|
|
124
|
-
className: "space-y-6
|
|
125
|
+
className: "space-y-6",
|
|
125
126
|
style: {
|
|
126
127
|
backgroundColor: resolved.background.color.rgb,
|
|
127
128
|
color: resolved.text.color.rgb
|
|
@@ -133,7 +134,10 @@ var Product = ({
|
|
|
133
134
|
"div",
|
|
134
135
|
{
|
|
135
136
|
...{
|
|
136
|
-
className: "flex items-center
|
|
137
|
+
className: "flex items-center " + (images.length > 1 ? "pr-12" : ""),
|
|
138
|
+
style: {
|
|
139
|
+
height: "12rem"
|
|
140
|
+
}
|
|
137
141
|
},
|
|
138
142
|
children: [
|
|
139
143
|
images.length > 1 && /* @__PURE__ */ jsx(
|
|
@@ -147,14 +151,21 @@ var Product = ({
|
|
|
147
151
|
"button",
|
|
148
152
|
{
|
|
149
153
|
...{
|
|
150
|
-
|
|
154
|
+
// Active state: a 2px border in the button (accent) color so
|
|
155
|
+
// the selected thumbnail reads as uniquely selected. Only the
|
|
156
|
+
// border color is set inline — never a full inputStyle, whose
|
|
157
|
+
// borderRadius would override the `rounded` class and square
|
|
158
|
+
// off the active thumb.
|
|
159
|
+
className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border-2 border-transparent",
|
|
151
160
|
onClick: () => {
|
|
152
161
|
setActiveImage(key);
|
|
153
162
|
emblaApi == null ? void 0 : emblaApi.scrollTo(key);
|
|
154
163
|
},
|
|
155
164
|
type: "button",
|
|
156
165
|
...activeImage === key && {
|
|
157
|
-
style:
|
|
166
|
+
style: {
|
|
167
|
+
borderColor: buttonStyle(resolved).backgroundColor
|
|
168
|
+
}
|
|
158
169
|
}
|
|
159
170
|
},
|
|
160
171
|
children: /* @__PURE__ */ jsx(
|
|
@@ -166,6 +177,11 @@ var Product = ({
|
|
|
166
177
|
fill: true,
|
|
167
178
|
sizes: "48px",
|
|
168
179
|
src: cdnShopify(src, "100x100", product == null ? void 0 : product.updatedAt) || src,
|
|
180
|
+
...activeImage === key && {
|
|
181
|
+
style: {
|
|
182
|
+
opacity: 0.6
|
|
183
|
+
}
|
|
184
|
+
},
|
|
169
185
|
unoptimized: true
|
|
170
186
|
}
|
|
171
187
|
}
|
|
@@ -179,20 +195,35 @@ var Product = ({
|
|
|
179
195
|
"div",
|
|
180
196
|
{
|
|
181
197
|
...{
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
// Dimensions are inline rather than Tailwind size utilities:
|
|
199
|
+
// those sizes live only in this package's dist, and a consuming
|
|
200
|
+
// app's Tailwind scan of node_modules can lag and drop them,
|
|
201
|
+
// silently collapsing the carousel. Inline styles are immune.
|
|
202
|
+
className: "overflow-hidden rounded-3xl m-auto",
|
|
203
|
+
ref: emblaRef,
|
|
204
|
+
style: {
|
|
205
|
+
width: "12rem",
|
|
206
|
+
height: "12rem"
|
|
207
|
+
}
|
|
184
208
|
},
|
|
185
209
|
children: /* @__PURE__ */ jsx(
|
|
186
210
|
"div",
|
|
187
211
|
{
|
|
188
212
|
...{
|
|
189
|
-
className: "flex
|
|
213
|
+
className: "flex",
|
|
214
|
+
style: {
|
|
215
|
+
height: "100%"
|
|
216
|
+
}
|
|
190
217
|
},
|
|
191
218
|
children: images.map(({ src }, key) => /* @__PURE__ */ jsx(
|
|
192
219
|
"div",
|
|
193
220
|
{
|
|
194
221
|
...{
|
|
195
|
-
className: "min-w-0
|
|
222
|
+
className: "min-w-0 relative bg-gray-100",
|
|
223
|
+
style: {
|
|
224
|
+
flex: "0 0 100%",
|
|
225
|
+
height: "100%"
|
|
226
|
+
}
|
|
196
227
|
},
|
|
197
228
|
children: /* @__PURE__ */ jsx(
|
|
198
229
|
ImageComponent,
|
package/dist/input-number.js
CHANGED
|
@@ -102,7 +102,7 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
|
102
102
|
var InputNumber = ({
|
|
103
103
|
className,
|
|
104
104
|
inline = false,
|
|
105
|
-
layout = "
|
|
105
|
+
layout = "after",
|
|
106
106
|
max,
|
|
107
107
|
min,
|
|
108
108
|
onChange,
|
|
@@ -111,7 +111,7 @@ var InputNumber = ({
|
|
|
111
111
|
value,
|
|
112
112
|
...rest
|
|
113
113
|
}) => {
|
|
114
|
-
const classes = [(inline ? "inline-flex" : "
|
|
114
|
+
const classes = [(inline ? "inline-flex items-center border border-inherit rounded-sm" : "input p-0 flex items-center") + " divide-x divide-inherit overflow-hidden"];
|
|
115
115
|
if (className) {
|
|
116
116
|
classes.push(className);
|
|
117
117
|
}
|
|
@@ -193,10 +193,17 @@ var InputNumber = ({
|
|
|
193
193
|
...rest,
|
|
194
194
|
max,
|
|
195
195
|
min,
|
|
196
|
-
|
|
196
|
+
// Focus reset uses the v3+v4-common outline utility, and the fill is
|
|
197
|
+
// an inline flex grow rather than a version-specific grow utility, so
|
|
198
|
+
// this works in BOTH consumers (app-web is Tailwind v3, share is v4).
|
|
199
|
+
className: "text-inherit bg-transparent focus:outline-none focus:ring-0 " + (small ? "py-1 px-2" : "py-2 px-3") + (inline ? small ? " w-10" : " w-12" : "") + (layout === "split" ? " text-center" : ""),
|
|
197
200
|
inputMode: "numeric",
|
|
198
201
|
onChange: ({ target }) => onChange(Number(target.value)),
|
|
199
202
|
step: 1,
|
|
203
|
+
style: inline ? void 0 : {
|
|
204
|
+
flex: "1 1 0%",
|
|
205
|
+
minWidth: 0
|
|
206
|
+
},
|
|
200
207
|
type: "number",
|
|
201
208
|
value
|
|
202
209
|
}
|
package/dist/input-number.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
var InputNumber = ({
|
|
15
15
|
className,
|
|
16
16
|
inline = false,
|
|
17
|
-
layout = "
|
|
17
|
+
layout = "after",
|
|
18
18
|
max,
|
|
19
19
|
min,
|
|
20
20
|
onChange,
|
|
@@ -23,7 +23,7 @@ var InputNumber = ({
|
|
|
23
23
|
value,
|
|
24
24
|
...rest
|
|
25
25
|
}) => {
|
|
26
|
-
const classes = [(inline ? "inline-flex" : "
|
|
26
|
+
const classes = [(inline ? "inline-flex items-center border border-inherit rounded-sm" : "input p-0 flex items-center") + " divide-x divide-inherit overflow-hidden"];
|
|
27
27
|
if (className) {
|
|
28
28
|
classes.push(className);
|
|
29
29
|
}
|
|
@@ -105,10 +105,17 @@ var InputNumber = ({
|
|
|
105
105
|
...rest,
|
|
106
106
|
max,
|
|
107
107
|
min,
|
|
108
|
-
|
|
108
|
+
// Focus reset uses the v3+v4-common outline utility, and the fill is
|
|
109
|
+
// an inline flex grow rather than a version-specific grow utility, so
|
|
110
|
+
// this works in BOTH consumers (app-web is Tailwind v3, share is v4).
|
|
111
|
+
className: "text-inherit bg-transparent focus:outline-none focus:ring-0 " + (small ? "py-1 px-2" : "py-2 px-3") + (inline ? small ? " w-10" : " w-12" : "") + (layout === "split" ? " text-center" : ""),
|
|
109
112
|
inputMode: "numeric",
|
|
110
113
|
onChange: ({ target }) => onChange(Number(target.value)),
|
|
111
114
|
step: 1,
|
|
115
|
+
style: inline ? void 0 : {
|
|
116
|
+
flex: "1 1 0%",
|
|
117
|
+
minWidth: 0
|
|
118
|
+
},
|
|
112
119
|
type: "number",
|
|
113
120
|
value
|
|
114
121
|
}
|
package/dist/product.js
CHANGED
|
@@ -569,13 +569,14 @@ var loader_default = Loader;
|
|
|
569
569
|
|
|
570
570
|
// components/product.js
|
|
571
571
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
572
|
-
var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
572
|
+
var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
573
573
|
"img",
|
|
574
574
|
{
|
|
575
575
|
...{
|
|
576
576
|
alt,
|
|
577
577
|
className,
|
|
578
|
-
src
|
|
578
|
+
src,
|
|
579
|
+
style
|
|
579
580
|
}
|
|
580
581
|
}
|
|
581
582
|
);
|
|
@@ -669,7 +670,7 @@ var Product = ({
|
|
|
669
670
|
"div",
|
|
670
671
|
{
|
|
671
672
|
...{
|
|
672
|
-
className: "space-y-6
|
|
673
|
+
className: "space-y-6",
|
|
673
674
|
style: {
|
|
674
675
|
backgroundColor: resolved.background.color.rgb,
|
|
675
676
|
color: resolved.text.color.rgb
|
|
@@ -681,7 +682,10 @@ var Product = ({
|
|
|
681
682
|
"div",
|
|
682
683
|
{
|
|
683
684
|
...{
|
|
684
|
-
className: "flex items-center
|
|
685
|
+
className: "flex items-center " + (images.length > 1 ? "pr-12" : ""),
|
|
686
|
+
style: {
|
|
687
|
+
height: "12rem"
|
|
688
|
+
}
|
|
685
689
|
},
|
|
686
690
|
children: [
|
|
687
691
|
images.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -695,14 +699,21 @@ var Product = ({
|
|
|
695
699
|
"button",
|
|
696
700
|
{
|
|
697
701
|
...{
|
|
698
|
-
|
|
702
|
+
// Active state: a 2px border in the button (accent) color so
|
|
703
|
+
// the selected thumbnail reads as uniquely selected. Only the
|
|
704
|
+
// border color is set inline — never a full inputStyle, whose
|
|
705
|
+
// borderRadius would override the `rounded` class and square
|
|
706
|
+
// off the active thumb.
|
|
707
|
+
className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border-2 border-transparent",
|
|
699
708
|
onClick: () => {
|
|
700
709
|
setActiveImage(key);
|
|
701
710
|
emblaApi == null ? void 0 : emblaApi.scrollTo(key);
|
|
702
711
|
},
|
|
703
712
|
type: "button",
|
|
704
713
|
...activeImage === key && {
|
|
705
|
-
style:
|
|
714
|
+
style: {
|
|
715
|
+
borderColor: buttonStyle(resolved).backgroundColor
|
|
716
|
+
}
|
|
706
717
|
}
|
|
707
718
|
},
|
|
708
719
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -714,6 +725,11 @@ var Product = ({
|
|
|
714
725
|
fill: true,
|
|
715
726
|
sizes: "48px",
|
|
716
727
|
src: (0, import_cdn.cdnShopify)(src, "100x100", product == null ? void 0 : product.updatedAt) || src,
|
|
728
|
+
...activeImage === key && {
|
|
729
|
+
style: {
|
|
730
|
+
opacity: 0.6
|
|
731
|
+
}
|
|
732
|
+
},
|
|
717
733
|
unoptimized: true
|
|
718
734
|
}
|
|
719
735
|
}
|
|
@@ -727,20 +743,35 @@ var Product = ({
|
|
|
727
743
|
"div",
|
|
728
744
|
{
|
|
729
745
|
...{
|
|
730
|
-
|
|
731
|
-
|
|
746
|
+
// Dimensions are inline rather than Tailwind size utilities:
|
|
747
|
+
// those sizes live only in this package's dist, and a consuming
|
|
748
|
+
// app's Tailwind scan of node_modules can lag and drop them,
|
|
749
|
+
// silently collapsing the carousel. Inline styles are immune.
|
|
750
|
+
className: "overflow-hidden rounded-3xl m-auto",
|
|
751
|
+
ref: emblaRef,
|
|
752
|
+
style: {
|
|
753
|
+
width: "12rem",
|
|
754
|
+
height: "12rem"
|
|
755
|
+
}
|
|
732
756
|
},
|
|
733
757
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
734
758
|
"div",
|
|
735
759
|
{
|
|
736
760
|
...{
|
|
737
|
-
className: "flex
|
|
761
|
+
className: "flex",
|
|
762
|
+
style: {
|
|
763
|
+
height: "100%"
|
|
764
|
+
}
|
|
738
765
|
},
|
|
739
766
|
children: images.map(({ src }, key) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
740
767
|
"div",
|
|
741
768
|
{
|
|
742
769
|
...{
|
|
743
|
-
className: "min-w-0
|
|
770
|
+
className: "min-w-0 relative bg-gray-100",
|
|
771
|
+
style: {
|
|
772
|
+
flex: "0 0 100%",
|
|
773
|
+
height: "100%"
|
|
774
|
+
}
|
|
744
775
|
},
|
|
745
776
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
746
777
|
ImageComponent,
|
package/dist/product.mjs
CHANGED