@drawbridge/components 0.0.44 → 0.0.46

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,23 +1,42 @@
1
1
  "use client";
2
2
  import {
3
3
  product_default
4
- } from "./chunk-I2HL7C6E.mjs";
5
- import "./chunk-BD3TDNJE.mjs";
6
- import "./chunk-FYA7EAMR.mjs";
4
+ } from "./chunk-X7CR4JVY.mjs";
7
5
  import "./chunk-2ZYGRSSA.mjs";
8
6
  import "./chunk-XWELEL6Z.mjs";
9
- import {
10
- card_advertisement_default
11
- } from "./chunk-TJNIR4PF.mjs";
12
- import "./chunk-JJH46E7B.mjs";
7
+ import "./chunk-3SAKIKZP.mjs";
13
8
  import "./chunk-Q3UIVGPQ.mjs";
14
- import "./chunk-FJXG3REN.mjs";
9
+ import "./chunk-3SXAH7B7.mjs";
10
+ import "./chunk-FYA7EAMR.mjs";
11
+ import {
12
+ buttonStyle
13
+ } from "./chunk-FJ7PKMAC.mjs";
15
14
 
16
15
  // components/advertisement.js
17
- import { jsx } from "react/jsx-runtime";
16
+ import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ var DefaultImage = ({ alt, className, src }) => /* @__PURE__ */ jsx(
19
+ "img",
20
+ {
21
+ ...{
22
+ alt,
23
+ className,
24
+ src
25
+ }
26
+ }
27
+ );
28
+ var DefaultVideo = ({ className, hls, mp4, poster }) => /* @__PURE__ */ jsx(
29
+ "video",
30
+ {
31
+ ...{
32
+ className,
33
+ poster,
34
+ src: mp4 || hls
35
+ }
36
+ }
37
+ );
18
38
  var Advertisement = ({
19
39
  action = null,
20
- affiliate,
21
40
  brand,
22
41
  button,
23
42
  campaign,
@@ -26,16 +45,13 @@ var Advertisement = ({
26
45
  file,
27
46
  fonts,
28
47
  header,
29
- id,
30
- ImageComponent,
48
+ ImageComponent = DefaultImage,
31
49
  lead,
32
50
  onAdd,
33
51
  onBuy,
34
52
  onClick = () => {
35
53
  },
36
54
  onVariantChange,
37
- onVariantSelect = () => {
38
- },
39
55
  organization,
40
56
  page,
41
57
  preview = false,
@@ -44,8 +60,9 @@ var Advertisement = ({
44
60
  title,
45
61
  url,
46
62
  variant,
47
- VideoComponent
63
+ VideoComponent = DefaultVideo
48
64
  }) => {
65
+ var _a, _b, _c, _d, _e;
49
66
  if (product) {
50
67
  return /* @__PURE__ */ jsx(
51
68
  product_default,
@@ -61,36 +78,137 @@ var Advertisement = ({
61
78
  onBuy,
62
79
  onVariantChange,
63
80
  product,
64
- style,
81
+ style: (brand == null ? void 0 : brand.style) || style,
65
82
  variant
66
83
  }
67
84
  }
68
85
  );
69
86
  }
70
- return /* @__PURE__ */ jsx(
71
- card_advertisement_default,
87
+ const base = (brand == null ? void 0 : brand.style) || style;
88
+ const resolved = {
89
+ ...base,
90
+ background: {
91
+ ...base == null ? void 0 : base.background,
92
+ color: ((_a = base == null ? void 0 : base.background) == null ? void 0 : _a.color) || { hex: "#FFFFFF", rgb: "rgb( 255, 255, 255 )" }
93
+ },
94
+ text: {
95
+ ...base == null ? void 0 : base.text,
96
+ color: ((_b = base == null ? void 0 : base.text) == null ? void 0 : _b.color) || { hex: "#000000", rgb: "rgb( 0, 0, 0 )" }
97
+ }
98
+ };
99
+ const isVideo = (_c = file == null ? void 0 : file.mimetype) == null ? void 0 : _c.includes("video");
100
+ const card = (assetNode) => /* @__PURE__ */ jsxs(
101
+ "div",
72
102
  {
73
103
  ...{
74
- advertisement: id,
75
- affiliate,
76
- asset: file,
77
- brand: brand || { style },
78
- button,
79
- campaign,
80
- fonts,
81
- ImageComponent,
82
- lead,
83
- onClick,
84
- onVariantSelect,
85
- organization,
86
- page,
87
- preview,
88
- title,
89
- url,
90
- VideoComponent
91
- }
104
+ className: "block w-full space-y-2",
105
+ style: {
106
+ backgroundColor: resolved.background.color.hex,
107
+ color: resolved.text.color.hex
108
+ }
109
+ },
110
+ children: [
111
+ /* @__PURE__ */ jsx(
112
+ "span",
113
+ {
114
+ ...{
115
+ className: "block relative aspect-square rounded overflow-hidden" + ((file == null ? void 0 : file.sizes) ? "" : " bg-gray-light")
116
+ },
117
+ children: assetNode
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsxs(
121
+ "span",
122
+ {
123
+ ...{
124
+ className: "flex flex-col items-center justify-between gap-x-4 text-center text-sm rounded",
125
+ style: {
126
+ ...fonts == null ? void 0 : fonts.body,
127
+ color: resolved.text.color.hex,
128
+ gap: "10px",
129
+ marginTop: "10px"
130
+ }
131
+ },
132
+ children: [
133
+ /* @__PURE__ */ jsx(
134
+ "div",
135
+ {
136
+ ...{
137
+ className: "flex-1 min-w-0 space-y-2"
138
+ },
139
+ children: title && /* @__PURE__ */ jsx(
140
+ "p",
141
+ {
142
+ ...{
143
+ style: {
144
+ fontSize: "18px"
145
+ }
146
+ },
147
+ children: title
148
+ }
149
+ )
150
+ }
151
+ ),
152
+ button && /* @__PURE__ */ jsx(
153
+ "button",
154
+ {
155
+ ...{
156
+ className: "flex items-center justify-center py-3 px-4 w-full border",
157
+ disabled: !preview && !url,
158
+ onClick: preview ? () => {
159
+ } : onClick,
160
+ style: buttonStyle(resolved),
161
+ type: "button"
162
+ },
163
+ children: button
164
+ }
165
+ )
166
+ ]
167
+ }
168
+ )
169
+ ]
92
170
  }
93
171
  );
172
+ if (isVideo) {
173
+ return card(
174
+ /* @__PURE__ */ jsx(
175
+ "div",
176
+ {
177
+ ...{
178
+ className: "relative h-full w-full aspect-[9/16]"
179
+ },
180
+ children: /* @__PURE__ */ jsx(
181
+ VideoComponent,
182
+ {
183
+ ...{
184
+ className: "w-full h-full",
185
+ hls: cdnSrc(file, "hls", file == null ? void 0 : file.updatedAt),
186
+ 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),
188
+ style: resolved
189
+ }
190
+ }
191
+ )
192
+ }
193
+ )
194
+ );
195
+ }
196
+ return card(
197
+ /* @__PURE__ */ jsx(
198
+ ImageComponent,
199
+ {
200
+ ...{
201
+ alt: file == null ? void 0 : file.filename,
202
+ className: "w-full h-full object-cover",
203
+ fill: true,
204
+ priority: false,
205
+ sizes: "100%",
206
+ src: cdnSrc(file, "400x400", file == null ? void 0 : file.updatedAt)
207
+ }
208
+ },
209
+ file == null ? void 0 : file.id
210
+ )
211
+ );
94
212
  };
95
213
  var advertisement_default = Advertisement;
96
214
  export {
@@ -60,10 +60,10 @@ var InputGroup = ({
60
60
  {
61
61
  ...{
62
62
  className: "flex items-center justify-start space-x-2 py-1 rounded text-sm " + (error && "px-1.5"),
63
- ...error && Object.keys(style).length > 0 && {
63
+ ...error && {
64
64
  style: {
65
- backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb.replace(")", ",.1)"),
66
- color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
65
+ 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)"),
66
+ color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
67
67
  }
68
68
  }
69
69
  },
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FYA7EAMR.mjs";
4
4
  import {
5
5
  inputStyle
6
- } from "./chunk-FJXG3REN.mjs";
6
+ } from "./chunk-FJ7PKMAC.mjs";
7
7
 
8
8
  // components/input-select.js
9
9
  import { useEffect, useState } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inputStyle
3
- } from "./chunk-FJXG3REN.mjs";
3
+ } from "./chunk-FJ7PKMAC.mjs";
4
4
 
5
5
  // components/input-text.js
6
6
  import { jsx } from "react/jsx-runtime";
@@ -0,0 +1,88 @@
1
+ // components/styles.js
2
+ var WHITE = "rgb( 255, 255, 255 )";
3
+ var BLACK = "rgb( 0, 0, 0 )";
4
+ var bgColor = (style) => {
5
+ var _a, _b;
6
+ return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
7
+ };
8
+ var textColor = (style) => {
9
+ var _a, _b;
10
+ return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
11
+ };
12
+ var backgroundStyle = (style) => ({
13
+ backgroundColor: bgColor(style),
14
+ color: textColor(style)
15
+ });
16
+ var borderStyle = (style) => ({
17
+ borderColor: textColor(style)
18
+ });
19
+ var buttonStyle = (style) => {
20
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21
+ return {
22
+ 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),
23
+ 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),
24
+ borderRadius: ((_g = style == null ? void 0 : style.button) == null ? void 0 : _g.radius) != null ? style.button.radius / 4 + "px" : void 0,
25
+ 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)
26
+ };
27
+ };
28
+ var closeStyle = (style) => ({
29
+ backgroundColor: textColor(style),
30
+ color: bgColor(style)
31
+ });
32
+ var headerStyle = (style) => {
33
+ var _a, _b, _c;
34
+ return {
35
+ fontFamily: (_a = style == null ? void 0 : style.heading) == null ? void 0 : _a.family,
36
+ fontWeight: (_b = style == null ? void 0 : style.heading) == null ? void 0 : _b.weight,
37
+ textTransform: (_c = style == null ? void 0 : style.heading) == null ? void 0 : _c.transform
38
+ };
39
+ };
40
+ var inputStyle = (style) => {
41
+ var _a;
42
+ return {
43
+ backgroundColor: bgColor(style),
44
+ borderColor: textColor(style),
45
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
46
+ color: textColor(style)
47
+ };
48
+ };
49
+ var inputCheckboxStyle = (style) => {
50
+ var _a;
51
+ return {
52
+ ...inputStyle(style),
53
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? Math.min(style.input.radius / 4, 6) + "px" : void 0
54
+ };
55
+ };
56
+ var inputNameStyle = (style) => inputStyle(style);
57
+ var inputPhoneStyle = (style) => inputStyle(style);
58
+ var menuStyle = (style) => ({
59
+ backgroundColor: bgColor(style),
60
+ borderColor: textColor(style),
61
+ color: textColor(style)
62
+ });
63
+ var selectStyle = (style) => {
64
+ var _a;
65
+ return {
66
+ borderColor: textColor(style).replace(")", ", 0.3)"),
67
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
68
+ color: textColor(style)
69
+ };
70
+ };
71
+ var textStyle = (style) => ({
72
+ color: textColor(style)
73
+ });
74
+
75
+ export {
76
+ backgroundStyle,
77
+ borderStyle,
78
+ buttonStyle,
79
+ closeStyle,
80
+ headerStyle,
81
+ inputStyle,
82
+ inputCheckboxStyle,
83
+ inputNameStyle,
84
+ inputPhoneStyle,
85
+ menuStyle,
86
+ selectStyle,
87
+ textStyle
88
+ };
@@ -1,6 +1,3 @@
1
- import {
2
- input_select_default
3
- } from "./chunk-BD3TDNJE.mjs";
4
1
  import {
5
2
  loader_default
6
3
  } from "./chunk-2ZYGRSSA.mjs";
@@ -9,11 +6,14 @@ import {
9
6
  } from "./chunk-XWELEL6Z.mjs";
10
7
  import {
11
8
  input_group_default
12
- } from "./chunk-JJH46E7B.mjs";
9
+ } from "./chunk-3SAKIKZP.mjs";
10
+ import {
11
+ input_select_default
12
+ } from "./chunk-3SXAH7B7.mjs";
13
13
  import {
14
14
  buttonStyle,
15
15
  inputStyle
16
- } from "./chunk-FJXG3REN.mjs";
16
+ } from "./chunk-FJ7PKMAC.mjs";
17
17
 
18
18
  // components/product.js
19
19
  import { useEffect, useMemo, useState } from "react";
@@ -48,14 +48,25 @@ var Product = ({
48
48
  style = {},
49
49
  variant
50
50
  }) => {
51
- var _a, _b, _c, _d, _e, _f, _g;
51
+ var _a, _b, _c, _d, _e;
52
+ const resolved = {
53
+ ...style,
54
+ background: {
55
+ ...style == null ? void 0 : style.background,
56
+ color: ((_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) || { hex: "#FFFFFF", rgb: "rgb( 255, 255, 255 )" }
57
+ },
58
+ text: {
59
+ ...style == null ? void 0 : style.text,
60
+ color: ((_b = style == null ? void 0 : style.text) == null ? void 0 : _b.color) || { hex: "#000000", rgb: "rgb( 0, 0, 0 )" }
61
+ }
62
+ };
52
63
  const available = useMemo(
53
64
  () => ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale),
54
65
  [product]
55
66
  );
56
67
  const [activeImage, setActiveImage] = useState(0);
57
68
  const [emblaRef, emblaApi] = useEmblaCarousel();
58
- const selectedVariant = available.find((v) => v.id === variant) || null;
69
+ const selectedVariant = available.find((v) => v.id === variant) || available[0] || null;
59
70
  const images = useMemo(
60
71
  () => {
61
72
  const variants = ((product == null ? void 0 : product.variants) || []).filter((v) => v.availableForSale);
@@ -110,7 +121,11 @@ var Product = ({
110
121
  "div",
111
122
  {
112
123
  ...{
113
- className: "space-y-6 pb-12"
124
+ className: "space-y-6 pb-12",
125
+ style: {
126
+ backgroundColor: resolved.background.color.rgb,
127
+ color: resolved.text.color.rgb
128
+ }
114
129
  },
115
130
  children: [
116
131
  header,
@@ -126,7 +141,7 @@ var Product = ({
126
141
  {
127
142
  ...{
128
143
  classNameScroll: "flex flex-col w-12 h-48 space-y-3",
129
- color: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
144
+ color: resolved.background.color.rgb
130
145
  },
131
146
  children: images.map(({ src }, key) => /* @__PURE__ */ jsx(
132
147
  "button",
@@ -139,7 +154,7 @@ var Product = ({
139
154
  },
140
155
  type: "button",
141
156
  ...activeImage === key && {
142
- style: inputStyle(style)
157
+ style: inputStyle(resolved)
143
158
  }
144
159
  },
145
160
  children: /* @__PURE__ */ jsx(
@@ -233,7 +248,7 @@ var Product = ({
233
248
  {
234
249
  ...{
235
250
  classNameScroll: "max-h-[4.5em]",
236
- color: (_g = (_f = style == null ? void 0 : style.background) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
251
+ color: resolved.background.color.rgb
237
252
  },
238
253
  children: /* @__PURE__ */ jsx("p", { children: product.description })
239
254
  }
@@ -256,12 +271,12 @@ var Product = ({
256
271
  label: v.title,
257
272
  value: v.id
258
273
  })),
259
- style,
274
+ style: resolved,
260
275
  value: variant || ""
261
276
  }
262
277
  }
263
278
  ),
264
- style
279
+ style: resolved
265
280
  }
266
281
  }
267
282
  ),
@@ -281,10 +296,10 @@ var Product = ({
281
296
  "button",
282
297
  {
283
298
  ...{
284
- className: "button justify-center border",
299
+ className: "button justify-center border py-3 px-4 rounded",
285
300
  disabled: disabled || Boolean(action),
286
301
  onClick: onAdd,
287
- style: inputStyle(style),
302
+ style: inputStyle(resolved),
288
303
  type: "button"
289
304
  },
290
305
  children: action === "add" ? /* @__PURE__ */ jsx(
@@ -301,10 +316,10 @@ var Product = ({
301
316
  "button",
302
317
  {
303
318
  ...{
304
- className: "button justify-center" + (addToCart ? "" : " w-full"),
319
+ className: "button justify-center py-3 px-4 rounded" + (addToCart ? "" : " w-full"),
305
320
  disabled: disabled || Boolean(action),
306
321
  onClick: onBuy,
307
- style: buttonStyle(style),
322
+ style: buttonStyle(resolved),
308
323
  type: "button"
309
324
  },
310
325
  children: action === "buy" ? /* @__PURE__ */ jsx(
@@ -320,7 +335,7 @@ var Product = ({
320
335
  ]
321
336
  }
322
337
  ),
323
- style
338
+ style: resolved
324
339
  }
325
340
  }
326
341
  )
@@ -50,13 +50,23 @@ var Check = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
50
50
  var check_default = Check;
51
51
 
52
52
  // components/styles.js
53
+ var WHITE = "rgb( 255, 255, 255 )";
54
+ var BLACK = "rgb( 0, 0, 0 )";
55
+ var bgColor = (style) => {
56
+ var _a, _b;
57
+ return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
58
+ };
59
+ var textColor = (style) => {
60
+ var _a, _b;
61
+ return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
62
+ };
53
63
  var inputStyle = (style) => {
54
- var _a, _b, _c, _d, _e, _f, _g;
64
+ var _a;
55
65
  return {
56
- backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
57
- borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
58
- borderRadius: ((_e = style == null ? void 0 : style.input) == null ? void 0 : _e.radius) != null ? style.input.radius / 4 + "px" : void 0,
59
- color: (_g = (_f = style == null ? void 0 : style.text) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
66
+ backgroundColor: bgColor(style),
67
+ borderColor: textColor(style),
68
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
69
+ color: textColor(style)
60
70
  };
61
71
  };
62
72
  var inputCheckboxStyle = (style) => {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GFDZ7ER6.mjs";
4
4
  import {
5
5
  inputCheckboxStyle
6
- } from "./chunk-FJXG3REN.mjs";
6
+ } from "./chunk-FJ7PKMAC.mjs";
7
7
 
8
8
  // components/input-checkbox.js
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -107,10 +107,10 @@ var InputGroup = ({
107
107
  {
108
108
  ...{
109
109
  className: "flex items-center justify-start space-x-2 py-1 rounded text-sm " + (error && "px-1.5"),
110
- ...error && Object.keys(style).length > 0 && {
110
+ ...error && {
111
111
  style: {
112
- backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb.replace(")", ",.1)"),
113
- color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
112
+ 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)"),
113
+ color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
114
114
  }
115
115
  }
116
116
  },
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  input_group_default
3
- } from "./chunk-JJH46E7B.mjs";
3
+ } from "./chunk-3SAKIKZP.mjs";
4
4
  import "./chunk-Q3UIVGPQ.mjs";
5
5
  export {
6
6
  input_group_default as default
@@ -109,10 +109,10 @@ var InputGroup = ({
109
109
  {
110
110
  ...{
111
111
  className: "flex items-center justify-start space-x-2 py-1 rounded text-sm " + (error && "px-1.5"),
112
- ...error && Object.keys(style).length > 0 && {
112
+ ...error && {
113
113
  style: {
114
- backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb.replace(")", ",.1)"),
115
- color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
114
+ 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)"),
115
+ color: ((_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "rgb( 0, 0, 0 )"
116
116
  }
117
117
  }
118
118
  },
@@ -162,13 +162,23 @@ var InputGroup = ({
162
162
  var input_group_default = InputGroup;
163
163
 
164
164
  // components/styles.js
165
+ var WHITE = "rgb( 255, 255, 255 )";
166
+ var BLACK = "rgb( 0, 0, 0 )";
167
+ var bgColor = (style) => {
168
+ var _a, _b;
169
+ return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
170
+ };
171
+ var textColor = (style) => {
172
+ var _a, _b;
173
+ return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
174
+ };
165
175
  var inputStyle = (style) => {
166
- var _a, _b, _c, _d, _e, _f, _g;
176
+ var _a;
167
177
  return {
168
- backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
169
- borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
170
- borderRadius: ((_e = style == null ? void 0 : style.input) == null ? void 0 : _e.radius) != null ? style.input.radius / 4 + "px" : void 0,
171
- color: (_g = (_f = style == null ? void 0 : style.text) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
178
+ backgroundColor: bgColor(style),
179
+ borderColor: textColor(style),
180
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
181
+ color: textColor(style)
172
182
  };
173
183
  };
174
184
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  input_text_default
3
- } from "./chunk-BZ6WMIH7.mjs";
3
+ } from "./chunk-B6Y2SNRW.mjs";
4
4
  import {
5
5
  input_group_default
6
- } from "./chunk-JJH46E7B.mjs";
6
+ } from "./chunk-3SAKIKZP.mjs";
7
7
  import "./chunk-Q3UIVGPQ.mjs";
8
- import "./chunk-FJXG3REN.mjs";
8
+ import "./chunk-FJ7PKMAC.mjs";
9
9
 
10
10
  // components/input-name.js
11
11
  import { jsx } from "react/jsx-runtime";
@@ -76,13 +76,23 @@ var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
76
76
  var plus_default = Plus;
77
77
 
78
78
  // components/styles.js
79
+ var WHITE = "rgb( 255, 255, 255 )";
80
+ var BLACK = "rgb( 0, 0, 0 )";
81
+ var bgColor = (style) => {
82
+ var _a, _b;
83
+ return ((_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || WHITE;
84
+ };
85
+ var textColor = (style) => {
86
+ var _a, _b;
87
+ return ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || BLACK;
88
+ };
79
89
  var inputStyle = (style) => {
80
- var _a, _b, _c, _d, _e, _f, _g;
90
+ var _a;
81
91
  return {
82
- backgroundColor: (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb,
83
- borderColor: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb,
84
- borderRadius: ((_e = style == null ? void 0 : style.input) == null ? void 0 : _e.radius) != null ? style.input.radius / 4 + "px" : void 0,
85
- color: (_g = (_f = style == null ? void 0 : style.text) == null ? void 0 : _f.color) == null ? void 0 : _g.rgb
92
+ backgroundColor: bgColor(style),
93
+ borderColor: textColor(style),
94
+ borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? style.input.radius / 4 + "px" : void 0,
95
+ color: textColor(style)
86
96
  };
87
97
  };
88
98
 
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-HH7WF5BT.mjs";
7
7
  import {
8
8
  inputStyle
9
- } from "./chunk-FJXG3REN.mjs";
9
+ } from "./chunk-FJ7PKMAC.mjs";
10
10
 
11
11
  // components/input-number.js
12
12
  import { useCallback } from "react";