@drawbridge/components 0.0.39 → 0.0.40
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 +1299 -0
- package/dist/advertisement.mjs +95 -0
- package/dist/card-advertisement.mjs +3 -354
- package/dist/chunk-2ZYGRSSA.mjs +45 -0
- package/dist/chunk-7ZLMDYBR.mjs +113 -0
- package/dist/chunk-BD3TDNJE.mjs +98 -0
- package/dist/chunk-FJXG3REN.mjs +93 -0
- package/dist/chunk-FYA7EAMR.mjs +29 -0
- package/dist/chunk-GFDZ7ER6.mjs +29 -0
- package/dist/chunk-HDOA3Y3U.mjs +334 -0
- package/dist/chunk-HH7WF5BT.mjs +29 -0
- package/dist/chunk-Q3UIVGPQ.mjs +29 -0
- package/dist/chunk-T5QQBFM3.mjs +29 -0
- package/dist/chunk-TJNIR4PF.mjs +358 -0
- package/dist/chunk-XWELEL6Z.mjs +208 -0
- package/dist/embla.js +41 -0
- package/dist/embla.mjs +6 -0
- package/dist/icons/arrow-down-tray.js +48 -0
- package/dist/icons/arrow-down-tray.mjs +28 -0
- package/dist/icons/arrow-left.js +48 -0
- package/dist/icons/arrow-left.mjs +28 -0
- package/dist/icons/arrow-right.js +48 -0
- package/dist/icons/arrow-right.mjs +28 -0
- package/dist/icons/arrow-up-tray.js +48 -0
- package/dist/icons/arrow-up-tray.mjs +28 -0
- package/dist/icons/bars-arrow-down.js +48 -0
- package/dist/icons/bars-arrow-down.mjs +28 -0
- package/dist/icons/bars-arrow-up.js +48 -0
- package/dist/icons/bars-arrow-up.mjs +28 -0
- package/dist/icons/bold.js +47 -0
- package/dist/icons/bold.mjs +27 -0
- package/dist/icons/bolt.js +48 -0
- package/dist/icons/bolt.mjs +28 -0
- package/dist/icons/calendar.js +48 -0
- package/dist/icons/calendar.mjs +28 -0
- package/dist/icons/cancel.js +48 -0
- package/dist/icons/cancel.mjs +28 -0
- package/dist/icons/card.js +48 -0
- package/dist/icons/card.mjs +28 -0
- package/dist/icons/chart.js +48 -0
- package/dist/icons/chart.mjs +28 -0
- package/dist/icons/check.js +48 -0
- package/dist/icons/check.mjs +6 -0
- package/dist/icons/chevron-down.js +48 -0
- package/dist/icons/chevron-down.mjs +6 -0
- package/dist/icons/chevron-left.js +48 -0
- package/dist/icons/chevron-left.mjs +28 -0
- package/dist/icons/chevron-right.js +48 -0
- package/dist/icons/chevron-right.mjs +28 -0
- package/dist/icons/chevron-up-down.js +48 -0
- package/dist/icons/chevron-up-down.mjs +28 -0
- package/dist/icons/chevron-up.js +48 -0
- package/dist/icons/chevron-up.mjs +28 -0
- package/dist/icons/clock.js +48 -0
- package/dist/icons/clock.mjs +28 -0
- package/dist/icons/code-bracket.js +48 -0
- package/dist/icons/code-bracket.mjs +28 -0
- package/dist/icons/cog.js +60 -0
- package/dist/icons/cog.mjs +40 -0
- package/dist/icons/copy.js +48 -0
- package/dist/icons/copy.mjs +28 -0
- package/dist/icons/document.js +48 -0
- package/dist/icons/document.mjs +28 -0
- package/dist/icons/download.js +48 -0
- package/dist/icons/download.mjs +28 -0
- package/dist/icons/drag.js +51 -0
- package/dist/icons/drag.mjs +31 -0
- package/dist/icons/ellipsis.js +48 -0
- package/dist/icons/ellipsis.mjs +28 -0
- package/dist/icons/email.js +48 -0
- package/dist/icons/email.mjs +28 -0
- package/dist/icons/external.js +48 -0
- package/dist/icons/external.mjs +28 -0
- package/dist/icons/filter.js +48 -0
- package/dist/icons/filter.mjs +28 -0
- package/dist/icons/flag.js +48 -0
- package/dist/icons/flag.mjs +28 -0
- package/dist/icons/google.js +74 -0
- package/dist/icons/google.mjs +54 -0
- package/dist/icons/home.js +48 -0
- package/dist/icons/home.mjs +28 -0
- package/dist/icons/image.js +48 -0
- package/dist/icons/image.mjs +28 -0
- package/dist/icons/italic.js +48 -0
- package/dist/icons/italic.mjs +28 -0
- package/dist/icons/link.js +48 -0
- package/dist/icons/link.mjs +28 -0
- package/dist/icons/loader.js +64 -0
- package/dist/icons/loader.mjs +6 -0
- package/dist/icons/lock.js +48 -0
- package/dist/icons/lock.mjs +28 -0
- package/dist/icons/logo-mark.js +55 -0
- package/dist/icons/logo-mark.mjs +35 -0
- package/dist/icons/logo-tagline.js +137 -0
- package/dist/icons/logo-tagline.mjs +117 -0
- package/dist/icons/map-pin.js +60 -0
- package/dist/icons/map-pin.mjs +40 -0
- package/dist/icons/menu.js +48 -0
- package/dist/icons/menu.mjs +28 -0
- package/dist/icons/minus.js +48 -0
- package/dist/icons/minus.mjs +6 -0
- package/dist/icons/muted.js +48 -0
- package/dist/icons/muted.mjs +28 -0
- package/dist/icons/pause.js +48 -0
- package/dist/icons/pause.mjs +28 -0
- package/dist/icons/pencil.js +48 -0
- package/dist/icons/pencil.mjs +28 -0
- package/dist/icons/play.js +48 -0
- package/dist/icons/play.mjs +28 -0
- package/dist/icons/plus.js +48 -0
- package/dist/icons/plus.mjs +6 -0
- package/dist/icons/powered-by.js +45 -0
- package/dist/icons/powered-by.mjs +25 -0
- package/dist/icons/qr-code.js +60 -0
- package/dist/icons/qr-code.mjs +40 -0
- package/dist/icons/queue.js +48 -0
- package/dist/icons/queue.mjs +28 -0
- package/dist/icons/refresh.js +48 -0
- package/dist/icons/refresh.mjs +28 -0
- package/dist/icons/refund.js +48 -0
- package/dist/icons/refund.mjs +28 -0
- package/dist/icons/rocket.js +48 -0
- package/dist/icons/rocket.mjs +28 -0
- package/dist/icons/search.js +48 -0
- package/dist/icons/search.mjs +28 -0
- package/dist/icons/share.js +48 -0
- package/dist/icons/share.mjs +28 -0
- package/dist/icons/shop.js +46 -0
- package/dist/icons/shop.mjs +26 -0
- package/dist/icons/sparkles.js +48 -0
- package/dist/icons/sparkles.mjs +28 -0
- package/dist/icons/star.js +48 -0
- package/dist/icons/star.mjs +28 -0
- package/dist/icons/switch.js +48 -0
- package/dist/icons/switch.mjs +28 -0
- package/dist/icons/times.js +48 -0
- package/dist/icons/times.mjs +28 -0
- package/dist/icons/trash.js +48 -0
- package/dist/icons/trash.mjs +28 -0
- package/dist/icons/underline.js +48 -0
- package/dist/icons/underline.mjs +28 -0
- package/dist/icons/upload.js +48 -0
- package/dist/icons/upload.mjs +28 -0
- package/dist/icons/volume.js +48 -0
- package/dist/icons/volume.mjs +28 -0
- package/dist/icons/warning.js +48 -0
- package/dist/icons/warning.mjs +6 -0
- package/dist/input-checkbox.js +130 -0
- package/dist/input-checkbox.mjs +71 -0
- package/dist/input-group.js +156 -0
- package/dist/input-group.mjs +7 -0
- package/dist/input-number.js +211 -0
- package/dist/input-number.mjs +136 -0
- package/dist/input-select.js +150 -0
- package/dist/input-select.mjs +9 -0
- package/dist/input-text.js +65 -0
- package/dist/input-text.mjs +36 -0
- package/dist/input-textarea.js +69 -0
- package/dist/input-textarea.mjs +40 -0
- package/dist/product.js +864 -0
- package/dist/product.mjs +14 -0
- package/dist/styles.js +127 -0
- package/dist/styles.mjs +28 -0
- package/dist/video.js +177 -0
- package/dist/video.mjs +107 -0
- package/dist/wrapper-gradient.js +232 -0
- package/dist/wrapper-gradient.mjs +9 -0
- package/package.json +312 -2
- package/types/advertisement.d.ts +35 -0
- package/types/embla.d.ts +2 -0
- package/types/icons/arrow-down-tray.d.ts +5 -0
- package/types/icons/arrow-left.d.ts +5 -0
- package/types/icons/arrow-right.d.ts +5 -0
- package/types/icons/arrow-up-tray.d.ts +5 -0
- package/types/icons/bars-arrow-down.d.ts +5 -0
- package/types/icons/bars-arrow-up.d.ts +5 -0
- package/types/icons/bold.d.ts +5 -0
- package/types/icons/bolt.d.ts +5 -0
- package/types/icons/calendar.d.ts +5 -0
- package/types/icons/cancel.d.ts +5 -0
- package/types/icons/card.d.ts +5 -0
- package/types/icons/chart.d.ts +5 -0
- package/types/icons/check.d.ts +5 -0
- package/types/icons/chevron-down.d.ts +5 -0
- package/types/icons/chevron-left.d.ts +5 -0
- package/types/icons/chevron-right.d.ts +5 -0
- package/types/icons/chevron-up-down.d.ts +5 -0
- package/types/icons/chevron-up.d.ts +5 -0
- package/types/icons/clock.d.ts +5 -0
- package/types/icons/code-bracket.d.ts +5 -0
- package/types/icons/cog.d.ts +5 -0
- package/types/icons/copy.d.ts +5 -0
- package/types/icons/document.d.ts +5 -0
- package/types/icons/download.d.ts +5 -0
- package/types/icons/drag.d.ts +5 -0
- package/types/icons/ellipsis.d.ts +5 -0
- package/types/icons/email.d.ts +5 -0
- package/types/icons/external.d.ts +5 -0
- package/types/icons/filter.d.ts +5 -0
- package/types/icons/flag.d.ts +5 -0
- package/types/icons/google.d.ts +5 -0
- package/types/icons/home.d.ts +5 -0
- package/types/icons/image.d.ts +5 -0
- package/types/icons/italic.d.ts +5 -0
- package/types/icons/link.d.ts +5 -0
- package/types/icons/loader.d.ts +5 -0
- package/types/icons/lock.d.ts +5 -0
- package/types/icons/logo-mark.d.ts +5 -0
- package/types/icons/logo-tagline.d.ts +5 -0
- package/types/icons/map-pin.d.ts +5 -0
- package/types/icons/menu.d.ts +5 -0
- package/types/icons/minus.d.ts +5 -0
- package/types/icons/muted.d.ts +5 -0
- package/types/icons/pause.d.ts +5 -0
- package/types/icons/pencil.d.ts +5 -0
- package/types/icons/play.d.ts +5 -0
- package/types/icons/plus.d.ts +5 -0
- package/types/icons/powered-by.d.ts +5 -0
- package/types/icons/qr-code.d.ts +5 -0
- package/types/icons/queue.d.ts +5 -0
- package/types/icons/refresh.d.ts +5 -0
- package/types/icons/refund.d.ts +5 -0
- package/types/icons/rocket.d.ts +5 -0
- package/types/icons/search.d.ts +5 -0
- package/types/icons/share.d.ts +5 -0
- package/types/icons/shop.d.ts +5 -0
- package/types/icons/sparkles.d.ts +5 -0
- package/types/icons/star.d.ts +5 -0
- package/types/icons/switch.d.ts +5 -0
- package/types/icons/times.d.ts +5 -0
- package/types/icons/trash.d.ts +5 -0
- package/types/icons/underline.d.ts +5 -0
- package/types/icons/upload.d.ts +5 -0
- package/types/icons/volume.d.ts +5 -0
- package/types/icons/warning.d.ts +5 -0
- package/types/input-checkbox.d.ts +14 -0
- package/types/input-group.d.ts +15 -0
- package/types/input-number.d.ts +17 -0
- package/types/input-select.d.ts +19 -0
- package/types/input-text.d.ts +12 -0
- package/types/input-textarea.d.ts +13 -0
- package/types/product.d.ts +20 -0
- package/types/styles.d.ts +37 -0
- package/types/video.d.ts +20 -0
- package/types/wrapper-gradient.d.ts +17 -0
|
@@ -0,0 +1,130 @@
|
|
|
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-checkbox.js
|
|
20
|
+
var input_checkbox_exports = {};
|
|
21
|
+
__export(input_checkbox_exports, {
|
|
22
|
+
default: () => input_checkbox_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(input_checkbox_exports);
|
|
25
|
+
|
|
26
|
+
// components/icons/check.js
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var Check = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
...{
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: 1.5,
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
...{
|
|
42
|
+
d: "m4.5 12.75 6 6 9-13.5",
|
|
43
|
+
strokeLinecap: "round",
|
|
44
|
+
strokeLinejoin: "round"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
var check_default = Check;
|
|
51
|
+
|
|
52
|
+
// components/styles.js
|
|
53
|
+
var inputStyle = (style) => {
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
55
|
+
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
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
var inputCheckboxStyle = (style) => {
|
|
63
|
+
var _a;
|
|
64
|
+
return {
|
|
65
|
+
...inputStyle(style),
|
|
66
|
+
borderRadius: ((_a = style == null ? void 0 : style.input) == null ? void 0 : _a.radius) != null ? Math.min(style.input.radius / 4, 6) + "px" : void 0
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// components/input-checkbox.js
|
|
71
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
72
|
+
var InputCheckbox = ({
|
|
73
|
+
className,
|
|
74
|
+
label,
|
|
75
|
+
labelId,
|
|
76
|
+
onChange,
|
|
77
|
+
style,
|
|
78
|
+
value,
|
|
79
|
+
...rest
|
|
80
|
+
}) => {
|
|
81
|
+
const classes = [
|
|
82
|
+
"inline-flex items-start space-x-2 w-full"
|
|
83
|
+
];
|
|
84
|
+
if (className) {
|
|
85
|
+
classes.push(className);
|
|
86
|
+
}
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
...{
|
|
91
|
+
className: classes.join(" ")
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
...{
|
|
98
|
+
className: "relative flex items-center justify-center w-5 h-5 rounded-xs text-inherit bg-inherit border border-inherit ring-0 outline-0 shrink-0 focus:ring-0 focus:ring-0 focus:ring-offset-0 focus:outline-1",
|
|
99
|
+
onClick: () => onChange(value ? false : true),
|
|
100
|
+
type: "button",
|
|
101
|
+
"aria-checked": value ? true : false,
|
|
102
|
+
"aria-labelledby": labelId,
|
|
103
|
+
style: inputCheckboxStyle(style),
|
|
104
|
+
...rest
|
|
105
|
+
},
|
|
106
|
+
children: Boolean(value) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
107
|
+
check_default,
|
|
108
|
+
{
|
|
109
|
+
...{
|
|
110
|
+
className: "absolute top-0 w-3.5 h-full pointer-events-none"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
...{
|
|
120
|
+
className: "leading-tight",
|
|
121
|
+
id: labelId
|
|
122
|
+
},
|
|
123
|
+
children: label
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
var input_checkbox_default = InputCheckbox;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
check_default
|
|
3
|
+
} from "./chunk-GFDZ7ER6.mjs";
|
|
4
|
+
import {
|
|
5
|
+
inputCheckboxStyle
|
|
6
|
+
} from "./chunk-FJXG3REN.mjs";
|
|
7
|
+
|
|
8
|
+
// components/input-checkbox.js
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var InputCheckbox = ({
|
|
11
|
+
className,
|
|
12
|
+
label,
|
|
13
|
+
labelId,
|
|
14
|
+
onChange,
|
|
15
|
+
style,
|
|
16
|
+
value,
|
|
17
|
+
...rest
|
|
18
|
+
}) => {
|
|
19
|
+
const classes = [
|
|
20
|
+
"inline-flex items-start space-x-2 w-full"
|
|
21
|
+
];
|
|
22
|
+
if (className) {
|
|
23
|
+
classes.push(className);
|
|
24
|
+
}
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
...{
|
|
29
|
+
className: classes.join(" ")
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
...{
|
|
36
|
+
className: "relative flex items-center justify-center w-5 h-5 rounded-xs text-inherit bg-inherit border border-inherit ring-0 outline-0 shrink-0 focus:ring-0 focus:ring-0 focus:ring-offset-0 focus:outline-1",
|
|
37
|
+
onClick: () => onChange(value ? false : true),
|
|
38
|
+
type: "button",
|
|
39
|
+
"aria-checked": value ? true : false,
|
|
40
|
+
"aria-labelledby": labelId,
|
|
41
|
+
style: inputCheckboxStyle(style),
|
|
42
|
+
...rest
|
|
43
|
+
},
|
|
44
|
+
children: Boolean(value) && /* @__PURE__ */ jsx(
|
|
45
|
+
check_default,
|
|
46
|
+
{
|
|
47
|
+
...{
|
|
48
|
+
className: "absolute top-0 w-3.5 h-full pointer-events-none"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
label && /* @__PURE__ */ jsx(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
...{
|
|
58
|
+
className: "leading-tight",
|
|
59
|
+
id: labelId
|
|
60
|
+
},
|
|
61
|
+
children: label
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
var input_checkbox_default = InputCheckbox;
|
|
69
|
+
export {
|
|
70
|
+
input_checkbox_default as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
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.js
|
|
20
|
+
var input_group_exports = {};
|
|
21
|
+
__export(input_group_exports, {
|
|
22
|
+
default: () => input_group_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(input_group_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.js
|
|
54
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
55
|
+
var InputGroup = ({
|
|
56
|
+
className,
|
|
57
|
+
error,
|
|
58
|
+
input,
|
|
59
|
+
label,
|
|
60
|
+
message,
|
|
61
|
+
style = {}
|
|
62
|
+
}) => {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
|
+
const classes = [
|
|
65
|
+
"input-group"
|
|
66
|
+
];
|
|
67
|
+
if (className) {
|
|
68
|
+
classes.push(className);
|
|
69
|
+
}
|
|
70
|
+
if (error) {
|
|
71
|
+
classes.push("error");
|
|
72
|
+
}
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
...{
|
|
77
|
+
className: classes.join(" "),
|
|
78
|
+
"aria-live": "polite"
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
...{
|
|
85
|
+
className: "space-y-2"
|
|
86
|
+
},
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
...{
|
|
92
|
+
className: "block"
|
|
93
|
+
},
|
|
94
|
+
children: label
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
input
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) : input,
|
|
101
|
+
(error || message) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
102
|
+
"p",
|
|
103
|
+
{
|
|
104
|
+
...{
|
|
105
|
+
className: "flex items-center justify-start space-x-2 py-1 rounded text-sm " + (error && "px-1.5"),
|
|
106
|
+
...error && Object.keys(style).length > 0 && {
|
|
107
|
+
style: {
|
|
108
|
+
backgroundColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb.replace(")", ",.1)"),
|
|
109
|
+
color: (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.Fragment, { children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
116
|
+
warning_default,
|
|
117
|
+
{
|
|
118
|
+
...{
|
|
119
|
+
className: "w-4 h-4",
|
|
120
|
+
"aria-hidden": true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
125
|
+
"span",
|
|
126
|
+
{
|
|
127
|
+
...{
|
|
128
|
+
className: "text-[0px] opacity-0 w-0 h-0 absolute"
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
label,
|
|
132
|
+
": ",
|
|
133
|
+
error
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
139
|
+
"span",
|
|
140
|
+
{
|
|
141
|
+
...{
|
|
142
|
+
...error && {
|
|
143
|
+
"aria-hidden": true
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
children: error || message
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
var input_group_default = InputGroup;
|
|
@@ -0,0 +1,211 @@
|
|
|
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-number.js
|
|
20
|
+
var input_number_exports = {};
|
|
21
|
+
__export(input_number_exports, {
|
|
22
|
+
default: () => input_number_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(input_number_exports);
|
|
25
|
+
|
|
26
|
+
// components/icons/minus.js
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var Minus = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
...{
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: 1.5,
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
...props
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
...{
|
|
42
|
+
d: "M5 12h14",
|
|
43
|
+
strokeLinecap: "round",
|
|
44
|
+
strokeLinejoin: "round"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
var minus_default = Minus;
|
|
51
|
+
|
|
52
|
+
// components/icons/plus.js
|
|
53
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
54
|
+
var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
55
|
+
"svg",
|
|
56
|
+
{
|
|
57
|
+
...{
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: "currentColor",
|
|
60
|
+
strokeWidth: 1.5,
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
...props
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
65
|
+
"path",
|
|
66
|
+
{
|
|
67
|
+
...{
|
|
68
|
+
d: "M12 4.5v15m7.5-7.5h-15",
|
|
69
|
+
strokeLinecap: "round",
|
|
70
|
+
strokeLinejoin: "round"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
var plus_default = Plus;
|
|
77
|
+
|
|
78
|
+
// components/styles.js
|
|
79
|
+
var inputStyle = (style) => {
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
81
|
+
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
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// components/input-number.js
|
|
90
|
+
var import_react = require("react");
|
|
91
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
92
|
+
var InputNumber = ({
|
|
93
|
+
className,
|
|
94
|
+
inline = false,
|
|
95
|
+
layout = "split",
|
|
96
|
+
max,
|
|
97
|
+
min,
|
|
98
|
+
onChange,
|
|
99
|
+
small,
|
|
100
|
+
style,
|
|
101
|
+
value,
|
|
102
|
+
...rest
|
|
103
|
+
}) => {
|
|
104
|
+
const classes = [(inline ? "inline-flex" : "flex") + " items-center border border-inherit divide-x divide-inherit rounded-sm overflow-hidden"];
|
|
105
|
+
if (className) {
|
|
106
|
+
classes.push(className);
|
|
107
|
+
}
|
|
108
|
+
;
|
|
109
|
+
const increment = (0, import_react.useCallback)(
|
|
110
|
+
() => {
|
|
111
|
+
const newValue = Number(value || 0) + 1;
|
|
112
|
+
if (max !== null && newValue > max) return;
|
|
113
|
+
onChange(newValue);
|
|
114
|
+
},
|
|
115
|
+
[max, onChange, value]
|
|
116
|
+
);
|
|
117
|
+
const decrement = (0, import_react.useCallback)(
|
|
118
|
+
() => {
|
|
119
|
+
const newValue = Number(value || 0) - 1;
|
|
120
|
+
if (min !== null && newValue < min) return;
|
|
121
|
+
onChange(newValue);
|
|
122
|
+
},
|
|
123
|
+
[min, onChange, value]
|
|
124
|
+
);
|
|
125
|
+
const decrementButton = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
...{
|
|
129
|
+
"aria-label": "decrement",
|
|
130
|
+
type: "button",
|
|
131
|
+
onClick: decrement,
|
|
132
|
+
className: (small ? "h-[34px] w-[34px]" : "h-[42px] w-[42px]") + " flex justify-center items-center text-inherit shrink-0 grow-0"
|
|
133
|
+
},
|
|
134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
...{
|
|
138
|
+
"aria-hidden": true
|
|
139
|
+
},
|
|
140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
141
|
+
minus_default,
|
|
142
|
+
{
|
|
143
|
+
...{
|
|
144
|
+
className: "w-4 h-4 text-inherit"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
const incrementButton = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
...{
|
|
156
|
+
"aria-label": "increment",
|
|
157
|
+
type: "button",
|
|
158
|
+
onClick: increment,
|
|
159
|
+
className: (small ? "h-[34px] w-[34px]" : "h-[42px] w-[42px]") + " flex justify-center items-center text-inherit shrink-0 grow-0"
|
|
160
|
+
},
|
|
161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
162
|
+
"span",
|
|
163
|
+
{
|
|
164
|
+
...{
|
|
165
|
+
"aria-hidden": true
|
|
166
|
+
},
|
|
167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
168
|
+
plus_default,
|
|
169
|
+
{
|
|
170
|
+
...{
|
|
171
|
+
className: "w-4 h-4 text-inherit"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
180
|
+
"input",
|
|
181
|
+
{
|
|
182
|
+
...{
|
|
183
|
+
...rest,
|
|
184
|
+
max,
|
|
185
|
+
min,
|
|
186
|
+
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" : ""),
|
|
187
|
+
inputMode: "numeric",
|
|
188
|
+
onChange: ({ target }) => onChange(Number(target.value)),
|
|
189
|
+
step: 1,
|
|
190
|
+
type: "number",
|
|
191
|
+
value
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
...{
|
|
199
|
+
className: classes.join(" "),
|
|
200
|
+
style: inputStyle(style)
|
|
201
|
+
},
|
|
202
|
+
children: [
|
|
203
|
+
layout === "split" && decrementButton,
|
|
204
|
+
input,
|
|
205
|
+
layout === "after" && decrementButton,
|
|
206
|
+
incrementButton
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
var input_number_default = InputNumber;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
plus_default
|
|
3
|
+
} from "./chunk-HH7WF5BT.mjs";
|
|
4
|
+
import {
|
|
5
|
+
minus_default
|
|
6
|
+
} from "./chunk-T5QQBFM3.mjs";
|
|
7
|
+
import {
|
|
8
|
+
inputStyle
|
|
9
|
+
} from "./chunk-FJXG3REN.mjs";
|
|
10
|
+
|
|
11
|
+
// components/input-number.js
|
|
12
|
+
import { useCallback } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var InputNumber = ({
|
|
15
|
+
className,
|
|
16
|
+
inline = false,
|
|
17
|
+
layout = "split",
|
|
18
|
+
max,
|
|
19
|
+
min,
|
|
20
|
+
onChange,
|
|
21
|
+
small,
|
|
22
|
+
style,
|
|
23
|
+
value,
|
|
24
|
+
...rest
|
|
25
|
+
}) => {
|
|
26
|
+
const classes = [(inline ? "inline-flex" : "flex") + " items-center border border-inherit divide-x divide-inherit rounded-sm overflow-hidden"];
|
|
27
|
+
if (className) {
|
|
28
|
+
classes.push(className);
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
const increment = useCallback(
|
|
32
|
+
() => {
|
|
33
|
+
const newValue = Number(value || 0) + 1;
|
|
34
|
+
if (max !== null && newValue > max) return;
|
|
35
|
+
onChange(newValue);
|
|
36
|
+
},
|
|
37
|
+
[max, onChange, value]
|
|
38
|
+
);
|
|
39
|
+
const decrement = useCallback(
|
|
40
|
+
() => {
|
|
41
|
+
const newValue = Number(value || 0) - 1;
|
|
42
|
+
if (min !== null && newValue < min) return;
|
|
43
|
+
onChange(newValue);
|
|
44
|
+
},
|
|
45
|
+
[min, onChange, value]
|
|
46
|
+
);
|
|
47
|
+
const decrementButton = /* @__PURE__ */ jsx(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
...{
|
|
51
|
+
"aria-label": "decrement",
|
|
52
|
+
type: "button",
|
|
53
|
+
onClick: decrement,
|
|
54
|
+
className: (small ? "h-[34px] w-[34px]" : "h-[42px] w-[42px]") + " flex justify-center items-center text-inherit shrink-0 grow-0"
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
...{
|
|
60
|
+
"aria-hidden": true
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ jsx(
|
|
63
|
+
minus_default,
|
|
64
|
+
{
|
|
65
|
+
...{
|
|
66
|
+
className: "w-4 h-4 text-inherit"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
const incrementButton = /* @__PURE__ */ jsx(
|
|
75
|
+
"button",
|
|
76
|
+
{
|
|
77
|
+
...{
|
|
78
|
+
"aria-label": "increment",
|
|
79
|
+
type: "button",
|
|
80
|
+
onClick: increment,
|
|
81
|
+
className: (small ? "h-[34px] w-[34px]" : "h-[42px] w-[42px]") + " flex justify-center items-center text-inherit shrink-0 grow-0"
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ jsx(
|
|
84
|
+
"span",
|
|
85
|
+
{
|
|
86
|
+
...{
|
|
87
|
+
"aria-hidden": true
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */ jsx(
|
|
90
|
+
plus_default,
|
|
91
|
+
{
|
|
92
|
+
...{
|
|
93
|
+
className: "w-4 h-4 text-inherit"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
const input = /* @__PURE__ */ jsx(
|
|
102
|
+
"input",
|
|
103
|
+
{
|
|
104
|
+
...{
|
|
105
|
+
...rest,
|
|
106
|
+
max,
|
|
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" : ""),
|
|
109
|
+
inputMode: "numeric",
|
|
110
|
+
onChange: ({ target }) => onChange(Number(target.value)),
|
|
111
|
+
step: 1,
|
|
112
|
+
type: "number",
|
|
113
|
+
value
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
return /* @__PURE__ */ jsxs(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
...{
|
|
121
|
+
className: classes.join(" "),
|
|
122
|
+
style: inputStyle(style)
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
layout === "split" && decrementButton,
|
|
126
|
+
input,
|
|
127
|
+
layout === "after" && decrementButton,
|
|
128
|
+
incrementButton
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
var input_number_default = InputNumber;
|
|
134
|
+
export {
|
|
135
|
+
input_number_default as default
|
|
136
|
+
};
|