@solibo/solibo-ui 2.2.14 → 2.2.16
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/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index53.css +1 -1
- package/dist/assets/index54.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +50 -50
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +24 -23
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +200 -190
- package/dist/components/dropzone/index.cjs +1 -1
- package/dist/components/dropzone/index.js +84 -56
- package/dist/components/editor/index.cjs +1 -1
- package/dist/components/editor/index.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/label/index.cjs +1 -1
- package/dist/components/label/index.js +16 -14
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.js +20 -20
- package/dist/components/page-layout/index.cjs +1 -1
- package/dist/components/page-layout/index.js +28 -28
- package/dist/components/radio/index.cjs +1 -1
- package/dist/components/radio/index.js +13 -13
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.js +39 -32
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +10 -10
- package/dist/index-6TyCExT0.js +87 -0
- package/dist/index-DEQcFR32.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +31 -8
- package/dist/index.js +1 -1
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
- package/dist/index-Bre56YYa.js +0 -90
- package/dist/index-CHJNMNDr.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),m=require("react"),b=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../../index-BwfsmdF6.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),m=require("react"),b=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../../index-BwfsmdF6.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-DEQcFR32.cjs"),J="_search_wsuwb_3",K="_controls_wsuwb_15",Q="_chips_wsuwb_35",S="_radio_wsuwb_101",l={search:J,controls:K,chips:Q,"filter-dialog":"_filter-dialog_wsuwb_42","filter-groups":"_filter-groups_wsuwb_47","filter-group":"_filter-group_wsuwb_47","filter-option":"_filter-option_wsuwb_83","option-copy":"_option-copy_wsuwb_89",radio:S,"collapsible-options":"_collapsible-options_wsuwb_124"},U=({filterButtonLabel:x="Filters",filterDialogColumns:f=1,filterDialogTitle:k="Filters",filterGroups:d=[],onChange:q,onSelectedFiltersChange:i,removeFilterLabel:M=c=>`Remove ${c.label} filter`,resetLabel:u="Reset",searchLabel:$="Search",searchPlaceholder:O="Search",selectedFilters:t=[],showResultsLabel:B="Show results",value:D=""})=>{const c=m.useId(),[j,r]=m.useState(!1),R=m.useMemo(()=>new Map(d.flatMap(s=>{var n;return[...s.options,...((n=s.collapsible)==null?void 0:n.options)??[]]}).map(s=>[s.value,s])),[d]),h=t.flatMap(s=>{const n=R.get(s);return n?[n]:[]}),p=(s,n,e)=>{var N;if(!i)return;const _=new Set([...(e==null?void 0:e.options.map(o=>o.value))??[],...((N=e==null?void 0:e.collapsible)==null?void 0:N.options.map(o=>o.value))??[]]),y=t.filter(o=>!_.has(o));if(n&&(e==null?void 0:e.defaultValue)===s){i(y);return}i(n?(e==null?void 0:e.control)==="radio"||(e==null?void 0:e.selectionMode)==="single"?[...y,s]:[...new Set([...t,s])]:t.filter(o=>o!==s))},v=(s,n)=>{var e;return t.includes(s)||n.defaultValue===s&&![...n.options,...((e=n.collapsible)==null?void 0:e.options)??[]].some(_=>t.includes(_.value))},w=(s,n)=>a.jsx("div",{className:l["filter-option"],"data-component":"renderfilter",children:n.control==="radio"?a.jsxs("label",{className:l.radio,children:[a.jsx("input",{checked:v(s.value,n),name:`${c}-filter-${n.label??"group"}`,onChange:e=>p(s.value,e.target.checked,n),type:"radio"}),a.jsxs("span",{className:l["option-copy"],children:[s.label,s.description&&a.jsx("sub",{children:s.description})]})]}):a.jsx(I.Checkbox,{checked:v(s.value,n),label:a.jsxs("span",{className:l["option-copy"],children:[s.label,s.description&&a.jsx("sub",{children:s.description})]}),onChange:e=>p(s.value,e.target.checked,n)})},s.value);return a.jsxs("div",{className:l.search,"data-component":"search",children:[a.jsxs("div",{className:l.controls,children:[a.jsx(E.Input,{"aria-label":$,icon:"MagnifyingGlass",onChange:s=>q(s.target.value),placeholder:O,type:"search",value:D}),d.length>0&&a.jsx(b.Button,{"aria-expanded":j,"aria-haspopup":"dialog",badge:h.length,icon:"Funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),h.length>0&&a.jsxs("div",{"aria-label":x,className:l.chips,children:[h.map(s=>a.jsx(T.Chip,{accessibleLabel:M(s),label:s.label,onDelete:()=>p(s.value,!1)},s.value)),a.jsx(b.Button,{onClick:()=>i==null?void 0:i([]),variant:"tertiary",children:u})]}),j&&a.jsx(z.Dialog,{"aria-labelledby":c,className:l["filter-dialog"],controls:a.jsxs(P.Controls,{children:[a.jsx(b.Button,{onClick:()=>{i==null||i([]),r(!1)},children:u}),a.jsx(b.Button,{onClick:()=>r(!1),variant:"primary",children:B})]}),header:a.jsx(A.Header,{children:a.jsx("h2",{id:c,children:k})}),open:!0,setOpen:r,children:a.jsx("div",{className:l["filter-groups"],"data-columns":f,children:d.map((s,n)=>a.jsxs("section",{"aria-labelledby":s.label?`${c}-${n}`:void 0,className:l["filter-group"],"data-column-span":s.columnSpan??1,role:s.control==="radio"?"radiogroup":"group",children:[s.label&&a.jsx("h3",{id:`${c}-${n}`,children:s.label}),s.options.map(e=>w(e,s)),s.collapsible&&a.jsx(H.Collapsible,{summary:s.collapsible.label,children:a.jsx("div",{className:l["collapsible-options"],children:s.collapsible.options.map(e=>w(e,s))})})]},s.label??n))})})]})};exports.Search=U;
|
|
@@ -7,7 +7,7 @@ import { Collapsible as C } from "../collapsible/index.js";
|
|
|
7
7
|
import { C as E } from "../../index-acMNM3VJ.js";
|
|
8
8
|
import { Dialog as J } from "../dialog/index.js";
|
|
9
9
|
import { Header as K } from "../header/index.js";
|
|
10
|
-
import { I as P } from "../../index-
|
|
10
|
+
import { I as P } from "../../index-6TyCExT0.js";
|
|
11
11
|
import '../../assets/index9.css';const Q = "_search_wsuwb_3", U = "_controls_wsuwb_15", V = "_chips_wsuwb_35", W = "_radio_wsuwb_101", o = {
|
|
12
12
|
search: Q,
|
|
13
13
|
controls: U,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index6.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index6.css');const e=require("react/jsx-runtime"),v=require("classix"),q=require("react"),B=require("../form/index.cjs"),T=require("../label/index.cjs"),i=require("../../use-touched-Bq5Gjbpz.cjs"),N="_field_1fxe1_3",E="_label_1fxe1_8",I="_control_1fxe1_19",g="_textarea_1fxe1_29",t={field:N,label:E,control:I,textarea:g},p=({className:d,description:x,errorMessage:a,invalid:s=!1,label:n,maxRows:u=12,minRows:_=3,onBlur:b,required:c,style:m,value:l,...o})=>{const f=q.useId(),r=s&&a?f:void 0,j=[o["aria-describedby"],r].filter(Boolean).join(" ")||void 0,{touched:h,onBlur:y}=i.useTouched(l==="");return e.jsxs("div",{className:t.field,"data-component":"textarea",children:[e.jsxs("label",{className:t.label,children:[n&&e.jsx(T.Label,{label:n,description:x,required:c}),e.jsx("span",{className:t.control,children:e.jsx("textarea",{...o,"aria-describedby":j,"aria-invalid":s?!0:o["aria-invalid"],"data-touched":h||void 0,className:v(t.textarea,d),onBlur:i.composeEventHandlers(y,b),required:c,style:{...m,"--min-rows":_,"--max-rows":u},value:l})})]}),r&&e.jsx(B.FieldError,{errorId:r,errorMessage:a})]})};exports.Textarea=p;
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import y from "classix";
|
|
3
|
+
import { useId as B } from "react";
|
|
4
|
+
import { FieldError as N } from "../form/index.js";
|
|
5
|
+
import { Label as j } from "../label/index.js";
|
|
6
|
+
import { u as E, c as I } from "../../use-touched-B999bBr8.js";
|
|
7
|
+
import '../../assets/index6.css';const w = "_field_1fxe1_3", T = "_label_1fxe1_8", F = "_control_1fxe1_19", H = "_textarea_1fxe1_29", o = {
|
|
8
|
+
field: w,
|
|
9
|
+
label: T,
|
|
10
|
+
control: F,
|
|
11
|
+
textarea: H
|
|
12
|
+
}, D = ({
|
|
13
|
+
className: d,
|
|
14
|
+
description: m,
|
|
15
|
+
errorMessage: t,
|
|
16
|
+
invalid: l = !1,
|
|
17
|
+
label: s,
|
|
18
|
+
maxRows: f = 12,
|
|
19
|
+
minRows: x = 3,
|
|
20
|
+
onBlur: _,
|
|
21
|
+
required: c,
|
|
22
|
+
style: b,
|
|
23
|
+
value: n,
|
|
24
|
+
...r
|
|
21
25
|
}) => {
|
|
22
|
-
const {
|
|
23
|
-
touched:
|
|
24
|
-
onBlur:
|
|
25
|
-
} =
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
const u = B(), a = l && t ? u : void 0, h = [r["aria-describedby"], a].filter(Boolean).join(" ") || void 0, {
|
|
27
|
+
touched: p,
|
|
28
|
+
onBlur: v
|
|
29
|
+
} = E(n === "");
|
|
30
|
+
return /* @__PURE__ */ i("div", { className: o.field, "data-component": "textarea", children: [
|
|
31
|
+
/* @__PURE__ */ i("label", { className: o.label, children: [
|
|
32
|
+
s && /* @__PURE__ */ e(j, { label: s, description: m, required: c }),
|
|
33
|
+
/* @__PURE__ */ e("span", { className: o.control, children: /* @__PURE__ */ e("textarea", { ...r, "aria-describedby": h, "aria-invalid": l ? !0 : r["aria-invalid"], "data-touched": p || void 0, className: y(o.textarea, d), onBlur: I(v, _), required: c, style: {
|
|
34
|
+
...b,
|
|
35
|
+
"--min-rows": x,
|
|
36
|
+
"--max-rows": f
|
|
37
|
+
}, value: n }) })
|
|
38
|
+
] }),
|
|
39
|
+
a && /* @__PURE__ */ e(N, { errorId: a, errorMessage: t })
|
|
33
40
|
] });
|
|
34
41
|
};
|
|
35
42
|
export {
|
|
36
|
-
|
|
43
|
+
D as Textarea
|
|
37
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index3.css');const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index3.css');const t=require("react/jsx-runtime"),g=require("../label/index.cjs"),i="_toggle_zmvgb_3",m="_thumb_zmvgb_14",u="_track_zmvgb_27",e={toggle:i,thumb:m,track:u},b=({checked:s,description:a,disabled:l,label:o,onChange:n})=>{const c=s!==void 0&&n===void 0;return t.jsxs("label",{className:e.toggle,onClick:r=>r.stopPropagation(),"data-component":"toggle",children:[o&&t.jsx(g.Label,{description:a,inline:!0,label:o}),t.jsx("input",{checked:s,disabled:l,onChange:n,readOnly:c,type:"checkbox"}),t.jsx("span",{"aria-hidden":"true",className:e.track,children:t.jsx("span",{className:e.thumb})})]})};exports.Toggle=b;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Label as
|
|
3
|
-
import '../../assets/index3.css';const
|
|
4
|
-
toggle:
|
|
5
|
-
thumb:
|
|
6
|
-
track:
|
|
7
|
-
},
|
|
1
|
+
import { jsxs as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Label as m } from "../label/index.js";
|
|
3
|
+
import '../../assets/index3.css';const i = "_toggle_zmvgb_3", p = "_thumb_zmvgb_14", b = "_track_zmvgb_27", o = {
|
|
4
|
+
toggle: i,
|
|
5
|
+
thumb: p,
|
|
6
|
+
track: b
|
|
7
|
+
}, u = ({
|
|
8
8
|
checked: e,
|
|
9
9
|
description: n,
|
|
10
10
|
disabled: r,
|
|
@@ -12,12 +12,12 @@ import '../../assets/index3.css';const m = "_toggle_1id87_3", d = "_thumb_1id87_
|
|
|
12
12
|
onChange: a
|
|
13
13
|
}) => {
|
|
14
14
|
const c = e !== void 0 && a === void 0;
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
s && /* @__PURE__ */ t(
|
|
15
|
+
return /* @__PURE__ */ g("label", { className: o.toggle, onClick: (l) => l.stopPropagation(), "data-component": "toggle", children: [
|
|
16
|
+
s && /* @__PURE__ */ t(m, { description: n, inline: !0, label: s }),
|
|
17
17
|
/* @__PURE__ */ t("input", { checked: e, disabled: r, onChange: a, readOnly: c, type: "checkbox" }),
|
|
18
18
|
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: o.track, children: /* @__PURE__ */ t("span", { className: o.thumb }) })
|
|
19
19
|
] });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
u as Toggle
|
|
23
23
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as f, Fragment as J, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import p from "classix";
|
|
3
|
+
import { useId as K, useState as z, useEffect as A } from "react";
|
|
4
|
+
import { FieldError as O } from "./components/form/index.js";
|
|
5
|
+
import { i as Q } from "./icons-DVeBguFb.js";
|
|
6
|
+
import { Label as R } from "./components/label/index.js";
|
|
7
|
+
import { u as X, c as Y } from "./use-touched-B999bBr8.js";
|
|
8
|
+
import './assets/index53.css';const Z = (e) => e && e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
9
|
+
function q(e) {
|
|
10
|
+
const n = Z(e);
|
|
11
|
+
return n && !n.endsWith(":") ? `${n}:` : n;
|
|
12
|
+
}
|
|
13
|
+
const M = "_field_1m40b_3", ee = "_input_1m40b_8", te = "_label_1m40b_30", ne = "_suffix_1m40b_40", ie = "_inline_1m40b_47", oe = "_code_1m40b_69", t = {
|
|
14
|
+
field: M,
|
|
15
|
+
input: ee,
|
|
16
|
+
label: te,
|
|
17
|
+
suffix: ne,
|
|
18
|
+
inline: ie,
|
|
19
|
+
code: oe,
|
|
20
|
+
"suffix-text": "_suffix-text_1m40b_95"
|
|
21
|
+
};
|
|
22
|
+
function me({
|
|
23
|
+
className: e,
|
|
24
|
+
defaultCountryCode: n = "+47",
|
|
25
|
+
description: G,
|
|
26
|
+
disabled: l = !1,
|
|
27
|
+
errorMessage: g,
|
|
28
|
+
icon: I,
|
|
29
|
+
invalid: h = !1,
|
|
30
|
+
label: b,
|
|
31
|
+
onBlur: H,
|
|
32
|
+
placeholder: N,
|
|
33
|
+
ref: B,
|
|
34
|
+
required: _,
|
|
35
|
+
style: L,
|
|
36
|
+
suffix: j,
|
|
37
|
+
type: i = "text",
|
|
38
|
+
variant: r = "default",
|
|
39
|
+
...s
|
|
40
|
+
}) {
|
|
41
|
+
const U = K(), [x, C] = z(""), [c, E] = z(""), {
|
|
42
|
+
name: F,
|
|
43
|
+
onChange: u,
|
|
44
|
+
pattern: W,
|
|
45
|
+
value: d,
|
|
46
|
+
...$
|
|
47
|
+
} = s, {
|
|
48
|
+
touched: w,
|
|
49
|
+
onBlur: k
|
|
50
|
+
} = X(d === ""), m = I && i !== "datetime-local" ? I : void 0, y = b && r === "inline" ? q(b) : b, v = h && g ? U : void 0, P = [s["aria-describedby"], v].filter(Boolean).join(" ") || void 0, S = m ? {
|
|
51
|
+
...L,
|
|
52
|
+
"--icon-svg": Q(m)
|
|
53
|
+
} : L, T = Y(k, H);
|
|
54
|
+
A(() => {
|
|
55
|
+
if (u && i === "tel") {
|
|
56
|
+
const a = {
|
|
57
|
+
name: F,
|
|
58
|
+
value: c ? (x || n).split(" ").join("") + c.split(" ").join("") : void 0
|
|
59
|
+
};
|
|
60
|
+
u({
|
|
61
|
+
target: a,
|
|
62
|
+
currentTarget: a
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, [x, n, F, u, c, i]), A(() => {
|
|
66
|
+
i === "tel" && !d && (E(""), C(""));
|
|
67
|
+
}, [i, d]);
|
|
68
|
+
const D = /* @__PURE__ */ f(J, { children: [
|
|
69
|
+
/* @__PURE__ */ o("input", { disabled: l, hidden: !0, onChange: u, pattern: void 0, placeholder: N, ref: B, type: i, value: d }),
|
|
70
|
+
/* @__PURE__ */ o("input", { type: "text", className: p(t.code, t.input), disabled: l, maxLength: 5, onChange: (a) => C(a.target.value), placeholder: n, value: x }),
|
|
71
|
+
/* @__PURE__ */ o("input", { ...$, "aria-describedby": P, "aria-invalid": h ? !0 : s["aria-invalid"], type: "tel", className: p(t.input, e), "data-icon": m ? "true" : void 0, "data-touched": w || void 0, disabled: l, maxLength: 14, name: void 0, onChange: (a) => E(a.target.value), onBlur: T, pattern: W, required: _, style: S, value: c })
|
|
72
|
+
] }), V = /* @__PURE__ */ o("input", { ...s, "aria-describedby": P, "aria-invalid": h ? !0 : s["aria-invalid"], ref: B, className: p(t.input, e), "data-icon": m ? "true" : void 0, "data-touched": w || void 0, disabled: l, onBlur: T, placeholder: N, required: _, style: S, type: i });
|
|
73
|
+
return /* @__PURE__ */ f("div", { className: t.field, "data-component": "input", children: [
|
|
74
|
+
/* @__PURE__ */ f("label", { className: p(t.label, r === "inline" && t.inline), children: [
|
|
75
|
+
y && /* @__PURE__ */ o(R, { description: G, inline: r === "inline", label: y, required: _ && r !== "inline" }),
|
|
76
|
+
i === "tel" ? D : j ? /* @__PURE__ */ f("span", { className: t.suffix, children: [
|
|
77
|
+
V,
|
|
78
|
+
/* @__PURE__ */ o("span", { className: t["suffix-text"], children: j })
|
|
79
|
+
] }) : V
|
|
80
|
+
] }),
|
|
81
|
+
v && /* @__PURE__ */ o(O, { errorId: v, errorMessage: g })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
me as I,
|
|
86
|
+
q as f
|
|
87
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/index53.css');const e=require("react/jsx-runtime"),x=require("classix"),c=require("react"),k=require("./components/form/index.cjs"),D=require("./icons-BIdcCH-v.cjs"),J=require("./components/label/index.cjs"),R=require("./use-touched-Bq5Gjbpz.cjs"),K=n=>n&&n.charAt(0).toUpperCase()+n.slice(1).toLowerCase();function V(n){const i=K(n);return i&&!i.endsWith(":")?`${i}:`:i}const O="_field_1m40b_3",Q="_input_1m40b_8",X="_label_1m40b_30",Y="_suffix_1m40b_40",Z="_inline_1m40b_47",M="_code_1m40b_69",t={field:O,input:Q,label:X,suffix:Y,inline:Z,code:M,"suffix-text":"_suffix-text_1m40b_95"};function ee({className:n,defaultCountryCode:i="+47",description:z,disabled:l=!1,errorMessage:j,icon:g,invalid:_=!1,label:b,onBlur:A,placeholder:I,ref:L,required:h,style:N,suffix:B,type:s="text",variant:r="default",...a}){const G=c.useId(),[p,q]=c.useState(""),[u,E]=c.useState(""),{name:C,onChange:d,pattern:H,value:m,...U}=a,{touched:F,onBlur:W}=R.useTouched(m===""),f=g&&s!=="datetime-local"?g:void 0,S=b&&r==="inline"?V(b):b,v=_&&j?G:void 0,T=[a["aria-describedby"],v].filter(Boolean).join(" ")||void 0,w=f?{...N,"--icon-svg":D.iconSVG(f)}:N,y=R.composeEventHandlers(W,A);c.useEffect(()=>{if(d&&s==="tel"){const o={name:C,value:u?(p||i).split(" ").join("")+u.split(" ").join(""):void 0};d({target:o,currentTarget:o})}},[p,i,C,d,u,s]),c.useEffect(()=>{s==="tel"&&!m&&(E(""),q(""))},[s,m]);const $=e.jsxs(e.Fragment,{children:[e.jsx("input",{disabled:l,hidden:!0,onChange:d,pattern:void 0,placeholder:I,ref:L,type:s,value:m}),e.jsx("input",{type:"text",className:x(t.code,t.input),disabled:l,maxLength:5,onChange:o=>q(o.target.value),placeholder:i,value:p}),e.jsx("input",{...U,"aria-describedby":T,"aria-invalid":_?!0:a["aria-invalid"],type:"tel",className:x(t.input,n),"data-icon":f?"true":void 0,"data-touched":F||void 0,disabled:l,maxLength:14,name:void 0,onChange:o=>E(o.target.value),onBlur:y,pattern:H,required:h,style:w,value:u})]}),P=e.jsx("input",{...a,"aria-describedby":T,"aria-invalid":_?!0:a["aria-invalid"],ref:L,className:x(t.input,n),"data-icon":f?"true":void 0,"data-touched":F||void 0,disabled:l,onBlur:y,placeholder:I,required:h,style:w,type:s});return e.jsxs("div",{className:t.field,"data-component":"input",children:[e.jsxs("label",{className:x(t.label,r==="inline"&&t.inline),children:[S&&e.jsx(J.Label,{description:z,inline:r==="inline",label:S,required:h&&r!=="inline"}),s==="tel"?$:B?e.jsxs("span",{className:t.suffix,children:[P,e.jsx("span",{className:t["suffix-text"],children:B})]}):P]}),v&&e.jsx(k.FieldError,{errorId:v,errorMessage:j})]})}exports.Input=ee;exports.formatInlineLabel=V;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const t=require("./components/app-link/index.cjs"),r=require("./components/app-shell/index.cjs"),i=require("./components/aside/index.cjs"),s=require("./components/avatar/index.cjs"),c=require("./components/badge/index.cjs"),_=require("./components/banner/index.cjs"),p=require("./components/branding/index.cjs"),a=require("./components/button/index.cjs"),d=require("./components/card/index.cjs"),m=require("./components/checkbox/index.cjs"),u=require("./components/chip/index.cjs"),l=require("./components/clipboard/index.cjs"),x=require("./components/collapsible/index.cjs"),q=require("./index-B4dFheLl.cjs"),g=require("./components/comments/index.cjs"),b=require("./index-BwfsmdF6.cjs"),C=require("./components/croppable/index.cjs"),h=require("./components/dialog/index.cjs"),L=require("./components/divider/index.cjs"),v=require("./components/dropdown/index.cjs"),S=require("./components/dropzone/index.cjs"),T=require("./components/editor/index.cjs"),I=require("./content-i-MRPlxK.cjs"),k=require("./components/empty-state/index.cjs"),F=require("./components/fieldset/index.cjs"),f=require("./components/figure/index.cjs"),P=require("./components/file/index.cjs"),y=require("./components/footer/index.cjs"),A=require("./components/form/index.cjs"),B=require("./components/graph/index.cjs"),D=require("./components/group/index.cjs"),M=require("./components/header/index.cjs"),E=require("./components/icon/index.cjs"),N=require("./components/iframe/index.cjs"),O=require("./components/image/index.cjs"),j=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const t=require("./components/app-link/index.cjs"),r=require("./components/app-shell/index.cjs"),i=require("./components/aside/index.cjs"),s=require("./components/avatar/index.cjs"),c=require("./components/badge/index.cjs"),_=require("./components/banner/index.cjs"),p=require("./components/branding/index.cjs"),a=require("./components/button/index.cjs"),d=require("./components/card/index.cjs"),m=require("./components/checkbox/index.cjs"),u=require("./components/chip/index.cjs"),l=require("./components/clipboard/index.cjs"),x=require("./components/collapsible/index.cjs"),q=require("./index-B4dFheLl.cjs"),g=require("./components/comments/index.cjs"),b=require("./index-BwfsmdF6.cjs"),C=require("./components/croppable/index.cjs"),h=require("./components/dialog/index.cjs"),L=require("./components/divider/index.cjs"),v=require("./components/dropdown/index.cjs"),S=require("./components/dropzone/index.cjs"),T=require("./components/editor/index.cjs"),I=require("./content-i-MRPlxK.cjs"),k=require("./components/empty-state/index.cjs"),F=require("./components/fieldset/index.cjs"),f=require("./components/figure/index.cjs"),P=require("./components/file/index.cjs"),y=require("./components/footer/index.cjs"),A=require("./components/form/index.cjs"),B=require("./components/graph/index.cjs"),D=require("./components/group/index.cjs"),M=require("./components/header/index.cjs"),E=require("./components/icon/index.cjs"),N=require("./components/iframe/index.cjs"),O=require("./components/image/index.cjs"),j=require("./index-DEQcFR32.cjs"),w=require("./components/label/index.cjs"),n=require("./components/link/index.cjs"),G=require("./components/list/index.cjs"),z=require("./components/loading/index.cjs"),H=require("./components/menu/index.cjs"),R=require("./components/message/index.cjs"),W=require("./components/messages/index.cjs"),e=require("./components/nav/index.cjs"),J=require("./components/object/index.cjs"),K=require("./components/page-layout/index.cjs"),Q=require("./components/panel/index.cjs"),U=require("./components/popover/index.cjs"),V=require("./components/portal/index.cjs"),X=require("./components/radio/index.cjs"),Y=require("./components/search/index.cjs"),Z=require("./index-BQoXmNo3.cjs"),o=require("./components/sortable/index.cjs"),$=require("./components/table/index.cjs"),ee=require("./components/textarea/index.cjs"),ne=require("./components/toast/index.cjs"),oe=require("./components/toasts/index.cjs"),te=require("./components/toggle/index.cjs"),re=require("./components/toolbar/index.cjs"),ie=require("./components/tooltip/index.cjs"),se=require("./components/widget/index.cjs");exports.AppLink=t.AppLink;exports.AppShell=r.AppShell;exports.Aside=i.Aside;exports.Avatar=s.Avatar;exports.Badge=c.Badge;exports.Banner=_.Banner;exports.Branding=p.Branding;exports.Button=a.Button;exports.Card=d.Card;exports.Checkbox=m.Checkbox;exports.Chip=u.Chip;exports.Clipboard=l.Clipboard;exports.Collapsible=x.Collapsible;exports.Comment=q.Comment;exports.Comments=g.Comments;exports.Controls=b.Controls;exports.Croppable=C.Croppable;exports.Dialog=h.Dialog;exports.Divider=L.Divider;exports.Dropdown=v.Dropdown;exports.Dropzone=S.Dropzone;exports.Editor=T.Editor;exports.hasEditorContent=I.hasEditorContent;exports.EmptyState=k.EmptyState;exports.Fieldset=F.Fieldset;exports.Figure=f.Figure;exports.File=P.File;exports.Footer=y.Footer;exports.Form=A.Form;exports.Graph=B.Graph;exports.Group=D.Group;exports.Header=M.Header;exports.Icon=E.Icon;exports.Iframe=N.Iframe;exports.Image=O.Image;exports.Input=j.Input;exports.Label=w.Label;exports.Link=n.Link;exports.LinkContent=n.LinkContent;exports.List=G.List;exports.Loading=z.Loading;exports.Menu=H.Menu;exports.Message=R.Message;exports.Messages=W.Messages;exports.Nav=e.Nav;exports.NavItem=e.NavItem;exports.NavLabel=e.NavLabel;exports.Object=J.Object;exports.PageLayout=K.PageLayout;exports.Panel=Q.Panel;exports.Popover=U.Popover;exports.Portal=V.Portal;exports.Radio=X.Radio;exports.Search=Y.Search;exports.Select=Z.Select;exports.Sortable=o.Sortable;exports.useOptionalSortableItem=o.useOptionalSortableItem;exports.Table=$.Table;exports.Textarea=ee.Textarea;exports.Toast=ne.Toast;exports.Toasts=oe.Toasts;exports.Toggle=te.Toggle;exports.Toolbar=re.Toolbar;exports.Tooltip=ie.Tooltip;exports.Widget=se.Widget;
|
package/dist/index.d.ts
CHANGED
|
@@ -290,7 +290,7 @@ export declare const Divider: ({ className, ...props }: DividerProps) => JSX.Ele
|
|
|
290
290
|
|
|
291
291
|
export declare type DividerProps = React.ComponentPropsWithoutRef<'hr'>;
|
|
292
292
|
|
|
293
|
-
export declare const Dropdown: ({ children: selectElement, className, combobox, createOption, emptyLabel, errorLabel, onRetry, retryLabel, label, filterOptions, hasNextPage, loading, loadMoreLabel, onLoadMore, onOpenChange, onSearchChange, searchValue, renderOption, searchPlaceholder, selectedItems, variant, ...props }: DropdownProps) => JSX.Element;
|
|
293
|
+
export declare const Dropdown: ({ children: selectElement, className, combobox, description, errorMessage, invalid, searchable: searchableProp, createOption, emptyLabel, errorLabel, onRetry, retryLabel, label, filterOptions, hasNextPage, loading, loadMoreLabel, onLoadMore, onOpenChange, onSearchChange, searchValue, renderOption, searchPlaceholder, selectedItems, variant, ...props }: DropdownProps) => JSX.Element;
|
|
294
294
|
|
|
295
295
|
export declare type DropdownCreateOption = {
|
|
296
296
|
isValid: (value: string) => boolean;
|
|
@@ -312,6 +312,11 @@ declare type DropdownOption = {
|
|
|
312
312
|
declare type DropdownProps = Omit<default_2.ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
313
313
|
children: DropdownSelectElement;
|
|
314
314
|
combobox?: boolean;
|
|
315
|
+
description?: string;
|
|
316
|
+
errorMessage?: default_2.ReactNode;
|
|
317
|
+
invalid?: boolean;
|
|
318
|
+
/** Defaults to true when there are more than eight visible options. */
|
|
319
|
+
searchable?: boolean;
|
|
315
320
|
createOption?: DropdownCreateOption;
|
|
316
321
|
emptyLabel?: string;
|
|
317
322
|
errorLabel?: string;
|
|
@@ -339,15 +344,29 @@ export declare type DropdownRenderOption = Pick<DropdownOption, 'groupLabel' | '
|
|
|
339
344
|
|
|
340
345
|
declare type DropdownSelectElement = NativeSelectElement | WrappedSelectElement;
|
|
341
346
|
|
|
342
|
-
export declare const Dropzone: ({ accepts, label, maxFileSize, multiple, onChange, onValidation, variant,
|
|
347
|
+
export declare const Dropzone: ({ "aria-describedby": externalDescription, accepts, children, className, description, disabled, dropLabel, errorMessage, id, invalid, label, maxFileSize, multiple, name, onChange, onValidation, required, uploadLabel, variant, }: DropzoneProps) => JSX.Element;
|
|
343
348
|
|
|
344
|
-
declare type DropzoneProps = {
|
|
349
|
+
export declare type DropzoneProps = {
|
|
350
|
+
'aria-describedby'?: string;
|
|
345
351
|
accepts?: string;
|
|
346
|
-
|
|
352
|
+
/** Selected files, typically rendered with the File component. */
|
|
353
|
+
children?: React.ReactNode;
|
|
354
|
+
className?: string;
|
|
355
|
+
description?: string;
|
|
356
|
+
disabled?: boolean;
|
|
357
|
+
dropLabel?: string;
|
|
358
|
+
errorMessage?: React.ReactNode;
|
|
359
|
+
id?: string;
|
|
360
|
+
invalid?: boolean;
|
|
361
|
+
/** Field label. Also used as the upload button text unless uploadLabel is supplied. */
|
|
362
|
+
label?: string;
|
|
347
363
|
maxFileSize?: number;
|
|
348
364
|
multiple?: boolean;
|
|
365
|
+
name?: string;
|
|
349
366
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
350
367
|
onValidation?: (empty: File[], oversized: File[]) => void;
|
|
368
|
+
required?: boolean;
|
|
369
|
+
uploadLabel?: string;
|
|
351
370
|
variant?: 'default' | 'minimal';
|
|
352
371
|
};
|
|
353
372
|
|
|
@@ -787,12 +806,14 @@ export declare type InputProps = React.ComponentPropsWithRef<'input'> & {
|
|
|
787
806
|
type?: 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text';
|
|
788
807
|
};
|
|
789
808
|
|
|
790
|
-
export declare const Label: ({ description, inline, label, required }: LabelProps) => JSX.Element;
|
|
809
|
+
export declare const Label: ({ description, descriptionId, inline, label, labelId, required, }: LabelProps) => JSX.Element;
|
|
791
810
|
|
|
792
811
|
declare type LabelProps = {
|
|
793
812
|
description?: string;
|
|
813
|
+
descriptionId?: string;
|
|
794
814
|
inline?: boolean;
|
|
795
|
-
label?:
|
|
815
|
+
label?: React.ReactNode;
|
|
816
|
+
labelId?: string;
|
|
796
817
|
required?: boolean;
|
|
797
818
|
};
|
|
798
819
|
|
|
@@ -1438,10 +1459,12 @@ declare type TableProps = React.TableHTMLAttributes<HTMLTableElement> & {
|
|
|
1438
1459
|
locale?: string | string[];
|
|
1439
1460
|
};
|
|
1440
1461
|
|
|
1441
|
-
export declare const Textarea: ({ className, description, label, maxRows, minRows, onBlur: onBlurProp, required, style, value, ...props }: TextareaProps) => JSX.Element;
|
|
1462
|
+
export declare const Textarea: ({ className, description, errorMessage, invalid, label, maxRows, minRows, onBlur: onBlurProp, required, style, value, ...props }: TextareaProps) => JSX.Element;
|
|
1442
1463
|
|
|
1443
|
-
declare type TextareaProps = Omit<React.
|
|
1464
|
+
export declare type TextareaProps = Omit<React.ComponentPropsWithRef<'textarea'>, 'children'> & {
|
|
1444
1465
|
description?: string;
|
|
1466
|
+
errorMessage?: React.ReactNode;
|
|
1467
|
+
invalid?: boolean;
|
|
1445
1468
|
label?: string;
|
|
1446
1469
|
maxRows?: number;
|
|
1447
1470
|
minRows?: number;
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import { Header as no } from "./components/header/index.js";
|
|
|
33
33
|
import { Icon as so } from "./components/icon/index.js";
|
|
34
34
|
import { Iframe as go } from "./components/iframe/index.js";
|
|
35
35
|
import { Image as Lo } from "./components/image/index.js";
|
|
36
|
-
import { I as uo } from "./index-
|
|
36
|
+
import { I as uo } from "./index-6TyCExT0.js";
|
|
37
37
|
import { Label as So } from "./components/label/index.js";
|
|
38
38
|
import { Link as vo, LinkContent as co } from "./components/link/index.js";
|
|
39
39
|
import { List as ko } from "./components/list/index.js";
|
package/dist/tokens.json
CHANGED
package/package.json
CHANGED
package/dist/index-Bre56YYa.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsxs as x, Fragment as Y, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import m from "classix";
|
|
3
|
-
import { useId as Z, useState as b, useEffect as W } from "react";
|
|
4
|
-
import { FieldError as q } from "./components/form/index.js";
|
|
5
|
-
import { i as M } from "./icons-DVeBguFb.js";
|
|
6
|
-
import { Label as nn } from "./components/label/index.js";
|
|
7
|
-
import { u as tn, c as I } from "./use-touched-B999bBr8.js";
|
|
8
|
-
import './assets/index53.css';const en = (t) => t && t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
9
|
-
function on(t) {
|
|
10
|
-
const e = en(t);
|
|
11
|
-
return e && !e.endsWith(":") ? `${e}:` : e;
|
|
12
|
-
}
|
|
13
|
-
const an = "_field_11xgx_3", sn = "_input_11xgx_8", cn = "_label_11xgx_54", ln = "_inline_11xgx_69", rn = "_suffix_11xgx_84", dn = "_touched_11xgx_98", un = "_code_11xgx_136", n = {
|
|
14
|
-
field: an,
|
|
15
|
-
input: sn,
|
|
16
|
-
label: cn,
|
|
17
|
-
inline: ln,
|
|
18
|
-
suffix: rn,
|
|
19
|
-
touched: dn,
|
|
20
|
-
code: un,
|
|
21
|
-
"suffix-text": "_suffix-text_11xgx_162"
|
|
22
|
-
};
|
|
23
|
-
function vn({
|
|
24
|
-
className: t,
|
|
25
|
-
defaultCountryCode: e = "+47",
|
|
26
|
-
description: $,
|
|
27
|
-
disabled: c = !1,
|
|
28
|
-
errorMessage: N,
|
|
29
|
-
icon: B,
|
|
30
|
-
invalid: h = !1,
|
|
31
|
-
label: g,
|
|
32
|
-
onBlur: k,
|
|
33
|
-
placeholder: L,
|
|
34
|
-
ref: w,
|
|
35
|
-
required: _,
|
|
36
|
-
style: E,
|
|
37
|
-
suffix: P,
|
|
38
|
-
type: i = "text",
|
|
39
|
-
variant: l = "default",
|
|
40
|
-
...o
|
|
41
|
-
}) {
|
|
42
|
-
const J = Z(), [p, j] = b(""), [r, C] = b(""), [D, y] = b(!1), {
|
|
43
|
-
name: F,
|
|
44
|
-
onChange: d,
|
|
45
|
-
pattern: K,
|
|
46
|
-
value: u,
|
|
47
|
-
...Q
|
|
48
|
-
} = o, {
|
|
49
|
-
touched: S,
|
|
50
|
-
onBlur: R
|
|
51
|
-
} = tn(u === ""), f = B && i !== "datetime-local" ? B : void 0, T = g && l === "inline" ? on(g) : g, v = h && N ? J : void 0, V = [o["aria-describedby"], v].filter(Boolean).join(" ") || void 0, z = f ? {
|
|
52
|
-
...E,
|
|
53
|
-
"--icon-svg": M(f)
|
|
54
|
-
} : E, A = I(R, () => y(!1), k), G = () => {
|
|
55
|
-
!c && !o.readOnly && y(!0);
|
|
56
|
-
}, H = I(G, o.onInput), O = I(G, o.onPointerDown);
|
|
57
|
-
W(() => {
|
|
58
|
-
if (d && i === "tel") {
|
|
59
|
-
const s = {
|
|
60
|
-
name: F,
|
|
61
|
-
value: r ? (p || e).split(" ").join("") + r.split(" ").join("") : void 0
|
|
62
|
-
};
|
|
63
|
-
d({
|
|
64
|
-
target: s,
|
|
65
|
-
currentTarget: s
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}, [p, e, F, d, r, i]), W(() => {
|
|
69
|
-
i === "tel" && !u && (C(""), j(""));
|
|
70
|
-
}, [i, u]);
|
|
71
|
-
const X = /* @__PURE__ */ x(Y, { children: [
|
|
72
|
-
/* @__PURE__ */ a("input", { disabled: c, hidden: !0, onChange: d, pattern: void 0, placeholder: L, ref: w, type: i, value: u }),
|
|
73
|
-
/* @__PURE__ */ a("input", { type: "text", className: m(n.code, n.input), disabled: c, maxLength: 5, onChange: (s) => j(s.target.value), placeholder: e, value: p }),
|
|
74
|
-
/* @__PURE__ */ a("input", { ...Q, "aria-describedby": V, "aria-invalid": h ? !0 : o["aria-invalid"], type: "tel", className: m(n.input, t, S && n.touched), "data-icon": f ? "true" : void 0, "data-editing": D || void 0, onInput: H, onPointerDown: O, disabled: c, maxLength: 14, name: void 0, onChange: (s) => C(s.target.value), onBlur: A, pattern: K, required: _, style: z, value: r })
|
|
75
|
-
] }), U = /* @__PURE__ */ a("input", { ...o, "aria-describedby": V, "aria-invalid": h ? !0 : o["aria-invalid"], ref: w, className: m(n.input, t, S && n.touched), "data-icon": f ? "true" : void 0, "data-editing": D || void 0, onInput: H, onPointerDown: O, disabled: c, onBlur: A, placeholder: L, required: _, style: z, type: i });
|
|
76
|
-
return /* @__PURE__ */ x("div", { className: n.field, "data-component": "input", children: [
|
|
77
|
-
/* @__PURE__ */ x("label", { className: m(n.label, l === "inline" && n.inline), children: [
|
|
78
|
-
T && /* @__PURE__ */ a(nn, { description: $, inline: l === "inline", label: T, required: _ && l !== "inline" }),
|
|
79
|
-
i === "tel" ? X : P ? /* @__PURE__ */ x("span", { className: n.suffix, children: [
|
|
80
|
-
U,
|
|
81
|
-
/* @__PURE__ */ a("span", { className: n["suffix-text"], children: P })
|
|
82
|
-
] }) : U
|
|
83
|
-
] }),
|
|
84
|
-
v && /* @__PURE__ */ a(q, { errorId: v, errorMessage: N })
|
|
85
|
-
] });
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
88
|
-
vn as I,
|
|
89
|
-
on as f
|
|
90
|
-
};
|
package/dist/index-CHJNMNDr.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require('./assets/index53.css');const e=require("react/jsx-runtime"),h=require("classix"),a=require("react"),Q=require("./components/form/index.cjs"),X=require("./icons-BIdcCH-v.cjs"),Y=require("./components/label/index.cjs"),_=require("./use-touched-Bq5Gjbpz.cjs"),Z=t=>t&&t.charAt(0).toUpperCase()+t.slice(1).toLowerCase();function G(t){const i=Z(t);return i&&!i.endsWith(":")?`${i}:`:i}const M="_field_11xgx_3",ee="_input_11xgx_8",ne="_label_11xgx_54",te="_inline_11xgx_69",ie="_suffix_11xgx_84",oe="_touched_11xgx_98",se="_code_11xgx_136",n={field:M,input:ee,label:ne,inline:te,suffix:ie,touched:oe,code:se,"suffix-text":"_suffix-text_11xgx_162"};function ce({className:t,defaultCountryCode:i="+47",description:O,disabled:l=!1,errorMessage:j,icon:I,invalid:g=!1,label:m,onBlur:U,placeholder:E,ref:L,required:p,style:N,suffix:B,type:o="text",variant:r="default",...s}){const W=a.useId(),[v,q]=a.useState(""),[u,w]=a.useState(""),[P,C]=a.useState(!1),{name:D,onChange:d,pattern:$,value:x,...k}=s,{touched:S,onBlur:J}=_.useTouched(x===""),f=I&&o!=="datetime-local"?I:void 0,y=m&&r==="inline"?G(m):m,b=g&&j?W:void 0,F=[s["aria-describedby"],b].filter(Boolean).join(" ")||void 0,H=f?{...N,"--icon-svg":X.iconSVG(f)}:N,T=_.composeEventHandlers(J,()=>C(!1),U),R=()=>{!l&&!s.readOnly&&C(!0)},V=_.composeEventHandlers(R,s.onInput),z=_.composeEventHandlers(R,s.onPointerDown);a.useEffect(()=>{if(d&&o==="tel"){const c={name:D,value:u?(v||i).split(" ").join("")+u.split(" ").join(""):void 0};d({target:c,currentTarget:c})}},[v,i,D,d,u,o]),a.useEffect(()=>{o==="tel"&&!x&&(w(""),q(""))},[o,x]);const K=e.jsxs(e.Fragment,{children:[e.jsx("input",{disabled:l,hidden:!0,onChange:d,pattern:void 0,placeholder:E,ref:L,type:o,value:x}),e.jsx("input",{type:"text",className:h(n.code,n.input),disabled:l,maxLength:5,onChange:c=>q(c.target.value),placeholder:i,value:v}),e.jsx("input",{...k,"aria-describedby":F,"aria-invalid":g?!0:s["aria-invalid"],type:"tel",className:h(n.input,t,S&&n.touched),"data-icon":f?"true":void 0,"data-editing":P||void 0,onInput:V,onPointerDown:z,disabled:l,maxLength:14,name:void 0,onChange:c=>w(c.target.value),onBlur:T,pattern:$,required:p,style:H,value:u})]}),A=e.jsx("input",{...s,"aria-describedby":F,"aria-invalid":g?!0:s["aria-invalid"],ref:L,className:h(n.input,t,S&&n.touched),"data-icon":f?"true":void 0,"data-editing":P||void 0,onInput:V,onPointerDown:z,disabled:l,onBlur:T,placeholder:E,required:p,style:H,type:o});return e.jsxs("div",{className:n.field,"data-component":"input",children:[e.jsxs("label",{className:h(n.label,r==="inline"&&n.inline),children:[y&&e.jsx(Y.Label,{description:O,inline:r==="inline",label:y,required:p&&r!=="inline"}),o==="tel"?K:B?e.jsxs("span",{className:n.suffix,children:[A,e.jsx("span",{className:n["suffix-text"],children:B})]}):A]}),b&&e.jsx(Q.FieldError,{errorId:b,errorMessage:j})]})}exports.Input=ce;exports.formatInlineLabel=G;
|