@telia-ace/widget-components-close-button 1.0.17 → 1.0.18
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.
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var b = Object.defineProperty, f = Object.defineProperties;
|
|
2
|
+
var h = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var l = Object.getOwnPropertySymbols;
|
|
4
|
+
var c = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var n = (e, t, o) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, m = (e, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
c.call(t, o) && n(e, o, t[o]);
|
|
8
|
+
if (l)
|
|
9
|
+
for (var o of l(t))
|
|
10
|
+
r.call(t, o) && n(e, o, t[o]);
|
|
11
|
+
return e;
|
|
12
|
+
}, d = (e, t) => f(e, h(t));
|
|
13
|
+
var y = (e, t) => {
|
|
14
|
+
var o = {};
|
|
15
|
+
for (var s in e)
|
|
16
|
+
c.call(e, s) && t.indexOf(s) < 0 && (o[s] = e[s]);
|
|
17
|
+
if (e != null && l)
|
|
18
|
+
for (var s of l(e))
|
|
19
|
+
t.indexOf(s) < 0 && r.call(e, s) && (o[s] = e[s]);
|
|
20
|
+
return o;
|
|
21
|
+
};
|
|
22
|
+
import { useDispatch as S, useProperties as x, Button as B, borderTabStyle as $, SymbolBadge as g } from "@telia-ace/widget-ui";
|
|
23
|
+
import a from "react";
|
|
24
|
+
import i from "styled-components";
|
|
25
|
+
const D = (o) => {
|
|
26
|
+
var s = o, { className: e } = s, t = y(s, ["className"]);
|
|
27
|
+
const p = S(), { ariaLabel: u = "" } = x();
|
|
28
|
+
return /* @__PURE__ */ a.createElement(v, d(m({}, t), {
|
|
29
|
+
className: e
|
|
30
|
+
}), /* @__PURE__ */ a.createElement(k, {
|
|
31
|
+
onClick: () => p("close"),
|
|
32
|
+
"aria-label": u
|
|
33
|
+
}, /* @__PURE__ */ a.createElement(z, {
|
|
34
|
+
size: 12,
|
|
35
|
+
symbol: { type: "Svg", content: "close" }
|
|
36
|
+
})));
|
|
37
|
+
}, v = i.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
`, k = i(B)`
|
|
42
|
+
&:focus-visible {
|
|
43
|
+
${$}
|
|
44
|
+
padding: ${(e) => {
|
|
45
|
+
var t, o;
|
|
46
|
+
return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small} / 2) ${(o = e.theme.sizes) == null ? void 0 : o.small}`;
|
|
47
|
+
}};
|
|
48
|
+
line,
|
|
49
|
+
path {
|
|
50
|
+
stroke: ${(e) => {
|
|
51
|
+
var t, o;
|
|
52
|
+
return (o = (t = e.theme.accessibility) == null ? void 0 : t.colors) == null ? void 0 : o.inactiveText;
|
|
53
|
+
}};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`, z = i(g)`
|
|
57
|
+
line,
|
|
58
|
+
path {
|
|
59
|
+
stroke: ${(e) => {
|
|
60
|
+
var t;
|
|
61
|
+
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
62
|
+
}};
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
export {
|
|
66
|
+
D as default
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=close-button.cd48ea6e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-button.cd48ea6e.js","sources":["../src/close-button.tsx"],"sourcesContent":["import {\r\n borderTabStyle,\r\n Button,\r\n SymbolBadge,\r\n useDispatch,\r\n useProperties,\r\n} from '@telia-ace/widget-ui';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { CloseButtonComponentProps } from './close-button-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst CloseButton: React.SFC<Props> = ({ className, ...other }) => {\r\n const dispatch = useDispatch();\r\n const { ariaLabel = '' } = useProperties<CloseButtonComponentProps>();\r\n\r\n return (\r\n <StyledButtonContainer {...other} className={className}>\r\n <StyledButton onClick={() => dispatch('close')} aria-label={ariaLabel}>\r\n <StyledSymbolBadge size={12} symbol={{ type: 'Svg', content: 'close' }} />\r\n </StyledButton>\r\n </StyledButtonContainer>\r\n );\r\n};\r\n\r\nexport default CloseButton;\r\n\r\nconst StyledButtonContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: flex-start;\r\n`;\r\n\r\nconst StyledButton = styled(Button)`\r\n &:focus-visible {\r\n ${borderTabStyle}\r\n padding: ${(p) => `calc(${p.theme.sizes?.small} / 2) ${p.theme.sizes?.small}`};\r\n line,\r\n path {\r\n stroke: ${(p) => p.theme.accessibility?.colors?.inactiveText};\r\n }\r\n }\r\n`;\r\n\r\nconst StyledSymbolBadge = styled(SymbolBadge)`\r\n line,\r\n path {\r\n stroke: ${(p) => p.theme.colors?.text};\r\n }\r\n`;\r\n"],"names":["CloseButton","_a","_b","className","other","__objRest","dispatch","useDispatch","ariaLabel","useProperties","React","StyledButtonContainer","__spreadProps","__spreadValues","StyledButton","StyledSymbolBadge","styled","Button","borderTabStyle","p","SymbolBadge"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,IAAgC,CAACC,MAA4B;AAA5B,MAAAC,IAAAD,GAAE,aAAAE,MAAFD,GAAgBE,IAAAC,EAAhBH,GAAgB,CAAd;AACrC,QAAMI,IAAWC,KACX,EAAE,WAAAC,IAAY,GAAG,IAAIC,EAAyC;AAEpE,SACK,gBAAAC,EAAA,cAAAC,GAAAC,EAAAC,EAAA,IAA0BT,IAA1B;AAAA,IAAiC,WAAAD;AAAA,EAAA,IAC7B,gBAAAO,EAAA,cAAAI,GAAA;AAAA,IAAa,SAAS,MAAMR,EAAS,OAAO;AAAA,IAAG,cAAYE;AAAA,EAAA,GACvD,gBAAAE,EAAA,cAAAK,GAAA;AAAA,IAAkB,MAAM;AAAA,IAAI,QAAQ,EAAE,MAAM,OAAO,SAAS,QAAQ;AAAA,EAAG,CAAA,CAC5E,CACJ;AAER,GAIMJ,IAAwBK,EAAO;AAAA;AAAA;AAAA;AAAA,GAM/BF,IAAeE,EAAOC,CAAM;AAAA;AAAA,UAExBC;AAAA,mBACS,CAACC,MAAM;;AAAA,kBAAQlB,IAAAkB,EAAE,MAAM,UAAR,gBAAAlB,EAAe,eAAcC,IAAAiB,EAAE,MAAM,UAAR,gBAAAjB,EAAe;AAAA;AAAA;AAAA;AAAA,sBAGxD,CAACiB,MAAA;;AAAM,UAAAjB,KAAAD,IAAAkB,EAAE,MAAM,kBAAR,gBAAAlB,EAAuB,WAAvB,gBAAAC,EAA+B;AAAA;AAAA;AAAA;AAAA,GAKtDa,IAAoBC,EAAOI,CAAW;AAAA;AAAA;AAAA,kBAG1B,CAACD,MAAM;;AAAA,UAAAlB,IAAAkB,EAAE,MAAM,WAAR,gBAAAlB,EAAgB;AAAA;AAAA;AAAA;"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { createReactComponent as n } from "@telia-ace/widget-ui";
|
|
2
|
-
const s = (t) => n(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
const s = (t) => n(
|
|
3
|
+
t,
|
|
4
|
+
"close-button",
|
|
5
|
+
import("./close-button.cd48ea6e.js"),
|
|
6
|
+
(e) => {
|
|
7
|
+
e.actions.create("close", (o = {}) => {
|
|
8
|
+
if (o.preventDefault)
|
|
9
|
+
return;
|
|
10
|
+
t.get("$widget").invoke("close");
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
);
|
|
9
14
|
export {
|
|
10
15
|
s as default
|
|
11
16
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/close-button-component.ts"],"sourcesContent":["import { createReactComponent } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type CloseButtonComponentProps = {\r\n ariaLabel?: string;\r\n};\r\n\r\nconst CloseButtonComponent = (container: Container) => {\r\n return createReactComponent(\r\n container,\r\n 'close-button',\r\n import('./close-button'),\r\n (component) => {\r\n // Action: 'close'\r\n component.actions.create('close', (options = {}) => {\r\n if (options.preventDefault) {\r\n return;\r\n }\r\n\r\n const widget = container.get('$widget');\r\n widget.invoke('close');\r\n });\r\n }\r\n );\r\n};\r\n\r\nexport default CloseButtonComponent;\r\n"],"names":[],"mappings":";AAOM,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/close-button-component.ts"],"sourcesContent":["import { createReactComponent } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type CloseButtonComponentProps = {\r\n ariaLabel?: string;\r\n};\r\n\r\nconst CloseButtonComponent = (container: Container) => {\r\n return createReactComponent(\r\n container,\r\n 'close-button',\r\n import('./close-button'),\r\n (component) => {\r\n // Action: 'close'\r\n component.actions.create('close', (options = {}) => {\r\n if (options.preventDefault) {\r\n return;\r\n }\r\n\r\n const widget = container.get('$widget');\r\n widget.invoke('close');\r\n });\r\n }\r\n );\r\n};\r\n\r\nexport default CloseButtonComponent;\r\n"],"names":["CloseButtonComponent","container","createReactComponent","component","options"],"mappings":";AAOM,MAAAA,IAAuB,CAACC,MACnBC;AAAA,EACHD;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,CAACE,MAAc;AAEX,IAAAA,EAAU,QAAQ,OAAO,SAAS,CAACC,IAAU,CAAA,MAAO;AAChD,UAAIA,EAAQ;AACR;AAIJ,MADeH,EAAU,IAAI,SAAS,EAC/B,OAAO,OAAO;AAAA,IAAA,CACxB;AAAA,EACL;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-components-close-button",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Close button component for ACE Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
10
|
"main": "dist/index.js",
|
|
11
|
+
"sourceMain": "src/index.ts",
|
|
11
12
|
"type": "module",
|
|
12
13
|
"types": "dist/index.d.ts",
|
|
13
14
|
"files": [
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
},
|
|
26
27
|
"sideEffects": false,
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@telia-ace/widget-ui": "^1.0.
|
|
29
|
+
"@telia-ace/widget-ui": "^1.0.22",
|
|
29
30
|
"@webprovisions/platform": "^1.1.2"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"@types/react-dom": "^16.8.0",
|
|
39
40
|
"@types/styled-components": "^5.1.7"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "c3045eebac4251ae8ba27333abd9b6aa3ccd5b38"
|
|
42
43
|
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var f = Object.defineProperty, h = Object.defineProperties;
|
|
2
|
-
var p = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var m = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var r = (e, t, s) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, y = (e, t) => {
|
|
6
|
-
for (var s in t || (t = {}))
|
|
7
|
-
m.call(t, s) && r(e, s, t[s]);
|
|
8
|
-
if (i)
|
|
9
|
-
for (var s of i(t))
|
|
10
|
-
d.call(t, s) && r(e, s, t[s]);
|
|
11
|
-
return e;
|
|
12
|
-
}, b = (e, t) => h(e, p(t));
|
|
13
|
-
var u = (e, t) => {
|
|
14
|
-
var s = {};
|
|
15
|
-
for (var o in e)
|
|
16
|
-
m.call(e, o) && t.indexOf(o) < 0 && (s[o] = e[o]);
|
|
17
|
-
if (e != null && i)
|
|
18
|
-
for (var o of i(e))
|
|
19
|
-
t.indexOf(o) < 0 && d.call(e, o) && (s[o] = e[o]);
|
|
20
|
-
return s;
|
|
21
|
-
};
|
|
22
|
-
import { useDispatch as S, useProperties as $, Button as g, borderTabStyle as x, SymbolBadge as B } from "@telia-ace/widget-ui";
|
|
23
|
-
import c from "react";
|
|
24
|
-
import n, { css as k } from "styled-components";
|
|
25
|
-
const L = (s) => {
|
|
26
|
-
var o = s, { className: e } = o, t = u(o, ["className"]);
|
|
27
|
-
const l = S(), { ariaLabel: a = "" } = $();
|
|
28
|
-
return /* @__PURE__ */ c.createElement(v, b(y({}, t), {
|
|
29
|
-
className: e
|
|
30
|
-
}), /* @__PURE__ */ c.createElement(z, {
|
|
31
|
-
onClick: () => l("close"),
|
|
32
|
-
"aria-label": a
|
|
33
|
-
}, /* @__PURE__ */ c.createElement(C, {
|
|
34
|
-
size: 12,
|
|
35
|
-
symbol: { type: "Svg", content: "close" }
|
|
36
|
-
})));
|
|
37
|
-
}, v = n.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
align-items: flex-start;
|
|
41
|
-
`, z = n(g)`
|
|
42
|
-
&:focus {
|
|
43
|
-
${(e) => {
|
|
44
|
-
var t, s, o, l, a;
|
|
45
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && k`
|
|
46
|
-
${x}
|
|
47
|
-
padding: ${`calc(${(s = e.theme.sizes) == null ? void 0 : s.small} / 2) ${(o = e.theme.sizes) == null ? void 0 : o.small}`};
|
|
48
|
-
line,
|
|
49
|
-
path {
|
|
50
|
-
stroke: ${(a = (l = e.theme.accessibility) == null ? void 0 : l.colors) == null ? void 0 : a.inactiveText};
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
}};
|
|
54
|
-
}
|
|
55
|
-
`, C = n(B)`
|
|
56
|
-
line,
|
|
57
|
-
path {
|
|
58
|
-
stroke: ${(e) => {
|
|
59
|
-
var t;
|
|
60
|
-
return (t = e.theme.colors) == null ? void 0 : t.text;
|
|
61
|
-
}};
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
export {
|
|
65
|
-
L as default
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=close-button.d425f6cf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close-button.d425f6cf.js","sources":["../src/close-button.tsx"],"sourcesContent":["import {\r\n borderTabStyle,\r\n Button,\r\n SymbolBadge,\r\n useDispatch,\r\n useProperties,\r\n} from '@telia-ace/widget-ui';\r\nimport React from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { CloseButtonComponentProps } from './close-button-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst CloseButton: React.SFC<Props> = ({ className, ...other }) => {\r\n const dispatch = useDispatch();\r\n const { ariaLabel = '' } = useProperties<CloseButtonComponentProps>();\r\n\r\n return (\r\n <StyledButtonContainer {...other} className={className}>\r\n <StyledButton onClick={() => dispatch('close')} aria-label={ariaLabel}>\r\n <StyledSymbolBadge size={12} symbol={{ type: 'Svg', content: 'close' }} />\r\n </StyledButton>\r\n </StyledButtonContainer>\r\n );\r\n};\r\n\r\nexport default CloseButton;\r\n\r\nconst StyledButtonContainer = styled.div`\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: flex-start;\r\n`;\r\n\r\nconst StyledButton = styled(Button)`\r\n &:focus {\r\n ${(p) =>\r\n p.theme.accessibility?.isTabbing &&\r\n css`\r\n ${borderTabStyle}\r\n padding: ${`calc(${p.theme.sizes?.small} / 2) ${p.theme.sizes?.small}`};\r\n line,\r\n path {\r\n stroke: ${p.theme.accessibility?.colors?.inactiveText};\r\n }\r\n `};\r\n }\r\n`;\r\n\r\nconst StyledSymbolBadge = styled(SymbolBadge)`\r\n line,\r\n path {\r\n stroke: ${(p) => p.theme.colors?.text};\r\n }\r\n`;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,IAAgC,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AACrC,QAAM,IAAW,KACX,EAAE,eAAY,OAAO,EAAyC;AAEpE,SACK,kBAAA,cAAA,GAAA,QAA0B,IAA1B;AAAA,IAAiC;AAAA,EAAA,IAC7B,kBAAA,cAAA,GAAA;AAAA,IAAa,SAAS,MAAM,EAAS,OAAO;AAAA,IAAG,cAAY;AAAA,EAAA,GACvD,kBAAA,cAAA,GAAA;AAAA,IAAkB,MAAM;AAAA,IAAI,QAAQ,EAAE,MAAM,OAAO,SAAS,QAAQ;AAAA,EAAG,CAAA,CAC5E,CACJ;AAER,GAIM,IAAwB,EAAO;AAAA;AAAA;AAAA;AAAA,GAM/B,IAAe,EAAO,CAAM;AAAA;AAAA,UAExB,CAAC,MAAA;;AACC,iBAAE,MAAM,kBAAR,kBAAuB,cACvB;AAAA,kBACM;AAAA,2BACS,QAAQ,OAAE,MAAM,UAAR,kBAAe,cAAc,OAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;AAAA,8BAGjD,YAAE,MAAM,kBAAR,kBAAuB,WAAvB,kBAA+B;AAAA;AAAA;AAAA;AAAA;AAAA,GAMvD,IAAoB,EAAO,CAAW;AAAA;AAAA;AAAA,kBAG1B,CAAC,MAAM;;AAAA,gBAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA;AAAA;"}
|