@laerdal/life-react-components 1.2.2-dev.15 → 1.2.2-dev.17

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 (66) hide show
  1. package/dist/esm/Accordion/AccordionItem.js +46 -0
  2. package/dist/esm/Accordion/AccordionItem.js.map +1 -0
  3. package/dist/esm/Accordion/AccordionMenu.js +35 -0
  4. package/dist/esm/Accordion/AccordionMenu.js.map +1 -0
  5. package/dist/esm/Accordion/__tests__/AccordionMenu.test.js +53 -0
  6. package/dist/esm/Accordion/__tests__/AccordionMenu.test.js.map +1 -0
  7. package/dist/esm/Accordion/index.js +4 -0
  8. package/dist/esm/Accordion/index.js.map +1 -0
  9. package/dist/esm/Accordion/styles.js +59 -0
  10. package/dist/esm/Accordion/styles.js.map +1 -0
  11. package/dist/esm/HyperLink/HyperLink.js +7 -15
  12. package/dist/esm/HyperLink/HyperLink.js.map +1 -1
  13. package/dist/esm/InputFields/Checkbox.js +27 -16
  14. package/dist/esm/InputFields/Checkbox.js.map +1 -1
  15. package/dist/esm/InputFields/RadioButton.js +21 -14
  16. package/dist/esm/InputFields/RadioButton.js.map +1 -1
  17. package/dist/esm/InputFields/SearchBar.js +13 -13
  18. package/dist/esm/InputFields/SearchBar.js.map +1 -1
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/js/Accordion/AccordionItem.d.ts +9 -0
  22. package/dist/js/Accordion/AccordionItem.js +58 -0
  23. package/dist/js/Accordion/AccordionItem.js.map +1 -0
  24. package/dist/js/Accordion/AccordionMenu.d.ts +15 -0
  25. package/dist/js/Accordion/AccordionMenu.js +55 -0
  26. package/dist/js/Accordion/AccordionMenu.js.map +1 -0
  27. package/dist/js/Accordion/__tests__/AccordionMenu.test.js +101 -0
  28. package/dist/js/Accordion/__tests__/AccordionMenu.test.js.map +1 -0
  29. package/dist/js/Accordion/index.d.ts +3 -0
  30. package/dist/js/Accordion/index.js +30 -0
  31. package/dist/js/Accordion/index.js.map +1 -0
  32. package/dist/js/Accordion/styles.d.ts +10 -0
  33. package/dist/js/Accordion/styles.js +50 -0
  34. package/dist/js/Accordion/styles.js.map +1 -0
  35. package/dist/js/HyperLink/HyperLink.js +10 -16
  36. package/dist/js/HyperLink/HyperLink.js.map +1 -1
  37. package/dist/js/InputFields/Checkbox.js +9 -5
  38. package/dist/js/InputFields/Checkbox.js.map +1 -1
  39. package/dist/js/InputFields/RadioButton.js +3 -3
  40. package/dist/js/InputFields/RadioButton.js.map +1 -1
  41. package/dist/js/InputFields/SearchBar.js +15 -15
  42. package/dist/js/InputFields/SearchBar.js.map +1 -1
  43. package/dist/js/index.d.ts +1 -0
  44. package/dist/js/index.js +13 -0
  45. package/dist/js/index.js.map +1 -1
  46. package/dist/umd/Accordion/AccordionItem.js +70 -0
  47. package/dist/umd/Accordion/AccordionItem.js.map +1 -0
  48. package/dist/umd/Accordion/AccordionMenu.js +112 -0
  49. package/dist/umd/Accordion/AccordionMenu.js.map +1 -0
  50. package/dist/umd/Accordion/__tests__/AccordionMenu.test.js +74 -0
  51. package/dist/umd/Accordion/__tests__/AccordionMenu.test.js.map +1 -0
  52. package/dist/umd/Accordion/index.js +44 -0
  53. package/dist/umd/Accordion/index.js.map +1 -0
  54. package/dist/umd/Accordion/styles.js +85 -0
  55. package/dist/umd/Accordion/styles.js.map +1 -0
  56. package/dist/umd/HyperLink/HyperLink.js +7 -15
  57. package/dist/umd/HyperLink/HyperLink.js.map +1 -1
  58. package/dist/umd/InputFields/Checkbox.js +27 -16
  59. package/dist/umd/InputFields/Checkbox.js.map +1 -1
  60. package/dist/umd/InputFields/RadioButton.js +21 -14
  61. package/dist/umd/InputFields/RadioButton.js.map +1 -1
  62. package/dist/umd/InputFields/SearchBar.js +13 -13
  63. package/dist/umd/InputFields/SearchBar.js.map +1 -1
  64. package/dist/umd/index.js +13 -4
  65. package/dist/umd/index.js.map +1 -1
  66. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/InputFields/RadioButton.tsx"],"names":["React","styled","RadioButtonOff","RadioButtonOn","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","StyledRadioButton","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","forwardRef","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","ref","onKeyPress","e","keyCode","Medium","preventDefault","toString","toLowerCase","concat","undefined"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAA0B,mBAA1B;AACA,SAAQC,cAAR,EAAwBC,aAAxB,QAA4C,kCAA5C;AACA,SAAQC,MAAR,EAAgBC,kBAAhB,QAAyC,WAAzC;AACA,SAASC,IAAT,QAAqB,UAArB;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,EAA8CC,iBAA9C,EAAiEC,mBAAjE,QAA2F,sBAA3F;AAEA,MAAMC,iBAAiB,GAAGV,MAAM,CAACW,GAAwF;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,KAAK,IAAKA,KAAK,CAACC,MAAN,GAAgB,WAAUD,KAAK,CAACC,MAAO,GAAvC,GAA4C,EAAI;AAC9D;AACA;AACA,WAAWV,MAAM,CAACW,KAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeF,KAAK,IAAKA,KAAK,CAACG,QAAN,GAAiBZ,MAAM,CAACa,WAAxB,GAAsCJ,KAAK,CAACK,WAAN,GAAoBd,MAAM,CAACe,WAA3B,GAAyCf,MAAM,CAACgB,WAAa;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQV,mBAAmB,CAACL,kBAAkB,CAACgB,OAApB,EAA6BjB,MAAM,CAACW,KAApC,CAA2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BAAI;AAAO,IAAA,OAAO,EAAED;AAAhB,KAAqBC,KAArB,CADZ,EAEGC,eAAe,KAAKc,SAApB,iBAAiC,kCAAOd,eAAP,CAFpC,CAdF,CADF;AAqBD,CAzCmB,CAApB;;AAZEF,EAAAA,E;AACAd,EAAAA,Q;AACAiB,EAAAA,M;AACAF,EAAAA,K;AACAC,EAAAA,e;AACAd,EAAAA,W;AACAgB,EAAAA,Q;AACAC,EAAAA,4B;AACArB,EAAAA,M;;AA+CF,eAAec,WAAf","sourcesContent":["import * as React from 'react';\nimport styled, {css} from 'styled-components';\nimport {RadioButtonOff, RadioButtonOn} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport { Size } from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling} from '../styles/typography';\n\nconst StyledRadioButton = styled.div<{ margin?: string, disabled?: boolean, showWarning?: boolean, selected?: boolean }>`\n display: flex;\n flex-direction: row;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n align-items: center;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n \n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600)};\n }\n }\n\n .label {\n user-select: none;\n display: flex;\n flex-direction: column;\n\n label{\n cursor: inherit;\n }\n\n span {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n\n &:not(.disabled):focus {\n outline: none;\n\n .icon {\n background-color: ${COLORS.white};\n box-shadow: 0 0 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ${COLORS.neutral_600};\n }\n }\n }\n\n &:not(.disabled):hover {\n .icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):active {\n .icon {\n background: ${COLORS.primary_100};\n box-shadow: none;\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .icon,\n .label {\n pointer-events: none;\n }\n\n .icon{\n background-color: ${COLORS.white};\n }\n \n .icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n`;\n\ninterface Props {\n id: string;\n selected: boolean;\n select: (selected: boolean) => void;\n label?: string;\n additionalLabel?: string;\n showWarning?: boolean;\n disabled?: boolean;\n iconPointerEventsTransparent?: boolean;\n margin?: string;\n size?: Size;\n}\n\nconst RadioButton = React.forwardRef<HTMLDivElement, Props>(({\n id,\n selected,\n label,\n additionalLabel,\n showWarning,\n select,\n disabled,\n margin,\n iconPointerEventsTransparent,\n size\n}: Props, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled) {\n select(!selected);\n }\n };\n\n size = size ?? Size.Medium;\n\n return (\n <StyledRadioButton key={id} margin={margin}\n ref={ref}\n onClick={() => !disabled && select(!selected)}\n onMouseDown={e => e.preventDefault()}\n onKeyDown={onKeyPress}\n disabled={disabled}\n className={size.toString().toLowerCase().concat(disabled ? ' disabled' : '')}\n tabIndex={disabled ? -1 : 0}\n showWarning={showWarning}\n selected={selected}>\n <div className={'icon'} id={id}>\n { selected && <RadioButtonOn className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n { !selected && <RadioButtonOff className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n </div>\n <div className={'label'}>\n {label && <label htmlFor={id}>{label}</label>}\n {additionalLabel !== undefined && <span>{additionalLabel}</span>}\n </div>\n </StyledRadioButton>\n );\n});\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
1
+ {"version":3,"sources":["../../../src/InputFields/RadioButton.tsx"],"names":["React","styled","RadioButtonOff","RadioButtonOn","COLORS","ComponentTextStyle","Size","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","StyledRadioButton","div","props","margin","black","selected","primary_500","showWarning","warning_400","neutral_600","Regular","white","primary_20","primary_700","primary_100","primary_800","neutral_300","RadioButton","forwardRef","id","label","additionalLabel","select","disabled","iconPointerEventsTransparent","size","ref","onKeyPress","e","keyCode","Medium","preventDefault","toString","toLowerCase","concat","undefined"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAA0B,mBAA1B;AACA,SAAQC,cAAR,EAAwBC,aAAxB,QAA4C,kCAA5C;AACA,SAAQC,MAAR,EAAgBC,kBAAhB,QAAyC,WAAzC;AACA,SAASC,IAAT,QAAqB,UAArB;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,EAA8CC,iBAA9C,EAAiEC,mBAAjE,QAA2F,sBAA3F;AAEA,MAAMC,iBAAiB,GAAGV,MAAM,CAACW,GAAwF;AACzH;AACA;AACA;AACA;AACA;AACA,IAAIC,KAAK,IAAKA,KAAK,CAACC,MAAN,GAAgB,WAAUD,KAAK,CAACC,MAAO,GAAvC,GAA4C,EAAI;AAC9D;AACA;AACA,WAAWV,MAAM,CAACW,KAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeF,KAAK,IAAKA,KAAK,CAACG,QAAN,GAAiBZ,MAAM,CAACa,WAAxB,GAAsCJ,KAAK,CAACK,WAAN,GAAoBd,MAAM,CAACe,WAA3B,GAAyCf,MAAM,CAACgB,WAAa;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQV,mBAAmB,CAACL,kBAAkB,CAACgB,OAApB,EAA6BjB,MAAM,CAACW,KAApC,CAA2C;AACtE;AACA;AACA;AACA;AACA,MAAMN,iBAAiB,CAACJ,kBAAkB,CAACgB,OAApB,EAA6BjB,MAAM,CAACW,KAApC,CAA2C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMP,iBAAiB,CAACH,kBAAkB,CAACgB,OAApB,EAA6BjB,MAAM,CAACW,KAApC,CAA2C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMR,iBAAiB,CAACF,kBAAkB,CAACgB,OAApB,EAA6BjB,MAAM,CAACW,KAApC,CAA2C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BX,MAAM,CAACkB,KAAM;AACvC,4BAA4BlB,MAAM,CAACa,WAAY;AAC/C;AACA;AACA,iBAAiBb,MAAM,CAACgB,WAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BhB,MAAM,CAACmB,UAAW;AAC5C;AACA;AACA,iBAAiBnB,MAAM,CAACoB,WAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoBpB,MAAM,CAACqB,WAAY;AACvC;AACA;AACA;AACA,iBAAiBrB,MAAM,CAACsB,WAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAatB,MAAM,CAACuB,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BvB,MAAM,CAACkB,KAAM;AACvC;AACA;AACA;AACA,eAAelB,MAAM,CAACuB,WAAY;AAClC;AACA;AACA,CAtHA;AAqIA,MAAMC,WAAW,gBAAG5B,KAAK,CAAC6B,UAAN,CAAwC,CAAC;AAC3DC,EAAAA,EAD2D;AAE3Dd,EAAAA,QAF2D;AAG3De,EAAAA,KAH2D;AAI3DC,EAAAA,eAJ2D;AAK3Dd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iBAAa,oBAAC,cAAD;AAAgB,IAAA,SAAS,EAAEmB,4BAA4B,GAAG,oBAAH,GAA0B,EAAjF;AAAqF,IAAA,IAAI,EAAC;AAA1F,IAFjB,CAVF,eAcE;AAAK,IAAA,SAAS,EAAE;AAAhB,KACGJ,KAAK,iBAAI;AAAO,IAAA,OAAO,EAAED;AAAhB,KAAqBC,KAArB,CADZ,EAEGC,eAAe,KAAKc,SAApB,iBAAiC,kCAAOd,eAAP,CAFpC,CAdF,CADF;AAqBD,CAzCmB,CAApB;;AAZEF,EAAAA,E;AACAd,EAAAA,Q;AACAiB,EAAAA,M;AACAF,EAAAA,K;AACAC,EAAAA,e;AACAd,EAAAA,W;AACAgB,EAAAA,Q;AACAC,EAAAA,4B;AACArB,EAAAA,M;;AA+CF,eAAec,WAAf","sourcesContent":["import * as React from 'react';\nimport styled, {css} from 'styled-components';\nimport {RadioButtonOff, RadioButtonOn} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport { Size } from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling} from '../styles/typography';\n\nconst StyledRadioButton = styled.div<{ margin?: string, disabled?: boolean, showWarning?: boolean, selected?: boolean }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n \n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .radio-button-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.showWarning ? COLORS.warning_400 : COLORS.neutral_600)};\n }\n }\n\n .radio-button-label {\n user-select: none;\n display: flex;\n flex-direction: column;\n\n label{\n cursor: inherit;\n }\n\n span {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .radio-button-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):focus {\n outline: none;\n\n .radio-button-icon {\n background-color: ${COLORS.white};\n box-shadow: 0 0 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n\n svg {\n color: ${COLORS.neutral_600};\n }\n }\n }\n\n &:not(.disabled):hover {\n .radio-button-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):active {\n .radio-button-icon {\n background: ${COLORS.primary_100};\n box-shadow: none;\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.disabled {\n box-shadow: none;\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .radio-button-icon,\n .radio-button-label {\n pointer-events: none;\n }\n\n .radio-button-icon{\n background-color: ${COLORS.white};\n }\n \n .radio-button-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n`;\n\ninterface Props {\n id: string;\n selected: boolean;\n select: (selected: boolean) => void;\n label?: string;\n additionalLabel?: string;\n showWarning?: boolean;\n disabled?: boolean;\n iconPointerEventsTransparent?: boolean;\n margin?: string;\n size?: Size;\n}\n\nconst RadioButton = React.forwardRef<HTMLDivElement, Props>(({\n id,\n selected,\n label,\n additionalLabel,\n showWarning,\n select,\n disabled,\n margin,\n iconPointerEventsTransparent,\n size\n}: Props, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled) {\n select(!selected);\n }\n };\n\n size = size ?? Size.Medium;\n\n return (\n <StyledRadioButton key={id} margin={margin}\n ref={ref}\n onClick={() => !disabled && select(!selected)}\n onMouseDown={e => e.preventDefault()}\n onKeyDown={onKeyPress}\n disabled={disabled}\n className={size.toString().toLowerCase().concat(disabled ? ' disabled' : '')}\n tabIndex={disabled ? -1 : 0}\n showWarning={showWarning}\n selected={selected}>\n <div className={'radio-button-icon'} id={id}>\n { selected && <RadioButtonOn className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n { !selected && <RadioButtonOff className={iconPointerEventsTransparent ? \"pointerTransparent\" : \"\"} size=\"24px\"/>}\n </div>\n <div className={'radio-button-label'}>\n {label && <label htmlFor={id}>{label}</label>}\n {additionalLabel !== undefined && <span>{additionalLabel}</span>}\n </div>\n </StyledRadioButton>\n );\n});\n\nexport default RadioButton;\n"],"file":"RadioButton.js"}
@@ -53,7 +53,18 @@ const SearchBar = ({
53
53
  disabled: disabled,
54
54
  tabbedHere: tabbedHere,
55
55
  validationMessage: validationMessage
56
- }, /*#__PURE__*/React.createElement(SearchIconWrapper, {
56
+ }, /*#__PURE__*/React.createElement(SearchBarInput, {
57
+ placeholder: disabled ? '' : placeholder,
58
+ ref: inputRef,
59
+ id: id,
60
+ size: size,
61
+ disabled: disabled,
62
+ setTabbedHere: setTabbedHere,
63
+ setSearchTerm: term => setSearchTerm(term),
64
+ searchTerm: searchTerm,
65
+ onKeyDown: onKeyDown,
66
+ enterSearch: enterSearch
67
+ }), /*#__PURE__*/React.createElement(SearchIconWrapper, {
57
68
  className: size ? size : '',
58
69
  "aria-label": performSearchLabel
59
70
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -65,18 +76,7 @@ const SearchBar = ({
65
76
  onKeyPress: e => isPressingEnter(e) ? enterSearch(e) : null
66
77
  }, /*#__PURE__*/React.createElement(SearchIcon, {
67
78
  size: "24px"
68
- }))), /*#__PURE__*/React.createElement(SearchBarInput, {
69
- placeholder: disabled ? '' : placeholder,
70
- ref: inputRef,
71
- id: id,
72
- size: size,
73
- disabled: disabled,
74
- setTabbedHere: setTabbedHere,
75
- setSearchTerm: term => setSearchTerm(term),
76
- searchTerm: searchTerm,
77
- onKeyDown: onKeyDown,
78
- enterSearch: enterSearch
79
- }), /*#__PURE__*/React.createElement(ClearIconWrapper, {
79
+ }))), /*#__PURE__*/React.createElement(ClearIconWrapper, {
80
80
  className: (size ? size : '').concat(!searchTerm ? ' hidden' : '')
81
81
  }, /*#__PURE__*/React.createElement(IconButton, {
82
82
  id: `${id}_Clear`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/InputFields/SearchBar.tsx"],"names":["React","COLORS","Search","SearchIcon","Clear","ClearIcon","TechnicalWarning","WarningMessage","InputWrapper","SearchIconWrapper","IconButton","SearchBarInput","SearchField","styled","ClearIconWrapper","div","SearchBar","id","searchTerm","setSearchTerm","enterSearch","removeSearch","placeholder","performSearchLabel","disabled","validationMessage","onKeyDown","size","margin","inputRef","useRef","tabbedHere","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","term","concat","warning_400"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,MAAM,IAAIC,UAAnB,EAA+BC,KAAK,IAAIC,SAAxC,EAAmDC,gBAAnD,QAA2E,kCAA3E;AACA,SAASC,cAAT,EAAyBC,YAAzB,EAAuCC,iBAAvC,QAA4E,WAA5E;AACA,SAASC,UAAT,QAA2B,WAA3B;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,WAAP,MAAwB,0BAAxB;AAEA,OAAOC,MAAP,MAAmB,mBAAnB;AAiBA,MAAMC,gBAAgB,GAAGD,MAAM,CAACE,GAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAPA;;AASA,MAAMC,SAAiD,GAAG,CAAC;AACzDC,EAAAA,EADyD;AAEzDC,EAAAA,UAFyD;AAGzDC,EAAAA,aAHyD;AAIzDC,EAAAA,WAJyD;AAKzDC,EAAAA,YALyD;AAMzDC,EAAAA,WANyD;AAOzDC,EAAAA,kBAPyD;AAQzDC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xCJ,CADF;AAgDD,CA1ED;;;AAvBER,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAC,EAAAA,W;AACAC,EAAAA,Y;AACAC,EAAAA,W;AACAC,EAAAA,kB;AACAC,EAAAA,Q;AACAC,EAAAA,iB;AACAC,EAAAA,S;AAEAE,EAAAA,M;;AAwFF,eAAeZ,SAAf","sourcesContent":["import React from 'react';\nimport { COLORS } from '../styles/index';\nimport { Search as SearchIcon, Clear as ClearIcon, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { WarningMessage, InputWrapper, SearchIconWrapper, StyledIcon } from './styling';\nimport { IconButton } from '../Button';\nimport SearchBarInput from './components/SearchBarInput';\nimport SearchField from './components/SearchField';\nimport { Size } from '../types';\nimport styled from 'styled-components';\n\ntype SeachBarProps = {\n id: string;\n searchTerm?: string;\n setSearchTerm: (term: string) => void;\n enterSearch: (e: any) => void;\n removeSearch: (e: any) => void;\n placeholder?: string;\n performSearchLabel?: string;\n disabled?: boolean;\n validationMessage?: string;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n size?: Size.Small | Size.Medium;\n margin?: string;\n};\n\nconst ClearIconWrapper = styled.div`\n display: flex;\n align-items: center;\n \n &.hidden{\n display: none !important;\n }\n`;\n\nconst SearchBar: React.FunctionComponent<SeachBarProps> = ({\n id,\n searchTerm,\n setSearchTerm,\n enterSearch,\n removeSearch,\n placeholder,\n performSearchLabel,\n disabled,\n validationMessage,\n onKeyDown,\n size,\n margin = '4px 0',\n}) => {\n const inputRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n return (\n <>\n <InputWrapper\n disabled={disabled}\n margin={margin}>\n <SearchField id={`${id}_main`} size={size || ''} searchTerm={searchTerm} disabled={disabled} tabbedHere={tabbedHere} validationMessage={validationMessage}>\n <SearchIconWrapper className={size ? size : ''} aria-label={performSearchLabel}>\n <IconButton id={`${id}_Search`}\n variant=\"secondary\"\n shape=\"circular\"\n action={enterSearch}\n disabled={disabled}\n onKeyPress={(e: any) => (isPressingEnter(e) ? enterSearch(e) : null)}>\n <SearchIcon size=\"24px\"/>\n </IconButton>\n </SearchIconWrapper>\n <SearchBarInput\n placeholder={disabled ? '' : placeholder}\n ref={inputRef}\n id={id}\n size={size}\n disabled={disabled}\n setTabbedHere={setTabbedHere}\n setSearchTerm={(term: string) => setSearchTerm(term)}\n searchTerm={searchTerm}\n onKeyDown={onKeyDown}\n enterSearch={enterSearch}\n />\n <ClearIconWrapper className={(size ? size : '').concat(!searchTerm ? ' hidden' : '')}>\n <IconButton id={`${id}_Clear`}\n variant=\"secondary\"\n shape=\"circular\"\n action={removeSearch}\n disabled={disabled}\n onKeyPress={(e: any) => (isPressingEnter(e) ? removeSearch(e) : null)}>\n <ClearIcon size=\"24px\"/>\n </IconButton>\n </ClearIconWrapper>\n </SearchField>\n </InputWrapper>\n {validationMessage && (\n <WarningMessage className={size || ''}>\n <TechnicalWarning color={COLORS.warning_400} className={size || ''} />\n <span>{validationMessage}</span>\n </WarningMessage>\n )}\n </>\n );\n};\n\nexport default SearchBar;\n"],"file":"SearchBar.js"}
1
+ {"version":3,"sources":["../../../src/InputFields/SearchBar.tsx"],"names":["React","COLORS","Search","SearchIcon","Clear","ClearIcon","TechnicalWarning","WarningMessage","InputWrapper","SearchIconWrapper","IconButton","SearchBarInput","SearchField","styled","ClearIconWrapper","div","SearchBar","id","searchTerm","setSearchTerm","enterSearch","removeSearch","placeholder","performSearchLabel","disabled","validationMessage","onKeyDown","size","margin","inputRef","useRef","tabbedHere","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","term","concat","warning_400"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,iBAAvB;AACA,SAASC,MAAM,IAAIC,UAAnB,EAA+BC,KAAK,IAAIC,SAA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AEY,IAAA,KAAK,EAAC,UAFlB;AAGY,IAAA,MAAM,EAAEI,YAHpB;AAIY,IAAA,QAAQ,EAAEG,QAJtB;AAKY,IAAA,UAAU,EAAGW,CAAD,IAAaD,eAAe,CAACC,CAAD,CAAf,GAAqBd,YAAY,CAACc,CAAD,CAAjC,GAAuC;AAL5E,kBAME,oBAAC,SAAD;AAAW,IAAA,IAAI,EAAC;AAAhB,IANF,CADF,CAvBF,CAHF,CADF,EAuCGV,iBAAiB,iBAChB,oBAAC,cAAD;AAAgB,IAAA,SAAS,EAAEE,IAAI,IAAI;AAAnC,kBACE,oBAAC,gBAAD;AAAkB,IAAA,KAAK,EAAE1B,MAAM,CAACwC,WAAhC;AAA6C,IAAA,SAAS,EAAEd,IAAI,IAAI;AAAhE,IADF,eAEE,kCAAOF,iBAAP,CAFF,CAxCJ,CADF;AAgDD,CA1ED;;;AAvBER,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAC,EAAAA,W;AACAC,EAAAA,Y;AACAC,EAAAA,W;AACAC,EAAAA,kB;AACAC,EAAAA,Q;AACAC,EAAAA,iB;AACAC,EAAAA,S;AAEAE,EAAAA,M;;AAwFF,eAAeZ,SAAf","sourcesContent":["import React from 'react';\nimport { COLORS } from '../styles/index';\nimport { Search as SearchIcon, Clear as ClearIcon, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { WarningMessage, InputWrapper, SearchIconWrapper, StyledIcon } from './styling';\nimport { IconButton } from '../Button';\nimport SearchBarInput from './components/SearchBarInput';\nimport SearchField from './components/SearchField';\nimport { Size } from '../types';\nimport styled from 'styled-components';\n\ntype SeachBarProps = {\n id: string;\n searchTerm?: string;\n setSearchTerm: (term: string) => void;\n enterSearch: (e: any) => void;\n removeSearch: (e: any) => void;\n placeholder?: string;\n performSearchLabel?: string;\n disabled?: boolean;\n validationMessage?: string;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n size?: Size.Small | Size.Medium;\n margin?: string;\n};\n\nconst ClearIconWrapper = styled.div`\n display: flex;\n align-items: center;\n \n &.hidden{\n display: none !important;\n }\n`;\n\nconst SearchBar: React.FunctionComponent<SeachBarProps> = ({\n id,\n searchTerm,\n setSearchTerm,\n enterSearch,\n removeSearch,\n placeholder,\n performSearchLabel,\n disabled,\n validationMessage,\n onKeyDown,\n size,\n margin = '4px 0',\n}) => {\n const inputRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n return (\n <>\n <InputWrapper\n disabled={disabled}\n margin={margin}>\n <SearchField id={`${id}_main`} size={size || ''} searchTerm={searchTerm} disabled={disabled} tabbedHere={tabbedHere} validationMessage={validationMessage}>\n <SearchBarInput\n placeholder={disabled ? '' : placeholder}\n ref={inputRef}\n id={id}\n size={size}\n disabled={disabled}\n setTabbedHere={setTabbedHere}\n setSearchTerm={(term: string) => setSearchTerm(term)}\n searchTerm={searchTerm}\n onKeyDown={onKeyDown}\n enterSearch={enterSearch}\n />\n <SearchIconWrapper className={size ? size : ''} aria-label={performSearchLabel}>\n <IconButton id={`${id}_Search`}\n variant=\"secondary\"\n shape=\"circular\"\n action={enterSearch}\n disabled={disabled}\n onKeyPress={(e: any) => (isPressingEnter(e) ? enterSearch(e) : null)}>\n <SearchIcon size=\"24px\"/>\n </IconButton>\n </SearchIconWrapper>\n <ClearIconWrapper className={(size ? size : '').concat(!searchTerm ? ' hidden' : '')}>\n <IconButton id={`${id}_Clear`}\n variant=\"secondary\"\n shape=\"circular\"\n action={removeSearch}\n disabled={disabled}\n onKeyPress={(e: any) => (isPressingEnter(e) ? removeSearch(e) : null)}>\n <ClearIcon size=\"24px\"/>\n </IconButton>\n </ClearIconWrapper>\n </SearchField>\n </InputWrapper>\n {validationMessage && (\n <WarningMessage className={size || ''}>\n <TechnicalWarning color={COLORS.warning_400} className={size || ''} />\n <span>{validationMessage}</span>\n </WarningMessage>\n )}\n </>\n );\n};\n\nexport default SearchBar;\n"],"file":"SearchBar.js"}
package/dist/esm/index.js CHANGED
@@ -26,4 +26,5 @@ export * from './Table';
26
26
  export * from './Toggles';
27
27
  export * from './HyperLink';
28
28
  export * from './NotificationDot';
29
+ export * from './Accordion';
29
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,SAAd;AAEA,cAAc,YAAd;AAEA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,WAAd;AACA,cAAc,WAAd;AACA,cAAc,uBAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,eAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,UAAd;AACA,cAAc,aAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,aAAd;AACA,cAAc,mBAAd","sourcesContent":["export * from './styles';\nexport * from './icons';\nexport * from './types';\n\nexport * from './AuthPage';\n\nexport * from './Button';\nexport * from './Breadcrumb';\nexport * from './Chips';\nexport * from './SkipToContent';\nexport * from './Footer';\nexport * from './LoadingIndicator';\nexport * from './MiniProductCard';\nexport * from './NavItem';\nexport * from './Layouts';\nexport * from './GlobalNavigationBar';\nexport * from './Tabs';\nexport * from './Banners';\nexport * from './Toasters';\nexport * from './InputFields';\nexport * from './Dropdown';\nexport * from './Switcher';\nexport * from './LoadingPage';\nexport * from './List';\nexport * from './Modals';\nexport * from './Paginator';\nexport * from './Table';\nexport * from './Toggles';\nexport * from './HyperLink';\nexport * from './NotificationDot';"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,SAAd;AAEA,cAAc,YAAd;AAEA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,oBAAd;AACA,cAAc,mBAAd;AACA,cAAc,WAAd;AACA,cAAc,WAAd;AACA,cAAc,uBAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,eAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,UAAd;AACA,cAAc,aAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,aAAd;AACA,cAAc,mBAAd;AACA,cAAc,aAAd","sourcesContent":["export * from './styles';\nexport * from './icons';\nexport * from './types';\n\nexport * from './AuthPage';\n\nexport * from './Button';\nexport * from './Breadcrumb';\nexport * from './Chips';\nexport * from './SkipToContent';\nexport * from './Footer';\nexport * from './LoadingIndicator';\nexport * from './MiniProductCard';\nexport * from './NavItem';\nexport * from './Layouts';\nexport * from './GlobalNavigationBar';\nexport * from './Tabs';\nexport * from './Banners';\nexport * from './Toasters';\nexport * from './InputFields';\nexport * from './Dropdown';\nexport * from './Switcher';\nexport * from './LoadingPage';\nexport * from './List';\nexport * from './Modals';\nexport * from './Paginator';\nexport * from './Table';\nexport * from './Toggles';\nexport * from './HyperLink';\nexport * from './NotificationDot';\nexport * from './Accordion';\n"],"file":"index.js"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { AccordionItemProps } from './AccordionMenu';
3
+ interface AccordionItemPropsInner extends AccordionItemProps {
4
+ onSelect: (id: string) => void;
5
+ isActive: boolean;
6
+ isLast: boolean;
7
+ }
8
+ declare const AccordionItem: React.FunctionComponent<AccordionItemPropsInner>;
9
+ export default AccordionItem;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _ = require("..");
13
+
14
+ var _icons = require("../icons");
15
+
16
+ var _styles = require("./styles");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ var AccordionItem = function AccordionItem(props) {
21
+ var id = props.id,
22
+ onSelect = props.onSelect,
23
+ isActive = props.isActive,
24
+ title = props.title,
25
+ icon = props.icon,
26
+ disabled = props.disabled,
27
+ isLast = props.isLast;
28
+ return /*#__PURE__*/_react.default.createElement(_styles.AccordionItemContainer, {
29
+ id: id,
30
+ displaySeparator: !isActive && !isLast,
31
+ isDisabled: disabled !== null && disabled !== void 0 ? disabled : false
32
+ }, /*#__PURE__*/_react.default.createElement(_styles.ItemHeaderContainer, {
33
+ tabIndex: !disabled ? 0 : -1,
34
+ onClick: function onClick() {
35
+ if (!disabled) {
36
+ onSelect(id);
37
+ }
38
+ },
39
+ isDisabled: disabled !== null && disabled !== void 0 ? disabled : false
40
+ }, icon && /*#__PURE__*/_react.default.cloneElement(icon, {
41
+ size: '24px'
42
+ }), /*#__PURE__*/_react.default.createElement(_.ComponentM, {
43
+ color: disabled ? _.COLORS.neutral_300 : undefined
44
+ }, title), isActive ? /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ChevronUp, {
45
+ size: "24px"
46
+ }) : /*#__PURE__*/_react.default.createElement(_icons.SystemIcons.ChevronDown, {
47
+ size: "24px"
48
+ })), isActive && /*#__PURE__*/_react.default.createElement(_styles.ItemBodyContainer, null, /*#__PURE__*/_react.default.createElement(_.ComponentS, null, props.children)));
49
+ };
50
+
51
+ AccordionItem.propTypes = {
52
+ onSelect: _propTypes.default.func.isRequired,
53
+ isActive: _propTypes.default.bool.isRequired,
54
+ isLast: _propTypes.default.bool.isRequired
55
+ };
56
+ var _default = AccordionItem;
57
+ exports.default = _default;
58
+ //# sourceMappingURL=AccordionItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Accordion/AccordionItem.tsx"],"names":["AccordionItem","props","id","onSelect","isActive","title","icon","disabled","isLast","React","cloneElement","size","COLORS","neutral_300","undefined","children"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAQA,IAAMA,aAA+D,GAAG,SAAlEA,aAAkE,CAACC,KAAD,EAAoC;AAC1G,MAAQC,EAAR,GAAkED,KAAlE,CAAQC,EAAR;AAAA,MAAYC,QAAZ,GAAkEF,KAAlE,CAAYE,QAAZ;AAAA,MAAsBC,QAAtB,GAAkEH,KAAlE,CAAsBG,QAAtB;AAAA,MAAgCC,KAAhC,GAAkEJ,KAAlE,CAAgCI,KAAhC;AAAA,MAAuCC,IAAvC,GAAkEL,KAAlE,CAAuCK,IAAvC;AAAA,MAA6CC,QAA7C,GAAkEN,KAAlE,CAA6CM,QAA7C;AAAA,MAAuDC,MAAvD,GAAkEP,KAAlE,CAAuDO,MAAvD;AACA,sBACE,6BAAC,8BAAD;AAAwB,IAAA,EAAE,EAAEN,EAA5B;AAAgC,IAAA,gBAAgB,EAAE,CAACE,QAAD,IAAa,CAACI,MAAhE;AAAwE,IAAA,UAAU,EAAED,QAAF,aAAEA,QAAF,cAAEA,QAAF,GAAc;AAAhG,kBACE,6BAAC,2BAAD;AACE,IAAA,QAAQ,EAAE,CAACA,QAAD,GAAY,CAAZ,GAAgB,CAAC,CAD7B;AAEE,IAAA,OAAO,EAAE,mBAAM;AACb,UAAI,CAACA,QAAL,EAAe;AACbJ,QAAAA,QAAQ,CAACD,EAAD,CAAR;AACD;AACF,KANH;AAOE,IAAA,UAAU,EAAEK,QAAF,aAAEA,QAAF,cAAEA,QAAF,GAAc;AAP1B,KAQGD,IAAI,iBAAIG,eAAMC,YAAN,CAAmBJ,IAAnB,EAA+C;AAAEK,IAAAA,IAAI,EAAE;AAAR,GAA/C,CARX,eASE,6BAAC,YAAD;AAAY,IAAA,KAAK,EAAEJ,QAAQ,GAAGK,SAAOC,WAAV,GAAwBC;AAAnD,KAA+DT,KAA/D,CATF,EAUGD,QAAQ,gBAAG,6BAAC,kBAAD,CAAa,SAAb;AAAuB,IAAA,IAAI,EAAC;AAA5B,IAAH,gBAA2C,6BAAC,kBAAD,CAAa,WAAb;AAAyB,IAAA,IAAI,EAAC;AAA9B,IAVtD,CADF,EAaGA,QAAQ,iBACP,6BAAC,yBAAD,qBACE,6BAAC,YAAD,QAAaH,KAAK,CAACc,QAAnB,CADF,CAdJ,CADF;AAqBD,CAvBD;;;AALEZ,EAAAA,Q;AACAC,EAAAA,Q;AACAI,EAAAA,M;;eA4BaR,a","sourcesContent":["import React from 'react';\nimport { COLORS, ComponentM, ComponentS } from '..';\nimport { SystemIcons } from '../icons';\nimport { AccordionItemProps } from './AccordionMenu';\nimport { AccordionItemContainer, HeaderIconContainer, ItemBodyContainer, ItemHeaderContainer } from './styles';\n\ninterface AccordionItemPropsInner extends AccordionItemProps {\n onSelect: (id: string) => void;\n isActive: boolean;\n isLast: boolean;\n}\n\nconst AccordionItem: React.FunctionComponent<AccordionItemPropsInner> = (props: AccordionItemPropsInner) => {\n const { id, onSelect, isActive, title, icon, disabled, isLast } = props;\n return (\n <AccordionItemContainer id={id} displaySeparator={!isActive && !isLast} isDisabled={disabled ?? false}>\n <ItemHeaderContainer\n tabIndex={!disabled ? 0 : -1}\n onClick={() => {\n if (!disabled) {\n onSelect(id);\n }\n }}\n isDisabled={disabled ?? false}>\n {icon && React.cloneElement(icon as React.ReactElement, { size: '24px' })}\n <ComponentM color={disabled ? COLORS.neutral_300 : undefined}>{title}</ComponentM>\n {isActive ? <SystemIcons.ChevronUp size=\"24px\" /> : <SystemIcons.ChevronDown size=\"24px\" />}\n </ItemHeaderContainer>\n {isActive && (\n <ItemBodyContainer>\n <ComponentS>{props.children}</ComponentS>\n </ItemBodyContainer>\n )}\n </AccordionItemContainer>\n );\n};\n\nexport default AccordionItem;\n"],"file":"AccordionItem.js"}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ export interface AccordionProps {
3
+ items: AccordionItemProps[];
4
+ selectedItemId?: string;
5
+ onSelect: (id: string) => void;
6
+ }
7
+ export interface AccordionItemProps {
8
+ id: string;
9
+ disabled?: boolean;
10
+ title: string;
11
+ icon?: React.ReactNode;
12
+ children: React.ReactNode;
13
+ }
14
+ declare const AccordionMenu: React.FunctionComponent<AccordionProps>;
15
+ export default AccordionMenu;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var React = _interopRequireWildcard(require("react"));
13
+
14
+ var _AccordionItem = _interopRequireDefault(require("./AccordionItem"));
15
+
16
+ var _styles = require("./styles");
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ var AccordionMenu = function AccordionMenu(_ref) {
25
+ var items = _ref.items,
26
+ selectedItemId = _ref.selectedItemId,
27
+ onSelect = _ref.onSelect;
28
+ return /*#__PURE__*/React.createElement(_styles.AccordionMenuWrapper, null, items.map(function (item) {
29
+ return /*#__PURE__*/React.createElement(_AccordionItem.default, {
30
+ key: item.id,
31
+ disabled: item.disabled,
32
+ id: item.id,
33
+ title: item.title,
34
+ icon: item.icon,
35
+ isActive: item.id === selectedItemId,
36
+ isLast: items.indexOf(item) === items.length - 1,
37
+ onSelect: onSelect
38
+ }, item.children);
39
+ }));
40
+ };
41
+
42
+ AccordionMenu.propTypes = {
43
+ items: _propTypes.default.arrayOf(_propTypes.default.shape({
44
+ id: _propTypes.default.string.isRequired,
45
+ disabled: _propTypes.default.bool,
46
+ title: _propTypes.default.string.isRequired,
47
+ icon: _propTypes.default.node,
48
+ children: _propTypes.default.node.isRequired
49
+ })).isRequired,
50
+ selectedItemId: _propTypes.default.string,
51
+ onSelect: _propTypes.default.func.isRequired
52
+ };
53
+ var _default = AccordionMenu;
54
+ exports.default = _default;
55
+ //# sourceMappingURL=AccordionMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Accordion/AccordionMenu.tsx"],"names":["AccordionMenu","items","selectedItemId","onSelect","map","item","id","disabled","title","icon","indexOf","length","children"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAgBA,IAAMA,aAAsD,GAAG,SAAzDA,aAAyD,OAAyD;AAAA,MAAtDC,KAAsD,QAAtDA,KAAsD;AAAA,MAA/CC,cAA+C,QAA/CA,cAA+C;AAAA,MAA/BC,QAA+B,QAA/BA,QAA+B;AACtH,sBACE,oBAAC,4BAAD,QACGF,KAAK,CAACG,GAAN,CAAU,UAACC,IAAD;AAAA,wBACT,oBAAC,sBAAD;AACE,MAAA,GAAG,EAAEA,IAAI,CAACC,EADZ;AAEE,MAAA,QAAQ,EAAED,IAAI,CAACE,QAFjB;AAGE,MAAA,EAAE,EAAEF,IAAI,CAACC,EAHX;AAIE,MAAA,KAAK,EAAED,IAAI,CAACG,KAJd;AAKE,MAAA,IAAI,EAAEH,IAAI,CAACI,IALb;AAME,MAAA,QAAQ,EAAEJ,IAAI,CAACC,EAAL,KAAYJ,cANxB;AAOE,MAAA,MAAM,EAAED,KAAK,CAACS,OAAN,CAAcL,IAAd,MAAwBJ,KAAK,CAACU,MAAN,GAAe,CAPjD;AAQE,MAAA,QAAQ,EAAER;AARZ,OASGE,IAAI,CAACO,QATR,CADS;AAAA,GAAV,CADH,CADF;AAiBD,CAlBD;;;AAbEX,EAAAA,K;AAMAK,IAAAA,E;AACAC,IAAAA,Q;AACAC,IAAAA,K;AACAC,IAAAA,I;AACAG,IAAAA,Q;;AATAV,EAAAA,c;AACAC,EAAAA,Q;;eA+BaH,a","sourcesContent":["import * as React from 'react';\nimport AccordionItem from './AccordionItem';\nimport { AccordionMenuWrapper } from './styles';\n\nexport interface AccordionProps {\n items: AccordionItemProps[];\n selectedItemId?: string;\n onSelect: (id: string) => void;\n}\n\nexport interface AccordionItemProps {\n id: string;\n disabled?: boolean;\n title: string;\n icon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nconst AccordionMenu: React.FunctionComponent<AccordionProps> = ({ items, selectedItemId, onSelect }: AccordionProps) => {\n return (\n <AccordionMenuWrapper>\n {items.map((item) => (\n <AccordionItem\n key={item.id}\n disabled={item.disabled}\n id={item.id}\n title={item.title}\n icon={item.icon}\n isActive={item.id === selectedItemId}\n isLast={items.indexOf(item) === items.length - 1}\n onSelect={onSelect}>\n {item.children}\n </AccordionItem>\n ))}\n </AccordionMenuWrapper>\n );\n};\n\nexport default AccordionMenu;\n"],"file":"AccordionMenu.js"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _react2 = require("@testing-library/react");
6
+
7
+ require("jest-styled-components");
8
+
9
+ var _styles = require("../../styles");
10
+
11
+ var _AccordionMenu = _interopRequireDefault(require("../AccordionMenu"));
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
16
+
17
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
18
+
19
+ var accordionItems = [{
20
+ id: 'test1_id',
21
+ title: 'Item label with text 1',
22
+ children: /*#__PURE__*/_react.default.createElement("div", null, "content test1")
23
+ }, {
24
+ id: 'test2_id',
25
+ title: 'Item label with text 2',
26
+ children: /*#__PURE__*/_react.default.createElement("div", null, "content test2")
27
+ }];
28
+ describe('<AccordionMenu />', function () {
29
+ it('Check correct text placed on labels', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
30
+ var _render, queryByText;
31
+
32
+ return regeneratorRuntime.wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_AccordionMenu.default, {
37
+ items: accordionItems,
38
+ onSelect: function onSelect() {}
39
+ })), queryByText = _render.queryByText;
40
+ expect(queryByText('Item label with text 1')).toBeDefined();
41
+ expect(queryByText('Item label with text 2')).toBeDefined();
42
+ expect(queryByText('content test1')).toBeNull();
43
+
44
+ case 4:
45
+ case "end":
46
+ return _context.stop();
47
+ }
48
+ }
49
+ }, _callee);
50
+ })));
51
+ it('Check item label element color and label', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
52
+ var _render2, container, headerItem;
53
+
54
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
55
+ while (1) {
56
+ switch (_context2.prev = _context2.next) {
57
+ case 0:
58
+ _render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_AccordionMenu.default, {
59
+ items: accordionItems,
60
+ onSelect: function onSelect() {}
61
+ })), container = _render2.container;
62
+ headerItem = container.querySelector('#test2_id');
63
+ expect(headerItem).toBeDefined();
64
+ expect(headerItem === null || headerItem === void 0 ? void 0 : headerItem.children[0]).toHaveStyleRule('background', _styles.COLORS.neutral_20);
65
+ expect(headerItem === null || headerItem === void 0 ? void 0 : headerItem.textContent).toContain('Item label with text 2');
66
+
67
+ case 5:
68
+ case "end":
69
+ return _context2.stop();
70
+ }
71
+ }
72
+ }, _callee2);
73
+ })));
74
+ it('Check expanded item text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
75
+ var _headerItem$children$;
76
+
77
+ var _render3, container, headerItem;
78
+
79
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
80
+ while (1) {
81
+ switch (_context3.prev = _context3.next) {
82
+ case 0:
83
+ _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_AccordionMenu.default, {
84
+ items: accordionItems,
85
+ onSelect: function onSelect() {},
86
+ selectedItemId: 'test1_id'
87
+ })), container = _render3.container;
88
+ headerItem = container.querySelector('#test1_id'); //check item expanded
89
+
90
+ expect(headerItem === null || headerItem === void 0 ? void 0 : headerItem.children[1]).toBeDefined();
91
+ expect(headerItem === null || headerItem === void 0 ? void 0 : (_headerItem$children$ = headerItem.children[1]) === null || _headerItem$children$ === void 0 ? void 0 : _headerItem$children$.textContent).toContain('content test1');
92
+
93
+ case 4:
94
+ case "end":
95
+ return _context3.stop();
96
+ }
97
+ }
98
+ }, _callee3);
99
+ })));
100
+ });
101
+ //# sourceMappingURL=AccordionMenu.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/Accordion/__tests__/AccordionMenu.test.tsx"],"names":["accordionItems","id","title","children","describe","it","queryByText","expect","toBeDefined","toBeNull","container","headerItem","querySelector","toHaveStyleRule","COLORS","neutral_20","textContent","toContain"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,cAAc,GAAG,CACrB;AACEC,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CADqB,EAMrB;AACEF,EAAAA,EAAE,EAAE,UADN;AAEEC,EAAAA,KAAK,EAAE,wBAFT;AAGEC,EAAAA,QAAQ,eAAE;AAHZ,CANqB,CAAvB;AAaAC,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AAClCC,EAAAA,EAAE,CAAC,qCAAD,uEAAwC;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,sBAChB,kCAAO,6BAAC,sBAAD;AAAe,cAAA,KAAK,EAAEL,cAAtB;AAAsC,cAAA,QAAQ,EAAE,oBAAM,CAAE;AAAxD,cAAP,CADgB,EAChCM,WADgC,WAChCA,WADgC;AAExCC,YAAAA,MAAM,CAACD,WAAW,CAAC,wBAAD,CAAZ,CAAN,CAA8CE,WAA9C;AACAD,YAAAA,MAAM,CAACD,WAAW,CAAC,wBAAD,CAAZ,CAAN,CAA8CE,WAA9C;AACAD,YAAAA,MAAM,CAACD,WAAW,CAAC,eAAD,CAAZ,CAAN,CAAqCG,QAArC;;AAJwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAxC,GAAF;AAOAJ,EAAAA,EAAE,CAAC,0C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AvD;;AAL6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAA7B,GAAF;AAOD,CAvBO,CAAR","sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport 'jest-styled-components';\nimport { COLORS } from '../../styles';\nimport AccordionMenu from '../AccordionMenu';\n\nconst accordionItems = [\n {\n id: 'test1_id',\n title: 'Item label with text 1',\n children: <div>content test1</div>,\n },\n {\n id: 'test2_id',\n title: 'Item label with text 2',\n children: <div>content test2</div>,\n },\n];\n\ndescribe('<AccordionMenu />', () => {\n it('Check correct text placed on labels', async () => {\n const { queryByText } = render(<AccordionMenu items={accordionItems} onSelect={() => {}}></AccordionMenu>);\n expect(queryByText('Item label with text 1')).toBeDefined();\n expect(queryByText('Item label with text 2')).toBeDefined();\n expect(queryByText('content test1')).toBeNull();\n });\n\n it('Check item label element color and label', async () => {\n const { container } = render(<AccordionMenu items={accordionItems} onSelect={() => {}}></AccordionMenu>);\n const headerItem = container.querySelector('#test2_id');\n expect(headerItem).toBeDefined();\n expect(headerItem?.children[0]).toHaveStyleRule('background', COLORS.neutral_20);\n expect(headerItem?.textContent).toContain('Item label with text 2');\n });\n\n it('Check expanded item text', async () => {\n const { container } = render(<AccordionMenu items={accordionItems} onSelect={() => {}} selectedItemId={'test1_id'}></AccordionMenu>);\n const headerItem = container.querySelector('#test1_id');\n //check item expanded\n expect(headerItem?.children[1]).toBeDefined();\n expect(headerItem?.children[1]?.textContent).toContain('content test1');\n });\n});\n"],"file":"AccordionMenu.test.js"}
@@ -0,0 +1,3 @@
1
+ export { default as AccordionMenu } from './AccordionMenu';
2
+ export { default as AccordionMenuItem } from './AccordionMenu';
3
+ export { AccordionMenuWrapper } from './styles';
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "AccordionMenu", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _AccordionMenu.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "AccordionMenuItem", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _AccordionMenu.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "AccordionMenuWrapper", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _styles.AccordionMenuWrapper;
22
+ }
23
+ });
24
+
25
+ var _AccordionMenu = _interopRequireDefault(require("./AccordionMenu"));
26
+
27
+ var _styles = require("./styles");
28
+
29
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Accordion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA","sourcesContent":["export { default as AccordionMenu } from './AccordionMenu';\nexport { default as AccordionMenuItem } from './AccordionMenu';\nexport { AccordionMenuWrapper } from './styles';\n"],"file":"index.js"}
@@ -0,0 +1,10 @@
1
+ export declare const AccordionMenuWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const AccordionItemContainer: import("styled-components").StyledComponent<"div", any, {
3
+ displaySeparator: boolean;
4
+ isDisabled: boolean;
5
+ }, never>;
6
+ export declare const ItemHeaderContainer: import("styled-components").StyledComponent<"div", any, {
7
+ isDisabled: boolean;
8
+ }, never>;
9
+ export declare const HeaderIconContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const ItemBodyContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ItemBodyContainer = exports.HeaderIconContainer = exports.ItemHeaderContainer = exports.AccordionItemContainer = exports.AccordionMenuWrapper = void 0;
9
+
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+
12
+ var _styles = require("../styles");
13
+
14
+ var _zIndexes = require("../styles/z-indexes");
15
+
16
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
23
+
24
+ var AccordionMenuWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-width: 320px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
25
+
26
+ exports.AccordionMenuWrapper = AccordionMenuWrapper;
27
+
28
+ var AccordionItemContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n border-bottom: ", ";\n cursor: ", ";\n"])), function (props) {
29
+ return props.displaySeparator ? "1px solid ".concat(_styles.COLORS.neutral_100) : '';
30
+ }, function (props) {
31
+ return props.isDisabled ? 'not-allowed' : 'pointer';
32
+ });
33
+
34
+ exports.AccordionItemContainer = AccordionItemContainer;
35
+ var disabledState = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", "!important;\n color: ", ";\n pointer-events: none;\n svg {\n color: ", "!important;\n }\n"])), _styles.COLORS.white, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
36
+
37
+ var ItemHeaderContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px 11px 16px;\n cursor: pointer;\n background: ", ";\n svg:last-child {\n margin-left: auto;\n }\n :focus {\n outline: none;\n z-index: ", ";\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", ";\n }\n\n ", "\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n }\n"])), _styles.COLORS.neutral_20, _zIndexes.Z_INDEXES.focus, _styles.COLORS.primary_500, _styles.COLORS.primary_500, function (props) {
38
+ return props.isDisabled ? disabledState : '';
39
+ }, _styles.COLORS.primary_20, _styles.COLORS.primary_100);
40
+
41
+ exports.ItemHeaderContainer = ItemHeaderContainer;
42
+
43
+ var HeaderIconContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: auto;\n"])));
44
+
45
+ exports.HeaderIconContainer = HeaderIconContainer;
46
+
47
+ var ItemBodyContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: 0px 24px;\n margin: 12px 0;\n background: ", ";\n"])), _styles.COLORS.white);
48
+
49
+ exports.ItemBodyContainer = ItemBodyContainer;
50
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Accordion/styles.ts"],"names":["AccordionMenuWrapper","styled","div","AccordionItemContainer","props","displaySeparator","COLORS","neutral_100","isDisabled","disabledState","css","white","neutral_300","ItemHeaderContainer","neutral_20","Z_INDEXES","focus","primary_500","primary_20","primary_100","HeaderIconContainer","ItemBodyContainer"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEO,IAAMA,oBAAoB,GAAGC,0BAAOC,GAAV,oKAA1B;;;;AAOA,IAAMC,sBAAsB,GAAGF,0BAAOC,GAAV,2MAKhB,UAACE,KAAD;AAAA,SAAYA,KAAK,CAACC,gBAAN,uBAAsCC,eAAOC,WAA7C,IAA6D,EAAzE;AAAA,CALgB,EAMvB,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACI,UAAN,GAAmB,aAAnB,GAAmC,SAA/C;AAAA,CANuB,CAA5B;;;AASP,IAAMC,aAAa,OAAGC,qBAAH,6LACHJ,eAAOK,KADJ,EAERL,eAAOM,WAFC,EAKNN,eAAOM,WALD,CAAnB;;AASO,IAAMC,mBAAmB,GAAGZ,0BAAOC,GAAV,6dAOhBI,eAAOQ,UAPS,EAajBC,oBAAUC,KAbO,EAcDV,eAAOW,WAdN,EAckCX,eAAOW,WAdzC,EAiB5B,UAACb,KAAD;AAAA,SAAYA,KAAK,CAACI,UAAN,GAAmBC,aAAnB,GAAmC,EAA/C;AAAA,CAjB4B,EAmBdH,eAAOY,UAnBO,EAsBdZ,eAAOa,WAtBO,CAAzB;;;;AA0BA,IAAMC,mBAAmB,GAAGnB,0BAAOC,GAAV,+FAAzB;;;;AAIA,IAAMmB,iBAAiB,GAAGpB,0BAAOC,GAAV,wIAGdI,eAAOK,KAHO,CAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../styles';\nimport { Z_INDEXES } from '../styles/z-indexes';\n\nexport const AccordionMenuWrapper = styled.div`\n min-width: 320px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n`;\n\nexport const AccordionItemContainer = styled.div<{ displaySeparator: boolean; isDisabled: boolean }>`\n width: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n border-bottom: ${(props) => (props.displaySeparator ? `1px solid ${COLORS.neutral_100}` : '')};\n cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};\n`;\n\nconst disabledState = css`\n background: ${COLORS.white}!important;\n color: ${COLORS.neutral_300};\n pointer-events: none;\n svg {\n color: ${COLORS.neutral_300}!important;\n }\n`;\n\nexport const ItemHeaderContainer = styled.div<{ isDisabled: boolean }>`\n position: relative;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px 11px 16px;\n cursor: pointer;\n background: ${COLORS.neutral_20};\n svg:last-child {\n margin-left: auto;\n }\n :focus {\n outline: none;\n z-index: ${Z_INDEXES.focus};\n box-shadow: 0px 4px 12px ${COLORS.primary_500}, 0px 0px 8px ${COLORS.primary_500};\n }\n\n ${(props) => (props.isDisabled ? disabledState : '')}\n :hover {\n background: ${COLORS.primary_20};\n }\n :active {\n background: ${COLORS.primary_100};\n }\n`;\n\nexport const HeaderIconContainer = styled.div`\n margin-left: auto;\n`;\n\nexport const ItemBodyContainer = styled.div`\n padding: 0px 24px;\n margin: 12px 0;\n background: ${COLORS.white};\n`;\n"],"file":"styles.js"}
@@ -15,7 +15,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
15
 
16
16
  var _styling = require("./styling");
17
17
 
18
- var _excluded = ["id", "className", "variant", "href", "margin", "children", "target"];
18
+ var _excluded = ["children", "target", "variant"];
19
19
 
20
20
  var _templateObject;
21
21
 
@@ -40,24 +40,18 @@ var StyledLink = _styledComponents.default.a(_templateObject || (_templateObject
40
40
  });
41
41
 
42
42
  var HyperLink = function HyperLink(_ref) {
43
- var id = _ref.id,
44
- className = _ref.className,
45
- variant = _ref.variant,
46
- href = _ref.href,
47
- margin = _ref.margin,
48
- children = _ref.children,
49
- target = _ref.target,
43
+ var children = _ref.children,
44
+ _ref$target = _ref.target,
45
+ target = _ref$target === void 0 ? '_blank' : _ref$target,
46
+ _ref$variant = _ref.variant,
47
+ variant = _ref$variant === void 0 ? 'default' : _ref$variant,
50
48
  props = _objectWithoutProperties(_ref, _excluded);
51
49
 
52
- return /*#__PURE__*/React.createElement(StyledLink, _extends({
53
- id: id,
54
- className: className,
50
+ return /*#__PURE__*/React.createElement(StyledLink, _extends({}, props, {
55
51
  variant: variant,
56
- href: href,
57
- target: target || '_blank',
58
- rel: "noopener noreferrer",
59
- margin: margin
60
- }, props), children);
52
+ target: target,
53
+ rel: "noopener noreferrer"
54
+ }), children);
61
55
  };
62
56
 
63
57
  HyperLink.propTypes = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/HyperLink/HyperLink.tsx"],"names":["StyledLink","styled","a","props","variant","invertedStyle","defaultStyle","margin","HyperLink","id","className","href","children","target","disabled"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAGC,0BAAOC,CAAV,wFAIZ,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,OAAN,KAAkB,UAAlB,GAA+BC,sBAA/B,GAA+CC,qBAA3D;AAAA,CAJY,EAKZ,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACI,MAAN,qBAA0BJ,KAAK,CAACI,MAAhC,SAA4C,EAAxD;AAAA,CALY,CAAhB;;AAkBA,IAAMC,SAAkD,GAAG,SAArDA,SAAqD,OAA0F;AAAA,MAAvFC,EAAuF,QAAvFA,EAAuF;AAAA,MAAnFC,SAAmF,QAAnFA,SAAmF;AAAA,MAAxEN,OAAwE,QAAxEA,OAAwE;AAAA,MAA/DO,IAA+D,QAA/DA,IAA+D;AAAA,MAAzDJ,MAAyD,QAAzDA,MAAyD;AAAA,MAAjDK,QAAiD,QAAjDA,QAAiD;AAAA,MAAvCC,MAAuC,QAAvCA,MAAuC;AAAA,MAA5BV,KAA4B;;AACnJ,sBACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAEM,EAAhB;AAAoB,IAAA,SAAS,EAAEC,SAA/B;AAA0C,IAAA,OAAO,EAAEN,OAAnD;AAA4D,IAAA,IAAI,EAAEO,IAAlE;AAAwE,IAAA,MAAM,EAAEE,MAAM,IAAI,QAA1F;AAAoG,IAAA,GAAG,EAAC,qBAAxG;AAA8H,IAAA,MAAM,EAAEN;AAAtI,KAAkJJ,KAAlJ,GACGS,QADH,CADF;AAKD,CAND;;;AATEH,EAAAA,E;AACAL,EAAAA,O,4BAAS,S,EAAY,U;AACrBO,EAAAA,I;AACAG,EAAAA,Q;AACAP,EAAAA,M;AACAK,EAAAA,Q;AACAF,EAAAA,S;;eAWaF,S","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { defaultStyle, invertedStyle } from './styling';\n\nconst StyledLink = styled.a<{\n variant: 'default' | 'inverted';\n margin?: string;\n}>`\n ${(props) => (props.variant === 'inverted' ? invertedStyle : defaultStyle)}\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nexport interface HyperlinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n id: string;\n variant: 'default' | 'inverted';\n href: string;\n disabled?: boolean;\n margin?: string;\n children?: any;\n className?: string;\n}\n\nconst HyperLink: React.FunctionComponent<HyperlinkProps> = ({ id, className, variant, href, margin, children, target, ...props }: HyperlinkProps) => {\n return (\n <StyledLink id={id} className={className} variant={variant} href={href} target={target || '_blank'} rel=\"noopener noreferrer\" margin={margin} {...props}>\n {children}\n </StyledLink>\n );\n};\n\nexport default HyperLink;\n"],"file":"HyperLink.js"}
1
+ {"version":3,"sources":["../../../src/HyperLink/HyperLink.tsx"],"names":["StyledLink","styled","a","props","variant","invertedStyle","defaultStyle","margin","HyperLink","children","target","id","href","disabled","className"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAGC,0BAAOC,CAAV,wFAIZ,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,OAAN,KAAkB,UAAlB,GAA+BC,sBAA/B,GAA+CC,qBAA3D;AAAA,CAJY,EAKZ,UAACH,KAAD;AAAA,SAAYA,KAAK,CAACI,MAAN,qBAA0BJ,KAAK,CAACI,MAAhC,SAA4C,EAAxD;AAAA,CALY,CAAhB;;AAkBA,IAAMC,SAAkD,GAAG,SAArDA,SAAqD,OAAoF;AAAA,MAAjFC,QAAiF,QAAjFA,QAAiF;AAAA,yBAAvEC,MAAuE;AAAA,MAAvEA,MAAuE,4BAA9D,QAA8D;AAAA,0BAApDN,OAAoD;AAAA,MAApDA,OAAoD,6BAA1C,SAA0C;AAAA,MAA5BD,KAA4B;;AAC7I,sBACE,oBAAC,UAAD,eAAgBA,KAAhB;AAAuB,IAAA,OAAO,EAAEC,OAAhC;AAAyC,IAAA,MAAM,EAAEM,MAAjD;AAAyD,IAAA,GAAG,EAAC;AAA7D,MACGD,QADH,CADF;AAKD,CAND;;;AATEE,EAAAA,E;AACAP,EAAAA,O,4BAAS,S,EAAY,U;AACrBQ,EAAAA,I;AACAC,EAAAA,Q;AACAN,EAAAA,M;AACAE,EAAAA,Q;AACAK,EAAAA,S;;eAWaN,S","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { defaultStyle, invertedStyle } from './styling';\n\nconst StyledLink = styled.a<{\n variant: 'default' | 'inverted';\n margin?: string;\n}>`\n ${(props) => (props.variant === 'inverted' ? invertedStyle : defaultStyle)}\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nexport interface HyperlinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n id: string;\n variant: 'default' | 'inverted';\n href: string;\n disabled?: boolean;\n margin?: string;\n children?: any;\n className?: string;\n}\n\nconst HyperLink: React.FunctionComponent<HyperlinkProps> = ({ children, target = '_blank', variant = 'default', ...props }: HyperlinkProps) => {\n return (\n <StyledLink {...props} variant={variant} target={target} rel=\"noopener noreferrer\">\n {children}\n </StyledLink>\n );\n};\n\nexport default HyperLink;\n"],"file":"HyperLink.js"}