@drawbridge/components 0.0.47 → 0.0.49

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.
@@ -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
  );
@@ -701,14 +702,21 @@ var Product = ({
701
702
  "button",
702
703
  {
703
704
  ...{
704
- className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border border-transparent",
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",
705
711
  onClick: () => {
706
712
  setActiveImage(key);
707
713
  emblaApi == null ? void 0 : emblaApi.scrollTo(key);
708
714
  },
709
715
  type: "button",
710
716
  ...activeImage === key && {
711
- style: inputStyle(resolved)
717
+ style: {
718
+ borderColor: buttonStyle(resolved).backgroundColor
719
+ }
712
720
  }
713
721
  },
714
722
  children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -720,6 +728,11 @@ var Product = ({
720
728
  fill: true,
721
729
  sizes: "48px",
722
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
+ },
723
736
  unoptimized: true
724
737
  }
725
738
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  product_default
4
- } from "./chunk-V3RUI64W.mjs";
4
+ } from "./chunk-FFZY3FQL.mjs";
5
5
  import "./chunk-2ZYGRSSA.mjs";
6
6
  import "./chunk-XWELEL6Z.mjs";
7
7
  import "./chunk-3SAKIKZP.mjs";
@@ -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
  );
@@ -150,14 +151,21 @@ var Product = ({
150
151
  "button",
151
152
  {
152
153
  ...{
153
- className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border border-transparent",
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",
154
160
  onClick: () => {
155
161
  setActiveImage(key);
156
162
  emblaApi == null ? void 0 : emblaApi.scrollTo(key);
157
163
  },
158
164
  type: "button",
159
165
  ...activeImage === key && {
160
- style: inputStyle(resolved)
166
+ style: {
167
+ borderColor: buttonStyle(resolved).backgroundColor
168
+ }
161
169
  }
162
170
  },
163
171
  children: /* @__PURE__ */ jsx(
@@ -169,6 +177,11 @@ var Product = ({
169
177
  fill: true,
170
178
  sizes: "48px",
171
179
  src: cdnShopify(src, "100x100", product == null ? void 0 : product.updatedAt) || src,
180
+ ...activeImage === key && {
181
+ style: {
182
+ opacity: 0.6
183
+ }
184
+ },
172
185
  unoptimized: true
173
186
  }
174
187
  }
@@ -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 = "split",
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" : "flex") + " items-center border border-inherit divide-x divide-inherit rounded-sm overflow-hidden"];
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,22 @@ var InputNumber = ({
193
193
  ...rest,
194
194
  max,
195
195
  min,
196
- className: "min-w-0 text-inherit bg-transparent focus:outline-hidden focus:ring-0 " + (small ? "py-1 px-2" : "py-2 px-3") + " " + (inline ? small ? "w-10" : "w-12" : "grow-1 w-0") + (layout === "split" ? " text-center" : ""),
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
+ // The bordered container is the single visible border; strip the
204
+ // native number-input border so it doesn't double up.
205
+ style: {
206
+ border: 0,
207
+ ...inline ? {} : {
208
+ flex: "1 1 0%",
209
+ minWidth: 0
210
+ }
211
+ },
200
212
  type: "number",
201
213
  value
202
214
  }
@@ -14,7 +14,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
14
14
  var InputNumber = ({
15
15
  className,
16
16
  inline = false,
17
- layout = "split",
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" : "flex") + " items-center border border-inherit divide-x divide-inherit rounded-sm overflow-hidden"];
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,22 @@ var InputNumber = ({
105
105
  ...rest,
106
106
  max,
107
107
  min,
108
- className: "min-w-0 text-inherit bg-transparent focus:outline-hidden focus:ring-0 " + (small ? "py-1 px-2" : "py-2 px-3") + " " + (inline ? small ? "w-10" : "w-12" : "grow-1 w-0") + (layout === "split" ? " text-center" : ""),
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
+ // The bordered container is the single visible border; strip the
116
+ // native number-input border so it doesn't double up.
117
+ style: {
118
+ border: 0,
119
+ ...inline ? {} : {
120
+ flex: "1 1 0%",
121
+ minWidth: 0
122
+ }
123
+ },
112
124
  type: "number",
113
125
  value
114
126
  }
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
  );
@@ -698,14 +699,21 @@ var Product = ({
698
699
  "button",
699
700
  {
700
701
  ...{
701
- className: "relative w-12 h-12 overflow-hidden rounded shrink-0 border border-transparent",
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",
702
708
  onClick: () => {
703
709
  setActiveImage(key);
704
710
  emblaApi == null ? void 0 : emblaApi.scrollTo(key);
705
711
  },
706
712
  type: "button",
707
713
  ...activeImage === key && {
708
- style: inputStyle(resolved)
714
+ style: {
715
+ borderColor: buttonStyle(resolved).backgroundColor
716
+ }
709
717
  }
710
718
  },
711
719
  children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -717,6 +725,11 @@ var Product = ({
717
725
  fill: true,
718
726
  sizes: "48px",
719
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
+ },
720
733
  unoptimized: true
721
734
  }
722
735
  }
package/dist/product.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  product_default
4
- } from "./chunk-V3RUI64W.mjs";
4
+ } from "./chunk-FFZY3FQL.mjs";
5
5
  import "./chunk-2ZYGRSSA.mjs";
6
6
  import "./chunk-XWELEL6Z.mjs";
7
7
  import "./chunk-3SAKIKZP.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/components",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "exports": {
5
5
  "./advertisement": {
6
6
  "types": "./types/advertisement.d.ts",