@telia-ace/widget-components-close-button 1.0.12 → 1.0.15
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/close-button.d425f6cf.js +67 -0
- package/dist/close-button.d425f6cf.js.map +1 -0
- package/dist/index.js +9 -11
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
- package/dist/close-button.js +0 -79
- package/dist/close-button.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { createReactComponent } from "@telia-ace/widget-ui";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
const widget = container.get("$widget");
|
|
9
|
-
widget.invoke("close");
|
|
10
|
-
});
|
|
1
|
+
import { createReactComponent as n } from "@telia-ace/widget-ui";
|
|
2
|
+
const s = (t) => n(t, "close-button", import("./close-button.d425f6cf.js"), (e) => {
|
|
3
|
+
e.actions.create("close", (o = {}) => {
|
|
4
|
+
if (o.preventDefault)
|
|
5
|
+
return;
|
|
6
|
+
t.get("$widget").invoke("close");
|
|
11
7
|
});
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
s as default
|
|
12
11
|
};
|
|
13
|
-
export { CloseButtonComponent as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
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,MAAA,
|
|
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,MAAA,IAAuB,CAAC,MACnB,EACH,GACA,gBACA,OAAO,+BACP,CAAC,MAAc;AAEX,IAAU,QAAQ,OAAO,SAAS,CAAC,IAAU,CAAA,MAAO;AAChD,QAAI,EAAQ;AACR;AAIJ,IADe,EAAU,IAAI,SAAS,EAC/B,OAAO,OAAO;AAAA,EAAA,CACxB;AAAA,CAET;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-components-close-button",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Close button component for ACE Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
|
-
"
|
|
10
|
+
"exports": {
|
|
11
|
+
"development": "./src/index.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
11
15
|
"types": "dist/index.d.ts",
|
|
12
16
|
"files": [
|
|
13
17
|
"LICENSE.txt",
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
},
|
|
25
29
|
"sideEffects": false,
|
|
26
30
|
"dependencies": {
|
|
27
|
-
"@telia-ace/widget-ui": "^1.0.
|
|
31
|
+
"@telia-ace/widget-ui": "^1.0.19",
|
|
28
32
|
"@webprovisions/platform": "^1.1.2"
|
|
29
33
|
},
|
|
30
34
|
"peerDependencies": {
|
|
@@ -37,5 +41,5 @@
|
|
|
37
41
|
"@types/react-dom": "^16.8.0",
|
|
38
42
|
"@types/styled-components": "^5.1.7"
|
|
39
43
|
},
|
|
40
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "126c3de892c9b6b93b38d3cb0909b9a6560b5209"
|
|
41
45
|
}
|
package/dist/close-button.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { useDispatch, useProperties, Button, borderTabStyle, SymbolBadge } from "@telia-ace/widget-ui";
|
|
33
|
-
import React from "react";
|
|
34
|
-
import styled, { css } from "styled-components";
|
|
35
|
-
const CloseButton = (_a) => {
|
|
36
|
-
var _b = _a, { className } = _b, other = __objRest(_b, ["className"]);
|
|
37
|
-
const dispatch = useDispatch();
|
|
38
|
-
const { ariaLabel = "" } = useProperties();
|
|
39
|
-
return /* @__PURE__ */ React.createElement(StyledButtonContainer, __spreadProps(__spreadValues({}, other), {
|
|
40
|
-
className
|
|
41
|
-
}), /* @__PURE__ */ React.createElement(StyledButton, {
|
|
42
|
-
onClick: () => dispatch("close"),
|
|
43
|
-
"aria-label": ariaLabel
|
|
44
|
-
}, /* @__PURE__ */ React.createElement(StyledSymbolBadge, {
|
|
45
|
-
size: 12,
|
|
46
|
-
symbol: { type: "Svg", content: "close" }
|
|
47
|
-
})));
|
|
48
|
-
};
|
|
49
|
-
const StyledButtonContainer = styled.div`
|
|
50
|
-
display: flex;
|
|
51
|
-
justify-content: flex-end;
|
|
52
|
-
align-items: flex-start;
|
|
53
|
-
`;
|
|
54
|
-
const StyledButton = styled(Button)`
|
|
55
|
-
&:focus {
|
|
56
|
-
${(p) => {
|
|
57
|
-
var _a, _b, _c, _d, _e;
|
|
58
|
-
return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && css`
|
|
59
|
-
${borderTabStyle}
|
|
60
|
-
padding: ${`calc(${(_b = p.theme.sizes) == null ? void 0 : _b.small} / 2) ${(_c = p.theme.sizes) == null ? void 0 : _c.small}`};
|
|
61
|
-
line,
|
|
62
|
-
path {
|
|
63
|
-
stroke: ${(_e = (_d = p.theme.accessibility) == null ? void 0 : _d.colors) == null ? void 0 : _e.inactiveText};
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
66
|
-
}};
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
69
|
-
const StyledSymbolBadge = styled(SymbolBadge)`
|
|
70
|
-
line,
|
|
71
|
-
path {
|
|
72
|
-
stroke: ${(p) => {
|
|
73
|
-
var _a;
|
|
74
|
-
return (_a = p.theme.colors) == null ? void 0 : _a.text;
|
|
75
|
-
}};
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
export { CloseButton as default };
|
|
79
|
-
//# sourceMappingURL=close-button.js.map
|
package/dist/close-button.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close-button.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,cAAgC,CAAC,OAA4B;AAA5B,eAAE,gBAAF,IAAgB,kBAAhB,IAAgB,CAAd;AACrC,QAAM,WAAW;AACX,QAAA,EAAE,YAAY,OAAO,cAAyC;AAEpE,SACK,sBAAA,cAAA,uBAAA,iCAA0B,QAA1B;AAAA,IAAiC;AAAA,EAAA,IAC7B,sBAAA,cAAA,cAAA;AAAA,IAAa,SAAS,MAAM,SAAS,OAAO;AAAA,IAAG,cAAY;AAAA,EAAA,GACvD,sBAAA,cAAA,mBAAA;AAAA,IAAkB,MAAM;AAAA,IAAI,QAAQ,EAAE,MAAM,OAAO,SAAS,QAAQ;AAAA,EAAG,CAAA,CAC5E,CACJ;AAER;AAIA,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMrC,MAAM,eAAe,OAAO,MAAM;AAAA;AAAA,UAExB,CAAC,MAAA;;AACC,kBAAE,MAAM,kBAAR,mBAAuB,cACvB;AAAA,kBACM;AAAA,2BACS,QAAQ,QAAE,MAAM,UAAR,mBAAe,cAAc,QAAE,MAAM,UAAR,mBAAe;AAAA;AAAA;AAAA,8BAGjD,cAAE,MAAM,kBAAR,mBAAuB,WAAvB,mBAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D,MAAM,oBAAoB,OAAO,WAAW;AAAA;AAAA;AAAA,kBAG1B,CAAC,MAAM;;AAAA,iBAAE,MAAM,WAAR,mBAAgB;AAAA;AAAA;AAAA;;"}
|