@konstructio/ui 0.1.2-alpha.54 → 0.1.2-alpha.56
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/assets/icons/components/BookOpen.d.ts +3 -0
- package/dist/assets/icons/components/BookOpen.js +32 -0
- package/dist/assets/icons/components/DollarSign.d.ts +3 -0
- package/dist/assets/icons/components/DollarSign.js +30 -0
- package/dist/assets/icons/components/LightBulb.d.ts +3 -0
- package/dist/assets/icons/components/LightBulb.js +43 -0
- package/dist/assets/icons/components/index.d.ts +3 -0
- package/dist/assets/icons/components/index.js +114 -108
- package/dist/assets/icons/index.js +114 -108
- package/dist/components/Autocomplete/Autocomplete.js +41 -40
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +2 -0
- package/dist/components/Button/Button.variants.js +7 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +34 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +136 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +94 -0
- package/dist/components/ButtonGroup/ButtonGroup.variants.d.ts +14 -0
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +39 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.d.ts +3 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +112 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +19 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +22 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +85 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/index.d.ts +2 -0
- package/dist/components/ButtonGroup/components/ButtonGroupItem/index.js +4 -0
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.d.ts +3 -0
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +45 -0
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +8 -0
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.d.ts +2 -0
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.js +4 -0
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.d.ts +3 -0
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +37 -0
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +6 -0
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/index.d.ts +2 -0
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/index.js +4 -0
- package/dist/components/ButtonGroup/components/index.d.ts +3 -0
- package/dist/components/ButtonGroup/components/index.js +8 -0
- package/dist/components/ButtonGroup/hooks/index.d.ts +2 -0
- package/dist/components/ButtonGroup/hooks/index.js +4 -0
- package/dist/components/ButtonGroup/hooks/useButtonGroup.d.ts +3 -0
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +67 -0
- package/dist/components/ButtonGroup/hooks/useButtonGroup.types.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.js +152 -144
- package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
- package/dist/components/Counter/Counter.js +43 -42
- package/dist/components/Counter/Counter.types.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +94 -93
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +2 -0
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +11 -11
- package/dist/components/Drawer/Drawer.d.ts +36 -0
- package/dist/components/Drawer/Drawer.js +134 -0
- package/dist/components/Drawer/Drawer.types.d.ts +65 -0
- package/dist/components/Drawer/Drawer.variants.d.ts +8 -0
- package/dist/components/Drawer/Drawer.variants.js +92 -0
- package/dist/components/Drawer/components/Body/Body.d.ts +3 -0
- package/dist/components/Drawer/components/Body/Body.js +24 -0
- package/dist/components/Drawer/components/Body/Body.types.d.ts +7 -0
- package/dist/components/Drawer/components/Body/index.d.ts +2 -0
- package/dist/components/Drawer/components/Body/index.js +4 -0
- package/dist/components/Drawer/components/Footer/Footer.d.ts +3 -0
- package/dist/components/Drawer/components/Footer/Footer.js +26 -0
- package/dist/components/Drawer/components/Footer/Footer.types.d.ts +7 -0
- package/dist/components/Drawer/components/Footer/index.d.ts +2 -0
- package/dist/components/Drawer/components/Footer/index.js +4 -0
- package/dist/components/Drawer/components/Header/Header.d.ts +3 -0
- package/dist/components/Drawer/components/Header/Header.js +27 -0
- package/dist/components/Drawer/components/Header/Header.types.d.ts +9 -0
- package/dist/components/Drawer/components/Header/index.d.ts +2 -0
- package/dist/components/Drawer/components/Header/index.js +4 -0
- package/dist/components/Drawer/components/index.d.ts +3 -0
- package/dist/components/Drawer/components/index.js +8 -0
- package/dist/components/Drawer/constants/index.d.ts +6 -0
- package/dist/components/Drawer/constants/index.js +9 -0
- package/dist/components/Drawer/contexts/Drawer.context.d.ts +7 -0
- package/dist/components/Drawer/contexts/Drawer.context.js +6 -0
- package/dist/components/Drawer/contexts/index.d.ts +2 -0
- package/dist/components/Drawer/contexts/index.js +5 -0
- package/dist/components/Drawer/hooks/index.d.ts +2 -0
- package/dist/components/Drawer/hooks/index.js +4 -0
- package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
- package/dist/components/Drawer/hooks/useDrawer.js +66 -0
- package/dist/components/Drawer/hooks/useDrawer.types.d.ts +30 -0
- package/dist/components/ImageUpload/ImageUpload.d.ts +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +51 -50
- package/dist/components/ImageUpload/ImageUpload.types.d.ts +2 -0
- package/dist/components/Input/Input.js +72 -58
- package/dist/components/Input/Input.types.d.ts +4 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +40 -39
- package/dist/components/PhoneNumberInput/PhoneNumberInput.types.d.ts +2 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +163 -162
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +172 -116
- package/dist/components/RadioGroup/RadioGroup.js +34 -33
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -1
- package/dist/components/Range/Range.js +26 -24
- package/dist/components/Range/Range.types.d.ts +2 -0
- package/dist/components/Select/Select.types.d.ts +1 -0
- package/dist/components/Select/Select.variants.js +2 -1
- package/dist/components/Select/components/Wrapper.js +74 -73
- package/dist/components/Slider/Slider.js +30 -20
- package/dist/components/Slider/Slider.types.d.ts +2 -0
- package/dist/components/Stepper/Stepper.js +29 -25
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.d.ts +1 -2
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +96 -91
- package/dist/components/Stepper/components/StepConnector/StepConnector.d.ts +1 -2
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +10 -9
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.d.ts +1 -2
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +13 -19
- package/dist/components/Stepper/components/StepItem/StepItem.d.ts +1 -2
- package/dist/components/Stepper/components/StepItem/StepItem.js +6 -5
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.d.ts +1 -2
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +65 -60
- package/dist/components/Stepper/constants/index.d.ts +3 -0
- package/dist/components/Stepper/constants/index.js +13 -0
- package/dist/components/Stepper/hooks/index.d.ts +1 -0
- package/dist/components/Stepper/hooks/index.js +4 -0
- package/dist/components/Stepper/hooks/useStepItemLogic.d.ts +2 -0
- package/dist/components/Stepper/hooks/useStepItemLogic.js +27 -0
- package/dist/components/Stepper/hooks/useStepItemLogic.types.d.ts +16 -0
- package/dist/components/Stepper/utils/index.d.ts +3 -0
- package/dist/components/Stepper/utils/index.js +13 -0
- package/dist/components/Switch/Switch.js +89 -87
- package/dist/components/Switch/Switch.types.d.ts +2 -0
- package/dist/components/TagSelect/TagSelect.types.d.ts +2 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +47 -46
- package/dist/components/TextArea/TextArea.js +27 -26
- package/dist/components/TextArea/TextArea.types.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.variants.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +113 -109
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +114 -108
- package/dist/index.js +115 -111
- package/dist/package.json +26 -25
- package/dist/{proxy-Drz23HDt.js → proxy-BhEKW5n7.js} +1743 -1588
- package/dist/styles.css +1 -1
- package/package.json +23 -24
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./FlagSelectorList/FlagSelectorList.js";
|
|
2
|
-
import { jsxs as Z, jsx as
|
|
2
|
+
import { jsxs as Z, jsx as B } from "react/jsx-runtime";
|
|
3
3
|
import { i as Ae } from "../../../index-BmVmDQGH.js";
|
|
4
|
-
import { useRef as
|
|
4
|
+
import { useRef as ne, useMemo as Ne, forwardRef as Be, useId as Re, useImperativeHandle as Ge, useCallback as Le, useEffect as pe } from "react";
|
|
5
5
|
import { Typography as X } from "../../Typography/Typography.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as ee } from "../../../utils/index.js";
|
|
7
7
|
import { labelVariants as Ve, phoneNumberInputVariants as xe } from "../PhoneNumberInput.variants.js";
|
|
8
8
|
import { usePhoneNumberContext as Ke } from "../contexts/phone-number.hook.js";
|
|
9
9
|
import { getPhoneMask as De } from "../utils/index.js";
|
|
@@ -36,8 +36,8 @@ function Oe(e, t) {
|
|
|
36
36
|
if (Array.isArray(e) || (n = (function(i, c) {
|
|
37
37
|
if (i) {
|
|
38
38
|
if (typeof i == "string") return fe(i, c);
|
|
39
|
-
var
|
|
40
|
-
return
|
|
39
|
+
var s = {}.toString.call(i).slice(8, -1);
|
|
40
|
+
return s === "Object" && i.constructor && (s = i.constructor.name), s === "Map" || s === "Set" ? Array.from(i) : s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? fe(i, c) : void 0;
|
|
41
41
|
}
|
|
42
42
|
})(e)) || t) {
|
|
43
43
|
n && (e = n);
|
|
@@ -90,7 +90,7 @@ function Y(e) {
|
|
|
90
90
|
}
|
|
91
91
|
function _e(e, t) {
|
|
92
92
|
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
93
|
-
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t &&
|
|
93
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && re(e, t);
|
|
94
94
|
}
|
|
95
95
|
function we() {
|
|
96
96
|
try {
|
|
@@ -140,20 +140,20 @@ function We(e, t) {
|
|
|
140
140
|
}
|
|
141
141
|
return o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function re(e, t) {
|
|
144
|
+
return re = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
145
145
|
return n.__proto__ = r, n;
|
|
146
|
-
},
|
|
146
|
+
}, re(e, t);
|
|
147
147
|
}
|
|
148
148
|
function U(e, t) {
|
|
149
149
|
var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = Oe(e);
|
|
150
150
|
try {
|
|
151
151
|
for (i.s(); !(n = i.n()).done; ) {
|
|
152
|
-
var c,
|
|
153
|
-
(a &&
|
|
152
|
+
var c, s = n.value, f = !Object.prototype.hasOwnProperty.call(o, s) && ((c = o[l[0]]) === null || c === void 0 ? void 0 : c.test(s));
|
|
153
|
+
(a && s === l[0] || f) && (l = l.slice(1), u += s);
|
|
154
154
|
}
|
|
155
|
-
} catch (
|
|
156
|
-
i.e(
|
|
155
|
+
} catch (S) {
|
|
156
|
+
i.e(S);
|
|
157
157
|
} finally {
|
|
158
158
|
i.f();
|
|
159
159
|
}
|
|
@@ -163,12 +163,12 @@ function ke(e, t) {
|
|
|
163
163
|
var n, r = t.mask, o = t.replacement, a = t.separate, l = t.showMask, u = 0, i = "", c = Oe(r);
|
|
164
164
|
try {
|
|
165
165
|
for (c.s(); !(n = c.n()).done; ) {
|
|
166
|
-
var
|
|
166
|
+
var s = n.value;
|
|
167
167
|
if (!l && e[u] === void 0) break;
|
|
168
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
168
|
+
Object.prototype.hasOwnProperty.call(o, s) && e[u] !== void 0 ? i += e[u++] : i += s;
|
|
169
169
|
}
|
|
170
|
-
} catch (
|
|
171
|
-
c.e(
|
|
170
|
+
} catch (S) {
|
|
171
|
+
c.e(S);
|
|
172
172
|
} finally {
|
|
173
173
|
c.f();
|
|
174
174
|
}
|
|
@@ -188,19 +188,19 @@ function Pe(e, t) {
|
|
|
188
188
|
function K(e) {
|
|
189
189
|
return e.length > 0 ? Se({}, e, /./) : {};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o),
|
|
193
|
-
var
|
|
194
|
-
|
|
191
|
+
function ae(e, t) {
|
|
192
|
+
for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o), s = "", f = 0; f < c.length; f++) {
|
|
193
|
+
var S = Object.prototype.hasOwnProperty.call(l, c[f]);
|
|
194
|
+
S && i[f] !== void 0 && i[f] !== c[f] ? s += i[f] : S && u && (s += c[f]);
|
|
195
195
|
}
|
|
196
|
-
return
|
|
196
|
+
return s;
|
|
197
197
|
}
|
|
198
198
|
function Me(e, t) {
|
|
199
199
|
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
200
200
|
return ke(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
|
|
201
201
|
}
|
|
202
202
|
function Ze(e, t) {
|
|
203
|
-
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a =
|
|
203
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = ae(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
204
204
|
return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
|
|
205
205
|
}
|
|
206
206
|
function Je(e, t) {
|
|
@@ -231,7 +231,7 @@ function Xe(e, t, n) {
|
|
|
231
231
|
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
232
232
|
return a;
|
|
233
233
|
})(r);
|
|
234
|
-
})(e,
|
|
234
|
+
})(e, ie() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
|
|
235
235
|
}
|
|
236
236
|
function Ee(e, t) {
|
|
237
237
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -263,13 +263,13 @@ function tt(e, t) {
|
|
|
263
263
|
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
264
264
|
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && H(e, t);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function ie() {
|
|
267
267
|
try {
|
|
268
268
|
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {
|
|
269
269
|
})));
|
|
270
270
|
} catch {
|
|
271
271
|
}
|
|
272
|
-
return (
|
|
272
|
+
return (ie = function() {
|
|
273
273
|
return !!e;
|
|
274
274
|
})();
|
|
275
275
|
}
|
|
@@ -316,9 +316,9 @@ function H(e, t) {
|
|
|
316
316
|
return n.__proto__ = r, n;
|
|
317
317
|
}, H(e, t);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function oe(e) {
|
|
320
320
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
321
|
-
return
|
|
321
|
+
return oe = function(n) {
|
|
322
322
|
if (n === null || !(function(o) {
|
|
323
323
|
try {
|
|
324
324
|
return Function.toString.call(o).indexOf("[native code]") !== -1;
|
|
@@ -333,7 +333,7 @@ function ae(e) {
|
|
|
333
333
|
}
|
|
334
334
|
function r() {
|
|
335
335
|
return (function(o, a, l) {
|
|
336
|
-
if (
|
|
336
|
+
if (ie()) return Reflect.construct.apply(null, arguments);
|
|
337
337
|
var u = [null];
|
|
338
338
|
u.push.apply(u, a);
|
|
339
339
|
var i = new (o.bind.apply(o, u))();
|
|
@@ -341,7 +341,7 @@ function ae(e) {
|
|
|
341
341
|
})(n, arguments, z(this).constructor);
|
|
342
342
|
}
|
|
343
343
|
return r.prototype = Object.create(n.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), H(r, n);
|
|
344
|
-
},
|
|
344
|
+
}, oe(e);
|
|
345
345
|
}
|
|
346
346
|
var $ = (function(e) {
|
|
347
347
|
function t(n) {
|
|
@@ -349,49 +349,49 @@ var $ = (function(e) {
|
|
|
349
349
|
return Ee(this, t), (r = Xe(this, t, [n])).name = "SyntheticChangeError", r;
|
|
350
350
|
}
|
|
351
351
|
return tt(t, e), Ce(t);
|
|
352
|
-
})(
|
|
352
|
+
})(oe(Error)), ye, rt = ["options"], ge = ["text", "email", "tel", "search", "url"], je = Ce((function e(t) {
|
|
353
353
|
var n = t.init, r = t.tracking;
|
|
354
354
|
Ee(this, e);
|
|
355
355
|
var o = /* @__PURE__ */ new WeakMap();
|
|
356
356
|
this.register = function(a) {
|
|
357
357
|
var l;
|
|
358
358
|
if (ge.includes(a.type)) {
|
|
359
|
-
var u = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i,
|
|
360
|
-
Object.defineProperty(a, "value", he(he({},
|
|
361
|
-
var
|
|
362
|
-
|
|
359
|
+
var u = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i, s = u.controlled, f = s !== void 0 && s, S = n({ initialValue: a.value || c, controlled: f }), M = S.value, j = S.options, y = { value: M, options: j, fallbackOptions: j }, m = { id: -1, cachedId: -1 }, p = { value: "", selectionStart: 0, selectionEnd: 0 }, w = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
360
|
+
Object.defineProperty(a, "value", he(he({}, w), {}, { set: function(h) {
|
|
361
|
+
var d;
|
|
362
|
+
p.value = h, w == null || (d = w.set) === null || d === void 0 || d.call(a, h);
|
|
363
363
|
} })), a.value = M;
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var
|
|
367
|
-
|
|
364
|
+
var g = function() {
|
|
365
|
+
var h = function() {
|
|
366
|
+
var d, k;
|
|
367
|
+
p.selectionStart = (d = a.selectionStart) !== null && d !== void 0 ? d : 0, p.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, m.id = window.setTimeout(h);
|
|
368
368
|
};
|
|
369
|
-
m.id = window.setTimeout(
|
|
370
|
-
},
|
|
369
|
+
m.id = window.setTimeout(h);
|
|
370
|
+
}, E = function() {
|
|
371
371
|
window.clearTimeout(m.id), m.id = -1, m.cachedId = -1;
|
|
372
|
-
},
|
|
372
|
+
}, v = function(h) {
|
|
373
373
|
try {
|
|
374
|
-
var
|
|
374
|
+
var d, k;
|
|
375
375
|
if (m.cachedId === m.id) throw new $("The input selection has not been updated.");
|
|
376
376
|
m.cachedId = m.id;
|
|
377
|
-
var P = a.value,
|
|
378
|
-
if (
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
381
|
-
var
|
|
382
|
-
if (
|
|
377
|
+
var P = a.value, b = a.selectionStart, N = a.selectionEnd;
|
|
378
|
+
if (b === null || N === null) throw new $("The selection attributes have not been initialized.");
|
|
379
|
+
var O, C = p.value;
|
|
380
|
+
if (h.inputType === void 0 && (p.selectionStart = 0, p.selectionEnd = C.length), b > p.selectionStart ? O = "insert" : b <= p.selectionStart && b < p.selectionEnd ? O = "deleteBackward" : b === p.selectionEnd && P.length < C.length && (O = "deleteForward"), O === void 0 || (O === "deleteBackward" || O === "deleteForward") && P.length > C.length) throw new $("Input type detection error.");
|
|
381
|
+
var T = "", I = p.selectionStart, R = p.selectionEnd;
|
|
382
|
+
if (O === "insert") T = P.slice(p.selectionStart, b);
|
|
383
383
|
else {
|
|
384
|
-
var D =
|
|
385
|
-
|
|
384
|
+
var D = C.length - P.length;
|
|
385
|
+
I = b, R = b + D;
|
|
386
386
|
}
|
|
387
|
-
|
|
388
|
-
var F =
|
|
389
|
-
a.value = A.value, a.setSelectionRange(A.selectionStart, A.selectionEnd),
|
|
387
|
+
y.value !== C ? y.options = y.fallbackOptions : y.fallbackOptions = y.options;
|
|
388
|
+
var F = y.options, G = r({ inputType: O, previousValue: C, previousOptions: F, value: P, addedValue: T, changeStart: I, changeEnd: R, selectionStart: b, selectionEnd: N }), _ = G.options, A = nt(G, rt);
|
|
389
|
+
a.value = A.value, a.setSelectionRange(A.selectionStart, A.selectionEnd), y.value = A.value, y.options = _, p.selectionStart = A.selectionStart, p.selectionEnd = A.selectionEnd, (d = a._valueTracker) === null || d === void 0 || (k = d.setValue) === null || k === void 0 || k.call(d, C);
|
|
390
390
|
} catch (W) {
|
|
391
|
-
if (a.value =
|
|
391
|
+
if (a.value = p.value, a.setSelectionRange(p.selectionStart, p.selectionEnd), h.preventDefault(), h.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
|
|
392
392
|
}
|
|
393
393
|
};
|
|
394
|
-
document.activeElement === a &&
|
|
394
|
+
document.activeElement === a && g(), a.addEventListener("focus", g), a.addEventListener("blur", E), a.addEventListener("input", v), o.set(a, { onFocus: g, onBlur: E, onInput: v });
|
|
395
395
|
} else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(ge.join(", "), "."));
|
|
396
396
|
}, this.unregister = function(a) {
|
|
397
397
|
var l = o.get(a);
|
|
@@ -399,7 +399,7 @@ var $ = (function(e) {
|
|
|
399
399
|
};
|
|
400
400
|
}));
|
|
401
401
|
ye = je, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
|
|
402
|
-
var
|
|
402
|
+
var te = function(e) {
|
|
403
403
|
return function() {
|
|
404
404
|
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
|
|
405
405
|
return new e("".concat(n.join(`
|
|
@@ -416,60 +416,60 @@ var Te = (function(e) {
|
|
|
416
416
|
function t() {
|
|
417
417
|
var n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
418
418
|
return ze(this, t), (n = $e(this, t, [{ init: function(o) {
|
|
419
|
-
var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement,
|
|
420
|
-
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && (function(
|
|
421
|
-
var M =
|
|
422
|
-
M.length > j.length && console.error(
|
|
423
|
-
var m = Object.keys(
|
|
424
|
-
return
|
|
419
|
+
var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, s = u.separate, f = u.showMask;
|
|
420
|
+
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && (function(S) {
|
|
421
|
+
var M = S.initialValue, j = S.mask, y = S.replacement;
|
|
422
|
+
M.length > j.length && console.error(te(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
423
|
+
var m = Object.keys(y).filter((function(v) {
|
|
424
|
+
return v.length > 1;
|
|
425
425
|
}));
|
|
426
|
-
m.length > 0 && console.error(
|
|
427
|
-
for (var
|
|
428
|
-
var
|
|
429
|
-
if (!(
|
|
430
|
-
|
|
426
|
+
m.length > 0 && console.error(te(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(m.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
427
|
+
for (var p = j.slice(0, M.length), w = -1, g = 0; g < p.length; g++) {
|
|
428
|
+
var E = Object.prototype.hasOwnProperty.call(y, p[g]);
|
|
429
|
+
if (!(p[g] === M[g] || E && y[p[g]].test(M[g]))) {
|
|
430
|
+
w = g;
|
|
431
431
|
break;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
|
|
435
|
-
})({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate:
|
|
434
|
+
w !== -1 && console.error(te(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(w, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
435
|
+
})({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: s } };
|
|
436
436
|
}, tracking: function(o) {
|
|
437
|
-
var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart,
|
|
438
|
-
if (
|
|
439
|
-
|
|
440
|
-
var
|
|
441
|
-
|
|
442
|
-
var
|
|
443
|
-
if (
|
|
444
|
-
if (
|
|
445
|
-
var
|
|
446
|
-
|
|
437
|
+
var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart, s = o.changeEnd, f = x(r), S = f.track, M = f.modify, j = We(f, at), y = j.mask, m = j.replacement, p = j.showMask, w = j.separate, g = J(J({}, a === "insert" ? { inputType: a, data: i } : { inputType: a, data: null }), {}, { value: l, selectionStart: c, selectionEnd: s }), E = S?.(g);
|
|
438
|
+
if (E === !1) throw new $("Custom tracking stop.");
|
|
439
|
+
E === null ? i = "" : E !== !0 && E !== void 0 && (i = E);
|
|
440
|
+
var v = M?.(g);
|
|
441
|
+
v?.mask !== void 0 && (y = v.mask), v?.replacement !== void 0 && (m = typeof v?.replacement == "string" ? K(v?.replacement) : v.replacement), v?.showMask !== void 0 && (p = v.showMask), v?.separate !== void 0 && (w = v.separate);
|
|
442
|
+
var h = ae(l, J({ end: c }, u)), d = ae(l, J({ start: s }, u)), k = RegExp("[^".concat(Object.keys(m).join(""), "]"), "g"), P = y.replace(k, "");
|
|
443
|
+
if (h && (h = U(h, { replacementChars: P, replacement: m, separate: w }), P = P.slice(h.length)), i && (i = U(i, { replacementChars: P, replacement: m, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
|
|
444
|
+
if (w) {
|
|
445
|
+
var b = y.slice(c, s).replace(k, ""), N = b.length - i.length;
|
|
446
|
+
N < 0 ? d = d.slice(-N) : N > 0 && (d = b.slice(-N) + d);
|
|
447
447
|
}
|
|
448
|
-
|
|
449
|
-
var
|
|
450
|
-
var
|
|
451
|
-
var
|
|
452
|
-
return
|
|
453
|
-
})),
|
|
448
|
+
d && (d = U(d, { replacementChars: P, replacement: m, separate: w }));
|
|
449
|
+
var O = ke(h + i + d, { mask: y, replacement: m, separate: w, showMask: p }), C = (function(T) {
|
|
450
|
+
var I, R, D, F = T.inputType, G = T.value, _ = T.addedValue, A = T.beforeChangeValue, W = T.mask, le = T.replacement, Ie = T.separate, Q = Pe(G, { mask: W, replacement: le }).filter((function(q) {
|
|
451
|
+
var se = q.type;
|
|
452
|
+
return se === "input" || Ie && se === "replacement";
|
|
453
|
+
})), ue = (I = Q[A.length + _.length - 1]) === null || I === void 0 ? void 0 : I.index, L = (R = Q[A.length - 1]) === null || R === void 0 ? void 0 : R.index, V = (D = Q[A.length + _.length]) === null || D === void 0 ? void 0 : D.index;
|
|
454
454
|
if (F === "insert") {
|
|
455
|
-
if (
|
|
456
|
-
if (
|
|
457
|
-
if (
|
|
455
|
+
if (ue !== void 0) return ue + 1;
|
|
456
|
+
if (V !== void 0) return V;
|
|
457
|
+
if (L !== void 0) return L + 1;
|
|
458
458
|
}
|
|
459
459
|
if (F === "deleteForward") {
|
|
460
|
-
if (
|
|
461
|
-
if (
|
|
460
|
+
if (V !== void 0) return V;
|
|
461
|
+
if (L !== void 0) return L + 1;
|
|
462
462
|
}
|
|
463
463
|
if (F === "deleteBackward") {
|
|
464
|
-
if (
|
|
465
|
-
if (
|
|
464
|
+
if (L !== void 0) return L + 1;
|
|
465
|
+
if (V !== void 0) return V;
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
return Object.prototype.hasOwnProperty.call(
|
|
467
|
+
var ce = G.split("").findIndex((function(q) {
|
|
468
|
+
return Object.prototype.hasOwnProperty.call(le, q);
|
|
469
469
|
}));
|
|
470
|
-
return
|
|
471
|
-
})({ inputType: a, value:
|
|
472
|
-
return { value:
|
|
470
|
+
return ce !== -1 ? ce : G.length;
|
|
471
|
+
})({ inputType: a, value: O, addedValue: i, beforeChangeValue: h, mask: y, replacement: m, separate: w });
|
|
472
|
+
return { value: O, selectionStart: C, selectionEnd: C, options: { mask: y, replacement: m, separate: w } };
|
|
473
473
|
} }])).format = function(o) {
|
|
474
474
|
return Me(o, x(r));
|
|
475
475
|
}, n.formatToParts = function(o) {
|
|
@@ -484,7 +484,7 @@ var Te = (function(e) {
|
|
|
484
484
|
})();
|
|
485
485
|
be = Te, Object.defineProperty(be.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
|
|
486
486
|
function ot() {
|
|
487
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u =
|
|
487
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = ne(null), i = ne({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
|
|
488
488
|
return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, Ne((function() {
|
|
489
489
|
return qe(u, new Te(i.current));
|
|
490
490
|
}), []);
|
|
@@ -503,65 +503,66 @@ const Ot = Be(
|
|
|
503
503
|
isRequired: o,
|
|
504
504
|
label: a,
|
|
505
505
|
labelClassName: l,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
506
|
+
labelWrapperClassName: u,
|
|
507
|
+
name: i,
|
|
508
|
+
placeholder: c,
|
|
509
|
+
showFlagOnSearch: s = !0,
|
|
510
|
+
showInputFilter: f = !0,
|
|
511
|
+
showNameOnSearch: S = !0,
|
|
512
|
+
wrapperClassName: M,
|
|
513
|
+
showPlaceHolder: j,
|
|
514
|
+
...y
|
|
515
|
+
}, m) => {
|
|
516
|
+
const p = Re(), w = i ?? p, g = ne(null), {
|
|
517
|
+
isOpenSelector: E,
|
|
518
|
+
value: v,
|
|
519
|
+
selectedCountry: h,
|
|
519
520
|
onChangeValue: d,
|
|
520
|
-
handleOpenSelector:
|
|
521
|
-
} = Ke(),
|
|
522
|
-
mask: De(
|
|
521
|
+
handleOpenSelector: k
|
|
522
|
+
} = Ke(), P = typeof t == "string" && t.length >= 0, b = ot({
|
|
523
|
+
mask: De(h),
|
|
523
524
|
replacement: { _: /\d/ }
|
|
524
525
|
});
|
|
525
|
-
Ge(
|
|
526
|
-
const
|
|
527
|
-
(
|
|
528
|
-
|
|
526
|
+
Ge(m, () => b.current, [b]);
|
|
527
|
+
const N = Le(
|
|
528
|
+
(O) => {
|
|
529
|
+
O.target.value.startsWith(h.prefix) ? d(O.target.value) : d(`${h.prefix} `);
|
|
529
530
|
},
|
|
530
|
-
[
|
|
531
|
+
[h.prefix, d]
|
|
531
532
|
);
|
|
532
|
-
return
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
},
|
|
536
|
-
|
|
533
|
+
return pe(() => {
|
|
534
|
+
const O = new AbortController(), C = (I) => {
|
|
535
|
+
I.key === "Escape" && k(!1);
|
|
536
|
+
}, T = (I) => {
|
|
537
|
+
g.current?.contains(I.target) || k(!1);
|
|
537
538
|
};
|
|
538
|
-
return document.addEventListener("keydown",
|
|
539
|
-
signal:
|
|
540
|
-
}), document.addEventListener("mousedown",
|
|
541
|
-
signal:
|
|
539
|
+
return document.addEventListener("keydown", C, {
|
|
540
|
+
signal: O.signal
|
|
541
|
+
}), document.addEventListener("mousedown", T, {
|
|
542
|
+
signal: O.signal
|
|
542
543
|
}), document.addEventListener(
|
|
543
544
|
"visibilitychange",
|
|
544
545
|
() => {
|
|
545
|
-
document.hidden &&
|
|
546
|
+
document.hidden && k(!1);
|
|
546
547
|
},
|
|
547
548
|
{
|
|
548
|
-
signal:
|
|
549
|
+
signal: O.signal
|
|
549
550
|
}
|
|
550
551
|
), () => {
|
|
551
|
-
|
|
552
|
+
O.abort();
|
|
552
553
|
};
|
|
553
|
-
}, [
|
|
554
|
-
|
|
555
|
-
}, [
|
|
556
|
-
a ? /* @__PURE__ */ Z(
|
|
554
|
+
}, [k, g]), pe(() => {
|
|
555
|
+
b.current && (b.current.value = h.prefix + " ");
|
|
556
|
+
}, [h.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
|
|
557
|
+
a ? /* @__PURE__ */ B("div", { className: ee(u), children: /* @__PURE__ */ Z(
|
|
557
558
|
"label",
|
|
558
559
|
{
|
|
559
|
-
id:
|
|
560
|
+
id: w,
|
|
560
561
|
className: Ve({ className: l }),
|
|
561
|
-
onClick: () => !e &&
|
|
562
|
+
onClick: () => !e && b.current?.focus(),
|
|
562
563
|
children: [
|
|
563
564
|
a,
|
|
564
|
-
o && /* @__PURE__ */
|
|
565
|
+
o && /* @__PURE__ */ B(
|
|
565
566
|
X,
|
|
566
567
|
{
|
|
567
568
|
component: "span",
|
|
@@ -571,27 +572,27 @@ const Ot = Be(
|
|
|
571
572
|
)
|
|
572
573
|
]
|
|
573
574
|
}
|
|
574
|
-
) : null,
|
|
575
|
+
) }) : null,
|
|
575
576
|
/* @__PURE__ */ Z(
|
|
576
577
|
"div",
|
|
577
578
|
{
|
|
578
|
-
ref:
|
|
579
|
-
"data-state":
|
|
579
|
+
ref: g,
|
|
580
|
+
"data-state": E ? "open" : "closed",
|
|
580
581
|
className: xe({
|
|
581
|
-
className:
|
|
582
|
-
variant:
|
|
582
|
+
className: M,
|
|
583
|
+
variant: P ? "error" : "default"
|
|
583
584
|
}),
|
|
584
585
|
children: [
|
|
585
586
|
/* @__PURE__ */ Z("div", { className: "p-2 flex items-center gap-2.5", children: [
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ B(Fe, {}),
|
|
588
|
+
/* @__PURE__ */ B(
|
|
588
589
|
"input",
|
|
589
590
|
{
|
|
590
|
-
id: a ?
|
|
591
|
-
ref:
|
|
592
|
-
name:
|
|
591
|
+
id: a ? w : void 0,
|
|
592
|
+
ref: b,
|
|
593
|
+
name: i,
|
|
593
594
|
autoComplete: "off",
|
|
594
|
-
className:
|
|
595
|
+
className: ee(
|
|
595
596
|
"outline-0",
|
|
596
597
|
"w-full",
|
|
597
598
|
"caret-slate-800",
|
|
@@ -604,27 +605,27 @@ const Ot = Be(
|
|
|
604
605
|
),
|
|
605
606
|
type: "tel",
|
|
606
607
|
inputMode: "tel",
|
|
607
|
-
value:
|
|
608
|
-
onChange:
|
|
608
|
+
value: v,
|
|
609
|
+
onChange: N,
|
|
609
610
|
disabled: e,
|
|
610
|
-
...
|
|
611
|
+
...y
|
|
611
612
|
}
|
|
612
613
|
)
|
|
613
614
|
] }),
|
|
614
|
-
|
|
615
|
+
E && /* @__PURE__ */ B(
|
|
615
616
|
Ue,
|
|
616
617
|
{
|
|
617
|
-
placeholder:
|
|
618
|
-
showFlagOnSearch:
|
|
619
|
-
showInputFilter:
|
|
620
|
-
showNameOnSearch:
|
|
621
|
-
showPlaceHolder:
|
|
618
|
+
placeholder: c,
|
|
619
|
+
showFlagOnSearch: s,
|
|
620
|
+
showInputFilter: f,
|
|
621
|
+
showNameOnSearch: S,
|
|
622
|
+
showPlaceHolder: j
|
|
622
623
|
}
|
|
623
624
|
)
|
|
624
625
|
]
|
|
625
626
|
}
|
|
626
627
|
),
|
|
627
|
-
t ? /* @__PURE__ */
|
|
628
|
+
t ? /* @__PURE__ */ B(
|
|
628
629
|
X,
|
|
629
630
|
{
|
|
630
631
|
component: "span",
|
|
@@ -632,11 +633,11 @@ const Ot = Be(
|
|
|
632
633
|
children: t
|
|
633
634
|
}
|
|
634
635
|
) : null,
|
|
635
|
-
!t && n ? /* @__PURE__ */
|
|
636
|
+
!t && n ? /* @__PURE__ */ B(
|
|
636
637
|
X,
|
|
637
638
|
{
|
|
638
639
|
component: "span",
|
|
639
|
-
className:
|
|
640
|
+
className: ee(
|
|
640
641
|
"text-xs kubefirst-dark:text-slate-200",
|
|
641
642
|
r
|
|
642
643
|
),
|