@drawbridge/components 0.0.52 → 0.0.55

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.
@@ -1,13 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  product_default
4
- } from "./chunk-L5X6LHYZ.mjs";
5
- import "./chunk-2ZYGRSSA.mjs";
6
- import "./chunk-XWELEL6Z.mjs";
7
- import "./chunk-3SAKIKZP.mjs";
8
- import "./chunk-Q3UIVGPQ.mjs";
4
+ } from "./chunk-7AIAMVTM.mjs";
5
+ import "./chunk-PT7UR6AO.mjs";
9
6
  import "./chunk-3SXAH7B7.mjs";
10
7
  import "./chunk-FYA7EAMR.mjs";
8
+ import "./chunk-2ZYGRSSA.mjs";
9
+ import "./chunk-DNK33H3K.mjs";
10
+ import "./chunk-OHJMWJAQ.mjs";
11
+ import "./chunk-Q3UIVGPQ.mjs";
11
12
  import {
12
13
  buttonStyle
13
14
  } from "./chunk-FJ7PKMAC.mjs";
@@ -62,7 +63,7 @@ var Advertisement = ({
62
63
  variant,
63
64
  VideoComponent = DefaultVideo
64
65
  }) => {
65
- var _a, _b, _c, _d, _e;
66
+ var _a, _b, _c, _d, _e, _f;
66
67
  if (product) {
67
68
  return /* @__PURE__ */ jsx(
68
69
  product_default,
@@ -70,6 +71,7 @@ var Advertisement = ({
70
71
  ...{
71
72
  action,
72
73
  addToCart: false,
74
+ buttonFontSize: "16px",
73
75
  disabled: preview || disabled,
74
76
  errors,
75
77
  header,
@@ -97,6 +99,7 @@ var Advertisement = ({
97
99
  }
98
100
  };
99
101
  const isVideo = (_c = file == null ? void 0 : file.mimetype) == null ? void 0 : _c.includes("video");
102
+ const imageRadius = ((_d = resolved == null ? void 0 : resolved.image) == null ? void 0 : _d.radius) != null ? resolved.image.radius + "px" : "12px";
100
103
  const card = (assetNode) => /* @__PURE__ */ jsxs(
101
104
  "div",
102
105
  {
@@ -112,7 +115,10 @@ var Advertisement = ({
112
115
  "span",
113
116
  {
114
117
  ...{
115
- className: "block relative aspect-square rounded overflow-hidden" + ((file == null ? void 0 : file.sizes) ? "" : " bg-gray-light")
118
+ className: "block relative aspect-square overflow-hidden" + ((file == null ? void 0 : file.sizes) ? "" : " bg-gray-light"),
119
+ style: {
120
+ borderRadius: imageRadius
121
+ }
116
122
  },
117
123
  children: assetNode
118
124
  }
@@ -121,12 +127,12 @@ var Advertisement = ({
121
127
  "span",
122
128
  {
123
129
  ...{
124
- className: "flex flex-col items-center justify-between gap-x-4 text-center text-sm rounded",
130
+ className: "flex flex-col items-center justify-between gap-x-6 text-center text-sm rounded",
125
131
  style: {
126
132
  ...fonts == null ? void 0 : fonts.body,
127
133
  color: resolved.text.color.hex,
128
- gap: "10px",
129
- marginTop: "10px"
134
+ gap: "15px",
135
+ marginTop: "15px"
130
136
  }
131
137
  },
132
138
  children: [
@@ -157,7 +163,10 @@ var Advertisement = ({
157
163
  disabled: !preview && !url,
158
164
  onClick: preview ? () => {
159
165
  } : onClick,
160
- style: buttonStyle(resolved),
166
+ style: {
167
+ ...buttonStyle(resolved),
168
+ fontSize: "16px"
169
+ },
161
170
  type: "button"
162
171
  },
163
172
  children: button
@@ -184,7 +193,7 @@ var Advertisement = ({
184
193
  className: "w-full h-full",
185
194
  hls: cdnSrc(file, "hls", file == null ? void 0 : file.updatedAt),
186
195
  mp4: cdnSrc(file, "original", file == null ? void 0 : file.updatedAt),
187
- poster: cdnSrc((_d = file == null ? void 0 : file.frames) == null ? void 0 : _d[file == null ? void 0 : file.poster], "500x500", file == null ? void 0 : file.updatedAt) || cdnSrc((_e = file == null ? void 0 : file.frames) == null ? void 0 : _e[file == null ? void 0 : file.poster], "1080x1920", file == null ? void 0 : file.updatedAt),
196
+ poster: cdnSrc((_e = file == null ? void 0 : file.frames) == null ? void 0 : _e[file == null ? void 0 : file.poster], "500x500", file == null ? void 0 : file.updatedAt) || cdnSrc((_f = file == null ? void 0 : file.frames) == null ? void 0 : _f[file == null ? void 0 : file.poster], "1080x1920", file == null ? void 0 : file.updatedAt),
188
197
  style: resolved
189
198
  }
190
199
  }
@@ -1,15 +1,15 @@
1
- import {
2
- loader_default
3
- } from "./chunk-2ZYGRSSA.mjs";
4
1
  import {
5
2
  wrapper_gradient_default
6
- } from "./chunk-XWELEL6Z.mjs";
7
- import {
8
- input_group_default
9
- } from "./chunk-3SAKIKZP.mjs";
3
+ } from "./chunk-PT7UR6AO.mjs";
10
4
  import {
11
5
  input_select_default
12
6
  } from "./chunk-3SXAH7B7.mjs";
7
+ import {
8
+ loader_default
9
+ } from "./chunk-2ZYGRSSA.mjs";
10
+ import {
11
+ input_group_default
12
+ } from "./chunk-DNK33H3K.mjs";
13
13
  import {
14
14
  buttonStyle,
15
15
  inputStyle
@@ -35,6 +35,7 @@ var DefaultImage = ({ alt, className, src, style }) => /* @__PURE__ */ jsx(
35
35
  var Product = ({
36
36
  action = null,
37
37
  addToCart = true,
38
+ buttonFontSize,
38
39
  disabled = false,
39
40
  errors = {},
40
41
  header,
@@ -49,7 +50,7 @@ var Product = ({
49
50
  style = {},
50
51
  variant
51
52
  }) => {
52
- var _a, _b, _c, _d, _e;
53
+ var _a, _b, _c, _d, _e, _f;
53
54
  const resolved = {
54
55
  ...style,
55
56
  background: {
@@ -61,6 +62,7 @@ var Product = ({
61
62
  color: ((_b = style == null ? void 0 : style.text) == null ? void 0 : _b.color) || { hex: "#000000", rgb: "rgb( 0, 0, 0 )" }
62
63
  }
63
64
  };
65
+ const imageRadius = ((_c = resolved == null ? void 0 : resolved.image) == null ? void 0 : _c.radius) != null ? resolved.image.radius + "px" : "12px";
64
66
  const available = useMemo(
65
67
  () => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
66
68
  [product]
@@ -152,11 +154,14 @@ var Product = ({
152
154
  {
153
155
  ...{
154
156
  // Active state is conveyed purely by a dimmed image (no border).
155
- className: "relative w-12 h-12 overflow-hidden rounded-xl shrink-0",
157
+ className: "relative w-12 h-12 overflow-hidden shrink-0",
156
158
  onClick: () => {
157
159
  setActiveImage(key);
158
160
  emblaApi == null ? void 0 : emblaApi.scrollTo(key);
159
161
  },
162
+ style: {
163
+ borderRadius: imageRadius
164
+ },
160
165
  type: "button"
161
166
  },
162
167
  children: /* @__PURE__ */ jsx(
@@ -191,9 +196,10 @@ var Product = ({
191
196
  // those sizes live only in this package's dist, and a consuming
192
197
  // app's Tailwind scan of node_modules can lag and drop them,
193
198
  // silently collapsing the carousel. Inline styles are immune.
194
- className: "overflow-hidden rounded-3xl m-auto",
199
+ className: "overflow-hidden m-auto",
195
200
  ref: emblaRef,
196
201
  style: {
202
+ borderRadius: imageRadius,
197
203
  width: "12rem",
198
204
  height: "12rem"
199
205
  }
@@ -253,9 +259,9 @@ var Product = ({
253
259
  ...{
254
260
  className: "max-w-80 mx-auto",
255
261
  style: {
256
- fontFamily: ((_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.family) || (style == null ? void 0 : style.fontFamily) || "Roboto Flex",
257
- fontWeight: ((_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.weight) || (style == null ? void 0 : style.fontWeight),
258
- textTransform: ((_e = style == null ? void 0 : style.heading) == null ? void 0 : _e.transform) || (style == null ? void 0 : style.textTransform)
262
+ fontFamily: ((_d = style == null ? void 0 : style.heading) == null ? void 0 : _d.family) || (style == null ? void 0 : style.fontFamily) || "Roboto Flex",
263
+ fontWeight: ((_e = style == null ? void 0 : style.heading) == null ? void 0 : _e.weight) || (style == null ? void 0 : style.fontWeight),
264
+ textTransform: ((_f = style == null ? void 0 : style.heading) == null ? void 0 : _f.transform) || (style == null ? void 0 : style.textTransform)
259
265
  }
260
266
  },
261
267
  children: product == null ? void 0 : product.title
@@ -322,7 +328,12 @@ var Product = ({
322
328
  className: "button justify-center border py-3 px-4 rounded",
323
329
  disabled: disabled || Boolean(action),
324
330
  onClick: onAdd,
325
- style: inputStyle(resolved),
331
+ style: {
332
+ ...inputStyle(resolved),
333
+ ...buttonFontSize && {
334
+ fontSize: buttonFontSize
335
+ }
336
+ },
326
337
  type: "button"
327
338
  },
328
339
  children: action === "add" ? /* @__PURE__ */ jsx(
@@ -342,7 +353,12 @@ var Product = ({
342
353
  className: "button justify-center py-3 px-4 rounded" + (addToCart ? "" : " w-full"),
343
354
  disabled: disabled || Boolean(action),
344
355
  onClick: onBuy,
345
- style: buttonStyle(resolved),
356
+ style: {
357
+ ...buttonStyle(resolved),
358
+ ...buttonFontSize && {
359
+ fontSize: buttonFontSize
360
+ }
361
+ },
346
362
  type: "button"
347
363
  },
348
364
  children: action === "buy" ? /* @__PURE__ */ jsx(
@@ -0,0 +1,75 @@
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 ? /* @__PURE__ */ jsxs(
37
+ "div",
38
+ {
39
+ ...{
40
+ className: "space-y-2"
41
+ },
42
+ children: [
43
+ /* @__PURE__ */ jsx(
44
+ "span",
45
+ {
46
+ ...{
47
+ className: "block"
48
+ },
49
+ children: label
50
+ }
51
+ ),
52
+ input
53
+ ]
54
+ }
55
+ ) : input,
56
+ /* @__PURE__ */ jsx(
57
+ input_group_error_default,
58
+ {
59
+ ...{
60
+ error,
61
+ label,
62
+ message,
63
+ style
64
+ }
65
+ }
66
+ )
67
+ ]
68
+ }
69
+ );
70
+ };
71
+ var input_group_default = InputGroup;
72
+
73
+ export {
74
+ input_group_default
75
+ };
@@ -0,0 +1,86 @@
1
+ import {
2
+ warning_default
3
+ } from "./chunk-Q3UIVGPQ.mjs";
4
+
5
+ // components/input-group-error.js
6
+ import { Fragment } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var InputGroupError = ({
9
+ className,
10
+ error,
11
+ label,
12
+ message,
13
+ style = {}
14
+ }) => {
15
+ var _a, _b, _c, _d;
16
+ if (!(error || message)) {
17
+ return null;
18
+ }
19
+ const classes = [
20
+ "flex items-center justify-start space-x-2 py-1 rounded text-sm"
21
+ ];
22
+ if (error) {
23
+ classes.push("px-1.5");
24
+ }
25
+ if (className) {
26
+ classes.push(className);
27
+ }
28
+ return /* @__PURE__ */ jsxs(
29
+ "p",
30
+ {
31
+ ...{
32
+ className: classes.join(" "),
33
+ ...error && {
34
+ style: {
35
+ backgroundColor: (((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || "rgb( 0, 0, 0 )").replace(")", ",.1)"),
36
+ color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
37
+ }
38
+ }
39
+ },
40
+ children: [
41
+ error && /* @__PURE__ */ jsxs(Fragment, { children: [
42
+ /* @__PURE__ */ jsx(
43
+ warning_default,
44
+ {
45
+ ...{
46
+ className: "w-4 h-4",
47
+ "aria-hidden": true
48
+ }
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsxs(
52
+ "span",
53
+ {
54
+ ...{
55
+ className: "text-[0px] opacity-0 w-0 h-0 absolute"
56
+ },
57
+ children: [
58
+ label ? /* @__PURE__ */ jsxs(Fragment, { children: [
59
+ label,
60
+ ": "
61
+ ] }) : null,
62
+ error
63
+ ]
64
+ }
65
+ )
66
+ ] }),
67
+ /* @__PURE__ */ jsx(
68
+ "span",
69
+ {
70
+ ...{
71
+ ...error && {
72
+ "aria-hidden": true
73
+ }
74
+ },
75
+ children: error || message
76
+ }
77
+ )
78
+ ]
79
+ }
80
+ );
81
+ };
82
+ var input_group_error_default = InputGroupError;
83
+
84
+ export {
85
+ input_group_error_default
86
+ };
@@ -15,9 +15,9 @@ var WrapperGradient = ({
15
15
  const showX = horizontal === true || horizontal === "both";
16
16
  const showY = horizontal === false || horizontal === "both";
17
17
  const overflowClass = horizontal === "both" ? "overflow-scroll" : horizontal ? "overflow-x-scroll overflow-y-visible" : "overflow-y-scroll overflow-x-visible";
18
- const overscrollClass = horizontal === "both" ? "overscroll-none" : horizontal ? "overscroll-x-none overscroll-y-auto" : "overscroll-y-none overscroll-x-auto";
18
+ const overscrollClass = horizontal ? "overscroll-x-none" : "";
19
19
  const themed = Boolean(color);
20
- const gradientDefaults = "absolute z-[2] " + (themed ? "pointer-events-none " : "") + "transition-all duration-[100ms] ";
20
+ const gradientDefaults = "absolute z-[2] pointer-events-none transition-all duration-[100ms] ";
21
21
  const classes = {
22
22
  container: [
23
23
  themed ? "relative" : "w-full relative",
@@ -0,0 +1,41 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // components/embla-fade.js
31
+ var embla_fade_exports = {};
32
+ __export(embla_fade_exports, {
33
+ default: () => import_embla_carousel_fade.default
34
+ });
35
+ module.exports = __toCommonJS(embla_fade_exports);
36
+ var import_embla_carousel_fade = __toESM(require("embla-carousel-fade"));
37
+ __reExport(embla_fade_exports, require("embla-carousel-fade"), module.exports);
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ ...require("embla-carousel-fade")
41
+ });
@@ -0,0 +1,6 @@
1
+ // components/embla-fade.js
2
+ import { default as default2 } from "embla-carousel-fade";
3
+ export * from "embla-carousel-fade";
4
+ export {
5
+ default2 as default
6
+ };
@@ -0,0 +1,129 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // components/input-group-error.js
20
+ var input_group_error_exports = {};
21
+ __export(input_group_error_exports, {
22
+ default: () => input_group_error_default
23
+ });
24
+ module.exports = __toCommonJS(input_group_error_exports);
25
+ var import_react = require("react");
26
+
27
+ // components/icons/warning.js
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
30
+ "svg",
31
+ {
32
+ ...{
33
+ fill: "none",
34
+ stroke: "currentColor",
35
+ strokeWidth: 1.5,
36
+ viewBox: "0 0 24 24",
37
+ ...props
38
+ },
39
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ "path",
41
+ {
42
+ ...{
43
+ d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z",
44
+ strokeLinecap: "round",
45
+ strokeLinejoin: "round"
46
+ }
47
+ }
48
+ )
49
+ }
50
+ );
51
+ var warning_default = Warning;
52
+
53
+ // components/input-group-error.js
54
+ var import_jsx_runtime2 = require("react/jsx-runtime");
55
+ var InputGroupError = ({
56
+ className,
57
+ error,
58
+ label,
59
+ message,
60
+ style = {}
61
+ }) => {
62
+ var _a, _b, _c, _d;
63
+ if (!(error || message)) {
64
+ return null;
65
+ }
66
+ const classes = [
67
+ "flex items-center justify-start space-x-2 py-1 rounded text-sm"
68
+ ];
69
+ if (error) {
70
+ classes.push("px-1.5");
71
+ }
72
+ if (className) {
73
+ classes.push(className);
74
+ }
75
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
76
+ "p",
77
+ {
78
+ ...{
79
+ className: classes.join(" "),
80
+ ...error && {
81
+ style: {
82
+ backgroundColor: (((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || "rgb( 0, 0, 0 )").replace(")", ",.1)"),
83
+ color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
84
+ }
85
+ }
86
+ },
87
+ children: [
88
+ error && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
89
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
90
+ warning_default,
91
+ {
92
+ ...{
93
+ className: "w-4 h-4",
94
+ "aria-hidden": true
95
+ }
96
+ }
97
+ ),
98
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
99
+ "span",
100
+ {
101
+ ...{
102
+ className: "text-[0px] opacity-0 w-0 h-0 absolute"
103
+ },
104
+ children: [
105
+ label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
106
+ label,
107
+ ": "
108
+ ] }) : null,
109
+ error
110
+ ]
111
+ }
112
+ )
113
+ ] }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
115
+ "span",
116
+ {
117
+ ...{
118
+ ...error && {
119
+ "aria-hidden": true
120
+ }
121
+ },
122
+ children: error || message
123
+ }
124
+ )
125
+ ]
126
+ }
127
+ );
128
+ };
129
+ var input_group_error_default = InputGroupError;
@@ -0,0 +1,7 @@
1
+ import {
2
+ input_group_error_default
3
+ } from "./chunk-OHJMWJAQ.mjs";
4
+ import "./chunk-Q3UIVGPQ.mjs";
5
+ export {
6
+ input_group_error_default as default
7
+ };