@telia-ace/widget-components-back-link 1.0.31 → 1.0.32
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/back-link-5311b7e9.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"back-link-5311b7e9.js","sources":["../src/back-link.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport {\n Button,\n createEmptyComponent,\n linkTabStyle,\n useContainer,\n useDispatch,\n useProperties,\n useRouteData,\n} from '@telia-ace/widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport { BackLinkComponentProps } from './back-link-component';\n\ntype Props = {\n className: string;\n};\n\nconst Wrapper = styled.div`\n font-weight: 300;\n button {\n color: ${(p) => p.theme.colors?.primary};\n text-decoration: underline;\n font-size: ${(p) => p.theme.fonts?.normal};\n span {\n font-weight: 300;\n }\n &:focus-visible {\n ${linkTabStyle}\n padding: ${(p) => `calc(${p.theme.sizes?.small} / 2) ${p.theme.sizes?.small}`};\n }\n }\n`;\n\nconst Caret = styled.svg`\n margin-right: ${(p) => p.theme.sizes?.small};\n line {\n stroke: ${(p) => p.theme.colors?.primary};\n }\n`;\n\nconst BackLink: React.FC<Props> = ({ className, ...other }) => {\n const dispatch = useDispatch();\n const { params } = useRouteData();\n const container = useContainer();\n const { conditions = [], label = '' } = useProperties<BackLinkComponentProps>();\n\n const conditionsMet =\n conditions && conditions.length\n ? conditions.reduce((acc: boolean, condition: string) => {\n return params[condition] ? true : acc;\n }, false)\n : true;\n\n if (!conditionsMet) {\n return createEmptyComponent(container, {\n ...other,\n className: appendClassNames(className, 'humany-back-link'),\n });\n }\n\n const handleClick = () => {\n dispatch('click');\n };\n\n if (!label) {\n return (\n <Wrapper {...other} className={appendClassNames(className, 'humany-back-link')}>\n <svg\n width=\"8\"\n height=\"16\"\n viewBox=\"0 0 8 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n y1=\"-0.5\"\n x2=\"10.2585\"\n y2=\"-0.5\"\n transform=\"matrix(-0.682358 -0.731018 0.682358 -0.731018 8 14.9999)\"\n stroke=\"white\"\n />\n <line\n y1=\"-0.5\"\n x2=\"10.2585\"\n y2=\"-0.5\"\n transform=\"matrix(0.682359 -0.731018 0.682358 0.731018 1 8.49915)\"\n stroke=\"white\"\n />\n </svg>\n </Wrapper>\n );\n }\n\n return (\n <Wrapper {...other} className={appendClassNames(className, 'humany-back-link')}>\n <Button aria-label={label} onClick={handleClick}>\n <Caret\n width=\"7\"\n height=\"13\"\n viewBox=\"0 0 7 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line x1=\"6.64645\" y1=\"12.5513\" x2=\"0.648357\" y2=\"6.55319\" />\n <line x1=\"0.646447\" y1=\"6.64455\" x2=\"6.64454\" y2=\"0.646465\" />\n </Caret>\n {label && <span>{label}</span>}\n </Button>\n </Wrapper>\n );\n};\n\nexport default BackLink;\n"],"names":["Wrapper","styled","p","_a","linkTabStyle","_b","Caret","BackLink","className","other","__objRest","dispatch","useDispatch","params","useRouteData","container","useContainer","conditions","label","useProperties","acc","condition","createEmptyComponent","__spreadProps","__spreadValues","appendClassNames","handleClick","React","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA,iBAGN,CAACC,MAAM;;AAAA,UAAAC,IAAAD,EAAE,MAAM,WAAR,gBAAAC,EAAgB;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"back-link-5311b7e9.js","sources":["../src/back-link.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport {\n Button,\n createEmptyComponent,\n linkTabStyle,\n useContainer,\n useDispatch,\n useProperties,\n useRouteData,\n} from '@telia-ace/widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport { BackLinkComponentProps } from './back-link-component';\n\ntype Props = {\n className: string;\n};\n\nconst Wrapper = styled.div`\n font-weight: 300;\n button {\n color: ${(p) => p.theme.colors?.primary};\n text-decoration: underline;\n font-size: ${(p) => p.theme.fonts?.normal};\n span {\n font-weight: 300;\n }\n &:focus-visible {\n ${linkTabStyle}\n padding: ${(p) => `calc(${p.theme.sizes?.small} / 2) ${p.theme.sizes?.small}`};\n }\n }\n`;\n\nconst Caret = styled.svg`\n margin-right: ${(p) => p.theme.sizes?.small};\n line {\n stroke: ${(p) => p.theme.colors?.primary};\n }\n`;\n\nconst BackLink: React.FC<Props> = ({ className, ...other }) => {\n const dispatch = useDispatch();\n const { params } = useRouteData();\n const container = useContainer();\n const { conditions = [], label = '' } = useProperties<BackLinkComponentProps>();\n\n const conditionsMet =\n conditions && conditions.length\n ? conditions.reduce((acc: boolean, condition: string) => {\n return params[condition] ? true : acc;\n }, false)\n : true;\n\n if (!conditionsMet) {\n return createEmptyComponent(container, {\n ...other,\n className: appendClassNames(className, 'humany-back-link'),\n });\n }\n\n const handleClick = () => {\n dispatch('click');\n };\n\n if (!label) {\n return (\n <Wrapper {...other} className={appendClassNames(className, 'humany-back-link')}>\n <svg\n width=\"8\"\n height=\"16\"\n viewBox=\"0 0 8 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n y1=\"-0.5\"\n x2=\"10.2585\"\n y2=\"-0.5\"\n transform=\"matrix(-0.682358 -0.731018 0.682358 -0.731018 8 14.9999)\"\n stroke=\"white\"\n />\n <line\n y1=\"-0.5\"\n x2=\"10.2585\"\n y2=\"-0.5\"\n transform=\"matrix(0.682359 -0.731018 0.682358 0.731018 1 8.49915)\"\n stroke=\"white\"\n />\n </svg>\n </Wrapper>\n );\n }\n\n return (\n <Wrapper {...other} className={appendClassNames(className, 'humany-back-link')}>\n <Button aria-label={label} onClick={handleClick}>\n <Caret\n width=\"7\"\n height=\"13\"\n viewBox=\"0 0 7 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line x1=\"6.64645\" y1=\"12.5513\" x2=\"0.648357\" y2=\"6.55319\" />\n <line x1=\"0.646447\" y1=\"6.64455\" x2=\"6.64454\" y2=\"0.646465\" />\n </Caret>\n {label && <span>{label}</span>}\n </Button>\n </Wrapper>\n );\n};\n\nexport default BackLink;\n"],"names":["Wrapper","styled","p","_a","linkTabStyle","_b","Caret","BackLink","className","other","__objRest","dispatch","useDispatch","params","useRouteData","container","useContainer","conditions","label","useProperties","acc","condition","createEmptyComponent","__spreadProps","__spreadValues","appendClassNames","handleClick","React","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA,iBAGN,CAACC,MAAM;;AAAA,UAAAC,IAAAD,EAAE,MAAM,WAAR,gBAAAC,EAAgB;AAAA,CAAO;AAAA;AAAA,qBAE1B,CAACD,MAAM;;AAAA,UAAAC,IAAAD,EAAE,MAAM,UAAR,gBAAAC,EAAe;AAAA,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA,cAKnCC,CAAY;AAAA,uBACH,CAACF,MAAM;;AAAA,kBAAQC,IAAAD,EAAE,MAAM,UAAR,gBAAAC,EAAe,KAAK,UAASE,IAAAH,EAAE,MAAM,UAAR,gBAAAG,EAAe,KAAK;AAAA,CAAE;AAAA;AAAA;AAAA,GAKnFC,IAAQL,EAAO;AAAA,oBACD,CAACC,MAAM;;AAAA,UAAAC,IAAAD,EAAE,MAAM,UAAR,gBAAAC,EAAe;AAAA,CAAK;AAAA;AAAA,kBAE7B,CAACD,MAAM;;AAAA,UAAAC,IAAAD,EAAE,MAAM,WAAR,gBAAAC,EAAgB;AAAA,CAAO;AAAA;AAAA,GAI1CI,IAA4B,CAACJ,MAA4B;AAA5B,MAAAE,IAAAF,GAAE,aAAAK,MAAFH,GAAgBI,IAAAC,EAAhBL,GAAgB,CAAd;AACjC,QAAMM,IAAWC,KACX,EAAE,QAAAC,MAAWC,KACbC,IAAYC,K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AAAA,QACG,IAAG;AAAA,QACH,IAAG;AAAA,QACH,IAAG;AAAA,QACH,WAAU;AAAA,QACV,QAAO;AAAA,MAAA;AAAA,IACX;AAAA,IACA,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,IAAG;AAAA,QACH,IAAG;AAAA,QACH,IAAG;AAAA,QACH,WAAU;AAAA,QACV,QAAO;AAAA,MAAA;AAAA,IACX;AAAA,EAAA,CAER;AAqBZ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-components-back-link",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "Back link component for ACE Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/widget-routing": "1.0.
|
|
25
|
-
"@telia-ace/widget-ui": "1.0.
|
|
26
|
-
"@telia-ace/widget-utilities": "1.0.
|
|
27
|
-
"@webprovisions/platform": "^1.1.
|
|
24
|
+
"@telia-ace/widget-routing": "1.0.30",
|
|
25
|
+
"@telia-ace/widget-ui": "1.0.36",
|
|
26
|
+
"@telia-ace/widget-utilities": "1.0.18",
|
|
27
|
+
"@webprovisions/platform": "^1.1.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@emotion/react": "^11.10.5",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"react-dom": "^18.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@emotion/react": "^11.
|
|
37
|
-
"@emotion/styled": "^11.
|
|
38
|
-
"@telia-ace/widget-core": "1.0.
|
|
39
|
-
"@telia-ace/widget-developer-tools": "1.0.
|
|
40
|
-
"@types/react": "^18.
|
|
41
|
-
"@types/react-dom": "^18.
|
|
36
|
+
"@emotion/react": "^11.11.1",
|
|
37
|
+
"@emotion/styled": "^11.11.0",
|
|
38
|
+
"@telia-ace/widget-core": "1.0.29",
|
|
39
|
+
"@telia-ace/widget-developer-tools": "1.0.24",
|
|
40
|
+
"@types/react": "^18.2.23",
|
|
41
|
+
"@types/react-dom": "^18.2.8",
|
|
42
42
|
"react": "^18.2.0",
|
|
43
43
|
"react-dom": "^18.2.0"
|
|
44
44
|
},
|