@helsenorge/designsystem-react 14.10.0 → 14.11.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 (139) hide show
  1. package/lib/BabyMobileMedium.js +1 -1
  2. package/lib/CHANGELOG.md +10 -0
  3. package/lib/Checkbox.js +25 -48
  4. package/lib/Checkbox.js.map +1 -1
  5. package/lib/CheckboxMarker.js +60 -0
  6. package/lib/CheckboxMarker.js.map +1 -0
  7. package/lib/ChildMedium.js +1 -1
  8. package/lib/EyeContactMedium.js +79 -0
  9. package/lib/EyeContactMedium.js.map +1 -0
  10. package/lib/FacialRecognitionFingerprintMedium.js +1 -1
  11. package/lib/FormGroup.js +5 -5
  12. package/lib/FormGroup.js.map +1 -1
  13. package/lib/GiveBabyFoodMedium.js +1 -1
  14. package/lib/Illustration.js +1 -1
  15. package/lib/IllustrationNames.js +4 -0
  16. package/lib/IllustrationNames.js.map +1 -1
  17. package/lib/LazyIllustration.js +5 -1
  18. package/lib/LazyIllustration.js.map +1 -1
  19. package/lib/Radio.js +73 -0
  20. package/lib/Radio.js.map +1 -0
  21. package/lib/RadioButton.js +95 -3
  22. package/lib/RadioButton.js.map +1 -1
  23. package/lib/RadioButton2.js +3 -73
  24. package/lib/RadioButton2.js.map +1 -1
  25. package/lib/RadioMarker.js +37 -0
  26. package/lib/RadioMarker.js.map +1 -0
  27. package/lib/ReadLettersMedium.js +1 -1
  28. package/lib/SkinToSkinMedium.js +106 -0
  29. package/lib/SkinToSkinMedium.js.map +1 -0
  30. package/lib/StorkMedium.js +1 -1
  31. package/lib/StrollerMedium.js +1 -1
  32. package/lib/Support2Medium.js +1 -1
  33. package/lib/TableBody.js +1 -1
  34. package/lib/TableHead.js +1 -1
  35. package/lib/TableRow.js +1 -1
  36. package/lib/ThinkingMedium.js +1 -1
  37. package/lib/VisualCheckbox.js +77 -0
  38. package/lib/VisualCheckbox.js.map +1 -0
  39. package/lib/VisualRadio.js +77 -0
  40. package/lib/VisualRadio.js.map +1 -0
  41. package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
  42. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
  43. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
  44. package/lib/components/Checkbox/styles.module.scss +9 -269
  45. package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
  46. package/lib/components/Illustration/index.js +1 -1
  47. package/lib/components/Illustrations/BabyMobile.js +1 -1
  48. package/lib/components/Illustrations/Child.js +1 -1
  49. package/lib/components/Illustrations/Doctor.js +1 -1
  50. package/lib/components/Illustrations/EyeContact.d.ts +8 -0
  51. package/lib/components/Illustrations/EyeContact.js +16 -0
  52. package/lib/components/Illustrations/EyeContact.js.map +1 -0
  53. package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
  54. package/lib/components/Illustrations/EyeContactMedium.js +2 -0
  55. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
  56. package/lib/components/Illustrations/GiveBabyFood.js +1 -1
  57. package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
  58. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  59. package/lib/components/Illustrations/ReadLetters.js +1 -1
  60. package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
  61. package/lib/components/Illustrations/SkinToSkin.js +16 -0
  62. package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
  63. package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
  64. package/lib/components/Illustrations/SkinToSkinMedium.js +2 -0
  65. package/lib/components/Illustrations/Stork.js +1 -1
  66. package/lib/components/Illustrations/Stroller.js +1 -1
  67. package/lib/components/Illustrations/Support2.js +1 -1
  68. package/lib/components/Illustrations/Thinking.js +1 -1
  69. package/lib/components/Panel/index.js +1 -1
  70. package/lib/components/PanelList/index.js +1 -1
  71. package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
  72. package/lib/components/RadioButton/RadioMarker/styles.module.scss +259 -0
  73. package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +24 -0
  74. package/lib/components/RadioButton/index.d.ts +0 -1
  75. package/lib/components/RadioButton/index.js +3 -3
  76. package/lib/components/RadioButton/styles.module.scss +11 -273
  77. package/lib/components/RadioButton/styles.module.scss.d.ts +1 -9
  78. package/lib/components/Table/index.js +1 -1
  79. package/lib/components/Validation/index.js +1 -1
  80. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +5 -128
  81. package/lib/components/VisualCheckboxCloud/styles.module.scss +2 -9
  82. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
  83. package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
  84. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
  85. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +5 -0
  86. package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
  87. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
  88. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
  89. package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
  90. package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
  91. package/lib/components/VisualCheckboxGroup/index.js +43 -0
  92. package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
  93. package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
  94. package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
  95. package/lib/components/{VisualRadioButtonCloud/RadioButton/RadioButton.d.ts → VisualRadioCloud/Radio/Radio.d.ts} +3 -3
  96. package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
  97. package/lib/components/VisualRadioCloud/Radio/index.js +5 -0
  98. package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
  99. package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
  100. package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
  101. package/lib/components/{VisualRadioButtonCloud/VisualRadioButtonCloud.d.ts → VisualRadioCloud/VisualRadioCloud.d.ts} +8 -8
  102. package/lib/components/VisualRadioCloud/index.d.ts +3 -0
  103. package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/index.js +7 -7
  104. package/lib/components/VisualRadioCloud/index.js.map +1 -0
  105. package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
  106. package/lib/components/{VisualRadioButtonCloud → VisualRadioCloud}/styles.module.scss.d.ts +1 -1
  107. package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
  108. package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
  109. package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
  110. package/lib/components/VisualRadioGroup/VisualRadio/index.js +5 -0
  111. package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
  112. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
  113. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
  114. package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
  115. package/lib/components/VisualRadioGroup/index.d.ts +3 -0
  116. package/lib/components/VisualRadioGroup/index.js +63 -0
  117. package/lib/components/VisualRadioGroup/index.js.map +1 -0
  118. package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
  119. package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
  120. package/lib/scss/_visual-form.scss +345 -0
  121. package/lib/utils3.js +10 -98
  122. package/lib/utils3.js.map +1 -1
  123. package/lib/utils4.js +28 -11
  124. package/lib/utils4.js.map +1 -1
  125. package/lib/utils5.js +58 -28
  126. package/lib/utils5.js.map +1 -1
  127. package/package.json +115 -1
  128. package/scss/_visual-form.scss +345 -0
  129. package/lib/components/RadioButton/utils.d.ts +0 -2
  130. package/lib/components/VisualRadioButtonCloud/RadioButton/index.d.ts +0 -3
  131. package/lib/components/VisualRadioButtonCloud/RadioButton/index.js +0 -5
  132. package/lib/components/VisualRadioButtonCloud/RadioButton/index.js.map +0 -1
  133. package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss +0 -133
  134. package/lib/components/VisualRadioButtonCloud/RadioButton/styles.module.scss.d.ts +0 -15
  135. package/lib/components/VisualRadioButtonCloud/index.d.ts +0 -3
  136. package/lib/components/VisualRadioButtonCloud/index.js.map +0 -1
  137. package/lib/components/VisualRadioButtonCloud/styles.module.scss +0 -13
  138. package/lib/utils6.js +0 -60
  139. package/lib/utils6.js.map +0 -1
package/lib/utils5.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils5.js","names":[],"sources":["../src/components/Panel/constants.ts","../src/components/PanelList/utils.tsx"],"sourcesContent":["export enum PanelLayout {\n vertical = 'vertical',\n horizontal = 'horizontal',\n combined = 'combined',\n bAsRightCol = 'bAsRightCol',\n}\n\nexport enum PanelVariant {\n fill = 'fill',\n line = 'line',\n outline = 'outline',\n}\n\nexport enum PanelStacking {\n default = 'default',\n bFirst = 'bFirst',\n}\n\nexport enum PanelStatus {\n none = 'none',\n new = 'new',\n error = 'error',\n draft = 'draft',\n}\n","import { createContext } from 'react';\n\nimport type { PanelVariant } from '../Panel/constants';\n\nexport interface PanelListContextValue {\n variant: PanelVariant;\n highlightText?: string;\n applyPanelClassName: (existingClassName?: string) => string;\n}\n\nexport const PanelListContext = createContext<PanelListContextValue | null>(null);\n"],"mappings":";AAAA,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,cAAA;AACA,eAAA,gBAAA;AACA,eAAA,cAAA;AACA,eAAA,iBAAA;;;AAGF,IAAY,eAAA,yBAAA,gBAAL;AACL,gBAAA,UAAA;AACA,gBAAA,UAAA;AACA,gBAAA,aAAA;;;AAGF,IAAY,gBAAA,yBAAA,iBAAL;AACL,iBAAA,aAAA;AACA,iBAAA,YAAA;;;AAGF,IAAY,cAAA,yBAAA,eAAL;AACL,eAAA,UAAA;AACA,eAAA,SAAA;AACA,eAAA,WAAA;AACA,eAAA,WAAA;;;ACZF,MAAa,mBAAmB,cAA4C,KAAK"}
1
+ {"version":3,"file":"utils5.js","names":["clone: Partial<T>"],"sources":["../src/components/Table/utils.ts"],"sourcesContent":["import React from 'react';\n\nimport type { ModeType } from './constants';\nimport type { BreakpointConfig } from './Table';\n\nimport { ResponsiveTableVariant } from './constants';\nimport { Breakpoint } from '../../hooks/useBreakpoint';\nimport { isTouchDevice } from '../../utils/device';\n\nimport styles from './styles.module.scss';\n\n/**\n * Sjekk om det skal brukes CSS for å bestemme responsivt utseende på dette breakpoint\n * @param config Konfigurasjon for responsiv oppførsel\n * @returns true om breakpoint bruker CSS\n */\nconst configUsesCss = (config: BreakpointConfig): boolean =>\n config.variant === ResponsiveTableVariant.centeredoverflow || config.variant === ResponsiveTableVariant.block;\n\n/**\n * Lag klassenavn for CSS-config\n * @param config Konfigurasjon for responsiv oppførsel\n * @returns CSS-klassenavn\n */\nconst mapConfigToClass = (config: BreakpointConfig): string =>\n config.variant === 'centeredoverflow' || config.variant === 'block' ? styles[`table--${config.variant}-${config.breakpoint}`] : '';\n\n/**\n * Sorter konfigurasjon etter breakpoints, fra største til minste\n * @param a Konfigurasjon for responsiv oppførsel\n * @param b Konfigurasjon for responsiv oppførsel\n * @returns Sortert liste\n */\nconst sortByBreakpointsDescending = (a: BreakpointConfig, b: BreakpointConfig): number =>\n Breakpoint[a.breakpoint] - Breakpoint[b.breakpoint];\n\n/**\n * Sjekk om en konfigurasjon skal brukes for nåværende breakpoint\n * @param a Konfigurasjon for responsiv oppførsel\n * @param breakpoint Nåværende breakpoint\n * @returns true dersom config skal brukes for breakpointet\n */\nconst isValidForCurrentBreakpoint = (config: BreakpointConfig, breakpoint: Breakpoint): boolean =>\n Breakpoint[config.breakpoint] >= breakpoint;\n\n/**\n * Finn konfigurasjon for nåværende breakpoint\n * @param config Konfigurasjon for responsiv oppførsel\n * @param breakpoint Nåværende breakpoint\n * @returns Konfigurasjon for responsiv oppførsel\n */\nconst getConfigForBreakpoint = (config: BreakpointConfig | BreakpointConfig[], breakpoint: Breakpoint): BreakpointConfig | undefined => {\n if (Array.isArray(config)) {\n config.sort(sortByBreakpointsDescending);\n\n return config.find(x => isValidForCurrentBreakpoint(x, breakpoint));\n } else if (config && isValidForCurrentBreakpoint(config, breakpoint)) {\n return config;\n }\n};\n\n/**\n * Finn konfigurasjon for nåværende breakpoint og tabellbredde\n * @param config Konfigurasjon for responsiv oppførsel\n * @param breakpoint Nåværende breakpoint\n * @param tableWidth Bredde på tabell i px\n * @returns Konfigurasjon for responsiv oppførsel uten fallbackVariant\n */\nexport const getCurrentConfig = (\n config: BreakpointConfig | BreakpointConfig[],\n breakpoint: Breakpoint,\n tableWidth: number,\n windowWidth: number\n): Omit<BreakpointConfig, 'fallbackVariant'> | undefined => {\n const breakpointConfig = getConfigForBreakpoint(config, breakpoint);\n const canUseHorizontalScroll = isTouchDevice();\n const canUseCenteredOverflow = tableWidth <= windowWidth;\n\n if (!breakpointConfig) {\n return;\n }\n\n if (\n breakpointConfig.variant === ResponsiveTableVariant.centeredoverflow &&\n !canUseCenteredOverflow &&\n breakpointConfig.fallbackVariant === ResponsiveTableVariant.horizontalscroll\n ) {\n return {\n variant: canUseHorizontalScroll ? ResponsiveTableVariant.horizontalscroll : ResponsiveTableVariant.none,\n breakpoint: breakpointConfig.breakpoint,\n };\n }\n\n if (\n breakpointConfig.variant === ResponsiveTableVariant.centeredoverflow &&\n !canUseCenteredOverflow &&\n breakpointConfig.fallbackVariant !== ResponsiveTableVariant.centeredoverflow\n ) {\n return {\n variant: breakpointConfig.fallbackVariant ?? ResponsiveTableVariant.none,\n breakpoint: breakpointConfig.breakpoint,\n };\n }\n\n if (\n breakpointConfig.variant === ResponsiveTableVariant.horizontalscroll &&\n !canUseHorizontalScroll &&\n breakpointConfig.fallbackVariant === ResponsiveTableVariant.centeredoverflow\n ) {\n return {\n variant: canUseCenteredOverflow ? ResponsiveTableVariant.centeredoverflow : ResponsiveTableVariant.none,\n breakpoint: breakpointConfig.breakpoint,\n };\n }\n\n if (\n breakpointConfig.variant === ResponsiveTableVariant.horizontalscroll &&\n !canUseHorizontalScroll &&\n breakpointConfig.fallbackVariant !== ResponsiveTableVariant.horizontalscroll\n ) {\n return {\n variant: breakpointConfig.fallbackVariant ?? ResponsiveTableVariant.none,\n breakpoint: breakpointConfig.breakpoint,\n };\n }\n\n return breakpointConfig;\n};\n\n/**\n * Finn klassenavn for responsiv oppførsel\n * @param config Konfigurasjon for responsiv oppførsel\n * @returns Klassenavn\n */\nexport const getBreakpointClass = (config?: BreakpointConfig): string | undefined =>\n config && configUsesCss(config) ? mapConfigToClass(config) : undefined;\n\n/**\n * Finn riktig posisjon for horisontal sentrering av tabell som skal vises \"centeredoverflow\"\n * @param parentWidth Bredde på element som tabellen ligger i\n * @param tableWidth Bredde på tabellen\n * @returns Styling som posisjonerer tabellen riktig\n */\nexport const getCenteredOverflowTableStyle = (parentWidth: number, tableWidth: number): React.CSSProperties | undefined => {\n if (parentWidth >= tableWidth) {\n return;\n }\n\n const COLUMN_GUTTER_WIDTH_PX = 8;\n\n return { left: `${(parentWidth - tableWidth) / 2 - COLUMN_GUTTER_WIDTH_PX}px` };\n};\n\n/**\n * Map children and inject the `mode` prop into element children, but never on React.Fragment.\n * If a Fragment is encountered, its children are mapped and updated, while the Fragment wrapper is preserved.\n */\nexport const mapChildrenWithMode = (children: React.ReactNode, mode: ModeType | undefined): React.ReactNode =>\n React.Children.map(children, child => {\n if (!React.isValidElement(child)) return child;\n if (child.type === React.Fragment) {\n const fragmentChildren = (child.props as { children?: React.ReactNode }).children;\n const mapped = React.Children.map(fragmentChildren, gc =>\n React.isValidElement<{ mode?: ModeType }>(gc) ? React.cloneElement(gc, { mode }) : gc\n );\n return React.cloneElement(child, undefined, mapped);\n }\n return React.cloneElement(child as React.ReactElement<{ mode?: ModeType }>, { mode });\n });\n\n/**\n * Create a shallow copy of an object with specific keys omitted.\n */\nexport const omitProps = <T extends Record<PropertyKey, unknown>>(obj: T, keys: Array<keyof T>): Partial<T> => {\n const clone: Partial<T> = { ...obj };\n for (const k of keys) {\n delete clone[k];\n }\n return clone;\n};\n"],"mappings":";;;;;AAgBA,IAAM,iBAAiB,WACrB,OAAO,YAAY,uBAAuB,oBAAoB,OAAO,YAAY,uBAAuB;AAO1G,IAAM,oBAAoB,WACxB,OAAO,YAAY,sBAAsB,OAAO,YAAY,UAAU,YAAO,UAAU,OAAO,QAAQ,GAAG,OAAO,gBAAgB;AAQlI,IAAM,+BAA+B,GAAqB,MACxD,WAAW,EAAE,cAAc,WAAW,EAAE;AAQ1C,IAAM,+BAA+B,QAA0B,eAC7D,WAAW,OAAO,eAAe;AAQnC,IAAM,0BAA0B,QAA+C,eAAyD;AACtI,KAAI,MAAM,QAAQ,OAAO,EAAE;AACzB,SAAO,KAAK,4BAA4B;AAExC,SAAO,OAAO,MAAK,MAAK,4BAA4B,GAAG,WAAW,CAAC;YAC1D,UAAU,4BAA4B,QAAQ,WAAW,CAClE,QAAO;;AAWX,MAAa,oBACX,QACA,YACA,YACA,gBAC0D;CAC1D,MAAM,mBAAmB,uBAAuB,QAAQ,WAAW;CACnE,MAAM,yBAAyB,eAAe;CAC9C,MAAM,yBAAyB,cAAc;AAE7C,KAAI,CAAC,iBACH;AAGF,KACE,iBAAiB,YAAY,uBAAuB,oBACpD,CAAC,0BACD,iBAAiB,oBAAoB,uBAAuB,iBAE5D,QAAO;EACL,SAAS,yBAAyB,uBAAuB,mBAAmB,uBAAuB;EACnG,YAAY,iBAAiB;EAC9B;AAGH,KACE,iBAAiB,YAAY,uBAAuB,oBACpD,CAAC,0BACD,iBAAiB,oBAAoB,uBAAuB,iBAE5D,QAAO;EACL,SAAS,iBAAiB,mBAAmB,uBAAuB;EACpE,YAAY,iBAAiB;EAC9B;AAGH,KACE,iBAAiB,YAAY,uBAAuB,oBACpD,CAAC,0BACD,iBAAiB,oBAAoB,uBAAuB,iBAE5D,QAAO;EACL,SAAS,yBAAyB,uBAAuB,mBAAmB,uBAAuB;EACnG,YAAY,iBAAiB;EAC9B;AAGH,KACE,iBAAiB,YAAY,uBAAuB,oBACpD,CAAC,0BACD,iBAAiB,oBAAoB,uBAAuB,iBAE5D,QAAO;EACL,SAAS,iBAAiB,mBAAmB,uBAAuB;EACpE,YAAY,iBAAiB;EAC9B;AAGH,QAAO;;AAQT,MAAa,sBAAsB,WACjC,UAAU,cAAc,OAAO,GAAG,iBAAiB,OAAO,GAAG,KAAA;AAQ/D,MAAa,iCAAiC,aAAqB,eAAwD;AACzH,KAAI,eAAe,WACjB;AAKF,QAAO,EAAE,MAAM,IAAI,cAAc,cAAc,IAFhB,EAE2C,KAAK;;AAOjF,MAAa,uBAAuB,UAA2B,SAC7D,MAAM,SAAS,IAAI,WAAU,UAAS;AACpC,KAAI,CAAC,MAAM,eAAe,MAAM,CAAE,QAAO;AACzC,KAAI,MAAM,SAAS,MAAM,UAAU;EACjC,MAAM,mBAAoB,MAAM,MAAyC;EACzE,MAAM,SAAS,MAAM,SAAS,IAAI,mBAAkB,OAClD,MAAM,eAAoC,GAAG,GAAG,MAAM,aAAa,IAAI,EAAE,MAAM,CAAC,GAAG,GACpF;AACD,SAAO,MAAM,aAAa,OAAO,KAAA,GAAW,OAAO;;AAErD,QAAO,MAAM,aAAa,OAAkD,EAAE,MAAM,CAAC;EACrF;AAKJ,MAAa,aAAqD,KAAQ,SAAqC;CAC7G,MAAMA,QAAoB,EAAE,GAAG,KAAK;AACpC,MAAK,MAAM,KAAK,KACd,QAAO,MAAM;AAEf,QAAO"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@helsenorge/designsystem-react",
3
3
  "sideEffects": false,
4
4
  "private": false,
5
- "version": "14.10.0",
5
+ "version": "14.11.0",
6
6
  "description": "The official design system for Helsenorge built with React.",
7
7
  "repository": {
8
8
  "type": "git",
@@ -732,6 +732,120 @@
732
732
  },
733
733
  "./components/Validation/types": {
734
734
  "types": "./lib/components/Validation/types.d.ts"
735
+ },
736
+ "./components/Avatar/constants": {
737
+ "types": "./lib/components/Avatar/constants.d.ts"
738
+ },
739
+ "./components/Chip/resourceHelper": {
740
+ "types": "./lib/components/Chip/resourceHelper.d.ts"
741
+ },
742
+ "./components/DropdownOld/constants": {
743
+ "types": "./lib/components/DropdownOld/constants.d.ts"
744
+ },
745
+ "./components/ElementHeader/utils": {
746
+ "types": "./lib/components/ElementHeader/utils.d.ts"
747
+ },
748
+ "./components/EmptyState/constants": {
749
+ "types": "./lib/components/EmptyState/constants.d.ts"
750
+ },
751
+ "./components/Expander/constants": {
752
+ "types": "./lib/components/Expander/constants.d.ts"
753
+ },
754
+ "./components/Filter/resourceHelper": {
755
+ "types": "./lib/components/Filter/resourceHelper.d.ts"
756
+ },
757
+ "./components/Filter/resourcesMock": {
758
+ "types": "./lib/components/Filter/resourcesMock.d.ts"
759
+ },
760
+ "./components/Filter/useFilter": {
761
+ "types": "./lib/components/Filter/useFilter.d.ts"
762
+ },
763
+ "./components/Filter/useFilterDrawer": {
764
+ "types": "./lib/components/Filter/useFilterDrawer.d.ts"
765
+ },
766
+ "./components/Filter/utils": {
767
+ "types": "./lib/components/Filter/utils.d.ts"
768
+ },
769
+ "./components/FormLayout/constants": {
770
+ "types": "./lib/components/FormLayout/constants.d.ts"
771
+ },
772
+ "./components/Icon/utils": {
773
+ "types": "./lib/components/Icon/utils.d.ts"
774
+ },
775
+ "./components/Input/constants": {
776
+ "types": "./lib/components/Input/constants.d.ts"
777
+ },
778
+ "./components/Input/resourceHelper": {
779
+ "types": "./lib/components/Input/resourceHelper.d.ts"
780
+ },
781
+ "./components/Label/utils": {
782
+ "types": "./lib/components/Label/utils.d.ts"
783
+ },
784
+ "./components/LinkList/resourceHelper": {
785
+ "types": "./lib/components/LinkList/resourceHelper.d.ts"
786
+ },
787
+ "./components/ListEditMode/constants": {
788
+ "types": "./lib/components/ListEditMode/constants.d.ts"
789
+ },
790
+ "./components/Loader/constants": {
791
+ "types": "./lib/components/Loader/constants.d.ts"
792
+ },
793
+ "./components/Modal/constants": {
794
+ "types": "./lib/components/Modal/constants.d.ts"
795
+ },
796
+ "./components/Panel/constants": {
797
+ "types": "./lib/components/Panel/constants.d.ts"
798
+ },
799
+ "./components/PanelList/utils": {
800
+ "types": "./lib/components/PanelList/utils.d.ts"
801
+ },
802
+ "./components/PopMenu/constants": {
803
+ "types": "./lib/components/PopMenu/constants.d.ts"
804
+ },
805
+ "./components/Progressbar/constants": {
806
+ "types": "./lib/components/Progressbar/constants.d.ts"
807
+ },
808
+ "./components/StatusDot/constants": {
809
+ "types": "./lib/components/StatusDot/constants.d.ts"
810
+ },
811
+ "./components/Table/constants": {
812
+ "types": "./lib/components/Table/constants.d.ts"
813
+ },
814
+ "./components/Tag/constants": {
815
+ "types": "./lib/components/Tag/constants.d.ts"
816
+ },
817
+ "./components/Textarea/resourceHelper": {
818
+ "types": "./lib/components/Textarea/resourceHelper.d.ts"
819
+ },
820
+ "./components/Title/utils": {
821
+ "types": "./lib/components/Title/utils.d.ts"
822
+ },
823
+ "./components/Toggle/constants": {
824
+ "types": "./lib/components/Toggle/constants.d.ts"
825
+ },
826
+ "./components/VisualCheckboxCloud/VisualCheckboxCloud": {
827
+ "types": "./lib/components/VisualCheckboxCloud/VisualCheckboxCloud.d.ts",
828
+ "import": "./lib/components/VisualCheckboxCloud/index.js",
829
+ "require": "./lib/components/VisualCheckboxCloud/index.js",
830
+ "default": "./lib/components/VisualCheckboxCloud/index.js"
831
+ },
832
+ "./components/VisualCheckboxGroup/VisualCheckboxGroup": {
833
+ "types": "./lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts",
834
+ "import": "./lib/components/VisualCheckboxGroup/index.js",
835
+ "require": "./lib/components/VisualCheckboxGroup/index.js",
836
+ "default": "./lib/components/VisualCheckboxGroup/index.js"
837
+ },
838
+ "./components/VisualRadioCloud/VisualRadioCloud": {
839
+ "types": "./lib/components/VisualRadioCloud/VisualRadioCloud.d.ts",
840
+ "import": "./lib/components/VisualRadioCloud/index.js",
841
+ "require": "./lib/components/VisualRadioCloud/index.js",
842
+ "default": "./lib/components/VisualRadioCloud/index.js"
843
+ },
844
+ "./components/VisualRadioGroup/VisualRadioGroup": {
845
+ "types": "./lib/components/VisualRadioGroup/VisualRadioGroup.d.ts",
846
+ "import": "./lib/components/VisualRadioGroup/index.js",
847
+ "require": "./lib/components/VisualRadioGroup/index.js",
848
+ "default": "./lib/components/VisualRadioGroup/index.js"
735
849
  }
736
850
  },
737
851
  "scripts": {
@@ -0,0 +1,345 @@
1
+ @use 'sass:map';
2
+ @use 'breakpoints' as breakpoints;
3
+ @use 'font-mixins' as fonts;
4
+
5
+ // Wrapper layout shared by VisualCheckboxCloud and VisualRadioCloud
6
+ @mixin visual-form-cloud {
7
+ display: flex;
8
+ flex-flow: row wrap;
9
+ gap: var(--core-space-4xs) var(--core-space-xs);
10
+
11
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
12
+ gap: var(--core-space-m) var(--core-space-s);
13
+ }
14
+ }
15
+
16
+ // Pill-style input shared by VisualCheckboxCloud/Checkbox and VisualRadioCloud/Radio
17
+ @mixin visual-form-pill(
18
+ $pill-padding-mobile: var(--core-space-3xs) var(--core-space-m),
19
+ $checked-pill-padding-md: var(--core-space-3xs) var(--core-space-m) var(--core-space-3xs) 1.25rem
20
+ ) {
21
+ position: relative;
22
+ display: inline-flex;
23
+ align-items: stretch;
24
+ min-height: 2.75rem;
25
+ padding: 0.313rem 0;
26
+ cursor: pointer;
27
+
28
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
29
+ padding: 0;
30
+ }
31
+
32
+ &__input {
33
+ // Hides input while making sure screen reader outline wraps the entire component
34
+ cursor: pointer;
35
+ position: absolute;
36
+ z-index: 0;
37
+ inset: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ outline: none;
41
+ appearance: none;
42
+ }
43
+
44
+ &__pill {
45
+ position: relative;
46
+ z-index: 1;
47
+ display: inline-flex;
48
+ align-items: center;
49
+ gap: var(--core-space-2xs);
50
+ box-sizing: border-box;
51
+ min-height: var(--core-space-l);
52
+ padding: $pill-padding-mobile;
53
+ border-radius: 100px;
54
+ background-color: var(--color-action-background-ondark);
55
+ border: 1px solid var(--color-action-border-onlight);
56
+ color: var(--color-base-text-onlight);
57
+
58
+ @include fonts.title6;
59
+
60
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
61
+ min-height: var(--core-space-xl);
62
+ padding: var(--core-space-3xs) var(--core-space-l);
63
+ }
64
+ }
65
+
66
+ &:hover &__pill {
67
+ background-color: var(--color-action-background-ondark-hover);
68
+ border-color: var(--color-action-border-onlight-hover);
69
+ }
70
+
71
+ &:active &__pill {
72
+ background-color: var(--color-action-background-ondark-selected);
73
+ border-color: var(--color-action-border-onlight-hover);
74
+ }
75
+
76
+ &--checked &__pill {
77
+ background-color: var(--color-action-background-onlight);
78
+ color: var(--color-action-text-ondark);
79
+ border-color: var(--color-action-background-onlight);
80
+ padding: var(--core-space-3xs) var(--core-space-s);
81
+
82
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
83
+ padding: $checked-pill-padding-md;
84
+ }
85
+ }
86
+
87
+ &--checked:hover &__pill {
88
+ background-color: var(--color-action-graphics-onlight-hover);
89
+ border-color: var(--color-action-graphics-onlight-hover);
90
+ }
91
+
92
+ &--checked:active &__pill {
93
+ background-color: var(--color-action-background-onlight-active);
94
+ border-color: var(--color-action-background-onlight-active);
95
+ }
96
+
97
+ &--invalid &__pill {
98
+ background-color: var(--color-action-background-ondark);
99
+ border-color: var(--color-destructive-border-normal);
100
+ }
101
+
102
+ &--invalid:hover &__pill {
103
+ background-color: var(--color-destructive-background-normal);
104
+ border-color: var(--color-destructive-border-normal);
105
+ }
106
+
107
+ &--invalid:active &__pill {
108
+ background-color: var(--color-destructive-background-emphasized);
109
+ border-color: var(--color-destructive-border-normal);
110
+ }
111
+
112
+ &--invalid#{&}--checked &__pill {
113
+ background-color: var(--color-destructive-graphics-normal);
114
+ border-color: var(--color-destructive-graphics-normal);
115
+ }
116
+
117
+ &--invalid#{&}--checked:hover &__pill {
118
+ background-color: var(--color-destructive-graphics-hover);
119
+ border-color: var(--color-destructive-graphics-hover);
120
+ }
121
+
122
+ &--invalid#{&}--checked:active &__pill {
123
+ background-color: var(--color-destructive-graphics-emphasized-onlight);
124
+ border-color: var(--color-destructive-graphics-emphasized-onlight);
125
+ }
126
+
127
+ &__input:focus-visible + &__pill {
128
+ outline: 3px solid var(--color-action-border-onlight-focus);
129
+ border-color: var(--color-action-border-ondark);
130
+ }
131
+
132
+ &__icon {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+
137
+ svg {
138
+ fill: var(--color-action-graphics-ondark);
139
+ }
140
+ }
141
+
142
+ &__label {
143
+ text-box: trim-both cap alphabetic;
144
+ }
145
+ }
146
+
147
+ // Grid layout shared by VisualCheckboxGroup and VisualRadioGroup.
148
+ @mixin visual-form-group {
149
+ display: grid;
150
+ grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
151
+ gap: var(--core-space-xs);
152
+
153
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
154
+ gap: 0.75rem var(--core-space-xs, 0.75rem);
155
+ }
156
+
157
+ &--variant-line {
158
+ grid-template-columns: 1fr;
159
+ }
160
+ }
161
+
162
+ // Styling shared by VisualCheckbox and VisualRadio
163
+ @mixin visual-form-card {
164
+ display: flex;
165
+ position: relative;
166
+ cursor: pointer;
167
+ width: 100%;
168
+
169
+ &--variant-line {
170
+ flex-direction: row;
171
+ justify-content: flex-start;
172
+ align-items: center;
173
+ min-height: 6rem;
174
+ min-width: 15.125rem;
175
+ }
176
+
177
+ &--variant-rectangle {
178
+ flex-direction: column;
179
+ align-items: center;
180
+ min-height: 12.625rem;
181
+ min-width: 8.75rem;
182
+ height: 100%;
183
+ }
184
+
185
+ &__input {
186
+ // Hides input while making sure screen reader outline wraps the entire component
187
+ cursor: pointer;
188
+ position: absolute;
189
+ z-index: 0;
190
+ inset: 0;
191
+ width: 100%;
192
+ height: 100%;
193
+ outline: none;
194
+ appearance: none;
195
+ }
196
+
197
+ &__frame {
198
+ position: relative;
199
+ width: 100%;
200
+ z-index: 1;
201
+ display: inline-flex;
202
+ border-radius: 4px;
203
+ background: var(--color-action-background-ondark);
204
+ border: 2px solid var(--color-action-border-onlight);
205
+ color: var(--color-base-text-onlight);
206
+ }
207
+
208
+ &--variant-line &__frame {
209
+ margin-left: -2.87rem;
210
+ gap: var(--core-space-2xs);
211
+ flex-direction: row;
212
+ justify-content: flex-end;
213
+ align-items: center;
214
+ min-height: 4.63rem;
215
+ min-width: 12.25rem;
216
+ padding: var(--core-space-s) var(--core-space-m) var(--core-space-s) var(--core-space-2xl);
217
+ }
218
+
219
+ &--variant-rectangle &__frame {
220
+ margin-top: -4.37rem;
221
+ flex: 1;
222
+ gap: var(--core-space-xs);
223
+ flex-direction: column;
224
+ align-items: center;
225
+ justify-content: flex-end;
226
+ text-align: center;
227
+ min-width: 8.75rem;
228
+ min-height: 10.25rem;
229
+ padding: var(--core-space-3xl) var(--core-space-xs) var(--core-space-m) var(--core-space-xs);
230
+ }
231
+
232
+ &__visual-content {
233
+ position: relative;
234
+ z-index: 2;
235
+ display: inline-flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ overflow: hidden;
239
+ border-radius: 100%;
240
+ background: var(--color-action-background-ondark);
241
+ border: 2px solid var(--color-action-border-ondark);
242
+
243
+ > * {
244
+ width: 100%;
245
+ height: 100%;
246
+ object-fit: cover;
247
+ }
248
+ }
249
+
250
+ &--variant-line &__visual-content {
251
+ min-width: var(--core-space-4xl);
252
+ min-height: var(--core-space-4xl);
253
+
254
+ @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
255
+ min-width: var(--core-space-5xl);
256
+ min-height: var(--core-space-5xl);
257
+ }
258
+ }
259
+
260
+ &--variant-rectangle &__visual-content {
261
+ flex-shrink: 0;
262
+ width: calc(100% - 2rem);
263
+ min-width: 6.75rem;
264
+ max-width: 13rem;
265
+ }
266
+
267
+ &--checked &__frame {
268
+ background: var(--color-action-background-onlight);
269
+ color: var(--color-action-text-ondark);
270
+ border-color: var(--color-action-background-onlight);
271
+ }
272
+
273
+ &--invalid &__frame {
274
+ background: var(--color-action-background-ondark);
275
+ border-color: var(--core-color-cherry-500);
276
+ }
277
+
278
+ &:hover &__frame {
279
+ background: var(--core-color-neutral-50);
280
+ border-color: var(--color-action-border-onlight-hover);
281
+ }
282
+
283
+ &:active &__frame {
284
+ background: var(--core-color-neutral-100);
285
+ border-color: var(--color-action-border-onlight-hover);
286
+ }
287
+
288
+ &--checked:hover &__frame {
289
+ background: var(--color-action-background-onlight-hover);
290
+ }
291
+
292
+ &--checked:active &__frame {
293
+ background: var(--color-action-background-onlight-active);
294
+ border-color: var(--color-action-background-onlight-active);
295
+ }
296
+
297
+ &--invalid:hover &__frame {
298
+ background: var(--core-color-cherry-50);
299
+ border-color: var(--core-color-cherry-500);
300
+ }
301
+
302
+ &--invalid:active &__frame {
303
+ background: var(--core-color-cherry-100);
304
+ border-color: var(--core-color-cherry-500);
305
+ }
306
+
307
+ &--invalid#{&}--checked &__frame {
308
+ background: var(--core-color-cherry-50);
309
+ color: var(--color-base-text-onlight);
310
+ border-color: var(--core-color-cherry-500);
311
+ }
312
+
313
+ &--invalid#{&}--checked:hover &__frame {
314
+ background: var(--core-color-cherry-100);
315
+ border-color: var(--core-color-cherry-500);
316
+ }
317
+
318
+ &--invalid#{&}--checked:active &__frame {
319
+ background: var(--core-color-cherry-200);
320
+ border-color: var(--core-color-cherry-500);
321
+ }
322
+
323
+ &__input:focus-visible + &__frame {
324
+ outline: 4px solid var(--color-action-border-onlight-focus);
325
+ border-color: var(--color-action-border-ondark);
326
+ }
327
+
328
+ &__icon {
329
+ display: inline-flex;
330
+ align-items: center;
331
+ justify-content: center;
332
+
333
+ svg {
334
+ fill: var(--color-action-graphics-ondark);
335
+ }
336
+ }
337
+
338
+ &__label {
339
+ flex: 1;
340
+ min-width: 0;
341
+ overflow-wrap: anywhere;
342
+
343
+ @include fonts.label-subdued;
344
+ }
345
+ }
@@ -1,2 +0,0 @@
1
- import { FormOnColor } from '../../constants';
2
- export declare const getRadioLabelClasses: (radioId: string, onColor: FormOnColor, large: boolean, checkedRadioId?: string) => string | undefined;
@@ -1,3 +0,0 @@
1
- import { default as RadioButton } from './RadioButton';
2
- export * from './RadioButton';
3
- export default RadioButton;
@@ -1,5 +0,0 @@
1
- import { t as RadioButton_default$1 } from "../../../RadioButton2.js";
2
- var RadioButton_default = RadioButton_default$1;
3
- export { RadioButton_default as default };
4
-
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/VisualRadioButtonCloud/RadioButton/index.ts"],"sourcesContent":["import RadioButton from './RadioButton';\nexport * from './RadioButton';\nexport default RadioButton;\n"],"mappings":";AAEA,IAAA,sBAAe"}
@@ -1,133 +0,0 @@
1
- @use 'sass:map';
2
- @use '../../../scss/screen-reader' as *;
3
- @use '../../../scss/breakpoints' as breakpoints;
4
- @use '../../../scss/font-mixins' as fonts;
5
- @import '../../../scss/supernova/styles/colors.css';
6
- @import '../../../scss/supernova/styles/spacers.css';
7
-
8
- .visual-radio-button {
9
- position: relative;
10
- display: inline-flex;
11
- align-items: stretch;
12
- min-height: 2.75rem;
13
- padding: 0.313rem 0;
14
- cursor: pointer;
15
-
16
- @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
17
- padding: 0;
18
- }
19
-
20
- &__input {
21
- // Hides input while making sure screen reader outline wraps the entire component
22
- cursor: pointer;
23
- position: absolute;
24
- z-index: 0;
25
- inset: 0;
26
- width: 100%;
27
- height: 100%;
28
- outline: none;
29
- appearance: none;
30
- }
31
-
32
- &__pill {
33
- position: relative;
34
- z-index: 1;
35
- display: inline-flex;
36
- align-items: center;
37
- gap: var(--core-space-2xs);
38
- box-sizing: border-box;
39
- min-height: var(--core-space-l);
40
- padding: var(--core-space-3xs) var(--core-space-m);
41
- border-radius: 100px;
42
- background-color: var(--color-action-background-ondark);
43
- border: 1px solid var(--color-action-border-onlight);
44
- color: var(--color-base-text-onlight);
45
-
46
- @include fonts.title6;
47
-
48
- @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
49
- min-height: var(--core-space-xl);
50
- padding: var(--core-space-3xs) var(--core-space-l);
51
- }
52
- }
53
-
54
- &:hover &__pill {
55
- background-color: var(--color-action-background-ondark-hover);
56
- border-color: var(--color-action-border-onlight-hover);
57
- }
58
-
59
- &:active &__pill {
60
- background-color: var(--color-action-background-ondark-selected);
61
- border-color: var(--color-action-border-onlight-hover);
62
- }
63
-
64
- &--checked &__pill {
65
- background-color: var(--color-action-background-onlight);
66
- color: var(--color-action-text-ondark);
67
- border-color: var(--color-action-background-onlight);
68
- padding: var(--core-space-3xs) var(--core-space-s);
69
-
70
- @media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
71
- padding: var(--core-space-3xs) var(--core-space-m) var(--core-space-3xs) 1.25rem;
72
- }
73
- }
74
-
75
- &--checked:hover &__pill {
76
- background-color: var(--color-action-graphics-onlight-hover);
77
- border-color: var(--color-action-graphics-onlight-hover);
78
- }
79
-
80
- &--checked:active &__pill {
81
- background-color: var(--color-action-background-onlight-active);
82
- border-color: var(--color-action-background-onlight-active);
83
- }
84
-
85
- &--invalid &__pill {
86
- background-color: var(--color-action-background-ondark);
87
- border-color: var(--color-destructive-border-normal);
88
- }
89
-
90
- &--invalid:hover &__pill {
91
- background-color: var(--color-destructive-background-normal);
92
- border-color: var(--color-destructive-border-normal);
93
- }
94
-
95
- &--invalid:active &__pill {
96
- background-color: var(--color-destructive-background-emphasized);
97
- border-color: var(--color-destructive-border-normal);
98
- }
99
-
100
- &--invalid#{&}--checked &__pill {
101
- background-color: var(--color-destructive-graphics-normal);
102
- border-color: var(--color-destructive-graphics-normal);
103
- }
104
-
105
- &--invalid#{&}--checked:hover &__pill {
106
- background-color: var(--color-destructive-graphics-hover);
107
- border-color: var(--color-destructive-graphics-hover);
108
- }
109
-
110
- &--invalid#{&}--checked:active &__pill {
111
- background-color: var(--color-destructive-graphics-emphasized-onlight);
112
- border-color: var(--color-destructive-graphics-emphasized-onlight);
113
- }
114
-
115
- &__input:focus-visible + &__pill {
116
- outline: 3px solid var(--color-action-border-onlight-focus);
117
- border-color: var(--color-action-border-ondark);
118
- }
119
-
120
- &__icon {
121
- display: inline-flex;
122
- align-items: center;
123
- justify-content: center;
124
-
125
- svg {
126
- fill: var(--color-action-graphics-ondark);
127
- }
128
- }
129
-
130
- &__label {
131
- text-box: trim-both cap alphabetic;
132
- }
133
- }
@@ -1,15 +0,0 @@
1
- export type Styles = {
2
- 'visual-radio-button': string;
3
- 'visual-radio-button__icon': string;
4
- 'visual-radio-button__input': string;
5
- 'visual-radio-button__label': string;
6
- 'visual-radio-button__pill': string;
7
- 'visual-radio-button--checked': string;
8
- 'visual-radio-button--invalid': string;
9
- };
10
-
11
- export type ClassNames = keyof Styles;
12
-
13
- declare const styles: Styles;
14
-
15
- export default styles;
@@ -1,3 +0,0 @@
1
- import { default as VisualRadioButtonCloud } from './VisualRadioButtonCloud';
2
- export * from './VisualRadioButtonCloud';
3
- export default VisualRadioButtonCloud;