@telia-ace/widget-components-area 1.2.4 → 1.2.6
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/area-f075309d.js +50 -0
- package/{area-2730550b.mjs → area-f9d028bf.mjs} +64 -53
- package/{index-ca543402.mjs → index-7fc9ef83.mjs} +1 -1
- package/{index-d68cb848.js → index-a2bac2d5.js} +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/area-b1abdc0c.js +0 -47
package/area-f075309d.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),v=require("@emotion/react"),u=require("@emotion/styled"),c=require("@telia-ace/widget-core"),C=require("@telia-ace/widget-types-grid"),t=require("@telia-ace/widget-ui"),h=require("@telia-ace/widget-utilities"),b=require("react"),d=require("./index-a2bac2d5.js"),G=b.forwardRef(({children:e,className:n,renderState:i,animation:a,...m},l)=>(b.useEffect(()=>{if(i==="open"){const o=document.querySelector(`[data-node-id='${m.id}']`);o&&o.focus()}}),i?r.jsx(t.TransitionComponent,{mountOnEnter:i!==c.WidgetRenderState.hidden,timeout:200,in:i===c.WidgetRenderState.open,transitions:a,unmountOnExit:i===c.WidgetRenderState.closed,children:(o,p)=>r.jsx(L,{...m,tabIndex:"-1",animationCss:p,"data-state":o,ref:l,className:h.appendClassNames("humany-animated-area",n),children:e})}):null)),L=u(t.Grid)`
|
|
2
|
+
${C.genericComponentStyling}
|
|
3
|
+
${e=>!!e.animationCss&&e.animationCss}
|
|
4
|
+
${e=>!!e.scrollableCss&&e.scrollableCss}
|
|
5
|
+
text-size-adjust: 100%;
|
|
6
|
+
input::-ms-clear {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
:focus-visible {
|
|
10
|
+
outline: none !important;
|
|
11
|
+
}
|
|
12
|
+
${e=>e.hidden&&e["data-state"]==="exited"&&v.css`
|
|
13
|
+
visibility: collapse;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
`};
|
|
16
|
+
`,U=({className:e,...n})=>{const{name:i}=t.useComponentDescriptor(),a=t.useRenderState(),m=t.useContext(),l=t.useProperties(),o=t.useChildren(),p=t.useContainer(),{gap:q="0"}=m,{columns:x=1,animation:g="none",scrollable:T=!1,mode:f=d.AreaMode.Static,trigger:A={},fullScreen:R,header:P,...M}=l,{size:W=24,symbol:$,label:j,ariaLabel:D,...N}=A,[z,B]=t.useScroll(T),E=b.useCallback(s=>{const{events:O}=p.get("$widget");return O.dispatch("widget:area-rendered",{name:i,properties:l,element:s}),B.current=s,s},[l,a]);if(!o.length)return t.createEmptyComponent(p,{...n,className:h.appendClassNames(e,"humany-area")});const w={...n,className:h.appendClassNames(e,"humany-area",`humany-area-${i}`),scrollableCss:z,...M,columns:x,gap:q,renderState:a,animation:g,hidden:a===c.WidgetRenderState.hidden,ref:E},y=(()=>g!=="none"?r.jsx(t.ColumnContext.Provider,{value:x,children:r.jsx(G,{...w,children:o.map(s=>r.jsx(C.Component,{id:s.id,branch:"default"},s.id))})}):a===c.WidgetRenderState.closed?null:r.jsx(t.ColumnContext.Provider,{value:x,children:r.jsx(H,{...w,children:o.map(s=>r.jsx(C.Component,{id:s.id,branch:"default"},s.id))})}))();if(f===d.AreaMode.Static)return y;const S=r.jsxs(k,{className:"humany-area-trigger",title:D,...t.filterCssProps(N),children:[j&&r.jsx(I,{children:j}),$&&r.jsx(F,{symbol:$,size:W})]});if(f===d.AreaMode.Dropdown)return r.jsx(t.Dropdown,{trigger:S,children:y});if(f===d.AreaMode.Drawer){const s=Object.values(t.DrawerAnimationType).includes(g)&&{type:g}||void 0;return r.jsx(t.Drawer,{header:P,animation:s,fullScreen:R,trigger:S,children:y})}return f===d.AreaMode.Modal&&h.Logger.warn("modal area not implemented"),null},k=u(t.Button)`
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: inherit;
|
|
19
|
+
align-self: center;
|
|
20
|
+
width: fit-content;
|
|
21
|
+
height: fit-content;
|
|
22
|
+
${t.filterCssPropsStyle}
|
|
23
|
+
|
|
24
|
+
${e=>e.theme.fonts&&`
|
|
25
|
+
font-family: ${e.theme.fonts.type};
|
|
26
|
+
font-size: ${e.theme.fonts.normal};
|
|
27
|
+
`}
|
|
28
|
+
|
|
29
|
+
&:focus-visible {
|
|
30
|
+
${t.paddedBorderTabStyle};
|
|
31
|
+
}
|
|
32
|
+
`,I=u(t.Text)`
|
|
33
|
+
margin: 0 ${e=>{var n;return(n=e.theme.sizes)==null?void 0:n.small}} 0 0;
|
|
34
|
+
color: ${e=>{var n;return(n=e.theme.colors)==null?void 0:n.text}};
|
|
35
|
+
`,F=u(t.SymbolBadge)`
|
|
36
|
+
path {
|
|
37
|
+
fill: ${e=>{var n;return(n=e.theme.colors)==null?void 0:n.text}};
|
|
38
|
+
}
|
|
39
|
+
`,H=u(t.Grid)`
|
|
40
|
+
${C.genericComponentStyling}
|
|
41
|
+
${e=>!!e.scrollableCss&&e.scrollableCss}
|
|
42
|
+
text-size-adjust: 100%;
|
|
43
|
+
input::-ms-clear {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
${e=>e.hidden&&v.css`
|
|
47
|
+
visibility: collapse;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
`};
|
|
50
|
+
`;exports.default=U;
|
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as q } from "react/jsx-runtime";
|
|
2
2
|
import { css as S } from "@emotion/react";
|
|
3
3
|
import m from "@emotion/styled";
|
|
4
4
|
import { WidgetRenderState as c } from "@telia-ace/widget-core";
|
|
5
5
|
import { genericComponentStyling as T, Component as v } from "@telia-ace/widget-types-grid";
|
|
6
|
-
import { TransitionComponent as
|
|
6
|
+
import { TransitionComponent as G, Grid as P, useComponentDescriptor as I, useRenderState as F, useContext as H, useProperties as J, useChildren as K, useContainer as Q, useScroll as U, createEmptyComponent as V, ColumnContext as w, filterCssProps as X, Dropdown as Y, DrawerAnimationType as Z, Drawer as _, Button as ee, filterCssPropsStyle as te, paddedBorderTabStyle as ne, Text as re, SymbolBadge as oe } from "@telia-ace/widget-ui";
|
|
7
7
|
import { appendClassNames as y, Logger as ie } from "@telia-ace/widget-utilities";
|
|
8
|
-
import { forwardRef as se,
|
|
9
|
-
import { A as l } from "./index-
|
|
10
|
-
const
|
|
11
|
-
({ children: e, className: t, renderState: o, animation:
|
|
12
|
-
|
|
8
|
+
import { forwardRef as se, useEffect as ae, useCallback as le } from "react";
|
|
9
|
+
import { A as l } from "./index-7fc9ef83.mjs";
|
|
10
|
+
const ce = se(
|
|
11
|
+
({ children: e, className: t, renderState: o, animation: s, ...d }, a) => (ae(() => {
|
|
12
|
+
if (o === "open") {
|
|
13
|
+
const i = document.querySelector(
|
|
14
|
+
`[data-node-id='${d.id}']`
|
|
15
|
+
);
|
|
16
|
+
i && i.focus();
|
|
17
|
+
}
|
|
18
|
+
}), o ? /* @__PURE__ */ n(
|
|
19
|
+
G,
|
|
13
20
|
{
|
|
14
21
|
mountOnEnter: o !== c.hidden,
|
|
15
22
|
timeout: 200,
|
|
16
23
|
in: o === c.open,
|
|
17
|
-
transitions:
|
|
24
|
+
transitions: s,
|
|
18
25
|
unmountOnExit: o === c.closed,
|
|
19
|
-
children: (
|
|
20
|
-
|
|
26
|
+
children: (i, u) => /* @__PURE__ */ n(
|
|
27
|
+
me,
|
|
21
28
|
{
|
|
22
|
-
...
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
...d,
|
|
30
|
+
tabIndex: "-1",
|
|
31
|
+
animationCss: u,
|
|
32
|
+
"data-state": i,
|
|
33
|
+
ref: a,
|
|
26
34
|
className: y("humany-animated-area", t),
|
|
27
35
|
children: e
|
|
28
36
|
}
|
|
29
37
|
)
|
|
30
38
|
}
|
|
31
|
-
) : null
|
|
32
|
-
),
|
|
39
|
+
) : null)
|
|
40
|
+
), me = m(P)`
|
|
33
41
|
${T}
|
|
34
42
|
${(e) => !!e.animationCss && e.animationCss}
|
|
35
43
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
@@ -37,34 +45,37 @@ const le = se(
|
|
|
37
45
|
input::-ms-clear {
|
|
38
46
|
display: none;
|
|
39
47
|
}
|
|
48
|
+
:focus-visible {
|
|
49
|
+
outline: none !important;
|
|
50
|
+
}
|
|
40
51
|
${(e) => e.hidden && e["data-state"] === "exited" && S`
|
|
41
52
|
visibility: collapse;
|
|
42
53
|
pointer-events: none;
|
|
43
54
|
`};
|
|
44
|
-
`,
|
|
45
|
-
const { name: o } =
|
|
46
|
-
columns:
|
|
47
|
-
animation:
|
|
55
|
+
`, Se = ({ className: e, ...t }) => {
|
|
56
|
+
const { name: o } = I(), s = F(), d = H(), a = J(), i = K(), u = Q(), { gap: A = "0" } = d, {
|
|
57
|
+
columns: g = 1,
|
|
58
|
+
animation: p = "none",
|
|
48
59
|
scrollable: D = !1,
|
|
49
|
-
mode:
|
|
60
|
+
mode: f = l.Static,
|
|
50
61
|
trigger: j = {},
|
|
51
62
|
fullScreen: z,
|
|
52
63
|
header: B,
|
|
53
|
-
...
|
|
54
|
-
} =
|
|
64
|
+
...E
|
|
65
|
+
} = a, { size: N = 24, symbol: b, label: C, ariaLabel: R, ...L } = j, [O, W] = U(D), M = le(
|
|
55
66
|
(r) => {
|
|
56
|
-
const { events: k } =
|
|
67
|
+
const { events: k } = u.get("$widget");
|
|
57
68
|
return k.dispatch("widget:area-rendered", {
|
|
58
69
|
name: o,
|
|
59
|
-
properties:
|
|
70
|
+
properties: a,
|
|
60
71
|
element: r
|
|
61
72
|
}), W.current = r, r;
|
|
62
73
|
},
|
|
63
74
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
[
|
|
75
|
+
[a, s]
|
|
65
76
|
);
|
|
66
|
-
if (!
|
|
67
|
-
return V(
|
|
77
|
+
if (!i.length)
|
|
78
|
+
return V(u, {
|
|
68
79
|
...t,
|
|
69
80
|
className: y(e, "humany-area")
|
|
70
81
|
});
|
|
@@ -76,33 +87,33 @@ const le = se(
|
|
|
76
87
|
`humany-area-${o}`
|
|
77
88
|
),
|
|
78
89
|
scrollableCss: O,
|
|
79
|
-
...
|
|
80
|
-
columns:
|
|
90
|
+
...E,
|
|
91
|
+
columns: g,
|
|
81
92
|
gap: A,
|
|
82
|
-
renderState:
|
|
83
|
-
animation:
|
|
84
|
-
hidden:
|
|
93
|
+
renderState: s,
|
|
94
|
+
animation: p,
|
|
95
|
+
hidden: s === c.hidden,
|
|
85
96
|
ref: M
|
|
86
|
-
},
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
89
|
-
const x = /* @__PURE__ */
|
|
90
|
-
|
|
97
|
+
}, h = (() => p !== "none" ? /* @__PURE__ */ n(w.Provider, { value: g, children: /* @__PURE__ */ n(ce, { ...$, children: i.map((r) => /* @__PURE__ */ n(v, { id: r.id, branch: "default" }, r.id)) }) }) : s === c.closed ? null : /* @__PURE__ */ n(w.Provider, { value: g, children: /* @__PURE__ */ n(fe, { ...$, children: i.map((r) => /* @__PURE__ */ n(v, { id: r.id, branch: "default" }, r.id)) }) }))();
|
|
98
|
+
if (f === l.Static)
|
|
99
|
+
return h;
|
|
100
|
+
const x = /* @__PURE__ */ q(
|
|
101
|
+
de,
|
|
91
102
|
{
|
|
92
103
|
className: "humany-area-trigger",
|
|
93
|
-
title:
|
|
104
|
+
title: R,
|
|
94
105
|
...X(L),
|
|
95
106
|
children: [
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
C && /* @__PURE__ */ n(ue, { children: C }),
|
|
108
|
+
b && /* @__PURE__ */ n(pe, { symbol: b, size: N })
|
|
98
109
|
]
|
|
99
110
|
}
|
|
100
111
|
);
|
|
101
|
-
if (
|
|
102
|
-
return /* @__PURE__ */ n(Y, { trigger: x, children:
|
|
103
|
-
if (
|
|
104
|
-
const r = Object.values(Z).includes(
|
|
105
|
-
type:
|
|
112
|
+
if (f === l.Dropdown)
|
|
113
|
+
return /* @__PURE__ */ n(Y, { trigger: x, children: h });
|
|
114
|
+
if (f === l.Drawer) {
|
|
115
|
+
const r = Object.values(Z).includes(p) && {
|
|
116
|
+
type: p
|
|
106
117
|
} || void 0;
|
|
107
118
|
return /* @__PURE__ */ n(
|
|
108
119
|
_,
|
|
@@ -111,12 +122,12 @@ const le = se(
|
|
|
111
122
|
animation: r,
|
|
112
123
|
fullScreen: z,
|
|
113
124
|
trigger: x,
|
|
114
|
-
children:
|
|
125
|
+
children: h
|
|
115
126
|
}
|
|
116
127
|
);
|
|
117
128
|
}
|
|
118
|
-
return
|
|
119
|
-
},
|
|
129
|
+
return f === l.Modal && ie.warn("modal area not implemented"), null;
|
|
130
|
+
}, de = m(ee)`
|
|
120
131
|
display: flex;
|
|
121
132
|
align-items: inherit;
|
|
122
133
|
align-self: center;
|
|
@@ -132,7 +143,7 @@ const le = se(
|
|
|
132
143
|
&:focus-visible {
|
|
133
144
|
${ne};
|
|
134
145
|
}
|
|
135
|
-
`,
|
|
146
|
+
`, ue = m(re)`
|
|
136
147
|
margin: 0 ${(e) => {
|
|
137
148
|
var t;
|
|
138
149
|
return (t = e.theme.sizes) == null ? void 0 : t.small;
|
|
@@ -141,14 +152,14 @@ const le = se(
|
|
|
141
152
|
var t;
|
|
142
153
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
143
154
|
}};
|
|
144
|
-
`,
|
|
155
|
+
`, pe = m(oe)`
|
|
145
156
|
path {
|
|
146
157
|
fill: ${(e) => {
|
|
147
158
|
var t;
|
|
148
159
|
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
149
160
|
}};
|
|
150
161
|
}
|
|
151
|
-
`,
|
|
162
|
+
`, fe = m(P)`
|
|
152
163
|
${T}
|
|
153
164
|
${(e) => !!e.scrollableCss && e.scrollableCss}
|
|
154
165
|
text-size-adjust: 100%;
|
|
@@ -161,5 +172,5 @@ const le = se(
|
|
|
161
172
|
`};
|
|
162
173
|
`;
|
|
163
174
|
export {
|
|
164
|
-
|
|
175
|
+
Se as default
|
|
165
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@telia-ace/widget-ui");var r=(e=>(e.Static="static",e.Drawer="drawer",e.Dropdown="dropdown",e.Modal="modal",e))(r||{});const o=e=>t.createReactComponent(e,"area",Promise.resolve().then(()=>require("./area-
|
|
1
|
+
"use strict";const t=require("@telia-ace/widget-ui");var r=(e=>(e.Static="static",e.Drawer="drawer",e.Dropdown="dropdown",e.Modal="modal",e))(r||{});const o=e=>t.createReactComponent(e,"area",Promise.resolve().then(()=>require("./area-f075309d.js")),n=>{});exports.AreaComponent=o;exports.AreaMode=r;
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./index-
|
|
1
|
+
"use strict";const e=require("./index-a2bac2d5.js");require("@telia-ace/widget-ui");module.exports=e.AreaComponent;
|
package/index.mjs
CHANGED
package/package.json
CHANGED
package/area-b1abdc0c.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),w=require("@emotion/react"),u=require("@emotion/styled"),c=require("@telia-ace/widget-core"),f=require("@telia-ace/widget-types-grid"),t=require("@telia-ace/widget-ui"),h=require("@telia-ace/widget-utilities"),v=require("react"),d=require("./index-d68cb848.js"),G=v.forwardRef(({children:e,className:n,renderState:i,animation:o,...C},a)=>i?r.jsx(t.TransitionComponent,{mountOnEnter:i!==c.WidgetRenderState.hidden,timeout:200,in:i===c.WidgetRenderState.open,transitions:o,unmountOnExit:i===c.WidgetRenderState.closed,children:(l,m)=>r.jsx(L,{...C,animationCss:m,"data-state":l,ref:a,className:h.appendClassNames("humany-animated-area",n),children:e})}):null),L=u(t.Grid)`
|
|
2
|
-
${f.genericComponentStyling}
|
|
3
|
-
${e=>!!e.animationCss&&e.animationCss}
|
|
4
|
-
${e=>!!e.scrollableCss&&e.scrollableCss}
|
|
5
|
-
text-size-adjust: 100%;
|
|
6
|
-
input::-ms-clear {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
${e=>e.hidden&&e["data-state"]==="exited"&&w.css`
|
|
10
|
-
visibility: collapse;
|
|
11
|
-
pointer-events: none;
|
|
12
|
-
`};
|
|
13
|
-
`,U=({className:e,...n})=>{const{name:i}=t.useComponentDescriptor(),o=t.useRenderState(),C=t.useContext(),a=t.useProperties(),l=t.useChildren(),m=t.useContainer(),{gap:T="0"}=C,{columns:x=1,animation:g="none",scrollable:q=!1,mode:p=d.AreaMode.Static,trigger:A={},fullScreen:R,header:P,...M}=a,{size:W=24,symbol:b,label:$,ariaLabel:D,...N}=A,[z,B]=t.useScroll(q),O=v.useCallback(s=>{const{events:E}=m.get("$widget");return E.dispatch("widget:area-rendered",{name:i,properties:a,element:s}),B.current=s,s},[a,o]);if(!l.length)return t.createEmptyComponent(m,{...n,className:h.appendClassNames(e,"humany-area")});const j={...n,className:h.appendClassNames(e,"humany-area",`humany-area-${i}`),scrollableCss:z,...M,columns:x,gap:T,renderState:o,animation:g,hidden:o===c.WidgetRenderState.hidden,ref:O},y=(()=>g!=="none"?r.jsx(t.ColumnContext.Provider,{value:x,children:r.jsx(G,{...j,children:l.map(s=>r.jsx(f.Component,{id:s.id,branch:"default"},s.id))})}):o===c.WidgetRenderState.closed?null:r.jsx(t.ColumnContext.Provider,{value:x,children:r.jsx(I,{...j,children:l.map(s=>r.jsx(f.Component,{id:s.id,branch:"default"},s.id))})}))();if(p===d.AreaMode.Static)return y;const S=r.jsxs(k,{className:"humany-area-trigger",title:D,...t.filterCssProps(N),children:[$&&r.jsx(F,{children:$}),b&&r.jsx(H,{symbol:b,size:W})]});if(p===d.AreaMode.Dropdown)return r.jsx(t.Dropdown,{trigger:S,children:y});if(p===d.AreaMode.Drawer){const s=Object.values(t.DrawerAnimationType).includes(g)&&{type:g}||void 0;return r.jsx(t.Drawer,{header:P,animation:s,fullScreen:R,trigger:S,children:y})}return p===d.AreaMode.Modal&&h.Logger.warn("modal area not implemented"),null},k=u(t.Button)`
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: inherit;
|
|
16
|
-
align-self: center;
|
|
17
|
-
width: fit-content;
|
|
18
|
-
height: fit-content;
|
|
19
|
-
${t.filterCssPropsStyle}
|
|
20
|
-
|
|
21
|
-
${e=>e.theme.fonts&&`
|
|
22
|
-
font-family: ${e.theme.fonts.type};
|
|
23
|
-
font-size: ${e.theme.fonts.normal};
|
|
24
|
-
`}
|
|
25
|
-
|
|
26
|
-
&:focus-visible {
|
|
27
|
-
${t.paddedBorderTabStyle};
|
|
28
|
-
}
|
|
29
|
-
`,F=u(t.Text)`
|
|
30
|
-
margin: 0 ${e=>{var n;return(n=e.theme.sizes)==null?void 0:n.small}} 0 0;
|
|
31
|
-
color: ${e=>{var n;return(n=e.theme.colors)==null?void 0:n.text}};
|
|
32
|
-
`,H=u(t.SymbolBadge)`
|
|
33
|
-
path {
|
|
34
|
-
fill: ${e=>{var n;return(n=e.theme.colors)==null?void 0:n.text}};
|
|
35
|
-
}
|
|
36
|
-
`,I=u(t.Grid)`
|
|
37
|
-
${f.genericComponentStyling}
|
|
38
|
-
${e=>!!e.scrollableCss&&e.scrollableCss}
|
|
39
|
-
text-size-adjust: 100%;
|
|
40
|
-
input::-ms-clear {
|
|
41
|
-
display: none;
|
|
42
|
-
}
|
|
43
|
-
${e=>e.hidden&&w.css`
|
|
44
|
-
visibility: collapse;
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
`};
|
|
47
|
-
`;exports.default=U;
|