@helsenorge/designsystem-react 2.12.0 → 2.14.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/Panel.js +1 -1
  3. package/Panel.js.map +1 -1
  4. package/components/Duolist/Duolist.d.ts +10 -1
  5. package/components/Duolist/Duolist.d.ts.map +1 -1
  6. package/components/Duolist/componentdata.json +1 -1
  7. package/components/Duolist/index.js +1 -1
  8. package/components/Duolist/index.js.map +1 -1
  9. package/components/Duolist/styles.module.scss +20 -0
  10. package/components/Duolist/styles.module.scss.d.ts +4 -0
  11. package/components/Icons/AdditionalIconInformation.js +4 -0
  12. package/components/Icons/HeartHands.d.ts +5 -0
  13. package/components/Icons/HeartHands.d.ts.map +1 -0
  14. package/components/Icons/HeartHands.js +2 -0
  15. package/components/Icons/HeartHands.js.map +1 -0
  16. package/components/Icons/Login.d.ts +5 -0
  17. package/components/Icons/Login.d.ts.map +1 -0
  18. package/components/Icons/Login.js +2 -0
  19. package/components/Icons/Login.js.map +1 -0
  20. package/components/Icons/Logout.d.ts +5 -0
  21. package/components/Icons/Logout.d.ts.map +1 -0
  22. package/components/Icons/Logout.js +2 -0
  23. package/components/Icons/Logout.js.map +1 -0
  24. package/components/Icons/TrangleX.d.ts +5 -0
  25. package/components/Icons/TrangleX.d.ts.map +1 -0
  26. package/components/Icons/TrangleX.js +2 -0
  27. package/components/Icons/TrangleX.js.map +1 -0
  28. package/components/Panel/Panel.d.ts.map +1 -1
  29. package/components/Panel/styles.module.scss +17 -7
  30. package/components/Panel/styles.module.scss.d.ts +2 -0
  31. package/components/Slider/Slider.d.ts +3 -3
  32. package/components/Slider/Slider.d.ts.map +1 -1
  33. package/components/Slider/componentdata.json +1 -1
  34. package/components/Slider/index.js +1 -1
  35. package/components/Slider/index.js.map +1 -1
  36. package/components/Slider/styles.module.scss +21 -23
  37. package/components/Slider/styles.module.scss.d.ts +2 -5
  38. package/package.json +1 -1
  39. package/components/Slider/SliderUtils.d.ts +0 -38
  40. package/components/Slider/SliderUtils.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## [2.13.0](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/branchCompare?baseVersion=GTv2.12.0&targetVersion=GTv2.13.0) (2023-01-26)
2
+
3
+
4
+ ### Features
5
+
6
+ * duolist nonformatted format lagt til ([6bbdb76](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/6bbdb76cd2dda87e8e7389ee7129936ae0253bc0)), closes [#292725](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/292725)
7
+ * panel status badge wrapper nå med title tekst ([d008826](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/d00882610a68cf00d6a3a39d3bb7bf6c5807526a)), closes [#292773](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/292773)
8
+ * slider har støtte for ariaLabel ([e4960e1](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/e4960e1e7f01fde1be4689ccae3ce8d23a72eea2)), closes [#293573](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/293573)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * panel spacing desktop fikset ([074afe7](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/074afe7dc54f71eb068b51eaed20277b8c51f6ec)), closes [#292769](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/292769)
14
+
15
+ ## [2.12.0](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/branchCompare?baseVersion=GTv2.11.3&targetVersion=GTv2.12.0) (2023-01-23)
16
+
17
+
18
+ ### Features
19
+
20
+ * gir vertikaler mulighet til å hente reset styling for radio button fra designsystemet ([868df37](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/868df372ab03638f25d2747d829e99248436528e)), closes [#292456](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/292456)
21
+ * panel med buttonAriaLabel bruker det som aria-label selv om title er satt ([23caab9](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/23caab91b8b4ac50df54dc34930618b2fd3583be)), closes [#293470](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/293470) [#293729](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/293729)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * duolist null child kaster ikke feilmelding ([7668bd2](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/7668bd26ffc077727fae2e1f1eaf2b371b81af80)), closes [#292617](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/292617)
27
+ * logo kan bare være hvit og svart ([c46dcc1](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/c46dcc17e13189973fef4691ab1b75c3442f6ab4)), closes [#293148](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/293148)
28
+ * panel detail button pil plassert riktig ([21782d8](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/21782d80502afdd9415c1e3ba9eca092f063157e)), closes [#287921](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/287921)
29
+ * taglist har nå role=list med listitems ([62be09d](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/62be09de17a946e1339f27792878c19c9e72be7f)), closes [#290367](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/290367)
30
+ * useOutsideEvent fungerer i web components ([ffe9b7f](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/ffe9b7ffc67e04f6b8d7232b0a6829a380d112d6)), closes [#293729](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/293729)
31
+ * vis slider på utskrift ([aa60206](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/commit/aa60206364af351c33045f22d5a9379276e814bf)), closes [#281560](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/issues/281560)
32
+
1
33
  ## [2.11.3](https://dev.azure.com/nhnfelles/Helsenorge/_git/HN-Designsystem/branchCompare?baseVersion=GTv2.11.2&targetVersion=GTv2.11.3) (2023-01-17)
2
34
 
3
35
 
@@ -261,7 +293,7 @@
261
293
 
262
294
  ## 2.0.0-beta.1 (2022-09-15)
263
295
 
264
- ## 2.0.0-beta.0 (2022-09-15)
296
+ ## 2.0.0-beta.0 (2022-09-12)
265
297
 
266
298
 
267
299
  ### Features
package/Panel.js CHANGED
@@ -1,2 +1,2 @@
1
- import t,{useState as se,useEffect as z}from"react";import o from"classnames";import e from"./components/Panel/styles.module.scss";import{T as ie}from"./Title.js";import{B as D}from"./Button.js";import{AnalyticsId as ce,IconSize as x}from"./constants.js";import{Icon as d}from"./components/Icons/Icon.js";import pe from"./components/Icons/ChevronDown.js";import me from"./components/Icons/ChevronUp.js";import ue from"./components/Icons/ArrowRight.js";import de from"./components/Icons/AlertSignFill.js";import{palette as $}from"./theme/palette.js";import fe from"./components/Icons/Pencil.js";import ye from"./components/Icons/Calendar.js";import be from"./components/Icons/Watch.js";import{useBreakpoint as _e,Breakpoint as j}from"./hooks/useBreakpoint.js";import{useUuid as W}from"./hooks/useUuid.js";import{usePrevious as Ee}from"./hooks/usePrevious.js";import{getAriaLabelAttributes as ve}from"./utils/accessibility.js";import{B as ge}from"./Badge.js";var he=(a=>(a.normal="normal",a.new="new",a.error="error",a.draft="draft",a))(he||{}),Ce=(a=>(a.fill="fill",a.white="white",a.stroke="stroke",a.line="line",a))(Ce||{}),we=(a=>(a.layout1="layout1",a.layout2="layout2",a.layout3a="layout3a",a.layout3b="layout3b",a.layout3c="layout3c",a))(we||{});const Ne=({status:a,statusMessage:s})=>{const v=()=>a==="error"?{color:$.cherry500,svgIcon:de}:{color:$.black,svgIcon:fe},i=o(e["status-message"],{[e["status-message--new"]]:a==="new"});return(a==="error"||a==="draft")&&s?t.createElement("div",{className:i,"data-testid":"display-status"},t.createElement(d,{...v(),size:x.XSmall})," ",t.createElement("span",null,s)):null},X=({date:a,time:s})=>a||s?t.createElement("div",{className:e["datetime-container"],"data-testid":"datetime"},a&&t.createElement("div",{className:e["datetime-container__icon"]},t.createElement(d,{svgIcon:ye,size:x.XSmall}),t.createElement("span",null,a)),s&&t.createElement("div",{className:e["datetime-container__icon"]},t.createElement(d,{svgIcon:be,size:x.XSmall}),t.createElement("span",null,s))):null,qe=t.forwardRef(function(s,v){const{children:i,contentA:F,contentB:r,className:H,testId:U,title:g,titleHtmlMarkup:L="h2",url:f,target:O="_self",icon:c,iconRight:B=!1,variant:p="fill",status:m="normal",statusMessage:h,buttonText:A="Se detaljer",buttonTextClose:q="Skjul detaljer",buttonAriaLabelledById:S,buttonAriaLabel:G,layout:n="layout2",containerAsButton:C=!1,date:w,time:N,noTopBorder:J,buttonOnClick:u,buttonHtmlMarkup:K="a",expanded:y=!1,onExpand:b,renderChildrenWhenClosed:Q=!1}=s,[l,T]=se(y),Y=Ee(l),I=W(),_=W(),R=_e();z(()=>{y!==l&&T(y)},[y]),z(()=>{b&&l!==!!Y&&b(l)},[l,b]);const E=["layout3a".toString(),"layout3b".toString(),"layout3c".toString()].includes(n),Z=o(e["panel-wrapper"],H),P=o(e.panel,{[e["panel--fill"]]:p==="fill",[e["panel--stroke"]]:p==="stroke",[e["panel--white"]]:p==="white",[e["panel--line"]]:p==="line",[e["panel--no-top-border"]]:p==="line"&&J,[e["panel--selected"]]:l,[e["panel--new"]]:m==="new",[e["panel--draft"]]:m==="draft",[e["panel--error"]]:m==="error",[e["panel--status"]]:m&&m!=="normal",[e["panel--with-icon"]]:c,[e["panel--button"]]:C,[e["panel--clickable"]]:i||f||b||u||C}),V=o({[e.panel__container]:n==="layout2"&&r,[e["panel__container--layout3"]]:E&&r,[e["panel__container--grow"]]:c}),ee=o({[e["panel-content-a"]]:n==="layout2",[e["panel-content-a--layout3a"]]:n==="layout3a",[e["panel-content-a--layout3b"]]:n==="layout3b",[e["panel-content-a--layout3c"]]:n==="layout3c"}),te=o({[e["panel__content-right--layout1"]]:r&&n==="layout1",[e["panel__content-right--layout2"]]:r&&n==="layout2",[e["panel__content-right--layout3"]]:r&&E,[e["panel__content-right--layout3a"]]:r&&n==="layout3a",[e["panel__content-right--layout3b"]]:r&&n==="layout3b",[e["panel__content-right--layout3c"]]:r&&n==="layout3c"}),ae=o(e["panel-content-b"],{[e["panel-content-b--layout1"]]:n==="layout1",[e["panel-content-b--layout3"]]:E}),ne=o(e["panel__details-btn"]),le=()=>{const k=ve({label:G,id:S&&`${_} ${S}`||g&&I&&`${_} ${I}`,prefer:"label"}),M={onClick:u||(()=>T(!l)),className:C?e.panel__expand:void 0,variant:"borderless",ellipsis:!0,...k};return i?t.createElement(D,{testId:"expand","aria-expanded":l,...M},t.createElement("span",{id:_},l?q:A),t.createElement(d,{svgIcon:l?me:pe})):t.createElement(D,{testId:"url",htmlMarkup:K,href:f,target:O,...M},t.createElement("span",{id:_},A),t.createElement(d,{svgIcon:ue}))},re=o(e["panel__btn-container"],{[e["panel__btn-container--layout3"]]:E,[e["panel__btn-container--padding-top"]]:r}),oe=()=>{if(!i||!Q&&!l)return null;const k=o(e["panel-details"],{[e["panel-details--open"]]:l,[e["panel-details--line"]]:p==="line",[e["panel-details--white"]]:p==="white",[e["panel-details--with-icon"]]:c});return t.createElement("div",{className:k,"data-testid":"panel-details"},t.createElement("div",null,i))};return t.createElement("div",{ref:v,"data-testid":U,className:Z,"data-analyticsid":ce.Panel},t.createElement("div",{className:P},c&&!B&&t.createElement("div",{className:e.panel__icon},c),t.createElement("div",{className:V},t.createElement("div",{className:ee},t.createElement(Ne,{status:m,statusMessage:h}),g&&t.createElement("div",{className:e["panel-content-a__title-container"]},t.createElement(ie,{appearance:"title3",htmlMarkup:L,id:I},g),h&&m==="new"&&t.createElement(ge,{color:"blueberry",testId:"badge-status",className:e.panel__badge},h)),F,R>=j.lg&&t.createElement(X,{date:w,time:N})),t.createElement("div",{className:te},r&&t.createElement("div",{className:ae},r),(i||f||w||N||u)&&t.createElement("div",{className:re},R<j.lg&&t.createElement(X,{date:w,time:N}),(i||f||u)&&t.createElement("div",{className:ne},le())))),c&&B&&t.createElement("div",{className:e["panel__icon--right"]},c)),oe())});export{qe as P,he as a,Ce as b,we as c};
1
+ import t,{useState as ce,useEffect as D}from"react";import o from"classnames";import e from"./components/Panel/styles.module.scss";import{T as pe}from"./Title.js";import{B as $}from"./Button.js";import{AnalyticsId as me,IconSize as B}from"./constants.js";import{Icon as u}from"./components/Icons/Icon.js";import de from"./components/Icons/ChevronDown.js";import ue from"./components/Icons/ChevronUp.js";import fe from"./components/Icons/ArrowRight.js";import _e from"./components/Icons/AlertSignFill.js";import{palette as j}from"./theme/palette.js";import ye from"./components/Icons/Pencil.js";import be from"./components/Icons/Calendar.js";import Ee from"./components/Icons/Watch.js";import{useBreakpoint as ge,Breakpoint as W}from"./hooks/useBreakpoint.js";import{useUuid as X}from"./hooks/useUuid.js";import{usePrevious as ve}from"./hooks/usePrevious.js";import{getAriaLabelAttributes as he}from"./utils/accessibility.js";import{B as Ce}from"./Badge.js";var we=(a=>(a.normal="normal",a.new="new",a.error="error",a.draft="draft",a))(we||{}),Ne=(a=>(a.fill="fill",a.white="white",a.stroke="stroke",a.line="line",a))(Ne||{}),Ie=(a=>(a.layout1="layout1",a.layout2="layout2",a.layout3a="layout3a",a.layout3b="layout3b",a.layout3c="layout3c",a))(Ie||{});const ke=({status:a,statusMessage:s})=>{const g=()=>a==="error"?{color:j.cherry500,svgIcon:_e}:{color:j.black,svgIcon:ye},i=o(e["status-message"],{[e["status-message--new"]]:a==="new"});return(a==="error"||a==="draft")&&s?t.createElement("div",{className:i,"data-testid":"display-status"},t.createElement(u,{...g(),size:B.XSmall})," ",t.createElement("span",null,s)):null},F=({date:a,time:s})=>a||s?t.createElement("div",{className:e["datetime-container"],"data-testid":"datetime"},a&&t.createElement("div",{className:e["datetime-container__icon"]},t.createElement(u,{svgIcon:be,size:B.XSmall}),t.createElement("span",null,a)),s&&t.createElement("div",{className:e["datetime-container__icon"]},t.createElement(u,{svgIcon:Ee,size:B.XSmall}),t.createElement("span",null,s))):null,Je=t.forwardRef(function(s,g){const{children:i,contentA:H,contentB:r,className:U,testId:L,title:v,titleHtmlMarkup:O="h2",url:f,target:q="_self",icon:c,iconRight:x=!1,variant:p="fill",status:m="normal",statusMessage:h,buttonText:A="Se detaljer",buttonTextClose:G="Skjul detaljer",buttonAriaLabelledById:S,buttonAriaLabel:J,layout:n="layout2",containerAsButton:C=!1,date:w,time:N,noTopBorder:K,buttonOnClick:d,buttonHtmlMarkup:Q="a",expanded:_=!1,onExpand:y,renderChildrenWhenClosed:Y=!1}=s,[l,T]=ce(_),Z=ve(l),I=X(),b=X(),R=ge(),M=h&&m==="new";D(()=>{_!==l&&T(_)},[_]),D(()=>{y&&l!==!!Z&&y(l)},[l,y]);const E=["layout3a".toString(),"layout3b".toString(),"layout3c".toString()].includes(n),P=o(e["panel-wrapper"],U),V=o(e.panel,{[e["panel--fill"]]:p==="fill",[e["panel--stroke"]]:p==="stroke",[e["panel--white"]]:p==="white",[e["panel--line"]]:p==="line",[e["panel--no-top-border"]]:p==="line"&&K,[e["panel--selected"]]:l,[e["panel--new"]]:m==="new",[e["panel--draft"]]:m==="draft",[e["panel--error"]]:m==="error",[e["panel--status"]]:m&&m!=="normal",[e["panel--with-icon"]]:c,[e["panel--button"]]:C,[e["panel--clickable"]]:i||f||y||d||C}),ee=o({[e.panel__container]:n==="layout2"&&r,[e["panel__container--layout3"]]:E&&r,[e["panel__container--grow"]]:c}),te=o({[e["panel-content-a"]]:n==="layout2",[e["panel-content-a--layout3a"]]:n==="layout3a",[e["panel-content-a--layout3b"]]:n==="layout3b",[e["panel-content-a--layout3c"]]:n==="layout3c"}),ae=o({[e["panel__content-right--layout1"]]:r&&n==="layout1",[e["panel__content-right--layout2"]]:r&&n==="layout2",[e["panel__content-right--layout3"]]:r&&E,[e["panel__content-right--layout3a"]]:r&&n==="layout3a",[e["panel__content-right--layout3b"]]:r&&n==="layout3b",[e["panel__content-right--layout3c"]]:r&&n==="layout3c"}),ne=o(e["panel-content-b"],{[e["panel-content-b--layout1"]]:n==="layout1",[e["panel-content-b--layout3"]]:E}),le=o(e["panel__details-btn"]),re=o(e["panel-content-a__title"],{[e["panel-content-a__title--badge"]]:M}),oe=()=>{const k=he({label:J,id:S&&`${b} ${S}`||v&&I&&`${b} ${I}`,prefer:"label"}),z={onClick:d||(()=>T(!l)),className:C?e.panel__expand:void 0,variant:"borderless",ellipsis:!0,...k};return i?t.createElement($,{testId:"expand","aria-expanded":l,...z},t.createElement("span",{id:b},l?G:A),t.createElement(u,{svgIcon:l?ue:de})):t.createElement($,{testId:"url",htmlMarkup:Q,href:f,target:q,...z},t.createElement("span",{id:b},A),t.createElement(u,{svgIcon:fe}))},se=o(e["panel__btn-container"],{[e["panel__btn-container--layout3"]]:E,[e["panel__btn-container--padding-top"]]:r}),ie=()=>{if(!i||!Y&&!l)return null;const k=o(e["panel-details"],{[e["panel-details--open"]]:l,[e["panel-details--line"]]:p==="line",[e["panel-details--white"]]:p==="white",[e["panel-details--with-icon"]]:c});return t.createElement("div",{className:k,"data-testid":"panel-details"},t.createElement("div",null,i))};return t.createElement("div",{ref:g,"data-testid":L,className:P,"data-analyticsid":me.Panel},t.createElement("div",{className:V},c&&!x&&t.createElement("div",{className:e.panel__icon},c),t.createElement("div",{className:ee},t.createElement("div",{className:te},t.createElement(ke,{status:m,statusMessage:h}),v&&t.createElement("div",{className:e["panel-content-a__title-container"]},t.createElement(pe,{appearance:"title3",htmlMarkup:O,id:I,className:re},v),M&&t.createElement("div",{className:e.panel__badge},t.createElement(Ce,{color:"blueberry",testId:"badge-status"},h))),H,R>=W.lg&&t.createElement(F,{date:w,time:N})),t.createElement("div",{className:ae},r&&t.createElement("div",{className:ne},r),(i||f||w||N||d)&&t.createElement("div",{className:se},R<W.lg&&t.createElement(F,{date:w,time:N}),(i||f||d)&&t.createElement("div",{className:le},oe())))),c&&x&&t.createElement("div",{className:e["panel__icon--right"]},c)),ie())});export{Je as P,we as a,Ne as b,Ie as c};
2
2
  //# sourceMappingURL=Panel.js.map
package/Panel.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.js","sources":["../src/components/Panel/Panel.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport panelStyles from './styles.module.scss';\nimport Title, { TitleTags } from '../Title';\nimport Button, { ButtonProps, ButtonTags } from '../Button';\nimport { AnchorTarget, AnalyticsId } from '../../constants';\n\nimport Icon, { IconSize, SvgPathProps } from '../Icons';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport ArrowRight from '../Icons/ArrowRight';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport { palette } from '../../theme/palette';\nimport Pencil from '../Icons/Pencil';\nimport Calendar from '../Icons/Calendar';\nimport Watch from '../Icons/Watch';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useUuid } from '../../hooks/useUuid';\nimport { usePrevious } from '../../hooks/usePrevious';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../utils/accessibility';\nimport Badge from '../Badge';\n\nexport enum PanelStatus {\n normal = 'normal',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport enum PanelVariant {\n fill = 'fill',\n white = 'white',\n stroke = 'stroke',\n line = 'line',\n}\n\nexport enum PanelLayout {\n layout1 = 'layout1',\n layout2 = 'layout2',\n layout3a = 'layout3a',\n layout3b = 'layout3b',\n layout3c = 'layout3c',\n}\n\nexport interface PanelProps {\n children?: React.ReactNode;\n /** Title of the panel */\n title?: string;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Displays a status on the left side: defualt normal */\n status?: keyof typeof PanelStatus;\n /** Displayed on top of the panel with a status icon */\n statusMessage?: string;\n /** Changes the visual representation of the panel. */\n variant?: keyof typeof PanelVariant;\n /** Url to details, renders as a button with anchor tag */\n url?: string;\n /** target used in the button: default is _self */\n target?: AnchorTarget;\n /** Icon displayed in title */\n icon?: React.ReactNode;\n /** Display icon on right */\n iconRight?: boolean;\n /** Panel section A content */\n contentA?: React.ReactNode | string;\n /** Panel section B content*/\n contentB?: React.ReactNode | string;\n /** Panel button text */\n buttonText?: string;\n /** Panel button close text */\n buttonTextClose?: string;\n /** HTML markup for panel button. Default: a */\n buttonHtmlMarkup?: ButtonTags;\n /** Callback when panel button is clicked */\n buttonOnClick?: ButtonProps['onClick'];\n /** Panel button is aria-labelledby the text in the button itself + the element set in buttonAriaLabelledById. Default: auto-generated id for title (if title is set). */\n buttonAriaLabelledById?: string;\n /** Panel button aria label */\n buttonAriaLabel?: string;\n /** Show close button in bottom of Panel Expand */\n /** @deprecated Has no effect anymore due to accessbility reasons. No close button is shown in expanded content. Will be removed in 2.0.0 */\n showCloseButtonInExpand?: boolean;\n /** Layout (see description) */\n layout?: keyof typeof PanelLayout;\n /** Clicking anywhere on the container will trigger a click on the panel's button */\n containerAsButton?: boolean;\n /** Displays time with icon */\n time?: string;\n /** Displays date with icon */\n date?: string;\n /** Removes top border when variant is \"line\" */\n noTopBorder?: boolean;\n /** Opens or closes the panel */\n expanded?: boolean;\n /** Called when panel is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Whether to render children when closed (in which case they are hidden with CSS). Default: false */\n renderChildrenWhenClosed?: boolean;\n}\n\nconst StatusText: React.FC<{ status?: keyof typeof PanelStatus; statusMessage?: string }> = ({ status, statusMessage }) => {\n const statusIcon = (): { color: string; svgIcon: React.FC<SvgPathProps> } => {\n if (status === PanelStatus.error) {\n return { color: palette.cherry500, svgIcon: AlertSignFill };\n }\n\n return { color: palette.black, svgIcon: Pencil };\n };\n\n const statusMessageClass = classNames(panelStyles['status-message'], {\n [panelStyles['status-message--new']]: status === PanelStatus.new,\n });\n\n if ((status === PanelStatus.error || status === PanelStatus.draft) && statusMessage) {\n return (\n <div className={statusMessageClass} data-testid=\"display-status\">\n {<Icon {...statusIcon()} size={IconSize.XSmall} />} <span>{statusMessage}</span>\n </div>\n );\n }\n\n return null;\n};\n\nconst DateTime: React.FC<{ date?: string; time?: string }> = ({ date, time }) => {\n if (date || time) {\n return (\n <div className={panelStyles['datetime-container']} data-testid=\"datetime\">\n {date && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Calendar} size={IconSize.XSmall} />\n <span>{date}</span>\n </div>\n )}\n {time && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Watch} size={IconSize.XSmall} />\n <span>{time}</span>\n </div>\n )}\n </div>\n );\n }\n\n return null;\n};\n\nconst Panel = React.forwardRef(function PanelForwardedRef(props: PanelProps, ref: React.ForwardedRef<HTMLHeadingElement>) {\n const {\n children,\n contentA,\n contentB,\n className,\n testId,\n title,\n titleHtmlMarkup = 'h2',\n url,\n target = '_self',\n icon,\n iconRight = false,\n variant = PanelVariant.fill,\n status = PanelStatus.normal,\n statusMessage,\n buttonText = 'Se detaljer',\n buttonTextClose = 'Skjul detaljer',\n buttonAriaLabelledById,\n buttonAriaLabel,\n layout = PanelLayout.layout2,\n containerAsButton = false,\n date,\n time,\n noTopBorder,\n buttonOnClick,\n buttonHtmlMarkup = 'a',\n expanded = false,\n onExpand,\n renderChildrenWhenClosed = false,\n } = props;\n\n const [isExpanded, setIsExpanded] = useState<boolean>(expanded);\n const previousIsExpanded = usePrevious(isExpanded);\n const titleId = useUuid();\n const buttonTextId = useUuid();\n const breakpoint = useBreakpoint();\n\n useEffect(() => {\n if (expanded !== isExpanded) {\n setIsExpanded(expanded);\n }\n }, [expanded]);\n\n useEffect(() => {\n if (onExpand && isExpanded !== !!previousIsExpanded) {\n onExpand(isExpanded);\n }\n }, [isExpanded, onExpand]);\n\n const layout3 = [PanelLayout.layout3a.toString(), PanelLayout.layout3b.toString(), PanelLayout.layout3c.toString()].includes(layout);\n\n const panelWrapperClass = classNames(panelStyles['panel-wrapper'], className);\n\n const panelClasses = classNames(panelStyles.panel, {\n [panelStyles['panel--fill']]: variant === PanelVariant.fill,\n [panelStyles['panel--stroke']]: variant === PanelVariant.stroke,\n [panelStyles['panel--white']]: variant === PanelVariant.white,\n [panelStyles['panel--line']]: variant === PanelVariant.line,\n [panelStyles['panel--no-top-border']]: variant === PanelVariant.line && noTopBorder,\n [panelStyles['panel--selected']]: isExpanded,\n [panelStyles['panel--new']]: status === PanelStatus.new,\n [panelStyles['panel--draft']]: status === PanelStatus.draft,\n [panelStyles['panel--error']]: status === PanelStatus.error,\n [panelStyles['panel--status']]: status && status !== PanelStatus.normal,\n [panelStyles['panel--with-icon']]: icon,\n [panelStyles['panel--button']]: containerAsButton,\n [panelStyles['panel--clickable']]: children || url || onExpand || buttonOnClick || containerAsButton,\n });\n\n const panelContainer = classNames({\n [panelStyles['panel__container']]: layout === PanelLayout.layout2 && contentB,\n [panelStyles['panel__container--layout3']]: layout3 && contentB,\n [panelStyles['panel__container--grow']]: icon,\n });\n\n const panelContentLeftClass = classNames({\n [panelStyles['panel-content-a']]: layout === PanelLayout.layout2,\n [panelStyles['panel-content-a--layout3a']]: layout === PanelLayout.layout3a,\n [panelStyles['panel-content-a--layout3b']]: layout === PanelLayout.layout3b,\n [panelStyles['panel-content-a--layout3c']]: layout === PanelLayout.layout3c,\n });\n\n const panelContentRightClass = classNames({\n [panelStyles['panel__content-right--layout1']]: contentB && layout === PanelLayout.layout1,\n [panelStyles['panel__content-right--layout2']]: contentB && layout === PanelLayout.layout2,\n [panelStyles['panel__content-right--layout3']]: contentB && layout3,\n [panelStyles['panel__content-right--layout3a']]: contentB && layout === PanelLayout.layout3a,\n [panelStyles['panel__content-right--layout3b']]: contentB && layout === PanelLayout.layout3b,\n [panelStyles['panel__content-right--layout3c']]: contentB && layout === PanelLayout.layout3c,\n });\n\n const panelContentBClass = classNames(panelStyles['panel-content-b'], {\n [panelStyles['panel-content-b--layout1']]: layout === PanelLayout.layout1,\n [panelStyles['panel-content-b--layout3']]: layout3,\n });\n\n const panelActionBtnClass = classNames(panelStyles['panel__details-btn']);\n\n const renderDetailsButton = (): JSX.Element => {\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: buttonAriaLabel,\n id: (buttonAriaLabelledById && `${buttonTextId} ${buttonAriaLabelledById}`) || (title && titleId && `${buttonTextId} ${titleId}`),\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: buttonOnClick ? buttonOnClick : () => setIsExpanded(!isExpanded),\n className: containerAsButton ? panelStyles['panel__expand'] : undefined,\n variant: 'borderless',\n ellipsis: true,\n ...ariaLabelAttributes,\n };\n\n if (!!children) {\n return (\n <Button testId=\"expand\" aria-expanded={isExpanded} {...commonProps}>\n <span id={buttonTextId}>{isExpanded ? buttonTextClose : buttonText}</span>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n );\n }\n\n return (\n <Button testId=\"url\" htmlMarkup={buttonHtmlMarkup} href={url} target={target} {...commonProps}>\n <span id={buttonTextId}>{buttonText}</span>\n <Icon svgIcon={ArrowRight} />\n </Button>\n );\n };\n\n const btnContainerClass = classNames(panelStyles['panel__btn-container'], {\n [panelStyles['panel__btn-container--layout3']]: layout3,\n [panelStyles['panel__btn-container--padding-top']]: contentB,\n });\n\n const renderContent = () => {\n if (!children) {\n return null;\n }\n if (!renderChildrenWhenClosed && !isExpanded) {\n return null;\n }\n\n const panelDetailsClasses = classNames(panelStyles['panel-details'], {\n [panelStyles['panel-details--open']]: isExpanded,\n [panelStyles['panel-details--line']]: variant === PanelVariant.line,\n [panelStyles['panel-details--white']]: variant === PanelVariant.white,\n [panelStyles['panel-details--with-icon']]: icon,\n });\n\n return (\n <div className={panelDetailsClasses} data-testid=\"panel-details\">\n <div>{children}</div>\n </div>\n );\n };\n\n return (\n <div ref={ref} data-testid={testId} className={panelWrapperClass} data-analyticsid={AnalyticsId.Panel}>\n <div className={panelClasses}>\n {icon && !iconRight && <div className={panelStyles.panel__icon}>{icon}</div>}\n <div className={panelContainer}>\n <div className={panelContentLeftClass}>\n <StatusText status={status} statusMessage={statusMessage} />\n {title && (\n <div className={panelStyles['panel-content-a__title-container']}>\n <Title appearance=\"title3\" htmlMarkup={titleHtmlMarkup} id={titleId}>\n {title}\n </Title>\n {statusMessage && status === PanelStatus.new && (\n <Badge color=\"blueberry\" testId=\"badge-status\" className={panelStyles.panel__badge}>\n {statusMessage}\n </Badge>\n )}\n </div>\n )}\n {contentA}\n {breakpoint >= Breakpoint.lg && <DateTime date={date} time={time} />}\n </div>\n <div className={panelContentRightClass}>\n {contentB && <div className={panelContentBClass}>{contentB}</div>}\n {(children || url || date || time || buttonOnClick) && (\n <div className={btnContainerClass}>\n {breakpoint < Breakpoint.lg && <DateTime date={date} time={time} />}\n {(children || url || buttonOnClick) && <div className={panelActionBtnClass}>{renderDetailsButton()}</div>}\n </div>\n )}\n </div>\n </div>\n {icon && iconRight && <div className={panelStyles['panel__icon--right']}>{icon}</div>}\n </div>\n {renderContent()}\n </div>\n );\n});\n\nexport default Panel;\n"],"names":["PanelStatus","PanelVariant","PanelLayout","StatusText","status","statusMessage","statusIcon","palette","AlertSignFill","Pencil","statusMessageClass","classNames","panelStyles","React","Icon","IconSize","DateTime","date","time","Calendar","Watch","Panel","props","ref","children","contentA","contentB","className","testId","title","titleHtmlMarkup","url","target","icon","iconRight","variant","buttonText","buttonTextClose","buttonAriaLabelledById","buttonAriaLabel","layout","containerAsButton","noTopBorder","buttonOnClick","buttonHtmlMarkup","expanded","onExpand","renderChildrenWhenClosed","isExpanded","setIsExpanded","useState","previousIsExpanded","usePrevious","titleId","useUuid","buttonTextId","breakpoint","useBreakpoint","useEffect","layout3","panelWrapperClass","panelClasses","panelContainer","panelContentLeftClass","panelContentRightClass","panelContentBClass","panelActionBtnClass","renderDetailsButton","ariaLabelAttributes","getAriaLabelAttributes","commonProps","Button","ChevronUp","ChevronDown","ArrowRight","btnContainerClass","renderContent","panelDetailsClasses","AnalyticsId","Title","Badge","Breakpoint"],"mappings":"67BAuBY,IAAAA,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QAJEA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,KAAO,OAJGA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WALDA,IAAAA,IAAA,CAAA,CAAA,EAqEZ,MAAMC,GAAsF,CAAC,CAAE,OAAAC,EAAQ,cAAAC,KAAoB,CACzH,MAAMC,EAAa,IACbF,IAAW,QACN,CAAE,MAAOG,EAAQ,UAAW,QAASC,EAAc,EAGrD,CAAE,MAAOD,EAAQ,MAAO,QAASE,EAAO,EAG3CC,EAAqBC,EAAWC,EAAY,kBAAmB,CACnE,CAACA,EAAY,wBAAyBR,IAAW,KAAA,CAClD,EAED,OAAKA,IAAW,SAAqBA,IAAW,UAAsBC,EAEjEQ,EAAA,cAAA,MAAA,CAAI,UAAWH,EAAoB,cAAY,gBAAA,EAC5CG,EAAA,cAAAC,EAAA,CAAM,GAAGR,EAAW,EAAG,KAAMS,EAAS,MAAA,CAAQ,EAAG,IAAEF,EAAA,cAAA,OAAA,KAAMR,CAAc,CAC3E,EAIG,IACT,EAEMW,EAAuD,CAAC,CAAE,KAAAC,EAAM,KAAAC,KAChED,GAAQC,EAEPL,EAAA,cAAA,MAAA,CAAI,UAAWD,EAAY,sBAAuB,cAAY,U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OpE,EAAA,cAAAG,EAAA,CAAS,KAAAC,EAAY,KAAAC,CAAA,CAAY,GAC/DM,GAAYO,GAAOY,IAAmB9B,EAAA,cAAA,MAAA,CAAI,UAAWqD,EAAA,EAAsBC,GAAA,CAAsB,CACrG,CAEJ,CACF,EACClC,GAAQC,GAAcrB,EAAA,cAAA,MAAA,CAAI,UAAWD,EAAY,qBAAA,EAAwBqB,CAAK,CACjF,EACC2C,GAAA,CACH,CAEJ,CAAC"}
1
+ {"version":3,"file":"Panel.js","sources":["../src/components/Panel/Panel.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport classNames from 'classnames';\n\nimport panelStyles from './styles.module.scss';\nimport Title, { TitleTags } from '../Title';\nimport Button, { ButtonProps, ButtonTags } from '../Button';\nimport { AnchorTarget, AnalyticsId } from '../../constants';\n\nimport Icon, { IconSize, SvgPathProps } from '../Icons';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport ArrowRight from '../Icons/ArrowRight';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport { palette } from '../../theme/palette';\nimport Pencil from '../Icons/Pencil';\nimport Calendar from '../Icons/Calendar';\nimport Watch from '../Icons/Watch';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useUuid } from '../../hooks/useUuid';\nimport { usePrevious } from '../../hooks/usePrevious';\nimport { AriaLabelAttributes, getAriaLabelAttributes } from '../../utils/accessibility';\nimport Badge from '../Badge';\n\nexport enum PanelStatus {\n normal = 'normal',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n\nexport enum PanelVariant {\n fill = 'fill',\n white = 'white',\n stroke = 'stroke',\n line = 'line',\n}\n\nexport enum PanelLayout {\n layout1 = 'layout1',\n layout2 = 'layout2',\n layout3a = 'layout3a',\n layout3b = 'layout3b',\n layout3c = 'layout3c',\n}\n\nexport interface PanelProps {\n children?: React.ReactNode;\n /** Title of the panel */\n title?: string;\n /** Changes the underlying element of the title. Default: h2*/\n titleHtmlMarkup?: TitleTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Displays a status on the left side: defualt normal */\n status?: keyof typeof PanelStatus;\n /** Displayed on top of the panel with a status icon */\n statusMessage?: string;\n /** Changes the visual representation of the panel. */\n variant?: keyof typeof PanelVariant;\n /** Url to details, renders as a button with anchor tag */\n url?: string;\n /** target used in the button: default is _self */\n target?: AnchorTarget;\n /** Icon displayed in title */\n icon?: React.ReactNode;\n /** Display icon on right */\n iconRight?: boolean;\n /** Panel section A content */\n contentA?: React.ReactNode | string;\n /** Panel section B content*/\n contentB?: React.ReactNode | string;\n /** Panel button text */\n buttonText?: string;\n /** Panel button close text */\n buttonTextClose?: string;\n /** HTML markup for panel button. Default: a */\n buttonHtmlMarkup?: ButtonTags;\n /** Callback when panel button is clicked */\n buttonOnClick?: ButtonProps['onClick'];\n /** Panel button is aria-labelledby the text in the button itself + the element set in buttonAriaLabelledById. Default: auto-generated id for title (if title is set). */\n buttonAriaLabelledById?: string;\n /** Panel button aria label */\n buttonAriaLabel?: string;\n /** Show close button in bottom of Panel Expand */\n /** @deprecated Has no effect anymore due to accessbility reasons. No close button is shown in expanded content. Will be removed in 2.0.0 */\n showCloseButtonInExpand?: boolean;\n /** Layout (see description) */\n layout?: keyof typeof PanelLayout;\n /** Clicking anywhere on the container will trigger a click on the panel's button */\n containerAsButton?: boolean;\n /** Displays time with icon */\n time?: string;\n /** Displays date with icon */\n date?: string;\n /** Removes top border when variant is \"line\" */\n noTopBorder?: boolean;\n /** Opens or closes the panel */\n expanded?: boolean;\n /** Called when panel is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Whether to render children when closed (in which case they are hidden with CSS). Default: false */\n renderChildrenWhenClosed?: boolean;\n}\n\nconst StatusText: React.FC<{ status?: keyof typeof PanelStatus; statusMessage?: string }> = ({ status, statusMessage }) => {\n const statusIcon = (): { color: string; svgIcon: React.FC<SvgPathProps> } => {\n if (status === PanelStatus.error) {\n return { color: palette.cherry500, svgIcon: AlertSignFill };\n }\n\n return { color: palette.black, svgIcon: Pencil };\n };\n\n const statusMessageClass = classNames(panelStyles['status-message'], {\n [panelStyles['status-message--new']]: status === PanelStatus.new,\n });\n\n if ((status === PanelStatus.error || status === PanelStatus.draft) && statusMessage) {\n return (\n <div className={statusMessageClass} data-testid=\"display-status\">\n {<Icon {...statusIcon()} size={IconSize.XSmall} />} <span>{statusMessage}</span>\n </div>\n );\n }\n\n return null;\n};\n\nconst DateTime: React.FC<{ date?: string; time?: string }> = ({ date, time }) => {\n if (date || time) {\n return (\n <div className={panelStyles['datetime-container']} data-testid=\"datetime\">\n {date && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Calendar} size={IconSize.XSmall} />\n <span>{date}</span>\n </div>\n )}\n {time && (\n <div className={panelStyles['datetime-container__icon']}>\n <Icon svgIcon={Watch} size={IconSize.XSmall} />\n <span>{time}</span>\n </div>\n )}\n </div>\n );\n }\n\n return null;\n};\n\nconst Panel = React.forwardRef(function PanelForwardedRef(props: PanelProps, ref: React.ForwardedRef<HTMLHeadingElement>) {\n const {\n children,\n contentA,\n contentB,\n className,\n testId,\n title,\n titleHtmlMarkup = 'h2',\n url,\n target = '_self',\n icon,\n iconRight = false,\n variant = PanelVariant.fill,\n status = PanelStatus.normal,\n statusMessage,\n buttonText = 'Se detaljer',\n buttonTextClose = 'Skjul detaljer',\n buttonAriaLabelledById,\n buttonAriaLabel,\n layout = PanelLayout.layout2,\n containerAsButton = false,\n date,\n time,\n noTopBorder,\n buttonOnClick,\n buttonHtmlMarkup = 'a',\n expanded = false,\n onExpand,\n renderChildrenWhenClosed = false,\n } = props;\n\n const [isExpanded, setIsExpanded] = useState<boolean>(expanded);\n const previousIsExpanded = usePrevious(isExpanded);\n const titleId = useUuid();\n const buttonTextId = useUuid();\n const breakpoint = useBreakpoint();\n const hasBadge = statusMessage && status === PanelStatus.new;\n\n useEffect(() => {\n if (expanded !== isExpanded) {\n setIsExpanded(expanded);\n }\n }, [expanded]);\n\n useEffect(() => {\n if (onExpand && isExpanded !== !!previousIsExpanded) {\n onExpand(isExpanded);\n }\n }, [isExpanded, onExpand]);\n\n const layout3 = [PanelLayout.layout3a.toString(), PanelLayout.layout3b.toString(), PanelLayout.layout3c.toString()].includes(layout);\n\n const panelWrapperClass = classNames(panelStyles['panel-wrapper'], className);\n\n const panelClasses = classNames(panelStyles.panel, {\n [panelStyles['panel--fill']]: variant === PanelVariant.fill,\n [panelStyles['panel--stroke']]: variant === PanelVariant.stroke,\n [panelStyles['panel--white']]: variant === PanelVariant.white,\n [panelStyles['panel--line']]: variant === PanelVariant.line,\n [panelStyles['panel--no-top-border']]: variant === PanelVariant.line && noTopBorder,\n [panelStyles['panel--selected']]: isExpanded,\n [panelStyles['panel--new']]: status === PanelStatus.new,\n [panelStyles['panel--draft']]: status === PanelStatus.draft,\n [panelStyles['panel--error']]: status === PanelStatus.error,\n [panelStyles['panel--status']]: status && status !== PanelStatus.normal,\n [panelStyles['panel--with-icon']]: icon,\n [panelStyles['panel--button']]: containerAsButton,\n [panelStyles['panel--clickable']]: children || url || onExpand || buttonOnClick || containerAsButton,\n });\n\n const panelContainer = classNames({\n [panelStyles['panel__container']]: layout === PanelLayout.layout2 && contentB,\n [panelStyles['panel__container--layout3']]: layout3 && contentB,\n [panelStyles['panel__container--grow']]: icon,\n });\n\n const panelContentLeftClass = classNames({\n [panelStyles['panel-content-a']]: layout === PanelLayout.layout2,\n [panelStyles['panel-content-a--layout3a']]: layout === PanelLayout.layout3a,\n [panelStyles['panel-content-a--layout3b']]: layout === PanelLayout.layout3b,\n [panelStyles['panel-content-a--layout3c']]: layout === PanelLayout.layout3c,\n });\n\n const panelContentRightClass = classNames({\n [panelStyles['panel__content-right--layout1']]: contentB && layout === PanelLayout.layout1,\n [panelStyles['panel__content-right--layout2']]: contentB && layout === PanelLayout.layout2,\n [panelStyles['panel__content-right--layout3']]: contentB && layout3,\n [panelStyles['panel__content-right--layout3a']]: contentB && layout === PanelLayout.layout3a,\n [panelStyles['panel__content-right--layout3b']]: contentB && layout === PanelLayout.layout3b,\n [panelStyles['panel__content-right--layout3c']]: contentB && layout === PanelLayout.layout3c,\n });\n\n const panelContentBClass = classNames(panelStyles['panel-content-b'], {\n [panelStyles['panel-content-b--layout1']]: layout === PanelLayout.layout1,\n [panelStyles['panel-content-b--layout3']]: layout3,\n });\n\n const panelActionBtnClass = classNames(panelStyles['panel__details-btn']);\n const titleClasses = classNames(panelStyles['panel-content-a__title'], { [panelStyles['panel-content-a__title--badge']]: hasBadge });\n\n const renderDetailsButton = (): JSX.Element => {\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: buttonAriaLabel,\n id: (buttonAriaLabelledById && `${buttonTextId} ${buttonAriaLabelledById}`) || (title && titleId && `${buttonTextId} ${titleId}`),\n prefer: 'label',\n });\n\n const commonProps: Partial<ButtonProps> & AriaLabelAttributes = {\n onClick: buttonOnClick ? buttonOnClick : () => setIsExpanded(!isExpanded),\n className: containerAsButton ? panelStyles['panel__expand'] : undefined,\n variant: 'borderless',\n ellipsis: true,\n ...ariaLabelAttributes,\n };\n\n if (!!children) {\n return (\n <Button testId=\"expand\" aria-expanded={isExpanded} {...commonProps}>\n <span id={buttonTextId}>{isExpanded ? buttonTextClose : buttonText}</span>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} />\n </Button>\n );\n }\n\n return (\n <Button testId=\"url\" htmlMarkup={buttonHtmlMarkup} href={url} target={target} {...commonProps}>\n <span id={buttonTextId}>{buttonText}</span>\n <Icon svgIcon={ArrowRight} />\n </Button>\n );\n };\n\n const btnContainerClass = classNames(panelStyles['panel__btn-container'], {\n [panelStyles['panel__btn-container--layout3']]: layout3,\n [panelStyles['panel__btn-container--padding-top']]: contentB,\n });\n\n const renderContent = () => {\n if (!children) {\n return null;\n }\n if (!renderChildrenWhenClosed && !isExpanded) {\n return null;\n }\n\n const panelDetailsClasses = classNames(panelStyles['panel-details'], {\n [panelStyles['panel-details--open']]: isExpanded,\n [panelStyles['panel-details--line']]: variant === PanelVariant.line,\n [panelStyles['panel-details--white']]: variant === PanelVariant.white,\n [panelStyles['panel-details--with-icon']]: icon,\n });\n\n return (\n <div className={panelDetailsClasses} data-testid=\"panel-details\">\n <div>{children}</div>\n </div>\n );\n };\n\n return (\n <div ref={ref} data-testid={testId} className={panelWrapperClass} data-analyticsid={AnalyticsId.Panel}>\n <div className={panelClasses}>\n {icon && !iconRight && <div className={panelStyles.panel__icon}>{icon}</div>}\n <div className={panelContainer}>\n <div className={panelContentLeftClass}>\n <StatusText status={status} statusMessage={statusMessage} />\n {title && (\n <div className={panelStyles['panel-content-a__title-container']}>\n <Title appearance=\"title3\" htmlMarkup={titleHtmlMarkup} id={titleId} className={titleClasses}>\n {title}\n </Title>\n {hasBadge && (\n <div className={panelStyles.panel__badge}>\n <Badge color=\"blueberry\" testId=\"badge-status\">\n {statusMessage}\n </Badge>\n </div>\n )}\n </div>\n )}\n {contentA}\n {breakpoint >= Breakpoint.lg && <DateTime date={date} time={time} />}\n </div>\n <div className={panelContentRightClass}>\n {contentB && <div className={panelContentBClass}>{contentB}</div>}\n {(children || url || date || time || buttonOnClick) && (\n <div className={btnContainerClass}>\n {breakpoint < Breakpoint.lg && <DateTime date={date} time={time} />}\n {(children || url || buttonOnClick) && <div className={panelActionBtnClass}>{renderDetailsButton()}</div>}\n </div>\n )}\n </div>\n </div>\n {icon && iconRight && <div className={panelStyles['panel__icon--right']}>{icon}</div>}\n </div>\n {renderContent()}\n </div>\n );\n});\n\nexport default Panel;\n"],"names":["PanelStatus","PanelVariant","PanelLayout","StatusText","status","statusMessage","statusIcon","palette","AlertSignFill","Pencil","statusMessageClass","classNames","panelStyles","React","Icon","IconSize","DateTime","date","time","Calendar","Watch","Panel","props","ref","children","contentA","contentB","className","testId","title","titleHtmlMarkup","url","target","icon","iconRight","variant","buttonText","buttonTextClose","buttonAriaLabelledById","buttonAriaLabel","layout","containerAsButton","noTopBorder","buttonOnClick","buttonHtmlMarkup","expanded","onExpand","renderChildrenWhenClosed","isExpanded","setIsExpanded","useState","previousIsExpanded","usePrevious","titleId","useUuid","buttonTextId","breakpoint","useBreakpoint","hasBadge","useEffect","layout3","panelWrapperClass","panelClasses","panelContainer","panelContentLeftClass","panelContentRightClass","panelContentBClass","panelActionBtnClass","titleClasses","renderDetailsButton","ariaLabelAttributes","getAriaLabelAttributes","commonProps","Button","ChevronUp","ChevronDown","ArrowRight","btnContainerClass","renderContent","panelDetailsClasses","AnalyticsId","Title","Badge","Breakpoint"],"mappings":"67BAuBY,IAAAA,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QAJEA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,KAAO,OAJGA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WALDA,IAAAA,IAAA,CAAA,CAAA,EAqEZ,MAAMC,GAAsF,CAAC,CAAE,OAAAC,EAAQ,cAAAC,KAAoB,CACzH,MAAMC,EAAa,IACbF,IAAW,QACN,CAAE,MAAOG,EAAQ,UAAW,QAASC,EAAc,EAGrD,CAAE,MAAOD,EAAQ,MAAO,QAASE,EAAO,EAG3CC,EAAqBC,EAAWC,EAAY,kBAAmB,CACnE,CAACA,EAAY,wBAAyBR,IAAW,KAAA,CAClD,EAED,OAAKA,IAAW,SAAqBA,IAAW,UAAsBC,EAEjEQ,EAAA,cAAA,MAAA,CAAI,UAAWH,EAAoB,cAAY,gBAAA,EAC5CG,EAAA,cAAAC,EAAA,CAAM,GAAGR,EAAW,EAAG,KAAMS,EAAS,MAAA,CAAQ,EAAG,IAAEF,EAAA,cAAA,OAAA,KA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IAAOtE,EAAA,cAAAG,EAAA,CAAS,KAAAC,EAAY,KAAAC,CAAY,CAAA,CACpE,EACCL,EAAA,cAAA,MAAA,CAAI,UAAWoD,EAAA,EACbvC,GAAab,EAAA,cAAA,MAAA,CAAI,UAAWqD,EAAA,EAAqBxC,CAAS,GACzDF,GAAYO,GAAOd,GAAQC,GAAQyB,IAClC9B,EAAA,cAAA,MAAA,CAAI,UAAWgE,EAAA,EACbrB,EAAa2B,EAAW,IAAOtE,EAAA,cAAAG,EAAA,CAAS,KAAAC,EAAY,KAAAC,CAAA,CAAY,GAC/DM,GAAYO,GAAOY,IAAmB9B,EAAA,cAAA,MAAA,CAAI,UAAWsD,EAAA,EAAsBE,GAAA,CAAsB,CACrG,CAEJ,CACF,EACCpC,GAAQC,GAAcrB,EAAA,cAAA,MAAA,CAAI,UAAWD,EAAY,qBAAA,EAAwBqB,CAAK,CACjF,EACC6C,GAAA,CACH,CAEJ,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { TitleProps } from '../Title';
3
3
  export declare type DuolistVariants = 'normal' | 'line';
4
- export declare type BoldColumn = 'first' | 'second';
4
+ export declare type BoldColumn = 'first' | 'second' | 'none';
5
5
  export declare type Border = 'no-border' | 'border';
6
+ export declare type Formats = 'formatted' | 'non-formatted';
6
7
  interface DuolistProps {
7
8
  /** Determines which column is bold */
8
9
  boldColumn?: BoldColumn;
@@ -10,6 +11,10 @@ interface DuolistProps {
10
11
  border?: Border;
11
12
  /** Label of the Duolist */
12
13
  label?: TitleProps;
14
+ /** Formatted or non-formatted visual variants */
15
+ format?: Formats;
16
+ /** Character separator for non-formatted format */
17
+ separator?: string;
13
18
  /** Sets the visual variant of the Duolist. */
14
19
  variant?: DuolistVariants;
15
20
  /** Sets the content of the Duolist. */
@@ -26,6 +31,10 @@ interface DuolistGroupProps {
26
31
  boldColumn?: BoldColumn;
27
32
  /** Sets content of the <dd> tag. */
28
33
  description: React.ReactNode;
34
+ /** Formatted or non-formatted visual variants */
35
+ format?: Formats;
36
+ /** Character separator for non-formatted format */
37
+ separator?: string;
29
38
  /** Sets content of the <dt> tag. */
30
39
  term: React.ReactNode;
31
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Duolist.d.ts","sourceRoot":"","sources":["../../../src/components/Duolist/Duolist.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,oBAAY,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChD,oBAAY,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC5C,oBAAY,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE5C,UAAU,YAAY;IACpB,sCAAsC;IACtC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,iBAAiB;IACzB,sCAAsC;IACtC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oCAAoC;IACpC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,oCAAoC;IACpC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAcpD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA0C1C,C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CAAC,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4BpD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyD1C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"props":{"boldColumn":{"defaultValue":null,"description":"Determines which column is bold","name":"boldColumn","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":false,"type":{"name":"enum","raw":"BoldColumn","value":[{"value":"\"first\""},{"value":"\"second\""}]}},"description":{"defaultValue":null,"description":"Sets content of the <dd> tag.","name":"description","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":true,"type":{"name":"ReactNode"}},"term":{"defaultValue":null,"description":"Sets content of the <dt> tag.","name":"term","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":true,"type":{"name":"ReactNode"}}}}
1
+ {"props":{"boldColumn":{"defaultValue":null,"description":"Determines which column is bold","name":"boldColumn","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":false,"type":{"name":"enum","raw":"BoldColumn","value":[{"value":"\"first\""},{"value":"\"second\""},{"value":"\"none\""}]}},"description":{"defaultValue":null,"description":"Sets content of the <dd> tag.","name":"description","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":true,"type":{"name":"ReactNode"}},"format":{"defaultValue":null,"description":"Formatted or non-formatted visual variants","name":"format","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":false,"type":{"name":"enum","raw":"Formats","value":[{"value":"\"formatted\""},{"value":"\"non-formatted\""}]}},"separator":{"defaultValue":null,"description":"Character separator for non-formatted format","name":"separator","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":false,"type":{"name":"string"}},"term":{"defaultValue":null,"description":"Sets content of the <dt> tag.","name":"term","parent":{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"},"declarations":[{"fileName":"src/components/Duolist/Duolist.tsx","name":"DuolistGroupProps"}],"required":true,"type":{"name":"ReactNode"}}}}
@@ -1,2 +1,2 @@
1
- import t from"react";import r from"classnames";import e from"./styles.module.scss";import{AnalyticsId as g}from"../../constants.js";import{S as x}from"../../Spacer.js";import"../Spacer/styles.module.scss";const S=a=>{const{boldColumn:d="first",description:n,term:o}=a,s=d==="first",i=r(e.duolist__dt,{[e["duolist__dt--bold"]]:s}),m=r(e.duolist__dd,{[e["duolist__dd--bold"]]:!s});return t.createElement(t.Fragment,null,t.createElement("dt",{className:i},o),t.createElement("dd",{className:m},n))},G=a=>{const{boldColumn:d,border:n="no-border",descriptionWidth:o,label:s,variant:i="normal",children:m,className:b,testId:C}=a,u=n==="border",c=i==="line",E=u&&(s||c),N=r(e["duolist-wrapper"],{[e["duolist-wrapper--border"]]:u,[e["duolist-wrapper--extra-padding-top"]]:E},b),_=r(e.duolist,{[e["duolist--line"]]:c}),y=o?o+"%":"minmax(60%, 1fr)";return t.createElement("div",{className:N,"data-testid":C,"data-analyticsid":g.Duolist},s&&t.createElement(t.Fragment,null,s,t.createElement(x,null)),t.createElement("dl",{style:{gridTemplateColumns:`auto ${y}`},className:_},t.Children.map(m,l=>{var f;if(l===null||typeof l>"u")return;const p=l;if(p.type===S)return t.cloneElement(l,{boldColumn:(f=p.props.boldColumn)!=null?f:d})})))};export{G as Duolist,S as DuolistGroup,G as default};
1
+ import t from"react";import c from"classnames";import o from"./styles.module.scss";import{AnalyticsId as S}from"../../constants.js";import{S as B}from"../../Spacer.js";import"../Spacer/styles.module.scss";const D=u=>{const{format:n="formatted",boldColumn:a=n==="non-formatted"?"none":"first",description:d,separator:r=": ",term:l}=u,p=a==="first",f=a==="second",e=n==="non-formatted",_=c(o.duolist__dt,{[o["duolist__dt--bold"]]:p,[o["duolist__dt--non-formatted"]]:e}),C=c(o.duolist__dd,{[o["duolist__dd--bold"]]:f,[o["duolist__dd--non-formatted"]]:e}),s=()=>t.createElement(t.Fragment,null,t.createElement("dt",{"data-separator":e?r:void 0,className:_},l),t.createElement("dd",{className:C},d));return e?t.createElement("div",{className:o["duolist__content-wrapper"]},s()):t.createElement(t.Fragment,null,s())},L=u=>{const{boldColumn:n,border:a="no-border",descriptionWidth:d,label:r,format:l="formatted",separator:p,variant:f="normal",children:e,className:_,testId:C}=u,s=a==="border",b=f==="line",v=s&&(r||b),E=l==="non-formatted",F=c(o["duolist-wrapper"],{[o["duolist-wrapper--border"]]:s,[o["duolist-wrapper--extra-padding-top"]]:v},_),w=c(o.duolist,{[o["duolist--line"]]:b,[o["duolist--non-formatted"]]:E}),x=d?d+"%":"minmax(60%, 1fr)";return t.createElement("div",{className:F,"data-testid":C,"data-analyticsid":S.Duolist},r&&t.createElement(t.Fragment,null,r,t.createElement(B,null)),t.createElement("dl",{style:E?void 0:{gridTemplateColumns:`auto ${x}`},className:w},t.Children.map(e,m=>{var N,y,g;if(m===null||typeof m>"u")return;const i=m;if(i.type===D)return t.cloneElement(m,{boldColumn:(N=i.props.boldColumn)!=null?N:n,format:(y=i.props.format)!=null?y:l,separator:(g=i.props.separator)!=null?g:p})})))};export{L as Duolist,D as DuolistGroup,L as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Duolist/Duolist.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nimport duolistStyles from './styles.module.scss';\nimport { AnalyticsId } from '../../constants';\nimport { TitleProps } from '../Title';\nimport Spacer from '../Spacer';\n\nexport type DuolistVariants = 'normal' | 'line';\nexport type BoldColumn = 'first' | 'second';\nexport type Border = 'no-border' | 'border';\n\ninterface DuolistProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Label of the Duolist */\n border?: Border;\n /** Label of the Duolist */\n label?: TitleProps;\n /** Sets the visual variant of the Duolist. */\n variant?: DuolistVariants;\n /** Sets the content of the Duolist. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Width of the description column in percentage */\n descriptionWidth?: number;\n}\n\ninterface DuolistGroupProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Sets content of the <dd> tag. */\n description: React.ReactNode;\n /** Sets content of the <dt> tag. */\n term: React.ReactNode;\n}\n\nexport const DuolistGroup: React.FC<DuolistGroupProps> = props => {\n const { boldColumn = 'first', description, term } = props;\n\n const firstBold = boldColumn === 'first';\n\n const dtClassNames = classNames(duolistStyles['duolist__dt'], { [duolistStyles['duolist__dt--bold']]: firstBold });\n const ddClassNames = classNames(duolistStyles['duolist__dd'], { [duolistStyles['duolist__dd--bold']]: !firstBold });\n\n return (\n <>\n <dt className={dtClassNames}>{term}</dt>\n <dd className={ddClassNames}>{description}</dd>\n </>\n );\n};\n\nexport const Duolist: React.FC<DuolistProps> = props => {\n const { boldColumn, border = 'no-border', descriptionWidth, label, variant = 'normal', children, className, testId } = props;\n\n const hasBorder = border === 'border';\n const hasLines = variant === 'line';\n const extraPaddingTop = hasBorder && (label || hasLines);\n\n const duolistWrapperClasses = classNames(\n duolistStyles['duolist-wrapper'],\n {\n [duolistStyles['duolist-wrapper--border']]: hasBorder,\n [duolistStyles['duolist-wrapper--extra-padding-top']]: extraPaddingTop,\n },\n className\n );\n\n const duolistClasses = classNames(duolistStyles.duolist, {\n [duolistStyles['duolist--line']]: hasLines,\n });\n const duolistColumnStyle = descriptionWidth ? descriptionWidth + '%' : 'minmax(60%, 1fr)';\n\n return (\n <div className={duolistWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.Duolist}>\n {label && (\n <>\n {label}\n <Spacer />\n </>\n )}\n <dl style={{ gridTemplateColumns: `auto ${duolistColumnStyle}` }} className={duolistClasses}>\n {React.Children.map(children, (child: React.ReactNode | React.ReactElement<DuolistGroupProps>) => {\n if (child === null || typeof child === 'undefined') return;\n const duolistGroup = child as React.ReactElement<DuolistGroupProps>;\n if (duolistGroup.type === DuolistGroup) {\n return React.cloneElement(child as React.ReactElement<DuolistGroupProps>, {\n boldColumn: duolistGroup.props.boldColumn ?? boldColumn,\n });\n }\n })}\n </dl>\n </div>\n );\n};\n\nexport default Duolist;\n"],"names":["DuolistGroup","props","boldColumn","description","term","firstBold","dtClassNames","classNames","duolistStyles","ddClassNames","React","Duolist","border","descriptionWidth","label","variant","children","className","testId","hasBorder","hasLines","extraPaddingTop","duolistWrapperClasses","duolistClasses","duolistColumnStyle","AnalyticsId","Spacer","child","duolistGroup","_a"],"mappings":"6MAwCO,MAAMA,EAAqDC,GAAA,CAChE,KAAM,CAAE,WAAAC,EAAa,QAAS,YAAAC,EAAa,KAAAC,GAASH,EAE9CI,EAAYH,IAAe,QAE3BI,EAAeC,EAAWC,EAAc,YAAgB,CAAE,CAACA,EAAc,sBAAuBH,CAAA,CAAW,EAC3GI,EAAeF,EAAWC,EAAc,YAAgB,CAAE,CAACA,EAAc,sBAAuB,CAACH,CAAW,CAAA,EAElH,uCAEKK,EAAA,cAAA,KAAA,CAAG,UAAWJ,CAAe,EAAAF,CAAK,EAClCM,EAAA,cAAA,KAAA,CAAG,UAAWD,CAAA,EAAeN,CAAY,CAC5C,CAEJ,EAEaQ,EAA2CV,GAAA,CAChD,KAAA,CAAE,WAAAC,EAAY,OAAAU,EAAS,YAAa,iBAAAC,EAAkB,MAAAC,EAAO,QAAAC,EAAU,SAAU,SAAAC,EAAU,UAAAC,EAAW,OAAAC,CAAA,EAAWjB,EAEjHkB,EAAYP,IAAW,SACvBQ,EAAWL,IAAY,OACvBM,EAAkBF,IAAcL,GAASM,GAEzCE,EAAwBf,EAC5BC,EAAc,mBACd,CACE,CAACA,EAAc,4BAA6BW,EAC5C,CAACX,EAAc,uCAAwCa,CACzD,EACAJ,CAAA,EAGIM,EAAiBhB,EAAWC,EAAc,QAAS,CACvD,CAACA,EAAc,kBAAmBY,CAAA,CACnC,EACKI,EAAqBX,EAAmBA,EAAmB,IAAM,mBAEvE,OACGH,EAAA,cAAA,MAAA,CAAI,UAAWY,EAAuB,cAAaJ,EAAQ,mBAAkBO,EAAY,OAAA,EACvFX,GAEIJ,EAAA,cAAAA,EAAA,SAAA,KAAAI,kBACAY,EAAO,IAAA,CACV,EAEDhB,EAAA,cAAA,KAAA,CAAG,MAAO,CAAE,oBAAqB,QAAQc,GAAqB,EAAG,UAAWD,CAAA,EAC1Eb,EAAM,SAAS,IAAIM,EAAWW,GAAmE,OAC5F,GAAAA,IAAU,MAAQ,OAAOA,EAAU,IAAa,OACpD,MAAMC,EAAeD,EACjB,GAAAC,EAAa,OAAS5B,EACjB,OAAAU,EAAM,aAAaiB,EAAgD,CACxE,YAAYE,EAAAD,EAAa,MAAM,aAAnB,KAAAC,EAAiC3B,CAAA,CAC9C,CAEJ,CAAA,CACH,CACF,CAEJ"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Duolist/Duolist.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nimport duolistStyles from './styles.module.scss';\nimport { AnalyticsId } from '../../constants';\nimport { TitleProps } from '../Title';\nimport Spacer from '../Spacer';\n\nexport type DuolistVariants = 'normal' | 'line';\nexport type BoldColumn = 'first' | 'second' | 'none';\nexport type Border = 'no-border' | 'border';\nexport type Formats = 'formatted' | 'non-formatted';\n\ninterface DuolistProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Label of the Duolist */\n border?: Border;\n /** Label of the Duolist */\n label?: TitleProps;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets the visual variant of the Duolist. */\n variant?: DuolistVariants;\n /** Sets the content of the Duolist. */\n children: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Width of the description column in percentage */\n descriptionWidth?: number;\n}\n\ninterface DuolistGroupProps {\n /** Determines which column is bold */\n boldColumn?: BoldColumn;\n /** Sets content of the <dd> tag. */\n description: React.ReactNode;\n /** Formatted or non-formatted visual variants */\n format?: Formats;\n /** Character separator for non-formatted format */\n separator?: string;\n /** Sets content of the <dt> tag. */\n term: React.ReactNode;\n}\n\nexport const DuolistGroup: React.FC<DuolistGroupProps> = props => {\n const { format = 'formatted', boldColumn = format === 'non-formatted' ? 'none' : 'first', description, separator = ': ', term } = props;\n\n const firstBold = boldColumn === 'first';\n const secondBold = boldColumn === 'second';\n const nonFormatted = format === 'non-formatted';\n\n const dtClassNames = classNames(duolistStyles['duolist__dt'], {\n [duolistStyles['duolist__dt--bold']]: firstBold,\n [duolistStyles['duolist__dt--non-formatted']]: nonFormatted,\n });\n const ddClassNames = classNames(duolistStyles['duolist__dd'], {\n [duolistStyles['duolist__dd--bold']]: secondBold,\n [duolistStyles['duolist__dd--non-formatted']]: nonFormatted,\n });\n\n const renderContent = () => {\n return (\n <>\n <dt data-separator={nonFormatted ? separator : undefined} className={dtClassNames}>\n {term}\n </dt>\n <dd className={ddClassNames}>{description}</dd>\n </>\n );\n };\n\n return nonFormatted ? <div className={duolistStyles['duolist__content-wrapper']}>{renderContent()}</div> : <>{renderContent()}</>;\n};\n\nexport const Duolist: React.FC<DuolistProps> = props => {\n const {\n boldColumn,\n border = 'no-border',\n descriptionWidth,\n label,\n format = 'formatted',\n separator,\n variant = 'normal',\n children,\n className,\n testId,\n } = props;\n\n const hasBorder = border === 'border';\n const hasLines = variant === 'line';\n const extraPaddingTop = hasBorder && (label || hasLines);\n const nonFormatted = format === 'non-formatted';\n\n const duolistWrapperClasses = classNames(\n duolistStyles['duolist-wrapper'],\n {\n [duolistStyles['duolist-wrapper--border']]: hasBorder,\n [duolistStyles['duolist-wrapper--extra-padding-top']]: extraPaddingTop,\n },\n className\n );\n\n const duolistClasses = classNames(duolistStyles.duolist, {\n [duolistStyles['duolist--line']]: hasLines,\n [duolistStyles['duolist--non-formatted']]: nonFormatted,\n });\n const duolistColumnStyle = descriptionWidth ? descriptionWidth + '%' : 'minmax(60%, 1fr)';\n\n return (\n <div className={duolistWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.Duolist}>\n {label && (\n <>\n {label}\n <Spacer />\n </>\n )}\n <dl style={!nonFormatted ? { gridTemplateColumns: `auto ${duolistColumnStyle}` } : undefined} className={duolistClasses}>\n {React.Children.map(children, (child: React.ReactNode | React.ReactElement<DuolistGroupProps>) => {\n if (child === null || typeof child === 'undefined') return;\n const duolistGroup = child as React.ReactElement<DuolistGroupProps>;\n if (duolistGroup.type === DuolistGroup) {\n return React.cloneElement(child as React.ReactElement<DuolistGroupProps>, {\n boldColumn: duolistGroup.props.boldColumn ?? boldColumn,\n format: duolistGroup.props.format ?? format,\n separator: duolistGroup.props.separator ?? separator,\n });\n }\n })}\n </dl>\n </div>\n );\n};\n\nexport default Duolist;\n"],"names":["DuolistGroup","props","format","boldColumn","description","separator","term","firstBold","secondBold","nonFormatted","dtClassNames","classNames","duolistStyles","ddClassNames","renderContent","React","Duolist","border","descriptionWidth","label","variant","children","className","testId","hasBorder","hasLines","extraPaddingTop","duolistWrapperClasses","duolistClasses","duolistColumnStyle","AnalyticsId","Spacer","child","duolistGroup","_a","_b","_c"],"mappings":"6MAiDO,MAAMA,EAAqDC,GAAA,CAChE,KAAM,CAAE,OAAAC,EAAS,YAAa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,EAAA,cAAA,MAAA,CAAI,UAAWY,EAAuB,cAAaJ,EAAQ,mBAAkBO,EAAY,OAAA,EACvFX,GAEIJ,EAAA,cAAAA,EAAA,SAAA,KAAAI,kBACAY,EAAO,IAAA,CACV,EAEDhB,EAAA,cAAA,KAAA,CAAG,MAAQN,EAAuE,OAAxD,CAAE,oBAAqB,QAAQoB,GAAyB,EAAW,UAAWD,CAAA,EACtGb,EAAM,SAAS,IAAIM,EAAWW,GAAmE,WAC5F,GAAAA,IAAU,MAAQ,OAAOA,EAAU,IAAa,OACpD,MAAMC,EAAeD,EACjB,GAAAC,EAAa,OAASjC,EACjB,OAAAe,EAAM,aAAaiB,EAAgD,CACxE,YAAYE,EAAAD,EAAa,MAAM,aAAnB,KAAAC,EAAiC/B,EAC7C,QAAQgC,EAAAF,EAAa,MAAM,SAAnB,KAAAE,EAA6BjC,EACrC,WAAWkC,EAAAH,EAAa,MAAM,YAAnB,KAAAG,EAAgC/B,CAAA,CAC5C,CAEJ,CAAA,CACH,CACF,CAEJ"}
@@ -23,6 +23,10 @@
23
23
  font-size: $font-size-md;
24
24
  }
25
25
 
26
+ &__content-wrapper {
27
+ display: inline-block;
28
+ }
29
+
26
30
  &__dt,
27
31
  &__dd {
28
32
  line-height: $lineheight-size-md;
@@ -36,6 +40,10 @@
36
40
  font-weight: 600;
37
41
  line-height: $lineheight-size-sm;
38
42
  }
43
+
44
+ &--non-formatted {
45
+ display: inline;
46
+ }
39
47
  }
40
48
 
41
49
  &__dt {
@@ -44,6 +52,14 @@
44
52
  @media (min-width: map-get($grid-breakpoints, sm)) {
45
53
  padding-right: 2.6669rem;
46
54
  }
55
+
56
+ &--non-formatted {
57
+ padding-right: 0;
58
+ }
59
+ &--non-formatted#{&}::after {
60
+ content: attr(data-separator);
61
+ font-weight: 400;
62
+ }
47
63
  }
48
64
 
49
65
  &__dd {
@@ -61,4 +77,8 @@
61
77
  border-bottom: 0.062rem solid $neutral200;
62
78
  }
63
79
  }
80
+
81
+ &--non-formatted {
82
+ display: unset;
83
+ }
64
84
  }
@@ -1,10 +1,14 @@
1
1
  export type Styles = {
2
2
  duolist: string;
3
+ 'duolist__content-wrapper': string;
3
4
  duolist__dd: string;
4
5
  'duolist__dd--bold': string;
6
+ 'duolist__dd--non-formatted': string;
5
7
  duolist__dt: string;
6
8
  'duolist__dt--bold': string;
9
+ 'duolist__dt--non-formatted': string;
7
10
  'duolist--line': string;
11
+ 'duolist--non-formatted': string;
8
12
  'duolist-wrapper--border': string;
9
13
  'duolist-wrapper--extra-padding-top': string;
10
14
  };
@@ -270,4 +270,8 @@ export default {
270
270
  personcancel: { alternativeName: 'Person Avbryt', categories: 'Generisk, Tjeneste' },
271
271
  travelroute: { alternativeName: 'Reiserute', categories: 'Generisk, Tjeneste' },
272
272
  coins: { alternativeName: 'Mynter', categories: 'Generisk, Tjeneste' },
273
+ hearthands: { alternativeName: 'Hjertehender', categories: 'System, Generisk' },
274
+ trianglex: { alternativeName: 'TriangelX', categories: 'System, Generisk' },
275
+ login: { alternativeName: 'Logg inn', categories: 'System, Generisk' },
276
+ logout: { alternativeName: 'Logg ut', categories: 'System, Generisk' },
273
277
  };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SvgPathProps } from './Icon';
3
+ declare const HeartHands: React.FC<SvgPathProps>;
4
+ export default HeartHands;
5
+ //# sourceMappingURL=HeartHands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeartHands.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/HeartHands.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAoDtC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import c from"react";const t=({isHovered:a})=>{const l=c.createElement(c.Fragment,null,c.createElement("path",{"fill-rule":"evenodd",d:"M44.057 31.263a.65.65 0 0 1 .557.731l-.644-.087.644.088V32l-.002.006-.002.015a2.415 2.415 0 0 1-.039.183 3.317 3.317 0 0 1-.149.445 4.07 4.07 0 0 1-.854 1.285c-.91.934-2.51 1.746-5.26 1.694a.65.65 0 0 1 .024-1.3c2.47.047 3.695-.675 4.305-1.301.313-.321.487-.64.583-.873a2.02 2.02 0 0 0 .105-.332l.002-.009a.65.65 0 0 1 .73-.55ZM32.248 12.707c-.758-.18-1.292-.269-1.523-.26-.374.015-.935.265-1.638.77-.676.485-1.389 1.136-2.046 1.801a33.767 33.767 0 0 0-2.295 2.584l-.034.043-.008.01-.002.002a.65.65 0 0 1-1.024-.8l.512.4-.512-.4.004-.005.01-.013.037-.047.141-.175a35.144 35.144 0 0 1 2.246-2.513c.682-.69 1.453-1.397 2.213-1.943.734-.528 1.564-.983 2.346-1.013.44-.017 1.147.121 1.874.294.758.18 1.635.425 2.462.668a105.89 105.89 0 0 1 3.075.958l.068.022-.197.597.197-.597a.65.65 0 1 1-.409 1.234l-.065-.021-.188-.062a109.453 109.453 0 0 0-2.848-.884c-.818-.24-1.67-.477-2.396-.65ZM4.673 31.812a.65.65 0 0 0-1.287.182l.644-.087-.644.088V32l.001.006.003.015a1.59 1.59 0 0 0 .039.183c.028.113.075.266.149.445.148.36.407.826.854 1.285.91.934 2.51 1.746 5.26 1.694a.65.65 0 0 0-.024-1.3c-2.47.047-3.695-.675-4.305-1.301a2.771 2.771 0 0 1-.583-.873 2.02 2.02 0 0 1-.105-.332l-.002-.009Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M15.451 11.442c.727-.173 1.435-.31 1.873-.294h.001c.782.03 1.612.485 2.346 1.013.76.546 1.531 1.254 2.213 1.943a35.06 35.06 0 0 1 2.387 2.688l.037.047.01.013.003.003v.001l-.51.401.51-.4a.65.65 0 0 1-1.023.8l-.002-.002-.008-.01-.034-.043-.134-.166a33.76 33.76 0 0 0-2.161-2.418c-.657-.665-1.37-1.316-2.046-1.802-.703-.504-1.264-.754-1.638-.77-.231-.008-.765.08-1.522.261-.727.173-1.58.41-2.397.65a104.693 104.693 0 0 0-2.848.884l-.188.062-.064.021a.65.65 0 0 1-.41-1.234l.204.618-.205-.618.069-.022.191-.063a106.721 106.721 0 0 1 2.884-.895 50.95 50.95 0 0 1 2.462-.668Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M35.234 11.057c2.107.773 4.203 1.638 4.975 2.024.864.432 1.912 1.496 2.915 2.708.738.891 1.4 1.797 1.903 2.486.17.232.322.44.453.615a.65.65 0 1 0 1.04-.78c-.118-.157-.26-.352-.423-.575a53.814 53.814 0 0 0-1.971-2.575c-.997-1.205-2.2-2.474-3.335-3.042-.841-.42-2.995-1.305-5.11-2.081a56.13 56.13 0 0 0-3.025-1.026c-.45-.135-.864-.248-1.22-.328-.343-.078-.673-.133-.936-.133-.193 0-.369.06-.494.114a3.1 3.1 0 0 0-.418.225c-.28.176-.602.419-.942.702a24.993 24.993 0 0 0-2.249 2.168c-.764.828-1.507 1.73-2.063 2.564a8.474 8.474 0 0 0-.69 1.216c-.167.375-.294.778-.294 1.16v6c0 .535.42.8.713.889.302.09.645.073.97-.008.667-.167 1.424-.644 2.008-1.52a5.647 5.647 0 0 0 .813-1.797l.02-.072c.11-.382.194-.64.586-1.032.377-.377 1.072-.722 1.977-.9a6.782 6.782 0 0 1 2.905.071c1.734.434 3.008 1.818 3.008 3.87 0 1.368-.46 3.012-1.297 4.566-.836 1.552-2.02 2.963-3.414 3.893-1.371.914-2.636 1.616-3.715 2.215l-.24.132c-1.094.608-2.065 1.155-2.644 1.734l-.03.03c-.48.481-.939.939-1.239 1.688-.297.744-.421 1.722-.421 3.242v.401l.36.18c.71.355 1.438.286 2.11.047.654-.233 1.323-.651 1.978-1.088l.552-.371c1.187-.806 2.421-1.642 3.828-2.044.183-.052.369-.107.56-.163 2.425-.71 5.507-1.613 8.971.119 1.735.868 2.812 1.871 3.75 3.28a.65.65 0 0 0 1.082-.722c-1.062-1.592-2.308-2.75-4.25-3.72-3.94-1.97-7.49-.923-9.899-.211l-.57.167c-1.626.464-3.05 1.432-4.224 2.232-.18.122-.353.24-.521.352-.658.438-1.207.77-1.694.944-.286.102-.522.139-.728.12.025-1.176.144-1.834.323-2.282.194-.485.474-.774.982-1.282.42-.42 1.2-.874 2.356-1.516l.243-.135c1.076-.597 2.384-1.323 3.802-2.268 1.605-1.07 2.922-2.659 3.836-4.357.913-1.696 1.453-3.552 1.453-5.183 0-2.696-1.726-4.564-3.992-5.131a8.084 8.084 0 0 0-3.472-.085c-1.053.207-2.023.633-2.646 1.256-.608.608-.774 1.1-.915 1.594l-.021.073c-.113.4-.229.808-.645 1.432-.416.625-.909.897-1.242.98a1.18 1.18 0 0 1-.067.015V16.5c0-.117.045-.325.182-.632a7.2 7.2 0 0 1 .584-1.024c.506-.759 1.201-1.607 1.937-2.403a23.678 23.678 0 0 1 2.126-2.051c.316-.264.588-.467.8-.6a1.85 1.85 0 0 1 .26-.14c.12.006.322.036.613.101.314.07.697.174 1.13.305.864.26 1.903.617 2.952 1.002ZM30.56 9.644h-.001Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M12.766 11.057c-2.107.773-4.203 1.638-4.975 2.024-.864.432-1.912 1.496-2.915 2.708-.738.891-1.4 1.797-1.903 2.486-.17.232-.322.44-.453.615a.65.65 0 1 1-1.04-.78c.118-.157.26-.352.423-.575.505-.69 1.205-1.65 1.971-2.575.997-1.205 2.2-2.474 3.335-3.042.841-.42 2.995-1.305 5.11-2.081a56.13 56.13 0 0 1 3.025-1.026c.45-.135.864-.248 1.22-.328.343-.078.673-.133.936-.133.193 0 .369.06.494.114a3.1 3.1 0 0 1 .418.225c.28.176.602.419.942.702a24.993 24.993 0 0 1 2.249 2.168c.764.828 1.507 1.73 2.063 2.564.278.417.517.83.69 1.216.167.375.294.778.294 1.16v6c0 .535-.42.8-.713.889-.302.09-.645.073-.97-.008-.667-.167-1.424-.644-2.008-1.52a5.647 5.647 0 0 1-.813-1.797l-.02-.072c-.11-.382-.194-.64-.586-1.032-.377-.377-1.072-.722-1.977-.9a6.782 6.782 0 0 0-2.905.071c-1.734.434-3.008 1.818-3.008 3.87 0 1.368.46 3.012 1.297 4.566.836 1.552 2.02 2.963 3.414 3.893 1.371.914 2.636 1.616 3.715 2.215l.24.132c1.094.608 2.065 1.155 2.644 1.734l.03.03c.48.481.939.939 1.239 1.688.297.744.421 1.722.421 3.242v.401l-.36.18c-.71.355-1.438.286-2.11.047-.654-.233-1.323-.651-1.978-1.088l-.552-.371c-1.187-.806-2.421-1.642-3.828-2.044a82.95 82.95 0 0 1-.56-.163c-2.425-.71-5.506-1.613-8.971.119-1.736.868-2.812 1.871-3.75 3.28a.65.65 0 1 1-1.082-.722c1.062-1.592 2.309-2.75 4.25-3.72 3.94-1.97 7.49-.923 9.899-.211l.57.167c1.626.464 3.05 1.432 4.224 2.232.18.122.353.24.521.352.658.438 1.207.77 1.694.944.286.102.522.139.728.12-.025-1.176-.144-1.834-.323-2.282-.194-.485-.474-.774-.982-1.282-.42-.42-1.2-.874-2.356-1.516l-.243-.135c-1.076-.597-2.384-1.323-3.801-2.268-1.606-1.07-2.923-2.659-3.837-4.357C10.89 25.487 10.35 23.63 10.35 22c0-2.696 1.726-4.564 3.992-5.131a8.084 8.084 0 0 1 3.472-.085c1.053.207 2.023.633 2.646 1.256.608.608.774 1.1.915 1.594l.021.073c.113.4.229.808.645 1.432.416.625.909.897 1.242.98l.067.015V16.5c0-.117-.045-.325-.182-.632a7.198 7.198 0 0 0-.584-1.024c-.506-.759-1.201-1.607-1.937-2.403a23.678 23.678 0 0 0-2.126-2.051 7.803 7.803 0 0 0-.8-.6 1.85 1.85 0 0 0-.26-.14 4.04 4.04 0 0 0-.613.101c-.314.07-.697.174-1.13.305-.864.26-1.903.617-2.952 1.002Zm4.674-1.413h.001Z","clip-rule":"evenodd"})),e=c.createElement(c.Fragment,null,c.createElement("path",{"fill-rule":"evenodd",d:"M3.946 31.352a.65.65 0 0 1 .701.59v.002l.003.02a3.43 3.43 0 0 0 .107.483c.098.325.275.758.59 1.185.604.823 1.79 1.724 4.2 1.678a.65.65 0 0 1 .663.637c.007.36-.304.587-.662.594-2.81.054-4.38-.957-5.25-2.139a5.201 5.201 0 0 1-.913-2.116 3.376 3.376 0 0 1-.03-.207l-.002-.016v-.007s0-.002.647-.056l-.648.054a.65.65 0 0 1 .594-.702Zm40.758 0a.65.65 0 0 0-.701.59v.002l-.003.02a3.423 3.423 0 0 1-.108.483 3.902 3.902 0 0 1-.588 1.185c-.605.823-1.79 1.682-4.202 1.636-.358-.007-.655.32-.662.68-.007.358.303.58.663.586 2.808.054 4.378-.95 5.248-2.132a5.2 5.2 0 0 0 .914-2.116 3.476 3.476 0 0 0 .03-.207l.002-.016v-.007s0-.002-.647-.056l.648.054a.65.65 0 0 0-.594-.702Zm-29.263-19.91c.727-.173 1.435-.31 1.873-.294h.001c.782.03 1.612.485 2.346 1.013.76.546 1.53 1.254 2.212 1.943a35.144 35.144 0 0 1 2.388 2.688l.037.047.01.013.003.003v.001l-.511.401.512-.4a.65.65 0 0 1-1.024.8l-.002-.002-.009-.01-.033-.043a33.453 33.453 0 0 0-.631-.764 33.767 33.767 0 0 0-1.664-1.82c-.657-.665-1.37-1.316-2.047-1.802-.702-.504-1.263-.754-1.637-.77-.232-.008-.765.08-1.523.261-.726.173-1.578.41-2.396.65a104.474 104.474 0 0 0-2.848.884l-.188.062-.065.021-.198-.596.198.596a.65.65 0 0 1-.41-1.234l.205.617-.205-.617.069-.022.191-.063a106.335 106.335 0 0 1 2.884-.895 50.978 50.978 0 0 1 2.462-.668Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M32.238 12.707c-.758-.18-1.291-.269-1.523-.26-.374.015-.935.265-1.637.77-.677.485-1.39 1.136-2.047 1.801a33.767 33.767 0 0 0-2.295 2.584l-.034.043-.008.01-.002.002a.65.65 0 0 1-1.024-.8l.512.4-.512-.4.001-.002.003-.003.01-.013.037-.047.141-.175c.123-.15.299-.365.518-.622.436-.512 1.044-1.2 1.729-1.891.681-.69 1.452-1.397 2.212-1.943.734-.528 1.564-.983 2.346-1.013.44-.017 1.147.121 1.874.294.758.18 1.635.425 2.462.668a105.701 105.701 0 0 1 2.884.895l.191.063.069.022-.198.597.198-.597a.65.65 0 0 1-.41 1.234l.096-.288-.096.288-.065-.021-.188-.062a107.318 107.318 0 0 0-2.848-.884c-.818-.24-1.67-.477-2.396-.65Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M12.766 11.057c-2.107.773-4.203 1.638-4.975 2.024-.864.432-1.912 1.496-2.915 2.708-.738.891-1.4 1.797-1.903 2.486-.17.232-.322.44-.453.615a.65.65 0 1 1-1.04-.78c.118-.157.26-.352.423-.575.505-.69 1.205-1.65 1.971-2.575.997-1.205 2.2-2.474 3.335-3.042.841-.42 2.995-1.305 5.11-2.081a56.13 56.13 0 0 1 3.025-1.026c.45-.135.864-.248 1.22-.328.343-.078.673-.133.936-.133.193 0 .369.06.494.114a3.1 3.1 0 0 1 .418.225c.28.176.602.419.942.702a24.993 24.993 0 0 1 2.249 2.168c.764.828 1.507 1.73 2.063 2.564.278.417.517.83.69 1.216.167.375.294.778.294 1.16v6c0 .535-.42.8-.713.889-.302.09-.645.073-.97-.008-.667-.167-1.424-.644-2.008-1.52a5.647 5.647 0 0 1-.813-1.797l-.02-.072c-.11-.382-.194-.64-.586-1.032-.377-.377-1.072-.722-1.977-.9a6.782 6.782 0 0 0-2.905.071c-1.734.434-3.008 1.818-3.008 3.87 0 2.747 1.308 4.89 3.823 7.553l.006.007.006.007c2.5 2.8 4.989 5.487 5.975 6.473.132.132.274.27.421.412.632.61 1.364 1.318 1.864 2.15.655 1.093.935 2.414.372 4.103l-.12.358-.37.074c-.796.16-1.59-.009-2.331-.32-.74-.31-1.476-.78-2.178-1.292a46.554 46.554 0 0 1-1.61-1.245l-.458-.364c-.672-.531-1.299-1.008-1.884-1.359a15.12 15.12 0 0 0-4.315-1.727c-1.712-.382-3.515-.41-5.095.267-1.372.588-2.277 1.357-3.215 2.763a.65.65 0 1 1-1.082-.72c1.063-1.595 2.157-2.54 3.785-3.238 1.92-.823 4.024-.757 5.89-.341a16.42 16.42 0 0 1 4.7 1.881c.665.399 1.35.922 2.022 1.454l.478.38c.52.414 1.033.823 1.548 1.198.673.489 1.313.892 1.916 1.145.443.185.84.279 1.2.279.274-1.106.053-1.925-.368-2.627-.403-.67-.976-1.227-1.596-1.828a43.749 43.749 0 0 1-.494-.484c-1.013-1.013-3.52-3.722-6.019-6.52-2.58-2.734-4.171-5.189-4.171-8.44 0-2.695 1.726-4.563 3.992-5.13a8.084 8.084 0 0 1 3.472-.085c1.053.207 2.023.633 2.646 1.256.608.608.774 1.1.915 1.594l.021.073c.113.4.229.808.645 1.432.416.625.909.897 1.242.98l.067.015V16.5c0-.117-.045-.325-.182-.632a7.198 7.198 0 0 0-.584-1.024c-.506-.759-1.201-1.607-1.937-2.403a23.678 23.678 0 0 0-2.126-2.051 7.803 7.803 0 0 0-.8-.6 1.85 1.85 0 0 0-.26-.14 4.04 4.04 0 0 0-.613.101c-.314.07-.697.174-1.13.305-.864.26-1.903.617-2.952 1.002Zm4.674-1.413h.001Z","clip-rule":"evenodd"}),c.createElement("path",{"fill-rule":"evenodd",d:"M35.234 11.057c2.107.773 4.203 1.638 4.975 2.024.864.432 1.912 1.496 2.915 2.708.738.891 1.4 1.797 1.903 2.486.17.232.322.44.453.615a.65.65 0 1 0 1.04-.78c-.118-.157-.26-.352-.423-.575a53.814 53.814 0 0 0-1.971-2.575c-.997-1.205-2.2-2.474-3.335-3.042-.841-.42-2.995-1.305-5.11-2.081a56.13 56.13 0 0 0-3.025-1.026c-.45-.135-.864-.248-1.22-.328-.343-.078-.673-.133-.936-.133-.193 0-.369.06-.494.114a3.1 3.1 0 0 0-.418.225c-.28.176-.602.419-.942.702a24.993 24.993 0 0 0-2.249 2.168c-.764.828-1.507 1.73-2.063 2.564a8.474 8.474 0 0 0-.69 1.216c-.167.375-.294.778-.294 1.16v6c0 .535.42.8.713.889.302.09.645.073.97-.008.667-.167 1.424-.644 2.008-1.52a5.647 5.647 0 0 0 .813-1.797l.02-.072c.11-.382.194-.64.586-1.032.377-.377 1.072-.722 1.977-.9a6.782 6.782 0 0 1 2.905.071c1.734.434 3.008 1.818 3.008 3.87 0 2.747-1.308 4.89-3.823 7.553l-.006.007-.006.007c-2.5 2.8-4.989 5.487-5.975 6.473-.132.132-.274.27-.421.412-.632.61-1.364 1.318-1.864 2.15-.655 1.093-.935 2.414-.372 4.103l.12.358.37.074c.796.16 1.59-.009 2.331-.32.74-.31 1.476-.78 2.178-1.292a46.554 46.554 0 0 0 1.61-1.245l.458-.364c.672-.531 1.299-1.008 1.884-1.359a15.12 15.12 0 0 1 4.315-1.727c1.712-.382 3.515-.41 5.095.267 1.372.588 2.278 1.357 3.215 2.763a.65.65 0 0 0 1.082-.72c-1.063-1.595-2.157-2.54-3.785-3.238-1.92-.823-4.024-.757-5.89-.341a16.42 16.42 0 0 0-4.7 1.881c-.665.399-1.35.922-2.022 1.454l-.478.38c-.52.414-1.033.823-1.548 1.198-.673.489-1.313.892-1.916 1.145-.443.185-.84.279-1.2.279-.274-1.106-.053-1.925.368-2.627.403-.67.976-1.227 1.596-1.828.162-.157.327-.317.494-.484 1.013-1.013 3.52-3.722 6.019-6.52 2.58-2.734 4.171-5.189 4.171-8.44 0-2.695-1.726-4.563-3.992-5.13a8.084 8.084 0 0 0-3.472-.085c-1.053.207-2.023.633-2.646 1.256-.608.608-.774 1.1-.915 1.594l-.021.073c-.113.4-.229.808-.645 1.432-.416.625-.909.897-1.242.98a1.18 1.18 0 0 1-.067.015V16.5c0-.117.045-.325.182-.632a7.2 7.2 0 0 1 .584-1.024c.506-.759 1.201-1.607 1.937-2.403a23.678 23.678 0 0 1 2.126-2.051c.316-.264.588-.467.8-.6a1.85 1.85 0 0 1 .26-.14c.12.006.322.036.613.101.314.07.697.174 1.13.305.864.26 1.903.617 2.952 1.002ZM30.56 9.644h-.001Z","clip-rule":"evenodd"}));return a?e:l};export{t as default};
2
+ //# sourceMappingURL=HeartHands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeartHands.js","sources":["../../../src/components/Icons/HeartHands.tsx"],"sourcesContent":["import React from 'react';\nimport { SvgPathProps } from './Icon';\n\nconst HeartHands: React.FC<SvgPathProps> = ({ isHovered }: SvgPathProps): JSX.Element => {\n const normal = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"M44.057 31.263a.65.65 0 0 1 .557.731l-.644-.087.644.088V32l-.002.006-.002.015a2.415 2.415 0 0 1-.039.183 3.317 3.317 0 0 1-.149.445 4.07 4.07 0 0 1-.854 1.285c-.91.934-2.51 1.746-5.26 1.694a.65.65 0 0 1 .024-1.3c2.47.047 3.695-.675 4.305-1.301.313-.321.487-.64.583-.873a2.02 2.02 0 0 0 .105-.332l.002-.009a.65.65 0 0 1 .73-.55ZM32.248 12.707c-.758-.18-1.292-.269-1.523-.26-.374.015-.935.265-1.638.77-.676.485-1.389 1.136-2.046 1.801a33.767 33.767 0 0 0-2.295 2.584l-.034.043-.008.01-.002.002a.65.65 0 0 1-1.024-.8l.512.4-.512-.4.004-.005.01-.013.037-.047.141-.175a35.144 35.144 0 0 1 2.246-2.513c.682-.69 1.453-1.397 2.213-1.943.734-.528 1.564-.983 2.346-1.013.44-.017 1.147.121 1.874.294.758.18 1.635.425 2.462.668a105.89 105.89 0 0 1 3.075.958l.068.022-.197.597.197-.597a.65.65 0 1 1-.409 1.234l-.065-.021-.188-.062a109.453 109.453 0 0 0-2.848-.884c-.818-.24-1.67-.477-2.396-.65ZM4.673 31.812a.65.65 0 0 0-1.287.182l.644-.087-.644.088V32l.001.006.003.015a1.59 1.59 0 0 0 .039.183c.028.113.075.266.149.445.148.36.407.826.854 1.285.91.934 2.51 1.746 5.26 1.694a.65.65 0 0 0-.024-1.3c-2.47.047-3.695-.675-4.305-1.301a2.771 2.771 0 0 1-.583-.873 2.02 2.02 0 0 1-.105-.332l-.002-.009Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M15.451 11.442c.727-.173 1.435-.31 1.873-.294h.001c.782.03 1.612.485 2.346 1.013.76.546 1.531 1.254 2.213 1.943a35.06 35.06 0 0 1 2.387 2.688l.037.047.01.013.003.003v.001l-.51.401.51-.4a.65.65 0 0 1-1.023.8l-.002-.002-.008-.01-.034-.043-.134-.166a33.76 33.76 0 0 0-2.161-2.418c-.657-.665-1.37-1.316-2.046-1.802-.703-.504-1.264-.754-1.638-.77-.231-.008-.765.08-1.522.261-.727.173-1.58.41-2.397.65a104.693 104.693 0 0 0-2.848.884l-.188.062-.064.021a.65.65 0 0 1-.41-1.234l.204.618-.205-.618.069-.022.191-.063a106.721 106.721 0 0 1 2.884-.895 50.95 50.95 0 0 1 2.462-.668Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M35.234 11.057c2.107.773 4.203 1.638 4.975 2.024.864.432 1.912 1.496 2.915 2.708.738.891 1.4 1.797 1.903 2.486.17.232.322.44.453.615a.65.65 0 1 0 1.04-.78c-.118-.157-.26-.352-.423-.575a53.814 53.814 0 0 0-1.971-2.575c-.997-1.205-2.2-2.474-3.335-3.042-.841-.42-2.995-1.305-5.11-2.081a56.13 56.13 0 0 0-3.025-1.026c-.45-.135-.864-.248-1.22-.328-.343-.078-.673-.133-.936-.133-.193 0-.369.06-.494.114a3.1 3.1 0 0 0-.418.225c-.28.176-.602.419-.942.702a24.993 24.993 0 0 0-2.249 2.168c-.764.828-1.507 1.73-2.063 2.564a8.474 8.474 0 0 0-.69 1.216c-.167.375-.294.778-.294 1.16v6c0 .535.42.8.713.889.302.09.645.073.97-.008.667-.167 1.424-.644 2.008-1.52a5.647 5.647 0 0 0 .813-1.797l.02-.072c.11-.382.194-.64.586-1.032.377-.377 1.072-.722 1.977-.9a6.782 6.782 0 0 1 2.905.071c1.734.434 3.008 1.818 3.008 3.87 0 1.368-.46 3.012-1.297 4.566-.836 1.552-2.02 2.963-3.414 3.893-1.371.914-2.636 1.616-3.715 2.215l-.24.132c-1.094.608-2.065 1.155-2.644 1.734l-.03.03c-.48.481-.939.939-1.239 1.688-.297.744-.421 1.722-.421 3.242v.401l.36.18c.71.355 1.438.286 2.11.047.654-.233 1.323-.651 1.978-1.088l.552-.371c1.187-.806 2.421-1.642 3.828-2.044.183-.052.369-.107.56-.163 2.425-.71 5.507-1.613 8.971.119 1.735.868 2.812 1.871 3.75 3.28a.65.65 0 0 0 1.082-.722c-1.062-1.592-2.308-2.75-4.25-3.72-3.94-1.97-7.49-.923-9.899-.211l-.57.167c-1.626.464-3.05 1.432-4.224 2.232-.18.122-.353.24-.521.352-.658.438-1.207.77-1.694.944-.286.102-.522.139-.728.12.025-1.176.144-1.834.323-2.282.194-.485.474-.774.982-1.282.42-.42 1.2-.874 2.356-1.516l.243-.135c1.076-.597 2.384-1.323 3.802-2.268 1.605-1.07 2.922-2.659 3.836-4.357.913-1.696 1.453-3.552 1.453-5.183 0-2.696-1.726-4.564-3.992-5.131a8.084 8.084 0 0 0-3.472-.085c-1.053.207-2.023.633-2.646 1.256-.608.608-.774 1.1-.915 1.594l-.021.073c-.113.4-.229.808-.645 1.432-.416.625-.909.897-1.242.98a1.18 1.18 0 0 1-.067.015V16.5c0-.117.045-.325.182-.632a7.2 7.2 0 0 1 .584-1.024c.506-.759 1.201-1.607 1.937-2.403a23.678 23.678 0 0 1 2.126-2.051c.316-.264.588-.467.8-.6a1.85 1.85 0 0 1 .26-.14c.12.006.322.036.613.101.314.07.697.174 1.13.305.864.26 1.903.617 2.952 1.002ZM30.56 9.644h-.001Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M12.766 11.057c-2.107.773-4.203 1.638-4.975 2.024-.864.432-1.912 1.496-2.915 2.708-.738.891-1.4 1.797-1.903 2.486-.17.232-.322.44-.453.615a.65.65 0 1 1-1.04-.78c.118-.157.26-.352.423-.575.505-.69 1.205-1.65 1.971-2.575.997-1.205 2.2-2.474 3.335-3.042.841-.42 2.995-1.305 5.11-2.081a56.13 56.13 0 0 1 3.025-1.026c.45-.135.864-.248 1.22-.328.343-.078.673-.133.936-.133.193 0 .369.06.494.114a3.1 3.1 0 0 1 .418.225c.28.176.602.419.942.702a24.993 24.993 0 0 1 2.249 2.168c.764.828 1.507 1.73 2.063 2.564.278.417.517.83.69 1.216.167.375.294.778.294 1.16v6c0 .535-.42.8-.713.889-.302.09-.645.073-.97-.008-.667-.167-1.424-.644-2.008-1.52a5.647 5.647 0 0 1-.813-1.797l-.02-.072c-.11-.382-.194-.64-.586-1.032-.377-.377-1.072-.722-1.977-.9a6.782 6.782 0 0 0-2.905.071c-1.734.434-3.008 1.818-3.008 3.87 0 1.368.46 3.012 1.297 4.566.836 1.552 2.02 2.963 3.414 3.893 1.371.914 2.636 1.616 3.715 2.215l.24.132c1.094.608 2.065 1.155 2.644 1.734l.03.03c.48.481.939.939 1.239 1.688.297.744.421 1.722.421 3.242v.401l-.36.18c-.71.355-1.438.286-2.11.047-.654-.233-1.323-.651-1.978-1.088l-.552-.371c-1.187-.806-2.421-1.642-3.828-2.044a82.95 82.95 0 0 1-.56-.163c-2.425-.71-5.506-1.613-8.971.119-1.736.868-2.812 1.871-3.75 3.28a.65.65 0 1 1-1.082-.722c1.062-1.592 2.309-2.75 4.25-3.72 3.94-1.97 7.49-.923 9.899-.211l.57.167c1.626.464 3.05 1.432 4.224 2.232.18.122.353.24.521.352.658.438 1.207.77 1.694.944.286.102.522.139.728.12-.025-1.176-.144-1.834-.323-2.282-.194-.485-.474-.774-.982-1.282-.42-.42-1.2-.874-2.356-1.516l-.243-.135c-1.076-.597-2.384-1.323-3.801-2.268-1.606-1.07-2.923-2.659-3.837-4.357C10.89 25.487 10.35 23.63 10.35 22c0-2.696 1.726-4.564 3.992-5.131a8.084 8.084 0 0 1 3.472-.085c1.053.207 2.023.633 2.646 1.256.608.608.774 1.1.915 1.594l.021.073c.113.4.229.808.645 1.432.416.625.909.897 1.242.98l.067.015V16.5c0-.117-.045-.325-.182-.632a7.198 7.198 0 0 0-.584-1.024c-.506-.759-1.201-1.607-1.937-2.403a23.678 23.678 0 0 0-2.126-2.051 7.803 7.803 0 0 0-.8-.6 1.85 1.85 0 0 0-.26-.14 4.04 4.04 0 0 0-.613.101c-.314.07-.697.174-1.13.305-.864.26-1.903.617-2.952 1.002Zm4.674-1.413h.001Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const normalHover = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"M3.946 31.352a.65.65 0 0 1 .701.59v.002l.003.02a3.43 3.43 0 0 0 .107.483c.098.325.275.758.59 1.185.604.823 1.79 1.724 4.2 1.678a.65.65 0 0 1 .663.637c.007.36-.304.587-.662.594-2.81.054-4.38-.957-5.25-2.139a5.201 5.201 0 0 1-.913-2.116 3.376 3.376 0 0 1-.03-.207l-.002-.016v-.007s0-.002.647-.056l-.648.054a.65.65 0 0 1 .594-.702Zm40.758 0a.65.65 0 0 0-.701.59v.002l-.003.02a3.423 3.423 0 0 1-.108.483 3.902 3.902 0 0 1-.588 1.185c-.605.823-1.79 1.682-4.202 1.636-.358-.007-.655.32-.662.68-.007.358.303.58.663.586 2.808.054 4.378-.95 5.248-2.132a5.2 5.2 0 0 0 .914-2.116 3.476 3.476 0 0 0 .03-.207l.002-.016v-.007s0-.002-.647-.056l.648.054a.65.65 0 0 0-.594-.702Zm-29.263-19.91c.727-.173 1.435-.31 1.873-.294h.001c.782.03 1.612.485 2.346 1.013.76.546 1.53 1.254 2.212 1.943a35.144 35.144 0 0 1 2.388 2.688l.037.047.01.013.003.003v.001l-.511.401.512-.4a.65.65 0 0 1-1.024.8l-.002-.002-.009-.01-.033-.043a33.453 33.453 0 0 0-.631-.764 33.767 33.767 0 0 0-1.664-1.82c-.657-.665-1.37-1.316-2.047-1.802-.702-.504-1.263-.754-1.637-.77-.232-.008-.765.08-1.523.261-.726.173-1.578.41-2.396.65a104.474 104.474 0 0 0-2.848.884l-.188.062-.065.021-.198-.596.198.596a.65.65 0 0 1-.41-1.234l.205.617-.205-.617.069-.022.191-.063a106.335 106.335 0 0 1 2.884-.895 50.978 50.978 0 0 1 2.462-.668Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M32.238 12.707c-.758-.18-1.291-.269-1.523-.26-.374.015-.935.265-1.637.77-.677.485-1.39 1.136-2.047 1.801a33.767 33.767 0 0 0-2.295 2.584l-.034.043-.008.01-.002.002a.65.65 0 0 1-1.024-.8l.512.4-.512-.4.001-.002.003-.003.01-.013.037-.047.141-.175c.123-.15.299-.365.518-.622.436-.512 1.044-1.2 1.729-1.891.681-.69 1.452-1.397 2.212-1.943.734-.528 1.564-.983 2.346-1.013.44-.017 1.147.121 1.874.294.758.18 1.635.425 2.462.668a105.701 105.701 0 0 1 2.884.895l.191.063.069.022-.198.597.198-.597a.65.65 0 0 1-.41 1.234l.096-.288-.096.288-.065-.021-.188-.062a107.318 107.318 0 0 0-2.848-.884c-.818-.24-1.67-.477-2.396-.65Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M12.766 11.057c-2.107.773-4.203 1.638-4.975 2.024-.864.432-1.912 1.496-2.915 2.708-.738.891-1.4 1.797-1.903 2.486-.17.232-.322.44-.453.615a.65.65 0 1 1-1.04-.78c.118-.157.26-.352.423-.575.505-.69 1.205-1.65 1.971-2.575.997-1.205 2.2-2.474 3.335-3.042.841-.42 2.995-1.305 5.11-2.081a56.13 56.13 0 0 1 3.025-1.026c.45-.135.864-.248 1.22-.328.343-.078.673-.133.936-.133.193 0 .369.06.494.114a3.1 3.1 0 0 1 .418.225c.28.176.602.419.942.702a24.993 24.993 0 0 1 2.249 2.168c.764.828 1.507 1.73 2.063 2.564.278.417.517.83.69 1.216.167.375.294.778.294 1.16v6c0 .535-.42.8-.713.889-.302.09-.645.073-.97-.008-.667-.167-1.424-.644-2.008-1.52a5.647 5.647 0 0 1-.813-1.797l-.02-.072c-.11-.382-.194-.64-.586-1.032-.377-.377-1.072-.722-1.977-.9a6.782 6.782 0 0 0-2.905.071c-1.734.434-3.008 1.818-3.008 3.87 0 2.747 1.308 4.89 3.823 7.553l.006.007.006.007c2.5 2.8 4.989 5.487 5.975 6.473.132.132.274.27.421.412.632.61 1.364 1.318 1.864 2.15.655 1.093.935 2.414.372 4.103l-.12.358-.37.074c-.796.16-1.59-.009-2.331-.32-.74-.31-1.476-.78-2.178-1.292a46.554 46.554 0 0 1-1.61-1.245l-.458-.364c-.672-.531-1.299-1.008-1.884-1.359a15.12 15.12 0 0 0-4.315-1.727c-1.712-.382-3.515-.41-5.095.267-1.372.588-2.277 1.357-3.215 2.763a.65.65 0 1 1-1.082-.72c1.063-1.595 2.157-2.54 3.785-3.238 1.92-.823 4.024-.757 5.89-.341a16.42 16.42 0 0 1 4.7 1.881c.665.399 1.35.922 2.022 1.454l.478.38c.52.414 1.033.823 1.548 1.198.673.489 1.313.892 1.916 1.145.443.185.84.279 1.2.279.274-1.106.053-1.925-.368-2.627-.403-.67-.976-1.227-1.596-1.828a43.749 43.749 0 0 1-.494-.484c-1.013-1.013-3.52-3.722-6.019-6.52-2.58-2.734-4.171-5.189-4.171-8.44 0-2.695 1.726-4.563 3.992-5.13a8.084 8.084 0 0 1 3.472-.085c1.053.207 2.023.633 2.646 1.256.608.608.774 1.1.915 1.594l.021.073c.113.4.229.808.645 1.432.416.625.909.897 1.242.98l.067.015V16.5c0-.117-.045-.325-.182-.632a7.198 7.198 0 0 0-.584-1.024c-.506-.759-1.201-1.607-1.937-2.403a23.678 23.678 0 0 0-2.126-2.051 7.803 7.803 0 0 0-.8-.6 1.85 1.85 0 0 0-.26-.14 4.04 4.04 0 0 0-.613.101c-.314.07-.697.174-1.13.305-.864.26-1.903.617-2.952 1.002Zm4.674-1.413h.001Z\"\n clip-rule=\"evenodd\"\n />\n <path\n fill-rule=\"evenodd\"\n d=\"M35.234 11.057c2.107.773 4.203 1.638 4.975 2.024.864.432 1.912 1.496 2.915 2.708.738.891 1.4 1.797 1.903 2.486.17.232.322.44.453.615a.65.65 0 1 0 1.04-.78c-.118-.157-.26-.352-.423-.575a53.814 53.814 0 0 0-1.971-2.575c-.997-1.205-2.2-2.474-3.335-3.042-.841-.42-2.995-1.305-5.11-2.081a56.13 56.13 0 0 0-3.025-1.026c-.45-.135-.864-.248-1.22-.328-.343-.078-.673-.133-.936-.133-.193 0-.369.06-.494.114a3.1 3.1 0 0 0-.418.225c-.28.176-.602.419-.942.702a24.993 24.993 0 0 0-2.249 2.168c-.764.828-1.507 1.73-2.063 2.564a8.474 8.474 0 0 0-.69 1.216c-.167.375-.294.778-.294 1.16v6c0 .535.42.8.713.889.302.09.645.073.97-.008.667-.167 1.424-.644 2.008-1.52a5.647 5.647 0 0 0 .813-1.797l.02-.072c.11-.382.194-.64.586-1.032.377-.377 1.072-.722 1.977-.9a6.782 6.782 0 0 1 2.905.071c1.734.434 3.008 1.818 3.008 3.87 0 2.747-1.308 4.89-3.823 7.553l-.006.007-.006.007c-2.5 2.8-4.989 5.487-5.975 6.473-.132.132-.274.27-.421.412-.632.61-1.364 1.318-1.864 2.15-.655 1.093-.935 2.414-.372 4.103l.12.358.37.074c.796.16 1.59-.009 2.331-.32.74-.31 1.476-.78 2.178-1.292a46.554 46.554 0 0 0 1.61-1.245l.458-.364c.672-.531 1.299-1.008 1.884-1.359a15.12 15.12 0 0 1 4.315-1.727c1.712-.382 3.515-.41 5.095.267 1.372.588 2.278 1.357 3.215 2.763a.65.65 0 0 0 1.082-.72c-1.063-1.595-2.157-2.54-3.785-3.238-1.92-.823-4.024-.757-5.89-.341a16.42 16.42 0 0 0-4.7 1.881c-.665.399-1.35.922-2.022 1.454l-.478.38c-.52.414-1.033.823-1.548 1.198-.673.489-1.313.892-1.916 1.145-.443.185-.84.279-1.2.279-.274-1.106-.053-1.925.368-2.627.403-.67.976-1.227 1.596-1.828.162-.157.327-.317.494-.484 1.013-1.013 3.52-3.722 6.019-6.52 2.58-2.734 4.171-5.189 4.171-8.44 0-2.695-1.726-4.563-3.992-5.13a8.084 8.084 0 0 0-3.472-.085c-1.053.207-2.023.633-2.646 1.256-.608.608-.774 1.1-.915 1.594l-.021.073c-.113.4-.229.808-.645 1.432-.416.625-.909.897-1.242.98a1.18 1.18 0 0 1-.067.015V16.5c0-.117.045-.325.182-.632a7.2 7.2 0 0 1 .584-1.024c.506-.759 1.201-1.607 1.937-2.403a23.678 23.678 0 0 1 2.126-2.051c.316-.264.588-.467.8-.6a1.85 1.85 0 0 1 .26-.14c.12.006.322.036.613.101.314.07.697.174 1.13.305.864.26 1.903.617 2.952 1.002ZM30.56 9.644h-.001Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n return isHovered ? normalHover : normal;\n};\n\nexport default HeartHands;\n"],"names":["HeartHands","isHovered","normal","React","normalHover"],"mappings":"qBAGA,MAAMA,EAAqC,CAAC,CAAE,UAAAC,KAA2C,CACjF,MAAAC,kCAEDC,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,gqCACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4jBACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,6jEACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,kiEACF,YAAU,SACZ,CAAA,CACF,EAGIC,kCAEDD,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,8vCACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,ymBACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,qhEACF,YAAU,SAAA,CACZ,EACCA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,ijEACF,YAAU,SACZ,CAAA,CACF,EAGF,OAAOF,EAAYG,EAAcF,CACnC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SvgPathProps } from './Icon';
3
+ declare const Login: React.FC<SvgPathProps>;
4
+ export default Login;
5
+ //# sourceMappingURL=Login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/Login.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE/C,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8CjC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{getIcon as o}from"./Icon.js";import"classnames";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";const E=({size:l,isHovered:t})=>{const a=e.createElement(e.Fragment,null,e.createElement("path",{d:"M18.05 20.5v-9.39l16.4-2.589v30.957l-16.4-2.589v-8.39h-1.3v8.646a1 1 0 0 0 .844.988l17 2.684a1 1 0 0 0 1.156-.987V8.17a1 1 0 0 0-1.156-.988l-17 2.685a1 1 0 0 0-.844.987V20.5h1.3Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M26.673 24.936H8.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"})),r=e.createElement(e.Fragment,null,e.createElement("path",{d:"M18.05 20.5v-9.39l16.4-2.589v30.957l-16.4-2.589v-8.39h-1.3v8.646a1 1 0 0 0 .844.988l17 2.684a1 1 0 0 0 1.156-.987V8.17a1 1 0 0 0-1.156-.988l-17 2.685a1 1 0 0 0-.844.987V20.5h1.3Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M29.673 24.936H11.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"})),n=e.createElement(e.Fragment,null,e.createElement("path",{d:"M18.392 20.5v-9.097l15.716-2.481v30.156l-15.716-2.481V28.5H16.75v8.42c0 .622.452 1.151 1.066 1.248L34.29 40.77a1.263 1.263 0 0 0 1.46-1.248V8.478c0-.776-.693-1.368-1.46-1.247l-16.474 2.6a1.263 1.263 0 0 0-1.066 1.248V20.5h1.642Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M26.673 24.936H8.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"})),m=e.createElement(e.Fragment,null,e.createElement("path",{d:"M18.392 20.5v-9.097l15.716-2.481v30.156l-15.716-2.481V28.5H16.75v8.42c0 .622.452 1.151 1.066 1.248L34.29 40.77a1.263 1.263 0 0 0 1.46-1.248V8.478c0-.776-.693-1.368-1.46-1.247l-16.474 2.6a1.263 1.263 0 0 0-1.066 1.248V20.5h1.642Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M29.673 24.936H11.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"}));return o(l,t,a,r,n,m)};export{E as default};
2
+ //# sourceMappingURL=Login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Login.js","sources":["../../../src/components/Icons/Login.tsx"],"sourcesContent":["import React from 'react';\nimport { getIcon, SvgPathProps } from './Icon';\n\nconst Login: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): JSX.Element => {\n const normal = (\n <>\n <path d=\"M18.05 20.5v-9.39l16.4-2.589v30.957l-16.4-2.589v-8.39h-1.3v8.646a1 1 0 0 0 .844.988l17 2.684a1 1 0 0 0 1.156-.987V8.17a1 1 0 0 0-1.156-.988l-17 2.685a1 1 0 0 0-.844.987V20.5h1.3Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M26.673 24.936H8.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const normalHover = (\n <>\n <path d=\"M18.05 20.5v-9.39l16.4-2.589v30.957l-16.4-2.589v-8.39h-1.3v8.646a1 1 0 0 0 .844.988l17 2.684a1 1 0 0 0 1.156-.987V8.17a1 1 0 0 0-1.156-.988l-17 2.685a1 1 0 0 0-.844.987V20.5h1.3Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M29.673 24.936H11.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmall = (\n <>\n <path d=\"M18.392 20.5v-9.097l15.716-2.481v30.156l-15.716-2.481V28.5H16.75v8.42c0 .622.452 1.151 1.066 1.248L34.29 40.77a1.263 1.263 0 0 0 1.46-1.248V8.478c0-.776-.693-1.368-1.46-1.247l-16.474 2.6a1.263 1.263 0 0 0-1.066 1.248V20.5h1.642Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M26.673 24.936H8.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmallHover = (\n <>\n <path d=\"M18.392 20.5v-9.097l15.716-2.481v30.156l-15.716-2.481V28.5H16.75v8.42c0 .622.452 1.151 1.066 1.248L34.29 40.77a1.263 1.263 0 0 0 1.46-1.248V8.478c0-.776-.693-1.368-1.46-1.247l-16.474 2.6a1.263 1.263 0 0 0-1.066 1.248V20.5h1.642Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M29.673 24.936H11.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n return getIcon(size, isHovered, normal, normalHover, xSmall, xSmallHover);\n};\n\nexport default Login;\n"],"names":["Login","size","isHovered","normal","React","normalHover","xSmall","xSmallHover","getIcon"],"mappings":"+LAGA,MAAMA,EAAgC,CAAC,CAAE,KAAAC,EAAM,UAAAC,KAA2C,CAClF,MAAAC,kCAEDC,EAAA,cAAA,OAAA,CAAK,EAAE,oLAAA,CAAqL,EAC5LA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4HACF,YAAU,SACZ,CAAA,CACF,EAGIC,kCAEDD,EAAA,cAAA,OAAA,CAAK,EAAE,oLAAA,CAAqL,EAC5LA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,6HACF,YAAU,SACZ,CAAA,CACF,EAGIE,kCAEDF,EAAA,cAAA,OAAA,CAAK,EAAE,sOAAA,CAAuO,EAC9OA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4HACF,YAAU,SACZ,CAAA,CACF,EAGIG,kCAEDH,EAAA,cAAA,OAAA,CAAK,EAAE,sOAAA,CAAuO,EAC9OA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,6HACF,YAAU,SACZ,CAAA,CACF,EAGF,OAAOI,EAAQP,EAAMC,EAAWC,EAAQE,EAAaC,EAAQC,CAAW,CAC1E"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SvgPathProps } from './Icon';
3
+ declare const Logout: React.FC<SvgPathProps>;
4
+ export default Logout;
5
+ //# sourceMappingURL=Logout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logout.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/Logout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE/C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8ClC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{getIcon as m}from"./Icon.js";import"classnames";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";const E=({size:l,isHovered:t})=>{const a=e.createElement(e.Fragment,null,e.createElement("path",{d:"M12.05 39.478V8.521l16.4 2.59V20.5h1.3v-9.646a1 1 0 0 0-.844-.987l-17-2.685a1 1 0 0 0-1.156.988v31.66a1 1 0 0 0 1.156.987l17-2.684a1 1 0 0 0 .844-.988V28.5h-1.3v8.389l-16.4 2.59Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M38.673 24.936H20.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"})),r=e.createElement(e.Fragment,null,e.createElement("path",{d:"M12.05 39.478V8.521l16.4 2.59V20.5h1.3v-9.646a1 1 0 0 0-.844-.987l-17-2.685a1 1 0 0 0-1.156.988v31.66a1 1 0 0 0 1.156.987l17-2.684a1 1 0 0 0 .844-.988V28.5h-1.3v8.389l-16.4 2.59Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M41.673 24.936H23.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z","clip-rule":"evenodd"})),n=e.createElement(e.Fragment,null,e.createElement("path",{d:"M12.392 39.078V8.922l15.716 2.481V20.5h1.642v-9.42c0-.622-.452-1.151-1.066-1.248L12.21 7.23a1.263 1.263 0 0 0-1.46 1.247v31.044c0 .776.694 1.369 1.46 1.248l16.474-2.602a1.263 1.263 0 0 0 1.066-1.247V28.5h-1.642v8.097l-15.716 2.481Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M38.673 24.936H20.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.92-.92 3.879-3.878Z","clip-rule":"evenodd"})),o=e.createElement(e.Fragment,null,e.createElement("path",{d:"M12.392 39.078V8.922l15.716 2.481V20.5h1.642v-9.42c0-.622-.452-1.151-1.066-1.248L12.21 7.23a1.263 1.263 0 0 0-1.46 1.247v31.044c0 .776.694 1.369 1.46 1.248l16.474-2.602a1.263 1.263 0 0 0 1.066-1.247V28.5h-1.642v8.097l-15.716 2.481Z"}),e.createElement("path",{"fill-rule":"evenodd",d:"M41.673 24.936H23.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.92-.92 3.879-3.878Z","clip-rule":"evenodd"}));return m(l,t,a,r,n,o)};export{E as default};
2
+ //# sourceMappingURL=Logout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logout.js","sources":["../../../src/components/Icons/Logout.tsx"],"sourcesContent":["import React from 'react';\nimport { getIcon, SvgPathProps } from './Icon';\n\nconst Logout: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): JSX.Element => {\n const normal = (\n <>\n <path d=\"M12.05 39.478V8.521l16.4 2.59V20.5h1.3v-9.646a1 1 0 0 0-.844-.987l-17-2.685a1 1 0 0 0-1.156.988v31.66a1 1 0 0 0 1.156.987l17-2.684a1 1 0 0 0 .844-.988V28.5h-1.3v8.389l-16.4 2.59Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M38.673 24.936H20.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const normalHover = (\n <>\n <path d=\"M12.05 39.478V8.521l16.4 2.59V20.5h1.3v-9.646a1 1 0 0 0-.844-.987l-17-2.685a1 1 0 0 0-1.156.988v31.66a1 1 0 0 0 1.156.987l17-2.684a1 1 0 0 0 .844-.988V28.5h-1.3v8.389l-16.4 2.59Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M41.673 24.936H23.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.919-.92 3.878-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmall = (\n <>\n <path d=\"M12.392 39.078V8.922l15.716 2.481V20.5h1.642v-9.42c0-.622-.452-1.151-1.066-1.248L12.21 7.23a1.263 1.263 0 0 0-1.46 1.247v31.044c0 .776.694 1.369 1.46 1.248l16.474-2.602a1.263 1.263 0 0 0 1.066-1.247V28.5h-1.642v8.097l-15.716 2.481Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M38.673 24.936H20.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.92-.92 3.879-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmallHover = (\n <>\n <path d=\"M12.392 39.078V8.922l15.716 2.481V20.5h1.642v-9.42c0-.622-.452-1.151-1.066-1.248L12.21 7.23a1.263 1.263 0 0 0-1.46 1.247v31.044c0 .776.694 1.369 1.46 1.248l16.474-2.602a1.263 1.263 0 0 0 1.066-1.247V28.5h-1.642v8.097l-15.716 2.481Z\" />\n <path\n fill-rule=\"evenodd\"\n d=\"M41.673 24.936H23.188v-1.3h18.449l-3.778-3.779.919-.92 4.907 4.906a.653.653 0 0 1 0 .92l-4.971 4.971-.92-.92 3.879-3.878Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n return getIcon(size, isHovered, normal, normalHover, xSmall, xSmallHover);\n};\n\nexport default Logout;\n"],"names":["Logout","size","isHovered","normal","React","normalHover","xSmall","xSmallHover","getIcon"],"mappings":"+LAGA,MAAMA,EAAiC,CAAC,CAAE,KAAAC,EAAM,UAAAC,KAA2C,CACnF,MAAAC,kCAEDC,EAAA,cAAA,OAAA,CAAK,EAAE,oLAAA,CAAqL,EAC5LA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,6HACF,YAAU,SACZ,CAAA,CACF,EAGIC,kCAEDD,EAAA,cAAA,OAAA,CAAK,EAAE,oLAAA,CAAqL,EAC5LA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,6HACF,YAAU,SACZ,CAAA,CACF,EAGIE,kCAEDF,EAAA,cAAA,OAAA,CAAK,EAAE,yOAAA,CAA0O,EACjPA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4HACF,YAAU,SACZ,CAAA,CACF,EAGIG,kCAEDH,EAAA,cAAA,OAAA,CAAK,EAAE,yOAAA,CAA0O,EACjPA,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4HACF,YAAU,SACZ,CAAA,CACF,EAGF,OAAOI,EAAQP,EAAMC,EAAWC,EAAQE,EAAaC,EAAQC,CAAW,CAC1E"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SvgPathProps } from './Icon';
3
+ declare const TrangleX: React.FC<SvgPathProps>;
4
+ export default TrangleX;
5
+ //# sourceMappingURL=TrangleX.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrangleX.d.ts","sourceRoot":"","sources":["../../../src/components/Icons/TrangleX.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE/C,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA0CpC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import{getIcon as o}from"./Icon.js";import"classnames";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";const Z=({size:l,isHovered:t})=>{const a=e.createElement(e.Fragment,null,e.createElement("path",{"fill-rule":"evenodd",d:"m24 7 19 33.712H5L24 7Zm-5.792 17.951a1.185 1.185 0 1 1 1.676-1.675l4.01 4.01 3.895-3.895a1.19 1.19 0 0 1 1.683 1.683l-3.895 3.895 4.387 4.387a1.185 1.185 0 0 1-1.675 1.675l-4.387-4.386-4.503 4.502a1.19 1.19 0 0 1-1.683-1.683l4.503-4.502-4.01-4.011Z","clip-rule":"evenodd"})),r=e.createElement(e.Fragment,null,e.createElement("path",{"fill-rule":"evenodd",d:"m24 7 19 33.712H5L24 7Zm-4.243 19.433a1.185 1.185 0 0 1 1.676-1.676l2.563 2.564 2.564-2.564a1.19 1.19 0 0 1 1.683 1.683l-2.564 2.564 2.564 2.563a1.184 1.184 0 1 1-1.676 1.676l-2.563-2.564-2.564 2.564a1.19 1.19 0 1 1-1.683-1.683l2.564-2.564-2.564-2.563Z","clip-rule":"evenodd"})),n=e.createElement(e.Fragment,null,e.createElement("path",{"fill-rule":"evenodd",d:"m24 7.5 19 33.712H5L24 7.5Zm-5.792 17.95a1.185 1.185 0 0 1 1.676-1.676l4.01 4.01 3.895-3.894a1.19 1.19 0 1 1 1.683 1.683l-3.895 3.895 4.387 4.387a1.184 1.184 0 1 1-1.675 1.675l-4.387-4.387-4.502 4.502a1.19 1.19 0 1 1-1.683-1.683l4.502-4.502-4.01-4.01Z","clip-rule":"evenodd"})),m=e.createElement(e.Fragment,null,e.createElement("path",{"fill-rule":"evenodd",d:"m24 7.5 19 33.712H5L24 7.5Zm-4.243 19.433a1.185 1.185 0 0 1 1.676-1.675l2.563 2.564 2.564-2.564a1.19 1.19 0 0 1 1.683 1.683l-2.564 2.564 2.564 2.563a1.185 1.185 0 0 1-1.676 1.675l-2.563-2.563-2.564 2.564a1.19 1.19 0 1 1-1.683-1.683l2.564-2.564-2.564-2.564Z","clip-rule":"evenodd"}));return o(l,t,a,r,n,m)};export{Z as default};
2
+ //# sourceMappingURL=TrangleX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrangleX.js","sources":["../../../src/components/Icons/TrangleX.tsx"],"sourcesContent":["import React from 'react';\nimport { getIcon, SvgPathProps } from './Icon';\n\nconst TrangleX: React.FC<SvgPathProps> = ({ size, isHovered }: SvgPathProps): JSX.Element => {\n const normal = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"m24 7 19 33.712H5L24 7Zm-5.792 17.951a1.185 1.185 0 1 1 1.676-1.675l4.01 4.01 3.895-3.895a1.19 1.19 0 0 1 1.683 1.683l-3.895 3.895 4.387 4.387a1.185 1.185 0 0 1-1.675 1.675l-4.387-4.386-4.503 4.502a1.19 1.19 0 0 1-1.683-1.683l4.503-4.502-4.01-4.011Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const normalHover = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"m24 7 19 33.712H5L24 7Zm-4.243 19.433a1.185 1.185 0 0 1 1.676-1.676l2.563 2.564 2.564-2.564a1.19 1.19 0 0 1 1.683 1.683l-2.564 2.564 2.564 2.563a1.184 1.184 0 1 1-1.676 1.676l-2.563-2.564-2.564 2.564a1.19 1.19 0 1 1-1.683-1.683l2.564-2.564-2.564-2.563Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmall = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"m24 7.5 19 33.712H5L24 7.5Zm-5.792 17.95a1.185 1.185 0 0 1 1.676-1.676l4.01 4.01 3.895-3.894a1.19 1.19 0 1 1 1.683 1.683l-3.895 3.895 4.387 4.387a1.184 1.184 0 1 1-1.675 1.675l-4.387-4.387-4.502 4.502a1.19 1.19 0 1 1-1.683-1.683l4.502-4.502-4.01-4.01Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n const xSmallHover = (\n <>\n <path\n fill-rule=\"evenodd\"\n d=\"m24 7.5 19 33.712H5L24 7.5Zm-4.243 19.433a1.185 1.185 0 0 1 1.676-1.675l2.563 2.564 2.564-2.564a1.19 1.19 0 0 1 1.683 1.683l-2.564 2.564 2.564 2.563a1.185 1.185 0 0 1-1.676 1.675l-2.563-2.563-2.564 2.564a1.19 1.19 0 1 1-1.683-1.683l2.564-2.564-2.564-2.564Z\"\n clip-rule=\"evenodd\"\n />\n </>\n );\n\n return getIcon(size, isHovered, normal, normalHover, xSmall, xSmallHover);\n};\n\nexport default TrangleX;\n"],"names":["TrangleX","size","isHovered","normal","React","normalHover","xSmall","xSmallHover","getIcon"],"mappings":"+LAGA,MAAMA,EAAmC,CAAC,CAAE,KAAAC,EAAM,UAAAC,KAA2C,CACrF,MAAAC,kCAEDC,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,4PACF,YAAU,SACZ,CAAA,CACF,EAGIC,kCAEDD,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,+PACF,YAAU,SACZ,CAAA,CACF,EAGIE,kCAEDF,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,8PACF,YAAU,SACZ,CAAA,CACF,EAGIG,kCAEDH,EAAA,cAAA,OAAA,CACC,YAAU,UACV,EAAE,mQACF,YAAU,SACZ,CAAA,CACF,EAGF,OAAOI,EAAQP,EAAMC,EAAWC,EAAQE,EAAaC,EAAQC,CAAW,CAC1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAe,MAAM,iBAAiB,CAAC;AAiB5D,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SA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C,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAClC,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sGAAsG;IACtG,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAiDD,QAAA,MAAM,KAAK,uFAuMT,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -20,9 +20,6 @@
20
20
  @media (min-width: map-get($grid-breakpoints, md)) {
21
21
  padding: getSpacer(m) getSpacer(m) getSpacer(l) getSpacer(m);
22
22
  }
23
- @media (min-width: map-get($grid-breakpoints, lg)) {
24
- padding: getSpacer(l) getSpacer(m) getSpacer(l) getSpacer(m);
25
- }
26
23
  }
27
24
 
28
25
  @mixin hover-and-focus-effects($background-color, $box-shadow-color) {
@@ -43,7 +40,7 @@
43
40
  box-sizing: border-box;
44
41
 
45
42
  &__container {
46
- @media (min-width: map-get($grid-breakpoints, sm)) {
43
+ @media (min-width: map-get($grid-breakpoints, md)) {
47
44
  display: flex;
48
45
  flex-direction: row;
49
46
  flex: 1;
@@ -69,13 +66,19 @@
69
66
 
70
67
  &__icon {
71
68
  padding-right: getSpacer(s);
69
+
70
+ @media (min-width: map-get($grid-breakpoints, md)) {
71
+ padding-right: getSpacer(l);
72
+ }
73
+
72
74
  &--right {
73
75
  padding-left: getSpacer(s);
74
76
  }
75
77
  }
76
78
 
77
79
  &__badge {
78
- margin-left: getSpacer(2xs);
80
+ display: inline-block;
81
+ vertical-align: text-bottom;
79
82
  }
80
83
 
81
84
  &__content-left {
@@ -312,11 +315,18 @@
312
315
  }
313
316
 
314
317
  &__title-container {
315
- display: flex;
316
- align-items: center;
317
318
  padding-bottom: getSpacer(s);
318
319
  }
319
320
 
321
+ &__title {
322
+ vertical-align: top;
323
+ display: inline;
324
+
325
+ &--badge {
326
+ padding-right: getSpacer(2xs);
327
+ }
328
+ }
329
+
320
330
  &--layout3a {
321
331
  flex: 0.6;
322
332
  }
@@ -34,6 +34,8 @@ export type Styles = {
34
34
  'panel--white': string;
35
35
  'panel--with-icon': string;
36
36
  'panel-content-a': string;
37
+ 'panel-content-a__title': string;
38
+ 'panel-content-a__title--badge': string;
37
39
  'panel-content-a__title-container': string;
38
40
  'panel-content-a--layout3a': string;
39
41
  'panel-content-a--layout3b': string;
@@ -6,8 +6,8 @@ interface SliderProps {
6
6
  labelLeft?: string;
7
7
  /** Adds the right hand label to the element. */
8
8
  labelRight?: string;
9
- /** Decides the number of steps for each movement of the slider. */
10
- step?: number;
9
+ /** Sets aria-label of the slider. */
10
+ ariaLabel?: string;
11
11
  /** Disables the slider element. */
12
12
  disabled?: boolean;
13
13
  /** Function to be called when the value state has changed. */
@@ -15,6 +15,6 @@ interface SliderProps {
15
15
  /** Sets the data-testid attribute. */
16
16
  testId?: string;
17
17
  }
18
- export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLElement>>;
18
+ export declare const Slider: React.FC<SliderProps>;
19
19
  export default Slider;
20
20
  //# sourceMappingURL=Slider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAsB3D,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,MAAM,iFAwIjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA2B3D,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAOD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4KxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"props":{"title":{"defaultValue":null,"description":"Sets the title of the slider.","name":"title","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelLeft":{"defaultValue":null,"description":"Adds the left hand label to the element.","name":"labelLeft","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelRight":{"defaultValue":null,"description":"Adds the right hand label to the element.","name":"labelRight","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"step":{"defaultValue":null,"description":"Decides the number of steps for each movement of the slider.","name":"step","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"number"}},"disabled":{"defaultValue":null,"description":"Disables the slider element.","name":"disabled","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"boolean"}},"onChange":{"defaultValue":null,"description":"Function to be called when the value state has changed.","name":"onChange","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"((value: number) => void)"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}}}}
1
+ {"props":{"title":{"defaultValue":null,"description":"Sets the title of the slider.","name":"title","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelLeft":{"defaultValue":null,"description":"Adds the left hand label to the element.","name":"labelLeft","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"labelRight":{"defaultValue":null,"description":"Adds the right hand label to the element.","name":"labelRight","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"ariaLabel":{"defaultValue":null,"description":"Sets aria-label of the slider.","name":"ariaLabel","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}},"disabled":{"defaultValue":{"value":"false"},"description":"Disables the slider element.","name":"disabled","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"boolean"}},"onChange":{"defaultValue":null,"description":"Function to be called when the value state has changed.","name":"onChange","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"((value: number) => void)"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"},"declarations":[{"fileName":"src/components/Slider/Slider.tsx","name":"SliderProps"}],"required":false,"type":{"name":"string"}}}}
@@ -1,2 +1,2 @@
1
- import l,{useState as S,useRef as I,useEffect as y}from"react";import _ from"classnames";import{T as W}from"../../Title.js";import c from"./styles.module.scss";import{AnalyticsId as j}from"../../constants.js";import{useSize as O}from"../../hooks/useSize.js";import"../Title/styles.module.scss";import"../../utils/debounce.js";const L=e=>(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1),U=e=>q(e)?e.touches[0].pageX:e.pageX,q=e=>e.type==="touchcancel"||e.type==="touchend"||e.type==="touchenter"||e.type==="touchleave"||e.type==="touchmove"||e.type==="touchstart"?e.touches.length!==0:!1,G=(e,t,i,a,s)=>{const r=s-a;return(t-i)/r*e},H=(e,t,i,a,s,r)=>{const n=r-s,f=(t-i)/n,v=Math.round(e/f);return J(v,a,r)},J=(e,t,i)=>{const a=e%t;let s=e-a;const r=Math.floor(i/t)*t;if(e>r){const n=i-r;e>r+n/2&&(s=i)}return Math.round(s)},Q=(e,t,i,a)=>{let s=a+e;return s<0&&(s=0),s>t-i&&(s=t-i),s},Y=(e,t,i,a)=>{const s=t?t.getBoundingClientRect():void 0,r=s?s.left:0,n=r?e-(r+i/2):0;a(n)},Z=(e,t)=>{document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",t,!1)},ee=(e,t)=>{document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup",t,!1)},te=(e,t)=>{document.addEventListener("touchmove",e,!1),document.addEventListener("touchend",t,!1)},oe=(e,t)=>{document.removeEventListener("touchmove",e,!1),document.removeEventListener("touchend",t,!1)},ue=l.forwardRef(function(t,i){const{title:a,labelLeft:s,labelRight:r,disabled:n=!1,step:f=1,onChange:v,testId:$}=t,[p,B]=S(50),[M,k]=S(!1),[T,b]=S(0),[F,x]=S(0),N=i||I(null),g=I(null),{width:h}=O(N)||{width:0},{width:m}=O(g)||{width:0},E=0,P=100,R=o=>{C(o)},z=o=>{A(o)},D=o=>{C(o)},V=o=>{A(o)};y(()=>{b(G(p,h,m,E,P))},[p,h,m]),y(()=>{M&&(Z(R,z),te(D,V))},[M]),y(()=>{!n&&v&&v(p)},[p]);const K=o=>{if(n)return;const d=P-E,u=(h-m)/d;(o.key==="ArrowRight"||o.key==="ArrowDown")&&w(f*u),(o.key==="ArrowLeft"||o.key==="ArrowUp")&&w(-f*u)},X=o=>{var u;if(n)return;const d=U(o);Y(d,g.current,m,w),k(!0),x(d),(u=g.current)==null||u.focus(),L(o)},A=o=>{n||(k(!1),ee(R,z),oe(D,V),L(o))},C=o=>{if(n||!M)return;const u=U(o)-F;w(u),L(o)},w=o=>{if(o===0)return;const d=Q(o,h,m,T);b(d),x(d+o),B(H(d,h,m,f,E,P))};return l.createElement("div",{className:c.slider,"data-testid":$,"data-analyticsid":j.Slider},a&&l.createElement(W,{htmlMarkup:"h3",margin:1.5,appearance:"title3"},a),l.createElement("div",{ref:N,className:_(c["slider__track-wrapper"],n?c["slider__track-wrapper--disabled"]:""),onMouseDown:X,onTouchStart:X,"data-testid":"tracker"},l.createElement("div",{className:_(c.slider__track,n?c["slider__track--disabled"]:"")}),l.createElement("div",{ref:g,className:_(c.slider__trigger,n?c["slider__trigger--disabled"]:""),style:{left:`${T}px`},onKeyDown:K,role:"slider","aria-valuenow":p,"aria-valuemin":E,"aria-valuemax":P,"aria-label":`${a?a+" ":""}${s?s+" ":""}${r?r+" ":""}`,tabIndex:n?-1:0},l.createElement("div",{className:_(c["slider__trigger-inner"],n?c["slider__trigger-inner--disabled"]:"")}))),(s||r)&&l.createElement("span",{className:c.slider__options},l.createElement("p",{className:c.slider__text,"aria-hidden":!0},s),l.createElement("p",{className:c.slider__text,"aria-hidden":!0},r)))});export{ue as Slider,ue as default};
1
+ import s,{useState as U,useRef as M,useEffect as h}from"react";import P from"classnames";import{T as C}from"../../Title.js";import i from"./styles.module.scss";import{AnalyticsId as K}from"../../constants.js";import{useSize as N}from"../../hooks/useSize.js";import{useUuid as g}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as W}from"../../utils/accessibility.js";import"../Title/styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";const z=(a,k,c)=>{const[u,r]=U(a);return[u,f=>{f>c?r(c):f<k?r(k):r(f)}]},m=100,d=0,V=1,b=10,ae=({title:a,ariaLabel:k,labelLeft:c,labelRight:u,disabled:r=!1,onChange:E,testId:f})=>{const[L,y]=U(!1),[n,o]=z((m-d)/2,d,m),p=g(),w=g(),_=g(),A=M(null),v=M(null),{width:I}=N(A)||{width:0},{width:R}=N(v)||{width:0};h(()=>{const e=()=>{y(!1)};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e)}},[]);const S=e=>{var l,D;const t=(D=(l=A.current)==null?void 0:l.getBoundingClientRect().x)!=null?D:0;return Math.round((e-t)/I*(m-d))};h(()=>{const e=t=>{if(!r&&L){const l=S(t.clientX);o(l)}};return document.addEventListener("pointermove",e),()=>{document.removeEventListener("pointermove",e)}},[L]),h(()=>{!r&&E&&E(n)},[n]);const T=e=>{if(r)return;let t=!1;switch(e.key){case"ArrowLeft":case"ArrowDown":o(n-V),t=!0;break;case"PageDown":o(n-b),t=!0;break;case"ArrowRight":case"ArrowUp":o(n+V),t=!0;break;case"PageUp":o(n+b),t=!0;break;case"Home":o(d),t=!0;break;case"End":o(m),t=!0;break}t&&(e.preventDefault(),e.stopPropagation())},x=e=>{var l;if(r)return;const t=S(e.clientX);o(t),(l=v.current)==null||l.focus()},B=e=>{var t;r||(y(!0),e.preventDefault(),e.stopPropagation(),(t=v.current)==null||t.focus())},X=(I-R)/(m-d)*n,j=W({label:k,id:(()=>{if(a&&c&&u)return[p,w,_].join(" ");if(a&&c)return[p,w].join(" ");if(a&&u)return[p,_].join(" ");if(a)return p})(),prefer:"label"});return s.createElement("div",{className:i.slider,"data-testid":f,"data-analyticsid":K.Slider},a&&s.createElement(C,{htmlMarkup:"h3",margin:1.5,appearance:"title3",id:p},a),s.createElement("div",{ref:A,className:P(i["slider__track-wrapper"],r&&i["slider__track-wrapper--disabled"]),onClick:x,onPointerDown:B},s.createElement("div",{className:P(i.slider__track,r&&i["slider__track--disabled"])}),s.createElement("div",{role:"slider",ref:v,className:P(i.slider__marker,r&&i["slider__marker--disabled"]),style:{left:`${X}px`},onKeyDown:T,"aria-valuenow":n,"aria-valuemin":d,"aria-valuemax":m,tabIndex:r?void 0:0,"aria-disabled":r,...j})),(c||u)&&s.createElement("span",{className:i.slider__options},s.createElement("span",{id:w},c),s.createElement("span",{id:_},u)))};export{ae as Slider,ae as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Slider/SliderUtils.tsx","../../../src/components/Slider/Slider.tsx"],"sourcesContent":["/** Stopper MouseEvent eller TouchEvent parameter e som sendes inn fra å nå videre.*/\nexport const stopEvent = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): boolean => {\n if (e.stopPropagation) e.stopPropagation();\n if (e.preventDefault) e.preventDefault();\n return false;\n};\n\n/** Henter ut x posisjon til MouseEvent eller TouchEvent e */\nexport const getMousePosition = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): number => {\n if (isTouchEvent(e)) {\n const touch: Touch = (e as TouchEvent).touches[0];\n return touch.pageX;\n }\n return (e as MouseEvent).pageX;\n};\n\n/** Returnerer en boolean på om innsendte event e er en TouchEvent */\nexport const isTouchEvent = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): boolean => {\n if (\n e.type === 'touchcancel' ||\n e.type === 'touchend' ||\n e.type === 'touchenter' ||\n e.type === 'touchleave' ||\n e.type === 'touchmove' ||\n e.type === 'touchstart'\n ) {\n return !((e as TouchEvent).touches.length === 0);\n }\n return false;\n};\n\n/** Kalkulerer x posisjonen til slideren basert på value som sendes inn,\n * trackerWidth - bredden til trackeren, sliderWidth - bredden på slideren,\n * og min og max verdier som er satt på slider komponentet. */\nexport const calculateSliderPositionBasedOnValue = (\n value: number,\n trackerWidth: number,\n sliderWidth: number,\n min: number,\n max: number\n): number => {\n const size: number = max - min;\n const pixelPerSize: number = (trackerWidth - sliderWidth) / size;\n return pixelPerSize * value;\n};\n\n/** Kalkulerer verdi basert på sliderPosition som sendes inn,\n * trackerWidth - bredden til trackeren, sliderWidth - bredden på slideren,\n * og min og max verdier som er satt på slider komponentet. */\nexport const calculateValueBasedOnSliderPosition = (\n sliderPosition: number,\n trackerWidth: number,\n sliderWidth: number,\n step: number,\n min: number,\n max: number\n): number => {\n const size: number = max - min;\n const pixelPerSize: number = (trackerWidth - sliderWidth) / size;\n const newValue: number = Math.round(sliderPosition / pixelPerSize);\n return alignValue(newValue, step, max);\n};\n\n/** Kalkulerer modifisert value basert på step parameteret,\n * med hensyn til max verdi til slideren.\n * Med en step på 10 vil da value gå fra 0 til 10 til 20 osv. */\nexport const alignValue = (value: number, step: number, max: number): number => {\n const valModStep: number = value % step;\n let alignedValue: number = value - valModStep;\n\n const possibleMaxValueWithCurrentStep: number = Math.floor(max / step) * step;\n if (value > possibleMaxValueWithCurrentStep) {\n const diff: number = max - possibleMaxValueWithCurrentStep;\n if (value > possibleMaxValueWithCurrentStep + diff / 2) {\n alignedValue = max;\n }\n }\n\n return Math.round(alignedValue);\n};\n\n/** Kalkulerer ny x posisjon til slider basert på innsendt differanse diff,\n * nåværende sliderXPos, bredden til tracker - TrackerWidth og bredden til\n * slider - sliderWidth. */\nexport const calculateChangeOfPosition = (diff: number, trackerWidth: number, sliderWidth: number, sliderXPos: number): number => {\n let newSliderPos: number = sliderXPos + diff;\n if (newSliderPos < 0) {\n newSliderPos = 0;\n }\n if (newSliderPos > trackerWidth - sliderWidth) {\n newSliderPos = trackerWidth - sliderWidth;\n }\n return newSliderPos;\n};\n\n/** Kalkulerer posisjon til slider basert på xPos, nåværende sliderELement og\n * bredden til slider - sliderWidth */\nexport const calculateSliderTranslate = (\n xPos: number,\n sliderElement: HTMLDivElement | null,\n sliderWidth: number,\n cb: (a: number) => void\n) => {\n const elementViewportPosition = sliderElement ? sliderElement.getBoundingClientRect() : undefined;\n const sliderPageXPos = elementViewportPosition ? elementViewportPosition.left : 0;\n const diff: number = sliderPageXPos ? xPos - (sliderPageXPos + sliderWidth / 2) : 0;\n cb(diff);\n};\n\n/** Legger til mousemove og mouseup event listeners,\n * basert på moveMouseEvent og mouseUpEvent eventene */\nexport const addMouseListeners = (moveMouseEvent: (evt: MouseEvent) => void, mouseUpEvent: (evt: MouseEvent) => void): void => {\n document.addEventListener('mousemove', moveMouseEvent, false);\n document.addEventListener('mouseup', mouseUpEvent, false);\n};\n\n/** Fjerner mousemove og mouseup event listeners,\n * basert på moveMouseEvent og mouseUpEvent eventene */\nexport const removeMouseListeners = (moveMouseEvent: (evt: MouseEvent) => void, mouseUpEvent: (evt: MouseEvent) => void): void => {\n document.removeEventListener('mousemove', moveMouseEvent, false);\n document.removeEventListener('mouseup', mouseUpEvent, false);\n};\n\n/** Legger til touchmove og touchend event listeners,\n * basert på moveTouchEvent og touchUpEvent eventene */\nexport const addTouchListeners = (moveTouchEvent: (evt: TouchEvent) => void, touchUpEvent: (evt: TouchEvent) => void): void => {\n document.addEventListener('touchmove', moveTouchEvent, false);\n document.addEventListener('touchend', touchUpEvent, false);\n};\n\n/** Fjerner touchmove og touchup event listeners,\n * basert på moveTouchEvent og touchUpEvent eventene */\nexport const removeTouchListeners = (moveTouchEvent: (evt: TouchEvent) => void, touchUpEvent: (evt: TouchEvent) => void): void => {\n document.removeEventListener('touchmove', moveTouchEvent, false);\n document.removeEventListener('touchend', touchUpEvent, false);\n};\n","import React, { useEffect, useState, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport Title from '../Title';\n\nimport {\n stopEvent,\n getMousePosition,\n calculateSliderPositionBasedOnValue,\n calculateValueBasedOnSliderPosition,\n calculateChangeOfPosition,\n calculateSliderTranslate,\n addMouseListeners,\n addTouchListeners,\n removeMouseListeners,\n removeTouchListeners,\n} from './SliderUtils';\n\nimport SliderStyles from './styles.module.scss';\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tDecides the number of steps for each movement of the slider. */\n step?: number;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Slider = React.forwardRef(function SliderForwardedRef(props: SliderProps, ref: React.ForwardedRef<HTMLElement>) {\n const { title, labelLeft, labelRight, disabled = false, step = 1, onChange, testId } = props;\n const [value, setValue] = useState(50);\n const [isMouseDown, setIsMouseDown] = useState(false);\n\n const [sliderXPos, setSliderXPos] = useState(0);\n const [sliderTemporaryXPos, setSliderTemporaryXPos] = useState(0);\n const trackerRef = ref ? (ref as React.RefObject<HTMLDivElement>) : useRef<HTMLDivElement>(null);\n const sliderRef = useRef<HTMLDivElement>(null);\n const { width: trackerWidth } = useSize(trackerRef) || { width: 0 };\n const { width: sliderWidth } = useSize(sliderRef) || { width: 0 };\n const min = 0;\n const max = 100;\n\n const moveMouseEvent = (evt: MouseEvent) => {\n onMouseMove(evt);\n };\n const mouseUpEvent = (evt: MouseEvent) => {\n onMouseUp(evt);\n };\n const moveTouchEvent = (evt: TouchEvent) => {\n onMouseMove(evt);\n };\n const touchUpEvent = (evt: TouchEvent) => {\n onMouseUp(evt);\n };\n\n useEffect(() => {\n setSliderXPos(calculateSliderPositionBasedOnValue(value, trackerWidth, sliderWidth, min, max));\n }, [value, trackerWidth, sliderWidth]);\n\n useEffect(() => {\n if (isMouseDown) {\n addMouseListeners(moveMouseEvent, mouseUpEvent);\n addTouchListeners(moveTouchEvent, touchUpEvent);\n }\n }, [isMouseDown]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const onKeyDown = (evt: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const size: number = max - min;\n const pixelPerSize: number = (trackerWidth - sliderWidth) / size;\n if (evt.key === 'ArrowRight' || evt.key === 'ArrowDown') {\n updateSliderPosition(step * pixelPerSize);\n }\n if (evt.key === 'ArrowLeft' || evt.key === 'ArrowUp') {\n updateSliderPosition(-step * pixelPerSize);\n }\n };\n\n const onMouseOrTouchDown = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): void => {\n if (disabled) return;\n const updatedMousePosition: number = getMousePosition(e);\n calculateSliderTranslate(updatedMousePosition, sliderRef.current, sliderWidth, updateSliderPosition);\n setIsMouseDown(true);\n setSliderTemporaryXPos(updatedMousePosition);\n sliderRef.current?.focus();\n stopEvent(e);\n };\n\n const onMouseUp = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): void => {\n if (disabled) return;\n setIsMouseDown(false);\n removeMouseListeners(moveMouseEvent, mouseUpEvent);\n removeTouchListeners(moveTouchEvent, touchUpEvent);\n stopEvent(e);\n };\n\n const onMouseMove = (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>): void => {\n if (disabled || !isMouseDown) return;\n const updatedMousePosition: number = getMousePosition(e);\n const diff: number = updatedMousePosition - sliderTemporaryXPos;\n updateSliderPosition(diff);\n stopEvent(e);\n };\n\n const updateSliderPosition = (diff: number): void => {\n if (diff === 0) return;\n const updatedSliderPos: number = calculateChangeOfPosition(diff, trackerWidth, sliderWidth, sliderXPos);\n setSliderXPos(updatedSliderPos);\n setSliderTemporaryXPos(updatedSliderPos + diff);\n setValue(calculateValueBasedOnSliderPosition(updatedSliderPos, trackerWidth, sliderWidth, step, min, max));\n };\n\n return (\n <div className={SliderStyles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title htmlMarkup={'h3'} margin={1.5} appearance={'title3'}>\n {title}\n </Title>\n )}\n <div\n ref={trackerRef}\n className={classNames(SliderStyles['slider__track-wrapper'], disabled ? SliderStyles['slider__track-wrapper--disabled'] : '')}\n onMouseDown={onMouseOrTouchDown}\n onTouchStart={onMouseOrTouchDown}\n data-testid={'tracker'}\n >\n <div className={classNames(SliderStyles.slider__track, disabled ? SliderStyles['slider__track--disabled'] : '')} />\n <div\n ref={sliderRef}\n className={classNames(SliderStyles.slider__trigger, disabled ? SliderStyles['slider__trigger--disabled'] : '')}\n style={{\n left: `${sliderXPos}px`,\n }}\n onKeyDown={onKeyDown}\n role={'slider'}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={`${title ? title + ' ' : ''}${labelLeft ? labelLeft + ' ' : ''}${labelRight ? labelRight + ' ' : ''}`}\n tabIndex={disabled ? -1 : 0}\n >\n <div\n className={classNames(SliderStyles['slider__trigger-inner'], disabled ? SliderStyles['slider__trigger-inner--disabled'] : '')}\n />\n </div>\n </div>\n {(labelLeft || labelRight) && (\n <span className={SliderStyles.slider__options}>\n <p className={SliderStyles.slider__text} aria-hidden={true}>\n {labelLeft}\n </p>\n <p className={SliderStyles.slider__text} aria-hidden={true}>\n {labelRight}\n </p>\n </span>\n )}\n </div>\n );\n});\n\nexport default Slider;\n"],"names":["stopEvent","getMousePosition","isTouchEvent","calculateSliderPositionBasedOnValue","value","trackerWidth","sliderWidth","min","max","size","calculateValueBasedOnSliderPosition","sliderPosition","step","pixelPerSize","newValue","alignValue","valModStep","alignedValue","possibleMaxValueWithCurrentStep","diff","calculateChangeOfPosition","sliderXPos","newSliderPos","calculateSliderTranslate","xPos","sliderElement","cb","elementViewportPosition","sliderPageXPos","addMouseListeners","moveMouseEvent","mouseUpEvent","removeMouseListeners","addTouchListeners","moveTouchEvent","touchUpEvent","removeTouchListeners","Slider","React","props","ref","title","labelLeft","labelRight","disabled","onChange","testId","setValue","useState","isMouseDown","setIsMouseDown","setSliderXPos","sliderTemporaryXPos","setSliderTemporaryXPos","trackerRef","useRef","sliderRef","useSize","evt","onMouseMove","onMouseUp","useEffect","onKeyDown","updateSliderPosition","onMouseOrTouchDown","e","updatedMousePosition","_a","updatedSliderPos","SliderStyles","AnalyticsId","Title","classNames"],"mappings":"sUACa,MAAAA,EAAa,IACpB,EAAE,iBAAiB,EAAE,gBAAgB,EACrC,EAAE,gBAAgB,EAAE,eAAe,EAChC,IAIIC,EAAoB,GAC3BC,EAAa,CAAC,EACM,EAAiB,QAAQ,GAClC,MAEP,EAAiB,MAIdA,EAAgB,GAEzB,EAAE,OAAS,eACX,EAAE,OAAS,YACX,EAAE,OAAS,cACX,EAAE,OAAS,cACX,EAAE,OAAS,aACX,EAAE,OAAS,aAED,EAAiB,QAAQ,SAAW,EAEzC,GAMIC,EAAsC,CACjDC,EACAC,EACAC,EACAC,EACAC,IACW,CACX,MAAMC,EAAeD,EAAMD,EA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B,EAAY,MAAA,EACrF7B,GACEH,EAAA,cAAAiC,EAAA,CAAM,WAAY,KAAM,OAAQ,IAAK,WAAY,QAC/C,EAAA9B,CACH,EAEDH,EAAA,cAAA,MAAA,CACC,IAAKgB,EACL,UAAWkB,EAAWH,EAAa,yBAA0BzB,EAAWyB,EAAa,mCAAqC,EAAE,EAC5H,YAAaL,EACb,aAAcA,EACd,cAAa,SAAA,EAEZ1B,EAAA,cAAA,MAAA,CAAI,UAAWkC,EAAWH,EAAa,cAAezB,EAAWyB,EAAa,2BAA6B,EAAE,CAAA,CAAG,EAChH/B,EAAA,cAAA,MAAA,CACC,IAAKkB,EACL,UAAWgB,EAAWH,EAAa,gBAAiBzB,EAAWyB,EAAa,6BAA+B,EAAE,EAC7G,MAAO,CACL,KAAM,GAAGhD,KACX,EACA,UAAAyC,EACA,KAAM,SACN,gBAAe1D,EACf,gBAAeG,EACf,gBAAeC,EACf,aAAY,GAAGiC,EAAQA,EAAQ,IAAM,KAAKC,EAAYA,EAAY,IAAM,KAAKC,EAAaA,EAAa,IAAM,KAC7G,SAAUC,EAAW,GAAK,CAAA,EAEzBN,EAAA,cAAA,MAAA,CACC,UAAWkC,EAAWH,EAAa,yBAA0BzB,EAAWyB,EAAa,mCAAqC,EAAE,CAAA,CAC9H,CACF,CACF,GACE3B,GAAaC,IACZL,EAAA,cAAA,OAAA,CAAK,UAAW+B,EAAa,eAAA,EAC3B/B,EAAA,cAAA,IAAA,CAAE,UAAW+B,EAAa,aAAc,cAAa,EACnD,EAAA3B,CACH,EACCJ,EAAA,cAAA,IAAA,CAAE,UAAW+B,EAAa,aAAc,cAAa,EAAA,EACnD1B,CACH,CACF,CAEJ,CAEJ,CAAC"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n return [value, setSafeValue];\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst MAX_VALUE = 100;\nconst MIN_VALUE = 0;\nconst STEP = 1;\nconst LARGE_STEP = 10;\n\nexport const Slider: React.FC<SliderProps> = ({ title, ariaLabel, labelLeft, labelRight, disabled = false, onChange, testId }) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((MAX_VALUE - MIN_VALUE) / 2, MIN_VALUE, MAX_VALUE);\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const { width: markerWidth } = useSize(markerRef) || { width: 0 };\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n return Math.round(((markerPosition - trackPosition) / trackWidth) * (MAX_VALUE - MIN_VALUE));\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - STEP);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - LARGE_STEP);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + STEP);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + LARGE_STEP);\n flag = true;\n break;\n case 'Home':\n setValue(MIN_VALUE);\n flag = true;\n break;\n case 'End':\n setValue(MAX_VALUE);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = ((trackWidth - markerWidth) / (MAX_VALUE - MIN_VALUE)) * value;\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title htmlMarkup={'h3'} margin={1.5} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])} />\n <div\n role={'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuemin={MIN_VALUE}\n aria-valuemax={MAX_VALUE}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","newValue","MAX_VALUE","MIN_VALUE","STEP","LARGE_STEP","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","markerWidth","useEffect","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_b","_a","handlePointerMove","e","handleKeyDown","flag","handleTrackClick","handlePointerDown","markerXPos","ariaLabelAttributes","getAriaLabelAttributes","React","styles","AnalyticsId","Title","classNames"],"mappings":"sfAWA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAYnC,MAAA,CAACG,EAVcG,GAA2B,CAC3CA,EAAWJ,EACbE,EAASF,CAAG,E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T,GAKuB,EACvB,OAAQ,OAAA,CACT,EAED,OACG0B,EAAA,cAAA,MAAA,CAAI,UAAWC,EAAO,OAAQ,cAAa9B,EAAQ,mBAAkB+B,EAAY,MAAA,EAC/ErC,GACEmC,EAAA,cAAAG,EAAA,CAAM,WAAY,KAAM,OAAQ,IAAK,WAAY,SAAU,GAAI7B,CAC7D,EAAAT,CACH,EAEDmC,EAAA,cAAA,MAAA,CACC,IAAKtB,EACL,UAAW0B,EAAWH,EAAO,yBAA0BhC,GAAYgC,EAAO,kCAAkC,EAC5G,QAASN,EACT,cAAeC,CAAA,EAEdI,EAAA,cAAA,MAAA,CAAI,UAAWI,EAAWH,EAAO,cAAehC,GAAYgC,EAAO,0BAA0B,CAAA,CAAG,EAChGD,EAAA,cAAA,MAAA,CACC,KAAM,SACN,IAAKpB,EACL,UAAWwB,EAAWH,EAAO,eAAgBhC,GAAYgC,EAAO,2BAA2B,EAC3F,MAAO,CACL,KAAM,GAAGJ,KACX,EACA,UAAWJ,EACX,gBAAerC,EACf,gBAAeK,EACf,gBAAeD,EACf,SAAUS,EAAW,OAAY,EACjC,gBAAeA,EACd,GAAG6B,CAAA,CACN,CACF,GACE/B,GAAaC,IACZgC,EAAA,cAAA,OAAA,CAAK,UAAWC,EAAO,eAAA,EACrBD,EAAA,cAAA,OAAA,CAAK,GAAIxB,CAAc,EAAAT,CAAU,EACjCiC,EAAA,cAAA,OAAA,CAAK,GAAIvB,CAAA,EAAeT,CAAW,CACtC,CAEJ,CAEJ"}
@@ -24,11 +24,11 @@
24
24
  top: 1rem;
25
25
 
26
26
  &--disabled {
27
- background-color: $neutral600;
27
+ border-color: $neutral600;
28
28
  }
29
29
  }
30
30
 
31
- &__trigger {
31
+ &__marker {
32
32
  display: flex;
33
33
  justify-content: center;
34
34
  align-items: center;
@@ -43,34 +43,36 @@
43
43
  outline: none;
44
44
  cursor: pointer;
45
45
 
46
- &--disabled {
47
- border-color: $neutral500;
48
- cursor: default;
49
- }
50
46
  &:focus-within {
51
47
  box-shadow: 0px 0px 0px 0.1rem $black;
52
48
  }
53
- }
54
49
 
55
- &__trigger-inner {
56
- width: 1.25rem;
57
- height: 1.25rem;
58
- border: 0.1rem solid $black;
59
- border-radius: 1rem;
60
- background-color: $blueberry600;
50
+ &::after {
51
+ content: '';
52
+ width: 1.25rem;
53
+ height: 1.25rem;
54
+ border: 0.1rem solid $black;
55
+ border-radius: 1rem;
56
+ background-color: $blueberry600;
61
57
 
62
- :hover > &,
63
- :focus > & {
64
- background-color: $blueberry700;
58
+ :hover > &,
59
+ :focus > & {
60
+ background-color: $blueberry700;
61
+ }
65
62
  }
66
63
 
67
64
  &--disabled {
68
65
  border-color: $neutral500;
69
- background-color: $neutral200;
66
+ cursor: default;
70
67
 
71
- :hover > &,
72
- :focus > & {
68
+ &::after {
69
+ border-color: $neutral500;
73
70
  background-color: $neutral200;
71
+
72
+ :hover > &,
73
+ :focus > & {
74
+ background-color: $neutral200;
75
+ }
74
76
  }
75
77
  }
76
78
  }
@@ -80,8 +82,4 @@
80
82
  justify-content: space-between;
81
83
  width: 100%;
82
84
  }
83
-
84
- &__text {
85
- margin: 0;
86
- }
87
85
  }
@@ -1,15 +1,12 @@
1
1
  export type Styles = {
2
2
  slider: string;
3
+ slider__marker: string;
4
+ 'slider__marker--disabled': string;
3
5
  slider__options: string;
4
- slider__text: string;
5
6
  slider__track: string;
6
7
  'slider__track--disabled': string;
7
8
  'slider__track-wrapper': string;
8
9
  'slider__track-wrapper--disabled': string;
9
- slider__trigger: string;
10
- 'slider__trigger--disabled': string;
11
- 'slider__trigger-inner': string;
12
- 'slider__trigger-inner--disabled': string;
13
10
  };
14
11
 
15
12
  export type ClassNames = keyof Styles;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "The official design system for Helsenorge built with React.",
5
5
  "homepage": "https://helsenorge.design",
6
- "version": "2.12.0",
6
+ "version": "2.14.0",
7
7
  "author": "Helsenorge",
8
8
  "license": "MIT",
9
9
  "peerDependencies": {
@@ -1,38 +0,0 @@
1
- /** Stopper MouseEvent eller TouchEvent parameter e som sendes inn fra å nå videre.*/
2
- export declare const stopEvent: (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>) => boolean;
3
- /** Henter ut x posisjon til MouseEvent eller TouchEvent e */
4
- export declare const getMousePosition: (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>) => number;
5
- /** Returnerer en boolean på om innsendte event e er en TouchEvent */
6
- export declare const isTouchEvent: (e: MouseEvent | React.MouseEvent<{}> | TouchEvent | React.TouchEvent<{}>) => boolean;
7
- /** Kalkulerer x posisjonen til slideren basert på value som sendes inn,
8
- * trackerWidth - bredden til trackeren, sliderWidth - bredden på slideren,
9
- * og min og max verdier som er satt på slider komponentet. */
10
- export declare const calculateSliderPositionBasedOnValue: (value: number, trackerWidth: number, sliderWidth: number, min: number, max: number) => number;
11
- /** Kalkulerer verdi basert på sliderPosition som sendes inn,
12
- * trackerWidth - bredden til trackeren, sliderWidth - bredden på slideren,
13
- * og min og max verdier som er satt på slider komponentet. */
14
- export declare const calculateValueBasedOnSliderPosition: (sliderPosition: number, trackerWidth: number, sliderWidth: number, step: number, min: number, max: number) => number;
15
- /** Kalkulerer modifisert value basert på step parameteret,
16
- * med hensyn til max verdi til slideren.
17
- * Med en step på 10 vil da value gå fra 0 til 10 til 20 osv. */
18
- export declare const alignValue: (value: number, step: number, max: number) => number;
19
- /** Kalkulerer ny x posisjon til slider basert på innsendt differanse diff,
20
- * nåværende sliderXPos, bredden til tracker - TrackerWidth og bredden til
21
- * slider - sliderWidth. */
22
- export declare const calculateChangeOfPosition: (diff: number, trackerWidth: number, sliderWidth: number, sliderXPos: number) => number;
23
- /** Kalkulerer posisjon til slider basert på xPos, nåværende sliderELement og
24
- * bredden til slider - sliderWidth */
25
- export declare const calculateSliderTranslate: (xPos: number, sliderElement: HTMLDivElement | null, sliderWidth: number, cb: (a: number) => void) => void;
26
- /** Legger til mousemove og mouseup event listeners,
27
- * basert på moveMouseEvent og mouseUpEvent eventene */
28
- export declare const addMouseListeners: (moveMouseEvent: (evt: MouseEvent) => void, mouseUpEvent: (evt: MouseEvent) => void) => void;
29
- /** Fjerner mousemove og mouseup event listeners,
30
- * basert på moveMouseEvent og mouseUpEvent eventene */
31
- export declare const removeMouseListeners: (moveMouseEvent: (evt: MouseEvent) => void, mouseUpEvent: (evt: MouseEvent) => void) => void;
32
- /** Legger til touchmove og touchend event listeners,
33
- * basert på moveTouchEvent og touchUpEvent eventene */
34
- export declare const addTouchListeners: (moveTouchEvent: (evt: TouchEvent) => void, touchUpEvent: (evt: TouchEvent) => void) => void;
35
- /** Fjerner touchmove og touchup event listeners,
36
- * basert på moveTouchEvent og touchUpEvent eventene */
37
- export declare const removeTouchListeners: (moveTouchEvent: (evt: TouchEvent) => void, touchUpEvent: (evt: TouchEvent) => void) => void;
38
- //# sourceMappingURL=SliderUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SliderUtils.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/SliderUtils.tsx"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,SAAS,MAAO,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,KAAG,OAIpG,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,MAAO,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,KAAG,MAM3G,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY,MAAO,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,gBAAgB,CAAC,EAAE,CAAC,KAAG,OAYvG,CAAC;AAEF;;+DAE+D;AAC/D,eAAO,MAAM,mCAAmC,UACvC,MAAM,gBACC,MAAM,eACP,MAAM,OACd,MAAM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