@telia-ace/widget-components-close-button 0.0.1

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,43 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import l from "@emotion/styled";
3
+ import { useDispatch as n, useProperties as a, Button as c, borderTabStyle as r, SymbolBadge as d } from "@telia-ace/widget-ui";
4
+ const f = ({ className: t, ...e }) => {
5
+ const s = n(), { ariaLabel: i = "" } = a();
6
+ return /* @__PURE__ */ o(m, { ...e, className: t, children: /* @__PURE__ */ o(y, { onClick: () => s("close"), "aria-label": i, children: /* @__PURE__ */ o(
7
+ p,
8
+ {
9
+ size: 12,
10
+ symbol: { type: "Svg", content: "close" }
11
+ }
12
+ ) }) });
13
+ }, m = l.div`
14
+ display: flex;
15
+ justify-content: flex-end;
16
+ align-items: flex-start;
17
+ `, y = l(c)`
18
+ &:focus-visible {
19
+ ${r}
20
+ padding: ${(t) => {
21
+ var e, s;
22
+ return `calc(${(e = t.theme.sizes) == null ? void 0 : e.small} / 2) ${(s = t.theme.sizes) == null ? void 0 : s.small}`;
23
+ }};
24
+ line,
25
+ path {
26
+ stroke: ${(t) => {
27
+ var e, s;
28
+ return (s = (e = t.theme.accessibility) == null ? void 0 : e.colors) == null ? void 0 : s.inactiveText;
29
+ }};
30
+ }
31
+ }
32
+ `, p = l(d)`
33
+ line,
34
+ path {
35
+ stroke: ${(t) => {
36
+ var e;
37
+ return (e = t.theme.colors) == null ? void 0 : e.text;
38
+ }};
39
+ }
40
+ `;
41
+ export {
42
+ f as default
43
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("@emotion/styled"),l=require("@telia-ace/widget-ui"),c=({className:t,...e})=>{const s=l.useDispatch(),{ariaLabel:n=""}=l.useProperties();return i.jsx(a,{...e,className:t,children:i.jsx(r,{onClick:()=>s("close"),"aria-label":n,children:i.jsx(d,{size:12,symbol:{type:"Svg",content:"close"}})})})},a=o.div`
2
+ display: flex;
3
+ justify-content: flex-end;
4
+ align-items: flex-start;
5
+ `,r=o(l.Button)`
6
+ &:focus-visible {
7
+ ${l.borderTabStyle}
8
+ padding: ${t=>{var e,s;return`calc(${(e=t.theme.sizes)==null?void 0:e.small} / 2) ${(s=t.theme.sizes)==null?void 0:s.small}`}};
9
+ line,
10
+ path {
11
+ stroke: ${t=>{var e,s;return(s=(e=t.theme.accessibility)==null?void 0:e.colors)==null?void 0:s.inactiveText}};
12
+ }
13
+ }
14
+ `,d=o(l.SymbolBadge)`
15
+ line,
16
+ path {
17
+ stroke: ${t=>{var e;return(e=t.theme.colors)==null?void 0:e.text}};
18
+ }
19
+ `;exports.default=c;
@@ -0,0 +1,7 @@
1
+ import { Container } from '@webprovisions/platform';
2
+
3
+ export type CloseButtonComponentProps = {
4
+ ariaLabel?: string;
5
+ };
6
+ declare const CloseButtonComponent: (container: Container) => Promise<void>;
7
+ export default CloseButtonComponent;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+
3
+ type Props = {
4
+ className: string;
5
+ };
6
+ declare const CloseButton: React.FC<Props>;
7
+ export default CloseButton;
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { default as CloseButtonComponent } from './close-button-component';
2
+
3
+ export default CloseButtonComponent;
package/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";const r=require("@telia-ace/widget-ui"),n=e=>r.createReactComponent(e,"close-button",Promise.resolve().then(()=>require("./close-button-8bb06b17.js")),t=>{t.actions.create("close",(o={})=>{if(o.preventDefault)return;e.get("$widget").invoke("close")})});module.exports=n;
package/index.mjs ADDED
@@ -0,0 +1,16 @@
1
+ import { createReactComponent as n } from "@telia-ace/widget-ui";
2
+ const s = (t) => n(
3
+ t,
4
+ "close-button",
5
+ import("./close-button-0aa2e586.mjs"),
6
+ (e) => {
7
+ e.actions.create("close", (o = {}) => {
8
+ if (o.preventDefault)
9
+ return;
10
+ t.get("$widget").invoke("close");
11
+ });
12
+ }
13
+ );
14
+ export {
15
+ s as default
16
+ };
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@telia-ace/widget-components-close-button",
3
+ "version": "0.0.1",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./index.mjs",
9
+ "require": "./index.js"
10
+ }
11
+ },
12
+ "dependencies": {
13
+ "@telia-ace/widget-ui": "*",
14
+ "@telia-ace/widget-core": "*",
15
+ "@webprovisions/platform": "^1.1.4"
16
+ },
17
+ "peerDependencies": {
18
+ "@emotion/styled": "11.11.0",
19
+ "react": "18.2.0",
20
+ "@emotion/react": "11.11.1"
21
+ }
22
+ }