@helsenorge/designsystem-react 5.8.0 → 5.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/TableHeadCell.js +1 -1
  3. package/TableHeadCell.js.map +1 -1
  4. package/components/Illustration/Illustration.d.ts +6 -0
  5. package/components/Illustration/Illustration.d.ts.map +1 -0
  6. package/components/Illustration/index.d.ts +2 -0
  7. package/components/Illustration/index.d.ts.map +1 -0
  8. package/components/Illustration/index.js +2 -0
  9. package/components/Illustration/index.js.map +1 -0
  10. package/components/Input/index.d.ts.map +1 -1
  11. package/components/Label/componentdata.json +1 -1
  12. package/components/PromoPanel/PromoPanel.d.ts +33 -0
  13. package/components/PromoPanel/PromoPanel.d.ts.map +1 -0
  14. package/components/PromoPanel/componentdata.json +1 -0
  15. package/components/PromoPanel/index.d.ts +4 -0
  16. package/components/PromoPanel/index.d.ts.map +1 -0
  17. package/components/PromoPanel/index.js +2 -0
  18. package/components/PromoPanel/index.js.map +1 -0
  19. package/components/PromoPanel/styles.module.scss +115 -0
  20. package/components/PromoPanel/styles.module.scss.d.ts +16 -0
  21. package/components/Slider/Slider.d.ts +1 -0
  22. package/components/Slider/Slider.d.ts.map +1 -1
  23. package/components/Slider/index.js +1 -1
  24. package/components/Slider/index.js.map +1 -1
  25. package/components/Table/TableHeadCell/TableHeadCell.d.ts.map +1 -1
  26. package/components/Table/styles.module.scss +0 -12
  27. package/components/Table/styles.module.scss.d.ts +0 -1
  28. package/constants.d.ts +1 -0
  29. package/constants.d.ts.map +1 -1
  30. package/constants.js +1 -1
  31. package/constants.js.map +1 -1
  32. package/hooks/usePseudoClasses.d.ts.map +1 -1
  33. package/hooks/usePseudoClasses.js +1 -1
  34. package/hooks/usePseudoClasses.js.map +1 -1
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [5.9.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.8.0&targetVersion=GTv5.9.0) (2023-12-11)
2
+
3
+ ### Features
4
+
5
+ - promopanel ([a190968](https://github.com/helsenorge/designsystem/commit/a190968285e95e09c20590cbdf14799165affb30)), closes
6
+ [#315387](https://github.com/helsenorge/designsystem/issues/315387)
7
+
8
+ ### Bug Fixes
9
+
10
+ - label kan og sendes inn til emoji ([6d5d680](https://github.com/helsenorge/designsystem/commit/6d5d680d31b0c797230f3539305659bc073ddb3a)),
11
+ closes [#310765](https://github.com/helsenorge/designsystem/issues/310765)
12
+ - tabellheader med sortering har ikke underline
13
+ ([f191991](https://github.com/helsenorge/designsystem/commit/f191991cb9e3f32bda2df281b703833d12dfb5db)), closes
14
+ [#315407](https://github.com/helsenorge/designsystem/issues/315407)
15
+
16
+ ## [5.8.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.7.0&targetVersion=GTv5.8.0) (2023-12-08)
17
+
18
+ ### Features
19
+
20
+ - emptystate ([7e1d9a8](https://github.com/helsenorge/designsystem/commit/7e1d9a87a75009ebd7a5b313fbed946c905fdabc))
21
+
22
+ ### Bug Fixes
23
+
24
+ - anchorlink har ikke hardkodet font-size/line-height
25
+ ([687bac1](https://github.com/helsenorge/designsystem/commit/687bac112e20f8e5c09c5b99623401baf01d5bd4))
26
+ - slider aria fix for emoji og step labels
27
+ ([1ca0c1e](https://github.com/helsenorge/designsystem/commit/1ca0c1e8b979357ec2544248a2c4657ed25509fe)), closes
28
+ [#313810](https://github.com/helsenorge/designsystem/issues/313810) [#310765](https://github.com/helsenorge/designsystem/issues/310765)
29
+
1
30
  ## [5.7.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv5.6.0&targetVersion=GTv5.7.0) (2023-12-08)
2
31
 
3
32
  ### Features
package/TableHeadCell.js CHANGED
@@ -1,2 +1,2 @@
1
- import t from"react";import r from"classnames";import{Icon as i}from"./components/Icons/Icon.js";import{IconSize as f}from"./constants.js";import u from"./components/Icons/ArrowDown.js";import h from"./components/Icons/ArrowUp.js";import c from"./components/Table/styles.module.scss";import{M as m}from"./Table.js";var E=(e=>(e.asc="asc",e.desc="desc",e))(E||{});const w=({sortable:e,onClick:n,className:o,children:l,sortDir:a,mode:d=m.normal})=>{const s=r(c["table__head-cell"],o,{[c["table__head-cell--compact"]]:d===m.compact});if(!e&&!l)return t.createElement("td",{className:s});if(!e)return t.createElement("th",{scope:"col",className:s},l);const p=r(s,c["table__head-cell--sortable"],{[c["table__head-cell--sorted"]]:a},o),b=()=>a&&t.createElement("div",{className:c["table__head-cell-sort-icon-wrapper"]},t.createElement(i,{svgIcon:a=="asc"?u:h,size:f.XXSmall})),_=()=>{switch(a){case"asc":return"ascending";case"desc":return"descending"}};return t.createElement("th",{scope:"col",className:p,"aria-sort":_()},t.createElement("button",{type:"button",onClick:n,className:c["table__sort-button"],"aria-pressed":a?!!a:void 0},b(),l))},H=w;export{E as S,w as T,H as a};
1
+ import a from"react";import r from"classnames";import{Icon as f}from"./components/Icons/Icon.js";import{IconSize as _}from"./constants.js";import u from"./components/Icons/ArrowDown.js";import E from"./components/Icons/ArrowUp.js";import c from"./components/Table/styles.module.scss";import{M as m}from"./Table.js";var h=(e=>(e.asc="asc",e.desc="desc",e))(h||{});const w=({sortable:e,onClick:n,className:l,children:s,sortDir:t,mode:p=m.normal})=>{const o=r(c["table__head-cell"],l,{[c["table__head-cell--compact"]]:p===m.compact});if(!e&&!s)return a.createElement("td",{className:o});if(!e)return a.createElement("th",{scope:"col",className:o},s);const d=r(o,c["table__head-cell--sortable"],l),i=()=>t&&a.createElement("div",{className:c["table__head-cell-sort-icon-wrapper"]},a.createElement(f,{svgIcon:t=="asc"?u:E,size:_.XXSmall})),b=()=>{switch(t){case"asc":return"ascending";case"desc":return"descending"}};return a.createElement("th",{scope:"col",className:d,"aria-sort":b()},a.createElement("button",{type:"button",onClick:n,className:c["table__sort-button"],"aria-pressed":t?!!t:void 0},i(),s))},H=w;export{h as S,w as T,H as a};
2
2
  //# sourceMappingURL=TableHeadCell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeadCell.js","sources":["../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icons';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell = ({ sortable, onClick, className, children, sortDir, mode = ModeType.normal }: Props): React.JSX.Element => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope=\"col\" className={tableHeadCellDefaultClass}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(\n tableHeadCellDefaultClass,\n tableStyles['table__head-cell--sortable'],\n { [tableStyles['table__head-cell--sorted']]: sortDir },\n className\n );\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope=\"col\" className={sortableClasses} aria-sort={getSortDirection()}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection","TableHeadCell$1"],"mappings":"2TAUY,IAAAA,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,KAAO,OAFGA,IAAAA,GAAA,CAAA,CAAA,EAoBC,MAAAC,EAAgB,CAAC,CAAE,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,QAAAC,EAAS,KAAAC,EAAOC,EAAS,UAAuC,CACtI,MAAMC,EAA4BC,EAAWC,EAAY,kBAAkB,EAAGP,EAAW,CACvF,CAACO,EAAY,2BAA2B,CAAC,EAAGJ,IAASC,EAAS,OAAA,CAC/D,EAEG,GAAA,CAACN,GAAY,CAACG,EACT,OAAAO,EAAA,cAAC,KAAG,CAAA,UAAWH,CAA2B,CAAA,EAGnD,GAAI,CAACP,EACH,uBACG,KAAG,CAAA,MAAM,MAAM,UAAWO,GACxBJ,CACH,EAIJ,MAAMQ,EAAkBH,EACtBD,EACAE,EAAY,4BAA4B,EACxC,CAAE,CAACA,EAAY,0BAA0B,CAAC,EAAGL,CAAQ,EACrDF,CAAA,EAGIU,EAAiB,IACrBR,mBACG,MAAI,CAAA,UAAWK,EAAY,oCAAoC,CAAA,kBAC7DI,EAAK,CAAA,QAAST,GAAW,MAAoBU,EAAYC,EAAS,KAAMC,EAAS,QAAS,CAC7F,EAGEC,EAAmB,IAAyC,CAChE,OAAQb,EAAS,CACf,IAAK,MACI,MAAA,YACT,IAAK,OACI,MAAA,YACX,CAAA,EAIA,OAAAM,EAAA,cAAC,KAAG,CAAA,MAAM,MAAM,UAAWC,EAAiB,YAAWM,EAAiB,CAAA,EACrEP,EAAA,cAAA,SAAA,CAAO,KAAK,SAAS,QAAAT,EAAkB,UAAWQ,EAAY,oBAAoB,EAAG,eAAcL,EAAU,CAAC,CAACA,EAAU,MACvH,EAAAQ,EAAA,EACAT,CACH,CACF,CAEJ,EAEAe,EAAenB"}
1
+ {"version":3,"file":"TableHeadCell.js","sources":["../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icons';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell = ({ sortable, onClick, className, children, sortDir, mode = ModeType.normal }: Props): React.JSX.Element => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope=\"col\" className={tableHeadCellDefaultClass}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope=\"col\" className={sortableClasses} aria-sort={getSortDirection()}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection","TableHeadCell$1"],"mappings":"2TAUY,IAAAA,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,KAAO,OAFGA,IAAAA,GAAA,CAAA,CAAA,EAoBC,MAAAC,EAAgB,CAAC,CAAE,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,QAAAC,EAAS,KAAAC,EAAOC,EAAS,UAAuC,CACtI,MAAMC,EAA4BC,EAAWC,EAAY,kBAAkB,EAAGP,EAAW,CACvF,CAACO,EAAY,2BAA2B,CAAC,EAAGJ,IAASC,EAAS,OAAA,CAC/D,EAEG,GAAA,CAACN,GAAY,CAACG,EACT,OAAAO,EAAA,cAAC,KAAG,CAAA,UAAWH,CAA2B,CAAA,EAGnD,GAAI,CAACP,EACH,uBACG,KAAG,CAAA,MAAM,MAAM,UAAWO,GACxBJ,CACH,EAIJ,MAAMQ,EAAkBH,EAAWD,EAA2BE,EAAY,4BAA4B,EAAGP,CAAS,EAE5GU,EAAiB,IACrBR,mBACG,MAAI,CAAA,UAAWK,EAAY,oCAAoC,CAAA,kBAC7DI,EAAK,CAAA,QAAST,GAAW,MAAoBU,EAAYC,EAAS,KAAMC,EAAS,QAAS,CAC7F,EAGEC,EAAmB,IAAyC,CAChE,OAAQb,EAAS,CACf,IAAK,MACI,MAAA,YACT,IAAK,OACI,MAAA,YACX,CAAA,EAIA,OAAAM,EAAA,cAAC,KAAG,CAAA,MAAM,MAAM,UAAWC,EAAiB,YAAWM,EAAiB,CAAA,EACrEP,EAAA,cAAA,SAAA,CAAO,KAAK,SAAS,QAAAT,EAAkB,UAAWQ,EAAY,oBAAoB,EAAG,eAAcL,EAAU,CAAC,CAACA,EAAU,MACvH,EAAAQ,EAAA,EACAT,CACH,CACF,CAEJ,EAEAe,EAAenB"}
@@ -0,0 +1,6 @@
1
+ import { PaletteNames } from '../../theme/palette';
2
+ export interface IllustrationProps {
3
+ color?: PaletteNames;
4
+ className?: string;
5
+ }
6
+ //# sourceMappingURL=Illustration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Illustration.d.ts","sourceRoot":"","sources":["../../../src/components/Illustration/Illustration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export * from './Illustration';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Illustration/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,eAAe,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"props":{"toString":{"defaultValue":{},"description":"Returns a string representation of a string.\nReturns a string representation of an object.\n@param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.","name":"toString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | ((radix?: number) => string) | (() => string)"}},"charAt":{"defaultValue":null,"description":"Returns the character at the specified index.\n@param pos The zero-based index of the desired character.","name":"charAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => string"}},"charCodeAt":{"defaultValue":null,"description":"Returns the Unicode value of the character at the specified location.\n@param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.","name":"charCodeAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => number"}},"concat":{"defaultValue":null,"description":"Returns a string that contains the concatenation of two or more strings.\n@param strings The strings to append to the end of the string.","name":"concat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(...strings: string[]) => string"}},"indexOf":{"defaultValue":null,"description":"Returns the position of the first occurrence of a substring.\n@param searchString The substring to search for in the string\n@param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.","name":"indexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"lastIndexOf":{"defaultValue":null,"description":"Returns the last occurrence of a substring in the string.\n@param searchString The substring to search for.\n@param position The index at which to begin searching. If omitted, the search begins at the end of the string.","name":"lastIndexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"localeCompare":{"defaultValue":null,"description":"Determines whether two strings are equivalent in the current locale.\nDetermines whether two strings are equivalent in the current or specified locale.\n@param that String to compare to target string\n@param that String to compare to target string\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n@param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.","name":"localeCompare","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"{ (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; }"}},"match":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an array containing the results of that search.\nMatches a string or an object that supports being matched against, and returns an array\ncontaining the results of that search, or null if no matches are found.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.\n@param matcher An object that supports being matched against.","name":"match","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }"}},"replace":{"defaultValue":null,"description":"Replaces text in a string, using a regular expression or search string.\nPasses a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.\nReplaces text in a string, using an object that supports replacement within a string.\n@param searchValue A string or regular expression to search for.\n@param replaceValue A string containing the text to replace. When the {@linkcode searchValue } is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue } is replaced.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.\n@param searchValue An object that supports searching for and replacing matches within a string.\n@param replaceValue The replacement text.\n@param searchValue A object can search for and replace matches within a string.\n@param replacer A function that returns the replacement text.","name":"replace","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; }"}},"search":{"defaultValue":null,"description":"Finds the first substring match in a regular expression search.\n@param regexp The regular expression pattern and applicable flags.\n@param searcher An object which supports searching within a string.","name":"search","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }"}},"slice":{"defaultValue":null,"description":"Returns a section of a string.\n@param start The index to the beginning of the specified portion of stringObj.\n@param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of stringObj.","name":"slice","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start?: number | undefined, end?: number | undefined) => string"}},"split":{"defaultValue":null,"description":"Split a string into substrings using the specified separator and return them as an array.\n@param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n@param limit A value used to limit the number of elements returned in the array.\n@param splitter An object that can split a string.\n@param limit A value used to limit the number of elements returned in the array.","name":"split","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }"}},"substring":{"defaultValue":null,"description":"Returns the substring at the specified location within a String object.\n@param start The zero-based index number indicating the beginning of the substring.\n@param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.","name":"substring","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start: number, end?: number | undefined) => string"}},"toLowerCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to lowercase.","name":"toLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleLowerCase":{"defaultValue":null,"description":"Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.","name":"toLocaleLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"toUpperCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to uppercase.","name":"toUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleUpperCase":{"defaultValue":null,"description":"Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.","name":"toLocaleUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"trim":{"defaultValue":null,"description":"Removes the leading and trailing white space and line terminator characters from a string.","name":"trim","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"length":{"defaultValue":null,"description":"Returns the length of a String object.","name":"length","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"number"}},"substr":{"defaultValue":null,"description":"Gets a substring beginning at the specified location and having the specified length.\n@deprecated A legacy feature for browser compatibility\n@param from The starting position of the desired substring. The index of the first character in the string is zero.\n@param length The number of characters to include in the returned substring.","name":"substr","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(from: number, length?: number | undefined) => string"}},"valueOf":{"defaultValue":{},"description":"Returns the primitive value of the specified object.","name":"valueOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Boolean"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | (() => number) | (() => boolean) | (() => Object)"}},"codePointAt":{"defaultValue":null,"description":"Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\nvalue of the UTF-16 encoded code point starting at the string element at position pos in\nthe String resulting from converting this object to a String.\nIf there is no element at that position, the result is undefined.\nIf a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.","name":"codePointAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => number | undefined"}},"includes":{"defaultValue":null,"description":"Returns true if searchString appears as a substring of the result of converting this\nobject to a String, at one or more positions that are\ngreater than or equal to position; otherwise, returns false.\n@param searchString search string\n@param position If position is undefined, 0 is assumed, so as to search all of the String.","name":"includes","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"endsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nendPosition – length(this). Otherwise returns false.","name":"endsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, endPosition?: number | undefined) => boolean"}},"normalize":{"defaultValue":null,"description":"Returns the String value result of normalizing the string into the normalization form\nnamed by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"","name":"normalize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }"}},"repeat":{"defaultValue":null,"description":"Returns a String value that is made from count copies appended together. If count is 0,\nthe empty string is returned.\n@param count number of copies to append","name":"repeat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(count: number) => string"}},"startsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nposition. Otherwise returns false.","name":"startsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"anchor":{"defaultValue":null,"description":"Returns an `<a>` HTML anchor element and sets the name attribute to the text value\n@deprecated A legacy feature for browser compatibility\n@param name","name":"anchor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(name: string) => string"}},"big":{"defaultValue":null,"description":"Returns a `<big>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"big","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"blink":{"defaultValue":null,"description":"Returns a `<blink>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"blink","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"bold":{"defaultValue":null,"description":"Returns a `<b>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"bold","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fixed":{"defaultValue":null,"description":"Returns a `<tt>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"fixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fontcolor":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the color attribute value\n@deprecated A legacy feature for browser compatibility","name":"fontcolor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(color: string) => string"}},"fontsize":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the size attribute value\n@deprecated A legacy feature for browser compatibility\n@deprecated A legacy feature for browser compatibility","name":"fontsize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (size: number): string; (size: string): string; }"}},"italics":{"defaultValue":null,"description":"Returns an `<i>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"italics","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"link":{"defaultValue":null,"description":"Returns an `<a>` HTML element and sets the href attribute value\n@deprecated A legacy feature for browser compatibility","name":"link","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(url: string) => string"}},"small":{"defaultValue":null,"description":"Returns a `<small>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"small","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"strike":{"defaultValue":null,"description":"Returns a `<strike>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"strike","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sub":{"defaultValue":null,"description":"Returns a `<sub>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sub","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sup":{"defaultValue":null,"description":"Returns a `<sup>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sup","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"padStart":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the start (left) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"padEnd":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the end (right) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"trimEnd":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.","name":"trimEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimStart":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.","name":"trimStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimLeft":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimStart` instead","name":"trimLeft","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimRight":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimEnd` instead","name":"trimRight","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"matchAll":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an iterable of matches\ncontaining the results of that search.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.","name":"matchAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"}],"required":true,"type":{"name":"(regexp: RegExp) => IterableIterator<RegExpMatchArray>"}},"replaceAll":{"defaultValue":null,"description":"Replace all instances of a substring in a string, using a regular expression or search string.\n@param searchValue A string to search for.\n@param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.","name":"replaceAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }"}},"at":{"defaultValue":null,"description":"Returns a new String consisting of the single UTF-16 code unit located at the specified index.\n@param index The zero-based index of the desired code unit. A negative index will count back from the last item.","name":"at","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => string | undefined"}},"__@iterator@6107":{"defaultValue":null,"description":"Iterator","name":"__@iterator@6107","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"Iterable"}],"required":true,"type":{"name":"(() => IterableIterator<string>) | (() => Iterator<ReactNode, any, undefined>)"}},"toFixed":{"defaultValue":null,"description":"Returns a string representing a number in fixed-point notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toFixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toExponential":{"defaultValue":null,"description":"Returns a string containing a number represented in exponential notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toExponential","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toPrecision":{"defaultValue":null,"description":"Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n@param precision Number of significant digits. Must be in the range 1 - 21, inclusive.","name":"toPrecision","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(precision?: number | undefined) => string"}},"toLocaleString":{"defaultValue":{},"description":"Returns a date converted to a string using the current locale.\nConverts a number to a string by using the current or specified locale.\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.\n@param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.","name":"toLocaleString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.number.d.ts","name":"Number"}],"required":false,"type":{"name":"(() => string) | { (locales?: string | string[], options?: NumberFormatOptions): string; (locales?: LocalesArgument, options?: NumberFormatOptions | undefined): string; }"}},"type":{"defaultValue":null,"description":"","name":"type","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"string | JSXElementConstructor<any>"}},"props":{"defaultValue":null,"description":"","name":"props","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"any"}}}}
1
+ {"props":{"toString":{"defaultValue":{},"description":"Returns a string representation of a string.\nReturns a string representation of an object.\n@param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.","name":"toString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | ((radix?: number) => string) | (() => string)"}},"charAt":{"defaultValue":null,"description":"Returns the character at the specified index.\n@param pos The zero-based index of the desired character.","name":"charAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => string"}},"charCodeAt":{"defaultValue":null,"description":"Returns the Unicode value of the character at the specified location.\n@param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.","name":"charCodeAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => number"}},"concat":{"defaultValue":null,"description":"Returns a string that contains the concatenation of two or more strings.\n@param strings The strings to append to the end of the string.","name":"concat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(...strings: string[]) => string"}},"indexOf":{"defaultValue":null,"description":"Returns the position of the first occurrence of a substring.\n@param searchString The substring to search for in the string\n@param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.","name":"indexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"lastIndexOf":{"defaultValue":null,"description":"Returns the last occurrence of a substring in the string.\n@param searchString The substring to search for.\n@param position The index at which to begin searching. If omitted, the search begins at the end of the string.","name":"lastIndexOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => number"}},"localeCompare":{"defaultValue":null,"description":"Determines whether two strings are equivalent in the current locale.\nDetermines whether two strings are equivalent in the current or specified locale.\n@param that String to compare to target string\n@param that String to compare to target string\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n@param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.","name":"localeCompare","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"{ (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; }"}},"match":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an array containing the results of that search.\nMatches a string or an object that supports being matched against, and returns an array\ncontaining the results of that search, or null if no matches are found.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.\n@param matcher An object that supports being matched against.","name":"match","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }"}},"replace":{"defaultValue":null,"description":"Replaces text in a string, using a regular expression or search string.\nPasses a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.\nReplaces text in a string, using an object that supports replacement within a string.\n@param searchValue A string or regular expression to search for.\n@param replaceValue A string containing the text to replace. When the {@linkcode searchValue } is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue } is replaced.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.\n@param searchValue An object that supports searching for and replacing matches within a string.\n@param replaceValue The replacement text.\n@param searchValue A object can search for and replace matches within a string.\n@param replacer A function that returns the replacement text.","name":"replace","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; }"}},"search":{"defaultValue":null,"description":"Finds the first substring match in a regular expression search.\n@param regexp The regular expression pattern and applicable flags.\n@param searcher An object which supports searching within a string.","name":"search","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }"}},"slice":{"defaultValue":null,"description":"Returns a section of a string.\n@param start The index to the beginning of the specified portion of stringObj.\n@param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of stringObj.","name":"slice","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start?: number | undefined, end?: number | undefined) => string"}},"split":{"defaultValue":null,"description":"Split a string into substrings using the specified separator and return them as an array.\n@param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n@param limit A value used to limit the number of elements returned in the array.\n@param splitter An object that can split a string.\n@param limit A value used to limit the number of elements returned in the array.","name":"split","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","name":"String"}],"required":true,"type":{"name":"{ (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }"}},"substring":{"defaultValue":null,"description":"Returns the substring at the specified location within a String object.\n@param start The zero-based index number indicating the beginning of the substring.\n@param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.","name":"substring","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(start: number, end?: number | undefined) => string"}},"toLowerCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to lowercase.","name":"toLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleLowerCase":{"defaultValue":null,"description":"Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.","name":"toLocaleLowerCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"toUpperCase":{"defaultValue":null,"description":"Converts all the alphabetic characters in a string to uppercase.","name":"toUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"toLocaleUpperCase":{"defaultValue":null,"description":"Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.","name":"toLocaleUpperCase","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(locales?: string | string[] | undefined) => string"}},"trim":{"defaultValue":null,"description":"Removes the leading and trailing white space and line terminator characters from a string.","name":"trim","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"length":{"defaultValue":null,"description":"Returns the length of a String object.","name":"length","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"number"}},"substr":{"defaultValue":null,"description":"Gets a substring beginning at the specified location and having the specified length.\n@deprecated A legacy feature for browser compatibility\n@param from The starting position of the desired substring. The index of the first character in the string is zero.\n@param length The number of characters to include in the returned substring.","name":"substr","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"}],"required":true,"type":{"name":"(from: number, length?: number | undefined) => string"}},"valueOf":{"defaultValue":{},"description":"Returns the primitive value of the specified object.","name":"valueOf","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Boolean"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"}],"required":false,"type":{"name":"(() => string) | (() => number) | (() => boolean) | (() => Object)"}},"codePointAt":{"defaultValue":null,"description":"Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\nvalue of the UTF-16 encoded code point starting at the string element at position pos in\nthe String resulting from converting this object to a String.\nIf there is no element at that position, the result is undefined.\nIf a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.","name":"codePointAt","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(pos: number) => number | undefined"}},"includes":{"defaultValue":null,"description":"Returns true if searchString appears as a substring of the result of converting this\nobject to a String, at one or more positions that are\ngreater than or equal to position; otherwise, returns false.\n@param searchString search string\n@param position If position is undefined, 0 is assumed, so as to search all of the String.","name":"includes","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"endsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nendPosition – length(this). Otherwise returns false.","name":"endsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, endPosition?: number | undefined) => boolean"}},"normalize":{"defaultValue":null,"description":"Returns the String value result of normalizing the string into the normalization form\nnamed by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"\n@param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\nis \"NFC\"","name":"normalize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }"}},"repeat":{"defaultValue":null,"description":"Returns a String value that is made from count copies appended together. If count is 0,\nthe empty string is returned.\n@param count number of copies to append","name":"repeat","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(count: number) => string"}},"startsWith":{"defaultValue":null,"description":"Returns true if the sequence of elements of searchString converted to a String is the\nsame as the corresponding elements of this object (converted to a String) starting at\nposition. Otherwise returns false.","name":"startsWith","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(searchString: string, position?: number | undefined) => boolean"}},"anchor":{"defaultValue":null,"description":"Returns an `<a>` HTML anchor element and sets the name attribute to the text value\n@deprecated A legacy feature for browser compatibility\n@param name","name":"anchor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(name: string) => string"}},"big":{"defaultValue":null,"description":"Returns a `<big>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"big","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"blink":{"defaultValue":null,"description":"Returns a `<blink>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"blink","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"bold":{"defaultValue":null,"description":"Returns a `<b>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"bold","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fixed":{"defaultValue":null,"description":"Returns a `<tt>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"fixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"fontcolor":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the color attribute value\n@deprecated A legacy feature for browser compatibility","name":"fontcolor","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(color: string) => string"}},"fontsize":{"defaultValue":null,"description":"Returns a `<font>` HTML element and sets the size attribute value\n@deprecated A legacy feature for browser compatibility\n@deprecated A legacy feature for browser compatibility","name":"fontsize","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"{ (size: number): string; (size: string): string; }"}},"italics":{"defaultValue":null,"description":"Returns an `<i>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"italics","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"link":{"defaultValue":null,"description":"Returns an `<a>` HTML element and sets the href attribute value\n@deprecated A legacy feature for browser compatibility","name":"link","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"(url: string) => string"}},"small":{"defaultValue":null,"description":"Returns a `<small>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"small","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"strike":{"defaultValue":null,"description":"Returns a `<strike>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"strike","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sub":{"defaultValue":null,"description":"Returns a `<sub>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sub","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"sup":{"defaultValue":null,"description":"Returns a `<sup>` HTML element\n@deprecated A legacy feature for browser compatibility","name":"sup","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.core.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"padStart":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the start (left) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"padEnd":{"defaultValue":null,"description":"Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\nThe padding is applied from the end (right) of the current string.\n@param maxLength The length of the resulting string once the current string has been padded.\nIf this parameter is smaller than the current string's length, the current string will be returned as it is.\n@param fillString The string to pad the current string with.\nIf this string is too long, it will be truncated and the left-most part will be applied.\nThe default value for this parameter is \" \" (U+0020).","name":"padEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2017.string.d.ts","name":"String"}],"required":true,"type":{"name":"(maxLength: number, fillString?: string | undefined) => string"}},"trimEnd":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.","name":"trimEnd","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimStart":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.","name":"trimStart","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimLeft":{"defaultValue":null,"description":"Removes the leading white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimStart` instead","name":"trimLeft","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"trimRight":{"defaultValue":null,"description":"Removes the trailing white space and line terminator characters from a string.\n@deprecated A legacy feature for browser compatibility. Use `trimEnd` instead","name":"trimRight","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2019.string.d.ts","name":"String"}],"required":true,"type":{"name":"() => string"}},"matchAll":{"defaultValue":null,"description":"Matches a string with a regular expression, and returns an iterable of matches\ncontaining the results of that search.\n@param regexp A variable name or string literal containing the regular expression pattern and flags.","name":"matchAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.string.d.ts","name":"String"}],"required":true,"type":{"name":"(regexp: RegExp) => IterableIterator<RegExpMatchArray>"}},"replaceAll":{"defaultValue":null,"description":"Replace all instances of a substring in a string, using a regular expression or search string.\n@param searchValue A string to search for.\n@param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n@param searchValue A string to search for.\n@param replacer A function that returns the replacement text.","name":"replaceAll","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2021.string.d.ts","name":"String"}],"required":true,"type":{"name":"{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }"}},"at":{"defaultValue":null,"description":"Returns a new String consisting of the single UTF-16 code unit located at the specified index.\n@param index The zero-based index of the desired code unit. A negative index will count back from the last item.","name":"at","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2022.string.d.ts","name":"String"}],"required":true,"type":{"name":"(index: number) => string | undefined"}},"__@iterator@6206":{"defaultValue":null,"description":"Iterator","name":"__@iterator@6206","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"String"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2015.iterable.d.ts","name":"Iterable"}],"required":true,"type":{"name":"(() => IterableIterator<string>) | (() => Iterator<ReactNode, any, undefined>)"}},"toFixed":{"defaultValue":null,"description":"Returns a string representing a number in fixed-point notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toFixed","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toExponential":{"defaultValue":null,"description":"Returns a string containing a number represented in exponential notation.\n@param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.","name":"toExponential","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(fractionDigits?: number | undefined) => string"}},"toPrecision":{"defaultValue":null,"description":"Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n@param precision Number of significant digits. Must be in the range 1 - 21, inclusive.","name":"toPrecision","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"}],"required":true,"type":{"name":"(precision?: number | undefined) => string"}},"toLocaleString":{"defaultValue":{},"description":"Returns a date converted to a string using the current locale.\nConverts a number to a string by using the current or specified locale.\n@param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.\n@param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n@param options An object that contains one or more properties that specify comparison options.","name":"toLocaleString","parent":{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},"declarations":[{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Object"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es5.d.ts","name":"Number"},{"fileName":"designsystem/node_modules/typescript/lib/lib.es2020.number.d.ts","name":"Number"}],"required":false,"type":{"name":"(() => string) | { (locales?: string | string[], options?: NumberFormatOptions): string; (locales?: LocalesArgument, options?: NumberFormatOptions | undefined): string; }"}},"type":{"defaultValue":null,"description":"","name":"type","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"string | JSXElementConstructor<any>"}},"props":{"defaultValue":null,"description":"","name":"props","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"ReactElement"}],"required":true,"type":{"name":"any"}}}}
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { PaletteNames } from '../../theme/palette';
3
+ import { AnchorLinkTags, AnchorLinkTargets } from '../AnchorLink';
4
+ import { IllustrationProps } from '../Illustration/Illustration';
5
+ import { TitleTags } from '../Title';
6
+ export type PromoPanelColors = Extract<PaletteNames, 'neutral' | 'blueberry' | 'cherry'>;
7
+ interface PromoPanelProps {
8
+ /** Used as the link text if set. title or children must be set for the link to have accessible text. */
9
+ title?: string;
10
+ /** Used as the link text if title is not set. */
11
+ children?: string;
12
+ /** Illustration element */
13
+ illustration?: React.FC<IllustrationProps>;
14
+ /** Changes the underlying element of the title. */
15
+ titleHtmlMarkup?: TitleTags;
16
+ /** Changes the background color. Default: white */
17
+ color?: PromoPanelColors;
18
+ /** Not used if linkComponent is set */
19
+ href?: string;
20
+ /** Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links. */
21
+ target?: AnchorLinkTargets;
22
+ /** HTML markup for anchor link. Not used if linkComponent is set. Default: a */
23
+ linkHtmlMarkup?: AnchorLinkTags;
24
+ /** Function that is called when clicked. Not used if linkComponent is set. */
25
+ linkOnClick?: () => void;
26
+ /** Custom link component. Must be "a" a or "button" element with no styling. */
27
+ linkComponent?: React.ReactElement;
28
+ /** Sets the data-testid attribute. */
29
+ testId?: string;
30
+ }
31
+ declare const PromoPanel: React.FC<PromoPanelProps>;
32
+ export default PromoPanel;
33
+ //# sourceMappingURL=PromoPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/PromoPanel/PromoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC;AAEzF,UAAU,eAAe;IACvB,wGAAwG;IACxG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAC3C,mDAAmD;IACnD,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,mDAAmD;IACnD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wHAAwH;IACxH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gFAAgF;IAChF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,gFAAgF;IAChF,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8BD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgDzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ {"props":{"title":{"defaultValue":null,"description":"Used as the link text if set. title or children must be set for the link to have accessible text.","name":"title","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"string"}},"children":{"defaultValue":null,"description":"Used as the link text if title is not set.","name":"children","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"(string & (boolean | ReactChild | ReactFragment | ReactPortal | null))"}},"illustration":{"defaultValue":null,"description":"Illustration element","name":"illustration","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"FC<IllustrationProps>"}},"titleHtmlMarkup":{"defaultValue":null,"description":"Changes the underlying element of the title.","name":"titleHtmlMarkup","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"enum","raw":"TitleTags","value":[{"value":"\"h1\""},{"value":"\"h2\""},{"value":"\"h3\""},{"value":"\"h4\""},{"value":"\"h5\""},{"value":"\"span\""}]}},"color":{"defaultValue":null,"description":"Changes the background color. Default: white","name":"color","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"enum","raw":"PromoPanelColors","value":[{"value":"\"blueberry\""},{"value":"\"cherry\""},{"value":"\"neutral\""}]}},"href":{"defaultValue":null,"description":"Not used if linkComponent is set","name":"href","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"string"}},"target":{"defaultValue":null,"description":"Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links.","name":"target","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"enum","raw":"AnchorLinkTargets","value":[{"value":"\"_self\""},{"value":"\"_blank\""},{"value":"\"_parent\""}]}},"linkHtmlMarkup":{"defaultValue":null,"description":"HTML markup for anchor link. Not used if linkComponent is set. Default: a","name":"linkHtmlMarkup","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"enum","raw":"AnchorLinkTags","value":[{"value":"\"a\""},{"value":"\"button\""}]}},"linkOnClick":{"defaultValue":null,"description":"Function that is called when clicked. Not used if linkComponent is set.","name":"linkOnClick","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"(() => void)"}},"linkComponent":{"defaultValue":null,"description":"Custom link component. Must be \"a\" a or \"button\" element with no styling.","name":"linkComponent","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"ReactElement<any, string | JSXElementConstructor<any>>"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"},"declarations":[{"fileName":"src/components/PromoPanel/PromoPanel.tsx","name":"PromoPanelProps"}],"required":false,"type":{"name":"string"}}}}
@@ -0,0 +1,4 @@
1
+ import PromoPanel from './PromoPanel';
2
+ export * from './PromoPanel';
3
+ export default PromoPanel;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PromoPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import e from"react";import d from"classnames";import{AnalyticsId as s,IconSize as o}from"../../constants.js";import{useBreakpoint as h,Breakpoint as C}from"../../hooks/useBreakpoint.js";import{useHover as E}from"../../hooks/useHover.js";import{getColor as r}from"../../theme/currys/color.js";import{Icon as P}from"../Icons/Icon.js";import b from"../Icons/ArrowRight.js";import g from"../Icons/ArrowUpRight.js";import{T as _}from"../../Title.js";import n from"./styles.module.scss";import"../../theme/grid.js";import"../../hooks/usePseudoClasses.js";import"../../theme/index.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const v=t=>t.linkComponent?e.cloneElement(t.linkComponent,{children:t.children}):t.linkHtmlMarkup==="button"?e.createElement("button",{type:"button",onClick:t.linkOnClick},t.children):e.createElement("a",{href:t.href,target:t.target,onClick:t.linkOnClick},t.children),y=t=>{const{isHovered:i,hoverRef:a}=E(),{color:m="neutral",titleHtmlMarkup:c="h2",linkHtmlMarkup:k="a"}=t,u=h(),f=d(n.promopanel,n[`promopanel--${m}`],!t.illustration&&n["promopanel--no-illustration"]),l=e.createElement(v,{href:t.href,target:t.target,linkComponent:t.linkComponent,linkHtmlMarkup:k,linkOnClick:t.linkOnClick},t.title||t.children);return e.createElement("div",{className:f,"data-testid":t.testId,"data-analyticsid":s.PromoPanel,ref:a},e.isValidElement(t.illustration)&&e.cloneElement(t.illustration,{className:n.promopanel__illustration}),e.createElement("div",{className:n.promopanel__content},t.title&&e.createElement(_,{htmlMarkup:c,appearance:"title3"},l),t.title?t.children:l),e.createElement("div",{className:n.promopanel__icon},e.createElement(P,{svgIcon:t.target==="_blank"?g:b,size:u>=C.md?o.Small:o.XSmall,isHovered:i,color:r("blueberry",500),hoverColor:r("blueberry",600)})))},q=y;export{q as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/PromoPanel/PromoPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { getColor } from '../../theme/currys/color';\nimport { PaletteNames } from '../../theme/palette';\nimport { AnchorLinkTags, AnchorLinkTargets } from '../AnchorLink';\nimport Icon from '../Icons';\nimport ArrowRight from '../Icons/ArrowRight';\nimport ArrowUpRight from '../Icons/ArrowUpRight';\nimport { IllustrationProps } from '../Illustration/Illustration';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type PromoPanelColors = Extract<PaletteNames, 'neutral' | 'blueberry' | 'cherry'>;\n\ninterface PromoPanelProps {\n /** Used as the link text if set. title or children must be set for the link to have accessible text. */\n title?: string;\n /** Used as the link text if title is not set. */\n children?: string;\n /** Illustration element */\n illustration?: React.FC<IllustrationProps>;\n /** Changes the underlying element of the title. */\n titleHtmlMarkup?: TitleTags;\n /** Changes the background color. Default: white */\n color?: PromoPanelColors;\n /** Not used if linkComponent is set */\n href?: string;\n /** Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links. */\n target?: AnchorLinkTargets;\n /** HTML markup for anchor link. Not used if linkComponent is set. Default: a */\n linkHtmlMarkup?: AnchorLinkTags;\n /** Function that is called when clicked. Not used if linkComponent is set. */\n linkOnClick?: () => void;\n /** Custom link component. Must be \"a\" a or \"button\" element with no styling. */\n linkComponent?: React.ReactElement;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface PromoPanelLinkProps {\n children?: string;\n href?: string;\n target?: AnchorLinkTargets;\n linkComponent?: React.ReactElement;\n linkHtmlMarkup?: AnchorLinkTags;\n linkOnClick?: () => void;\n}\n\nconst PromoPanelLink: React.FC<PromoPanelLinkProps> = props => {\n if (props.linkComponent) {\n return React.cloneElement(props.linkComponent, { children: props.children });\n }\n\n if (props.linkHtmlMarkup === 'button') {\n return (\n <button type={'button'} onClick={props.linkOnClick}>\n {props.children}\n </button>\n );\n }\n return (\n <a href={props.href} target={props.target} onClick={props.linkOnClick}>\n {props.children}\n </a>\n );\n};\n\nconst PromoPanel: React.FC<PromoPanelProps> = props => {\n const { isHovered, hoverRef } = useHover<HTMLDivElement>();\n\n const { color = 'neutral', titleHtmlMarkup = 'h2', linkHtmlMarkup = 'a' } = props;\n\n const breakpoint = useBreakpoint();\n\n const promoPanelClasses = classNames(\n styles.promopanel,\n styles[`promopanel--${color}`],\n !props.illustration && styles['promopanel--no-illustration']\n );\n\n const promoPanelLink = (\n <PromoPanelLink\n href={props.href}\n target={props.target}\n linkComponent={props.linkComponent}\n linkHtmlMarkup={linkHtmlMarkup}\n linkOnClick={props.linkOnClick}\n >\n {props.title || props.children}\n </PromoPanelLink>\n );\n\n return (\n <div className={promoPanelClasses} data-testid={props.testId} data-analyticsid={AnalyticsId.PromoPanel} ref={hoverRef}>\n {React.isValidElement<IllustrationProps>(props.illustration) &&\n React.cloneElement(props.illustration, { className: styles.promopanel__illustration })}\n <div className={styles.promopanel__content}>\n {props.title && (\n <Title htmlMarkup={titleHtmlMarkup} appearance={'title3'}>\n {promoPanelLink}\n </Title>\n )}\n {!props.title ? promoPanelLink : props.children}\n </div>\n <div className={styles.promopanel__icon}>\n <Icon\n svgIcon={props.target === '_blank' ? ArrowUpRight : ArrowRight}\n size={breakpoint >= Breakpoint.md ? IconSize.Small : IconSize.XSmall}\n isHovered={isHovered}\n color={getColor('blueberry', 500)}\n hoverColor={getColor('blueberry', 600)}\n />\n </div>\n </div>\n );\n};\n\nexport default PromoPanel;\n"],"names":["PromoPanelLink","props","React","PromoPanel","isHovered","hoverRef","useHover","color","titleHtmlMarkup","linkHtmlMarkup","breakpoint","useBreakpoint","promoPanelClasses","classNames","styles","promoPanelLink","AnalyticsId","Title","Icon","ArrowUpRight","ArrowRight","Breakpoint","IconSize","getColor","PromoPanel$1"],"mappings":"6vBAsDA,MAAMA,EAAyDC,GACzDA,EAAM,cACDC,EAAM,aAAaD,EAAM,cAAe,CAAE,SAAUA,EAAM,SAAU,EAGzEA,EAAM,iBAAmB,SAEzBC,EAAA,cAAC,UAAO,KAAM,SAAU,QAASD,EAAM,WAAA,EACpCA,EAAM,QACT,EAIDC,EAAA,cAAA,IAAA,CAAE,KAAMD,EAAM,KAAM,OAAQA,EAAM,OAAQ,QAASA,EAAM,WACvD,EAAAA,EAAM,QACT,EAIEE,EAAiDF,GAAA,CACrD,KAAM,CAAE,UAAAG,EAAW,SAAAC,CAAS,EAAIC,EAAyB,EAEnD,CAAE,MAAAC,EAAQ,UAAW,gBAAAC,EAAkB,KAAM,eAAAC,EAAiB,GAAQ,EAAAR,EAEtES,EAAaC,IAEbC,EAAoBC,EACxBC,EAAO,WACPA,EAAO,eAAeP,CAAK,EAAE,EAC7B,CAACN,EAAM,cAAgBa,EAAO,6BAA6B,CAAA,EAGvDC,EACJb,EAAA,cAACF,EAAA,CACC,KAAMC,EAAM,KACZ,OAAQA,EAAM,OACd,cAAeA,EAAM,cACrB,eAAAQ,EACA,YAAaR,EAAM,WAAA,EAElBA,EAAM,OAASA,EAAM,QAAA,EAKxB,OAAAC,EAAA,cAAC,MAAI,CAAA,UAAWU,EAAmB,cAAaX,EAAM,OAAQ,mBAAkBe,EAAY,WAAY,IAAKX,CAAA,EAC1GH,EAAM,eAAkCD,EAAM,YAAY,GACzDC,EAAM,aAAaD,EAAM,aAAc,CAAE,UAAWa,EAAO,wBAA0B,CAAA,EACtFZ,EAAA,cAAA,MAAA,CAAI,UAAWY,EAAO,mBACpB,EAAAb,EAAM,OACJC,EAAA,cAAAe,EAAA,CAAM,WAAYT,EAAiB,WAAY,QAAA,EAC7CO,CACH,EAEAd,EAAM,MAAyBA,EAAM,SAAvBc,CAClB,EACCb,EAAA,cAAA,MAAA,CAAI,UAAWY,EAAO,gBACrB,EAAAZ,EAAA,cAACgB,EAAA,CACC,QAASjB,EAAM,SAAW,SAAWkB,EAAeC,EACpD,KAAMV,GAAcW,EAAW,GAAKC,EAAS,MAAQA,EAAS,OAC9D,UAAAlB,EACA,MAAOmB,EAAS,YAAa,GAAG,EAChC,WAAYA,EAAS,YAAa,GAAG,CAAA,CAEzC,CAAA,CACF,CAEJ,EAEAC,EAAerB"}
@@ -0,0 +1,115 @@
1
+ @use 'sass:map';
2
+ @import '../../scss/palette';
3
+ @import '../../scss/spacers';
4
+ @import '../../scss/breakpoints';
5
+
6
+ $colors: 'neutral', 'blueberry', 'cherry';
7
+
8
+ .promopanel {
9
+ position: relative;
10
+ width: 100%;
11
+ display: flex;
12
+ align-items: center;
13
+ border-radius: 8px;
14
+ padding-left: getSpacer(s);
15
+ padding-right: getSpacer(s);
16
+ transition: background-color 0.15s ease-in-out;
17
+
18
+ &:focus-within {
19
+ box-shadow: 0 0 0 2px $black, inset 0 0 0 2px $black;
20
+ }
21
+
22
+ @media (min-width: map.get($grid-breakpoints, xs)) {
23
+ padding-left: 0;
24
+ }
25
+
26
+ @media (min-width: map.get($grid-breakpoints, md)) {
27
+ padding-right: getSpacer(l);
28
+ }
29
+
30
+ &--no-illustration {
31
+ padding-left: getSpacer(s);
32
+
33
+ @media (min-width: map.get($grid-breakpoints, md)) {
34
+ padding-left: getSpacer(l);
35
+ }
36
+ }
37
+
38
+ @each $color in $colors {
39
+ &--#{$color} {
40
+ background-color: map.get($palette-map, #{$color}50);
41
+
42
+ &:hover {
43
+ background-color: map.get($palette-map, #{$color}100);
44
+ }
45
+ }
46
+ }
47
+
48
+ &__illustration {
49
+ display: none;
50
+ flex-shrink: 0;
51
+
52
+ @media (min-width: map.get($grid-breakpoints, xs)) {
53
+ display: inline;
54
+ width: 120px;
55
+ height: auto;
56
+ }
57
+
58
+ @media (min-width: map.get($grid-breakpoints, md)) {
59
+ width: 156px;
60
+ }
61
+
62
+ @media (min-width: map.get($grid-breakpoints, lg)) {
63
+ width: 180px;
64
+ }
65
+ }
66
+
67
+ &__content {
68
+ display: flex;
69
+ flex-direction: column;
70
+ gap: getSpacer(3xs);
71
+ max-width: 696px;
72
+ padding-top: getSpacer(m);
73
+ padding-bottom: getSpacer(m);
74
+
75
+ @media (min-width: map.get($grid-breakpoints, md)) {
76
+ gap: getSpacer(2xs);
77
+ padding-top: getSpacer(l);
78
+ padding-bottom: getSpacer(l);
79
+ }
80
+
81
+ @media (min-width: map.get($grid-breakpoints, lg)) {
82
+ padding-top: getSpacer(xl);
83
+ padding-bottom: getSpacer(xl);
84
+ }
85
+
86
+ a,
87
+ button {
88
+ all: unset;
89
+ cursor: pointer;
90
+
91
+ &::after {
92
+ inset: 0;
93
+ content: '';
94
+ position: absolute;
95
+ }
96
+ }
97
+ }
98
+
99
+ &__icon {
100
+ margin-left: auto;
101
+ padding-left: getSpacer(s);
102
+
103
+ @media (min-width: map.get($grid-breakpoints, xs)) {
104
+ display: none;
105
+ }
106
+
107
+ @media (min-width: map.get($grid-breakpoints, sm)) {
108
+ display: block;
109
+ }
110
+
111
+ @media (min-width: map.get($grid-breakpoints, lg)) {
112
+ padding-left: getSpacer(l);
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,16 @@
1
+ export type Styles = {
2
+ promopanel: string;
3
+ promopanel__content: string;
4
+ promopanel__icon: string;
5
+ promopanel__illustration: string;
6
+ 'promopanel--blueberry': string;
7
+ 'promopanel--cherry': string;
8
+ 'promopanel--neutral': string;
9
+ 'promopanel--no-illustration': string;
10
+ };
11
+
12
+ export type ClassNames = keyof Styles;
13
+
14
+ declare const styles: Styles;
15
+
16
+ export default styles;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  export type SliderStep = {
3
3
  label?: number | string;
4
+ /** Start emojicode with &# - otherwise it will render as a regular string */
4
5
  emojiUniCode?: string;
5
6
  };
6
7
  interface SliderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgC3D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,UAAU,WAAW;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iHAAiH;IACjH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iHAAiH;IACjH,QAAQ,CAAC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AM,CAAC;CACjB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2RxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- import a,{useState as T,useRef as R,useEffect as h}from"react";import j from"classnames";import{AnalyticsId as G}from"../../constants.js";import{useSize as J}from"../../hooks/useSize.js";import{useUuid as S}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as Q}from"../../utils/accessibility.js";import{T as Y}from"../../Title.js";import o from"./styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const Z=(m,v,c)=>{const[_,n]=T(m),E=t=>{t>c?n(c):t<v?n(v):n(t)};return h(()=>{n((c-v)/2+v)},[v,c]),[_,E]},x=({title:m,ariaLabel:v,labelLeft:c,labelRight:_,disabled:n=!1,onChange:E,steps:t,step:p=1,minValue:i=0,maxValue:l=t?t.length-1:100,testId:$})=>{const[A,I]=T(!1),[s,f]=Z((l-i)/2+i,i,l),k=S(),y=S(),w=S(),N=R(null),P=R(null),{width:C}=J(N)||{width:0},M=l/10;h(()=>{const e=()=>{I(!1)};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e)}},[]);const D=e=>{var U;const r=((U=N.current)==null?void 0:U.getBoundingClientRect().x)??0,d=(e-r)/C,g=l-i;let u=d*g+i;return u=Math.round(u/p)*p,u=Math.max(i,Math.min(l,u)),u};h(()=>{const e=r=>{if(!n&&A){const d=D(r.clientX);f(d)}};return document.addEventListener("pointermove",e),()=>{document.removeEventListener("pointermove",e)}},[A]),h(()=>{!n&&E&&E(s)},[s]);const B=e=>{if(n)return;let r=!1;switch(e.key){case"ArrowLeft":case"ArrowDown":f(s-p),r=!0;break;case"PageDown":f(s-M),r=!0;break;case"ArrowRight":case"ArrowUp":f(s+p),r=!0;break;case"PageUp":f(s+M),r=!0;break;case"Home":f(i),r=!0;break;case"End":f(l),r=!0;break}r&&(e.preventDefault(),e.stopPropagation())},X=e=>{var d;if(n)return;const r=D(e.clientX);f(r),(d=P.current)==null||d.focus()},z=e=>{var r;n||(I(!0),e.preventDefault(),e.stopPropagation(),(r=P.current)==null||r.focus())},K=l!==i?C/(l-i)*(s-i):0,H=()=>{const e=t?Math.round((s-i)/p):null;if(t&&e!==null&&e>=0&&e<t.length){const r=t[e],d=r.emojiUniCode,g=d?L(d):void 0,u=typeof r.label<"u"?r.label.toString():void 0;return g&&u?`${g} ${u}`:g||u}},O=Q({label:v,id:(()=>{if(m&&c&&_)return[k,y,w].join(" ");if(m&&c)return[k,y].join(" ");if(m&&_)return[k,w].join(" ");if(m)return k})(),prefer:"label"}),b=(e,r)=>({left:`${e/(r-1)*100}%`}),L=e=>{try{return String.fromCodePoint(parseInt(e,16))}catch{return e}},W=()=>a.createElement("div",{className:o["slider__emoji-container"]},t==null?void 0:t.map((e,r)=>e.emojiUniCode&&a.createElement("div",{"aria-hidden":!0,key:"emoji"+r,className:o.slider__emoji,style:b(r,t.length)},L(e.emojiUniCode)))),q=()=>t==null?void 0:t.map((e,r)=>a.createElement("div",{key:"step"+r,className:o.slider__track__step,style:b(r,t.length)})),F=()=>a.createElement("div",{className:o["slider__value-container"]},t==null?void 0:t.map((e,r)=>typeof e.label<"u"&&a.createElement("div",{"aria-hidden":!0,key:"label"+r,className:o.slider__value,style:b(r,t.length)},e.label)));return a.createElement("div",{className:o.slider,"data-testid":$,"data-analyticsid":G.Slider},m&&a.createElement(Y,{className:o.slider__title,htmlMarkup:"h3",margin:0,appearance:"title3",id:k},m),a.createElement("div",{className:o["slider__content-container"]},W(),a.createElement("div",{ref:N,className:j(o["slider__track-wrapper"],n&&o["slider__track-wrapper--disabled"]),onClick:X,onPointerDown:z},a.createElement("div",{className:j(o.slider__track,n&&o["slider__track--disabled"])},q()),a.createElement("div",{role:n?void 0:"slider",ref:P,className:j(o.slider__marker,n&&o["slider__marker--disabled"]),style:{left:`${K}px`},onKeyDown:B,"aria-valuenow":s,"aria-valuetext":H(),"aria-valuemin":i,"aria-valuemax":l,tabIndex:n?void 0:0,"aria-disabled":n,...O})),F()),(c||_)&&a.createElement("span",{className:o.slider__options},a.createElement("span",{id:y},c),a.createElement("span",{id:w},_)))},fe=x;export{x as Slider,fe as default};
1
+ import a,{useState as T,useRef as U,useEffect as E}from"react";import b from"classnames";import{AnalyticsId as G}from"../../constants.js";import{useSize as J}from"../../hooks/useSize.js";import{useUuid as S}from"../../hooks/useUuid.js";import{getAriaLabelAttributes as Q}from"../../utils/accessibility.js";import{T as Y}from"../../Title.js";import o from"./styles.module.scss";import"../../utils/debounce.js";import"../../uuid.js";import"../../utils/environment.js";import"../Title/styles.module.scss";const Z=(m,v,l)=>{const[_,n]=T(m),h=r=>{r>l?n(l):r<v?n(v):n(r)};return E(()=>{n((l-v)/2+v)},[v,l]),[_,h]},x=({title:m,ariaLabel:v,labelLeft:l,labelRight:_,disabled:n=!1,onChange:h,steps:r,step:p=1,minValue:i=0,maxValue:s=r?r.length-1:100,testId:$})=>{const[A,I]=T(!1),[d,f]=Z((s-i)/2+i,i,s),g=S(),y=S(),w=S(),j=U(null),N=U(null),{width:C}=J(j)||{width:0},M=s/10;E(()=>{const e=()=>{I(!1)};return document.addEventListener("pointerup",e),()=>{document.removeEventListener("pointerup",e)}},[]);const D=e=>{var R;const t=((R=j.current)==null?void 0:R.getBoundingClientRect().x)??0,c=(e-t)/C,k=s-i;let u=c*k+i;return u=Math.round(u/p)*p,u=Math.max(i,Math.min(s,u)),u};E(()=>{const e=t=>{if(!n&&A){const c=D(t.clientX);f(c)}};return document.addEventListener("pointermove",e),()=>{document.removeEventListener("pointermove",e)}},[A]),E(()=>{!n&&h&&h(d)},[d]);const B=e=>{if(n)return;let t=!1;switch(e.key){case"ArrowLeft":case"ArrowDown":f(d-p),t=!0;break;case"PageDown":f(d-M),t=!0;break;case"ArrowRight":case"ArrowUp":f(d+p),t=!0;break;case"PageUp":f(d+M),t=!0;break;case"Home":f(i),t=!0;break;case"End":f(s),t=!0;break}t&&(e.preventDefault(),e.stopPropagation())},X=e=>{var c;if(n)return;const t=D(e.clientX);f(t),(c=N.current)==null||c.focus()},z=e=>{var t;n||(I(!0),e.preventDefault(),e.stopPropagation(),(t=N.current)==null||t.focus())},K=s!==i?C/(s-i)*(d-i):0,W=()=>{const e=r?Math.round((d-i)/p):null;if(r&&e!==null&&e>=0&&e<r.length){const t=r[e],c=t.emojiUniCode,k=c?L(c):void 0,u=typeof t.label<"u"?t.label.toString():void 0;return k&&u?`${k} ${u}`:k||u}},H=Q({label:v,id:(()=>{if(m&&l&&_)return[g,y,w].join(" ");if(m&&l)return[g,y].join(" ");if(m&&_)return[g,w].join(" ");if(m)return g})(),prefer:"label"}),P=(e,t)=>({left:`${e/(t-1)*100}%`}),L=e=>{try{if(/^&#\d+/.test(e)){const c=e.replace(/^&#/,"");return String.fromCodePoint(parseInt(c,16))}else return e}catch{return e}},O=()=>a.createElement("div",{className:o["slider__emoji-container"]},r==null?void 0:r.map((e,t)=>e.emojiUniCode&&a.createElement("div",{"aria-hidden":!0,key:"emoji"+t,className:o.slider__emoji,style:P(t,r.length)},L(e.emojiUniCode)))),q=()=>r==null?void 0:r.map((e,t)=>a.createElement("div",{key:"step"+t,className:o.slider__track__step,style:P(t,r.length)})),F=()=>a.createElement("div",{className:o["slider__value-container"]},r==null?void 0:r.map((e,t)=>typeof e.label<"u"&&a.createElement("div",{"aria-hidden":!0,key:"label"+t,className:o.slider__value,style:P(t,r.length)},e.label)));return a.createElement("div",{className:o.slider,"data-testid":$,"data-analyticsid":G.Slider},m&&a.createElement(Y,{className:o.slider__title,htmlMarkup:"h3",margin:0,appearance:"title3",id:g},m),a.createElement("div",{className:o["slider__content-container"]},O(),a.createElement("div",{ref:j,className:b(o["slider__track-wrapper"],n&&o["slider__track-wrapper--disabled"]),onClick:X,onPointerDown:z},a.createElement("div",{className:b(o.slider__track,n&&o["slider__track--disabled"])},q()),a.createElement("div",{role:n?void 0:"slider",ref:N,className:b(o.slider__marker,n&&o["slider__marker--disabled"]),style:{left:`${K}px`},onKeyDown:B,"aria-valuenow":d,"aria-valuetext":W(),"aria-valuemin":i,"aria-valuemax":s,tabIndex:n?void 0:0,"aria-disabled":n,...H})),F()),(l||_)&&a.createElement("span",{className:o.slider__options},a.createElement("span",{id:y},l),a.createElement("span",{id:w},_)))},fe=x;export{x as Slider,fe as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n useEffect(() => {\n setValue((max - min) / 2 + min);\n }, [min, max]);\n\n return [value, setSafeValue];\n};\n\nexport type SliderStep = {\n label?: number | string;\n emojiUniCode?: string;\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n minValue?: number;\n /** Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n maxValue?: number;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the steps data for the slider*/\n steps?: SliderStep[];\n /** Sets the step to move per point in the slider */\n step?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Slider: React.FC<SliderProps> = ({\n title,\n ariaLabel,\n labelLeft,\n labelRight,\n disabled = false,\n onChange,\n steps,\n step = 1,\n minValue = 0,\n maxValue = steps ? steps.length - 1 : 100,\n testId,\n}) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((maxValue - minValue) / 2 + minValue, minValue, maxValue);\n\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const largeStep = maxValue / 10;\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n // Calculate the normalized position (0 to 1) of the marker along the track\n const normalizedPosition = (markerPosition - trackPosition) / trackWidth;\n const valueRange = maxValue - minValue;\n // Calculate the value without considering the step\n let value = normalizedPosition * valueRange + minValue;\n // Adjust the value to account for the step increment\n const stepCount = Math.round(value / step);\n value = stepCount * step;\n value = Math.max(minValue, Math.min(maxValue, value));\n\n return value;\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - step);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - largeStep);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + step);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + largeStep);\n flag = true;\n break;\n case 'Home':\n setValue(minValue);\n flag = true;\n break;\n case 'End':\n setValue(maxValue);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = maxValue !== minValue ? (trackWidth / (maxValue - minValue)) * (value - minValue) : 0;\n\n const getAriaValueText = (): string | undefined => {\n const stepIndex = steps ? Math.round((value - minValue) / step) : null;\n\n if (steps && stepIndex !== null && stepIndex >= 0 && stepIndex < steps.length) {\n const step = steps[stepIndex];\n const emojiCode = step.emojiUniCode;\n const emojiAsText = emojiCode ? safelyReturnEmoji(emojiCode) : undefined;\n const label = typeof step.label !== 'undefined' ? step.label.toString() : undefined;\n\n return emojiAsText && label ? `${emojiAsText} ${label}` : emojiAsText || label;\n }\n\n return undefined;\n };\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n const getXPostionStyling = (index: number, stepsLength: number): { left: string } => {\n return { left: `${(index / (stepsLength - 1)) * 100}%` };\n };\n\n const safelyReturnEmoji = (code: string): string => {\n try {\n return String.fromCodePoint(parseInt(code, 16));\n } catch (e) {\n return code;\n }\n };\n\n const renderEmojies = (): React.ReactNode => {\n return (\n <div className={styles['slider__emoji-container']}>\n {steps?.map((step, index) => {\n return (\n step.emojiUniCode && (\n <div\n aria-hidden={true}\n key={'emoji' + index}\n className={styles['slider__emoji']}\n style={getXPostionStyling(index, steps.length)}\n >\n {safelyReturnEmoji(step.emojiUniCode)}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n const renderSteps = (): React.ReactNode => {\n return steps?.map((_step, index) => {\n return <div key={'step' + index} className={styles['slider__track__step']} style={getXPostionStyling(index, steps.length)} />;\n });\n };\n\n const renderStepLabels = (): React.ReactNode => {\n return (\n <div className={styles['slider__value-container']}>\n {steps?.map((step, index) => {\n return (\n typeof step.label !== 'undefined' && (\n <div\n aria-hidden={true}\n key={'label' + index}\n className={styles['slider__value']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.label}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title className={styles['slider__title']} htmlMarkup={'h3'} margin={0} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div className={styles['slider__content-container']}>\n {renderEmojies()}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])}>{renderSteps()}</div>\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuetext={getAriaValueText()}\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {renderStepLabels()}\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","setSafeValue","newValue","useEffect","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","steps","step","minValue","maxValue","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","largeStep","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","normalizedPosition","valueRange","handlePointerMove","e","handleKeyDown","flag","handleTrackClick","handlePointerDown","markerXPos","getAriaValueText","stepIndex","emojiCode","emojiAsText","safelyReturnEmoji","label","ariaLabelAttributes","getAriaLabelAttributes","getXPostionStyling","index","stepsLength","code","renderEmojies","React","styles","renderSteps","_step","renderStepLabels","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAEpCM,EAAgBC,GAA2B,CAC3CA,EAAWL,EACbE,EAASF,CAAG,EACHK,EAAWN,EACpBG,EAASH,CAAG,EAEZG,EAASG,CAAQ,CACnB,EAGF,OAAAC,EAAU,IAAM,CACJJ,GAAAF,EAAMD,GAAO,EAAIA,CAAG,CAAA,EAC7B,CAACA,EAAKC,CAAG,CAAC,EAEN,CAACC,EAAOG,CAAY,CAC7B,EAgCaG,EAAgC,CAAC,CAC5C,MAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,SAAAC,EAAW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,CAEJ,EAEAuD,GAAe3D"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n useEffect(() => {\n setValue((max - min) / 2 + min);\n }, [min, max]);\n\n return [value, setSafeValue];\n};\n\nexport type SliderStep = {\n label?: number | string;\n /** Start emojicode with &# - otherwise it will render as a regular string */\n emojiUniCode?: string;\n};\n\ninterface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n minValue?: number;\n /** Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n maxValue?: number;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** Sets the steps data for the slider*/\n steps?: SliderStep[];\n /** Sets the step to move per point in the slider */\n step?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const Slider: React.FC<SliderProps> = ({\n title,\n ariaLabel,\n labelLeft,\n labelRight,\n disabled = false,\n onChange,\n steps,\n step = 1,\n minValue = 0,\n maxValue = steps ? steps.length - 1 : 100,\n testId,\n}) => {\n const [isMoving, setIsMoving] = useState(false);\n const [value, setValue] = useSafeNumberValue((maxValue - minValue) / 2 + minValue, minValue, maxValue);\n\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const largeStep = maxValue / 10;\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n // Calculate the normalized position (0 to 1) of the marker along the track\n const normalizedPosition = (markerPosition - trackPosition) / trackWidth;\n const valueRange = maxValue - minValue;\n // Calculate the value without considering the step\n let value = normalizedPosition * valueRange + minValue;\n // Adjust the value to account for the step increment\n const stepCount = Math.round(value / step);\n value = stepCount * step;\n value = Math.max(minValue, Math.min(maxValue, value));\n\n return value;\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (!disabled && onChange) {\n onChange(value);\n }\n }, [value]);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValue(value - step);\n flag = true;\n break;\n case 'PageDown':\n setValue(value - largeStep);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValue(value + step);\n flag = true;\n break;\n case 'PageUp':\n setValue(value + largeStep);\n flag = true;\n break;\n case 'Home':\n setValue(minValue);\n flag = true;\n break;\n case 'End':\n setValue(maxValue);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValue(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = maxValue !== minValue ? (trackWidth / (maxValue - minValue)) * (value - minValue) : 0;\n\n const getAriaValueText = (): string | undefined => {\n const stepIndex = steps ? Math.round((value - minValue) / step) : null;\n\n if (steps && stepIndex !== null && stepIndex >= 0 && stepIndex < steps.length) {\n const step = steps[stepIndex];\n const emojiCode = step.emojiUniCode;\n const emojiAsText = emojiCode ? safelyReturnEmoji(emojiCode) : undefined;\n const label = typeof step.label !== 'undefined' ? step.label.toString() : undefined;\n\n return emojiAsText && label ? `${emojiAsText} ${label}` : emojiAsText || label;\n }\n\n return undefined;\n };\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n const getXPostionStyling = (index: number, stepsLength: number): { left: string } => {\n return { left: `${(index / (stepsLength - 1)) * 100}%` };\n };\n\n const safelyReturnEmoji = (code: string): string => {\n try {\n const regex = /^&#\\d+/;\n if (regex.test(code)) {\n const emojiWithoutRegex = code.replace(/^&#/, '');\n return String.fromCodePoint(parseInt(emojiWithoutRegex, 16));\n } else {\n return code;\n }\n } catch (e) {\n return code;\n }\n };\n\n const renderEmojies = (): React.ReactNode => {\n return (\n <div className={styles['slider__emoji-container']}>\n {steps?.map((step, index) => {\n return (\n step.emojiUniCode && (\n <div\n aria-hidden={true}\n key={'emoji' + index}\n className={styles['slider__emoji']}\n style={getXPostionStyling(index, steps.length)}\n >\n {safelyReturnEmoji(step.emojiUniCode)}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n const renderSteps = (): React.ReactNode => {\n return steps?.map((_step, index) => {\n return <div key={'step' + index} className={styles['slider__track__step']} style={getXPostionStyling(index, steps.length)} />;\n });\n };\n\n const renderStepLabels = (): React.ReactNode => {\n return (\n <div className={styles['slider__value-container']}>\n {steps?.map((step, index) => {\n return (\n typeof step.label !== 'undefined' && (\n <div\n aria-hidden={true}\n key={'label' + index}\n className={styles['slider__value']}\n style={getXPostionStyling(index, steps.length)}\n >\n {step.label}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title className={styles['slider__title']} htmlMarkup={'h3'} margin={0} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div className={styles['slider__content-container']}>\n {renderEmojies()}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])}>{renderSteps()}</div>\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, disabled && styles['slider__marker--disabled'])}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={value}\n aria-valuetext={getAriaValueText()}\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {renderStepLabels()}\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","setSafeValue","newValue","useEffect","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","steps","step","minValue","maxValue","testId","isMoving","setIsMoving","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","largeStep","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","normalizedPosition","valueRange","handlePointerMove","e","handleKeyDown","flag","handleTrackClick","handlePointerDown","markerXPos","getAriaValueText","stepIndex","emojiCode","emojiAsText","safelyReturnEmoji","label","ariaLabelAttributes","getAriaLabelAttributes","getXPostionStyling","index","stepsLength","code","emojiWithoutRegex","renderEmojies","React","styles","renderSteps","_step","renderStepLabels","AnalyticsId","Title","classNames","Slider$1"],"mappings":"sfAYA,MAAMA,EAAqB,CAACC,EAAiBC,EAAaC,IAAmD,CAC3G,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAASL,CAAO,EAEpCM,EAAgBC,GAA2B,CAC3CA,EAAWL,EACbE,EAASF,CAAG,EACHK,EAAWN,EACpBG,EAASH,CAAG,EAEZG,EAASG,CAAQ,CACnB,EAGF,OAAAC,EAAU,IAAM,CACJJ,GAAAF,EAAMD,GAAO,EAAIA,CAAG,CAAA,EAC7B,CAACA,EAAKC,CAAG,CAAC,EAEN,CAACC,EAAOG,CAAY,CAC7B,EAiCaG,EAAgC,CAAC,CAC5C,MAAAC,EACA,UAAAC,EACA,UAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,SAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,EACP,SAAAC,EAAW,EACX,SAAAC,EAAWH,EAAQA,EAAM,OAAS,EA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AEJ,CAEJ,EAEAwD,GAAe5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeadCell.d.ts","sourceRoot":"","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,MAAM,WAAW,KAAK;IACpB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0FAA0F;IAC1F,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,8DAAiF,KAAK,KAAG,SAAS,QAgD3H,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"TableHeadCell.d.ts","sourceRoot":"","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,MAAM,WAAW,KAAK;IACpB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0FAA0F;IAC1F,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,8DAAiF,KAAK,KAAG,SAAS,QA2C3H,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -43,12 +43,6 @@ table .table-body .table-row {
43
43
  max-width: 100%;
44
44
  }
45
45
 
46
- .table__head-cell:focus {
47
- outline: none;
48
- background-color: $blueberry800;
49
- text-decoration: underline;
50
- }
51
-
52
46
  .table__cell {
53
47
  position: relative;
54
48
  padding: 0.75rem 0 0.75rem 40%;
@@ -212,12 +206,6 @@ table .table-body .table-row {
212
206
  outline-offset: -3px;
213
207
  }
214
208
 
215
- &--sorted {
216
- text-decoration: underline;
217
- text-decoration-thickness: 1px;
218
- text-underline-offset: 0.3125rem;
219
- }
220
-
221
209
  @media (min-width: map.get($grid-breakpoints, lg)) {
222
210
  padding: 1rem;
223
211
  height: 5.5rem;
@@ -21,7 +21,6 @@ export type Styles = {
21
21
  'table__head-cell': string;
22
22
  'table__head-cell--compact': string;
23
23
  'table__head-cell--sortable': string;
24
- 'table__head-cell--sorted': string;
25
24
  'table__head-cell-sort-icon-wrapper': string;
26
25
  'table__row--expandable': string;
27
26
  'table__row--expandable--selected': string;
package/constants.d.ts CHANGED
@@ -84,6 +84,7 @@ export declare enum AnalyticsId {
84
84
  PopMenu = "pop-menu",
85
85
  PopOver = "pop-over",
86
86
  Portal = "portal",
87
+ PromoPanel = "promo-panel",
87
88
  RadioButton = "radio-button",
88
89
  Select = "select",
89
90
  SharingStatus = "sharing-status",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;C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MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,SAAS,eAAe;IACxB,IAAI,SAAS;IACb,WAAW,iBAAiB;IAC5B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,aAAa;IACpB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ"}
package/constants.js CHANGED
@@ -1,2 +1,2 @@
1
- var e=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(e||{}),o=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(o||{});const g=12;var p=(r=>(r.onwhite="onwhite",r.ongrey="ongrey",r.onblueberry="onblueberry",r.ondark="ondark",r.oninvalid="oninvalid",r))(p||{}),a=(r=>(r.normal="normal",r.bigform="bigform",r))(a||{}),t=(r=>(r.AnchorLink="anchor-link",r.Avatar="avatar",r.Badge="badge",r.Button="button",r.Checkbox="checkbox",r.Close="close",r.DictionaryTrigger="dictionary-trigger",r.Dropdown="dropdown",r.Duolist="duolist",r.EmptyState="empty-state",r.Expander="expander",r.ExpanderHierarchy="expander-hierarchy",r.ExpanderHierarchyExpander="expander-hierarchy-expander",r.ExpanderList="expander-list",r.ExpanderListExpander="expander-list-expander",r.FormGroup="form-group",r.FormLayout="form-layout",r.HelpBubble="help-bubble",r.HelpQuestion="help-question",r.HighlightBox="highlight-box",r.Icon="icon",r.Input="input",r.Label="label",r.Link="link",r.LinkList="link-list",r.List="list",r.Loader="loader",r.Logo="logo",r.Modal="modal",r.NotificationPanel="notification-panel",r.Panel="panel",r.PanelList="panel-list",r.PopMenu="pop-menu",r.PopOver="pop-over",r.Portal="portal",r.RadioButton="radio-button",r.Select="select",r.SharingStatus="sharing-status",r.Slider="slider",r.Spacer="spacer",r.StatusDot="status-dot",r.Step="step",r.StepButtons="step-buttons",r.Stepper="stepper",r.Sublabel="sublabel",r.Table="table",r.Tag="tag",r.TagList="tag-list",r.Textarea="textarea",r.Tile="tile",r.Title="title",r.Tooltip="tooltip",r.Trigger="trigger",r.Validation="validation",r))(t||{}),u=(r=>(r.Enter="Enter",r.Escape="Escape",r.ArrowDown="ArrowDown",r.ArrowUp="ArrowUp",r.Home="Home",r.End="End",r))(u||{});export{g as AVERAGE_CHARACTER_WIDTH_PX,t as AnalyticsId,p as FormMode,a as FormVariant,e as IconSize,u as KeyboardEventKey,o as ZIndex};
1
+ var e=(r=>(r[r.XXSmall=24]="XXSmall",r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge",r))(e||{}),o=(r=>(r[r.Modal=13e5]="Modal",r[r.ExpanderTrigger=1e4]="ExpanderTrigger",r))(o||{});const g=12;var p=(r=>(r.onwhite="onwhite",r.ongrey="ongrey",r.onblueberry="onblueberry",r.ondark="ondark",r.oninvalid="oninvalid",r))(p||{}),a=(r=>(r.normal="normal",r.bigform="bigform",r))(a||{}),t=(r=>(r.AnchorLink="anchor-link",r.Avatar="avatar",r.Badge="badge",r.Button="button",r.Checkbox="checkbox",r.Close="close",r.DictionaryTrigger="dictionary-trigger",r.Dropdown="dropdown",r.Duolist="duolist",r.EmptyState="empty-state",r.Expander="expander",r.ExpanderHierarchy="expander-hierarchy",r.ExpanderHierarchyExpander="expander-hierarchy-expander",r.ExpanderList="expander-list",r.ExpanderListExpander="expander-list-expander",r.FormGroup="form-group",r.FormLayout="form-layout",r.HelpBubble="help-bubble",r.HelpQuestion="help-question",r.HighlightBox="highlight-box",r.Icon="icon",r.Input="input",r.Label="label",r.Link="link",r.LinkList="link-list",r.List="list",r.Loader="loader",r.Logo="logo",r.Modal="modal",r.NotificationPanel="notification-panel",r.Panel="panel",r.PanelList="panel-list",r.PopMenu="pop-menu",r.PopOver="pop-over",r.Portal="portal",r.PromoPanel="promo-panel",r.RadioButton="radio-button",r.Select="select",r.SharingStatus="sharing-status",r.Slider="slider",r.Spacer="spacer",r.StatusDot="status-dot",r.Step="step",r.StepButtons="step-buttons",r.Stepper="stepper",r.Sublabel="sublabel",r.Table="table",r.Tag="tag",r.TagList="tag-list",r.Textarea="textarea",r.Tile="tile",r.Title="title",r.Tooltip="tooltip",r.Trigger="trigger",r.Validation="validation",r))(t||{}),u=(r=>(r.Enter="Enter",r.Escape="Escape",r.ArrowDown="ArrowDown",r.ArrowUp="ArrowUp",r.Home="Home",r.End="End",r))(u||{});export{g as AVERAGE_CHARACTER_WIDTH_PX,t as AnalyticsId,p as FormMode,a as FormVariant,e as IconSize,u as KeyboardEventKey,o as ZIndex};
2
2
  //# sourceMappingURL=constants.js.map
package/constants.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n DictionaryTrigger = 'dictionary-trigger',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n EmptyState = 'empty-state',\n Expander = 'expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HelpQuestion = 'help-question',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Label = 'label',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n RadioButton = 'radio-button',\n Select = 'select',\n SharingStatus = 'sharing-status',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Step = 'step',\n StepButtons = 'step-buttons',\n Stepper = 'stepper',\n Sublabel = 'sublabel',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Trigger = 'trigger',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,EAAV,EAAA,UACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,GAAT,EAAA,SANUA,IAAAA,GAAA,CAAA,CAAA,EASAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,IAAR,EAAA,QACAA,EAAAA,EAAA,gBAAkB,GAAlB,EAAA,kBAFUA,IAAAA,GAAA,CAAA,CAAA,EAKL,MAAMC,EAA6B,GAyC9B,IAAAC,GAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,UAAY,YALFA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,cACbA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,kBAAoB,qBACpBA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,WAAa,cACbA,EAAA,SAAW,WACXA,EAAA,kBAAoB,qBACpBA,EAAA,0BAA4B,8BAC5BA,EAAA,aAAe,gBACfA,EAAA,qBAAuB,yBACvBA,EAAA,UAAY,aACZA,EAAA,WAAa,cACbA,EAAA,WAAa,cACbA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,SAAW,YACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,kBAAoB,qBACpBA,EAAA,MAAQ,QACRA,EAAA,UAAY,aACZA,EAAA,QAAU,WACVA,EAAA,QAAU,WACVA,EAAA,OAAS,SACTA,EAAA,YAAc,eACdA,EAAA,OAAS,SACTA,EAAA,cAAgB,iBAChBA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,UAAY,aACZA,EAAA,KAAO,OACPA,EAAA,YAAc,eACdA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,QAAU,WACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,WAAa,aAtDHA,IAAAA,GAAA,CAAA,CAAA,EAyDAC,GAAAA,IACVA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MANIA,IAAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export enum IconSize {\n XXSmall = 24,\n XSmall = 38,\n Small = 48,\n Medium = 64,\n Large = 80,\n XLarge = 130,\n}\n\nexport enum ZIndex {\n Modal = 1300000,\n ExpanderTrigger = 10000,\n}\n\nexport const AVERAGE_CHARACTER_WIDTH_PX = 12;\n\nexport interface HTMLButtonProps {\n autoFocus?: boolean;\n disabled?: boolean;\n form?: string;\n formAction?: string;\n formEncType?: string;\n formMethod?: string;\n formNoValidate?: boolean;\n formTarget?: string;\n name?: string;\n type?: 'submit' | 'reset' | 'button' | string;\n value?: string | string[] | number;\n id?: string;\n}\n\nexport type AnchorTarget = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface HTMLAnchorProps {\n download?: string;\n href?: string;\n hrefLang?: string;\n media?: string;\n ping?: string;\n rel?: AnchorTarget;\n target?: string;\n referrerPolicy?:\n | ''\n | 'same-origin'\n | 'no-referrer'\n | 'no-referrer-when-downgrade'\n | 'origin'\n | 'origin-when-cross-origin'\n | 'strict-origin'\n | 'strict-origin-when-cross-origin'\n | 'unsafe-url';\n}\n\nexport type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;\n\nexport enum FormMode {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n ondark = 'ondark',\n oninvalid = 'oninvalid',\n}\n\nexport enum FormVariant {\n normal = 'normal',\n bigform = 'bigform',\n}\n\nexport enum AnalyticsId {\n AnchorLink = 'anchor-link',\n Avatar = 'avatar',\n Badge = 'badge',\n Button = 'button',\n Checkbox = 'checkbox',\n Close = 'close',\n DictionaryTrigger = 'dictionary-trigger',\n Dropdown = 'dropdown',\n Duolist = 'duolist',\n EmptyState = 'empty-state',\n Expander = 'expander',\n ExpanderHierarchy = 'expander-hierarchy',\n ExpanderHierarchyExpander = 'expander-hierarchy-expander',\n ExpanderList = 'expander-list',\n ExpanderListExpander = 'expander-list-expander',\n FormGroup = 'form-group',\n FormLayout = 'form-layout',\n HelpBubble = 'help-bubble',\n HelpQuestion = 'help-question',\n HighlightBox = 'highlight-box',\n Icon = 'icon',\n Input = 'input',\n Label = 'label',\n Link = 'link',\n LinkList = 'link-list',\n List = 'list',\n Loader = 'loader',\n Logo = 'logo',\n Modal = 'modal',\n NotificationPanel = 'notification-panel',\n Panel = 'panel',\n PanelList = 'panel-list',\n PopMenu = 'pop-menu',\n PopOver = 'pop-over',\n Portal = 'portal',\n PromoPanel = 'promo-panel',\n RadioButton = 'radio-button',\n Select = 'select',\n SharingStatus = 'sharing-status',\n Slider = 'slider',\n Spacer = 'spacer',\n StatusDot = 'status-dot',\n Step = 'step',\n StepButtons = 'step-buttons',\n Stepper = 'stepper',\n Sublabel = 'sublabel',\n Table = 'table',\n Tag = 'tag',\n TagList = 'tag-list',\n Textarea = 'textarea',\n Tile = 'tile',\n Title = 'title',\n Tooltip = 'tooltip',\n Trigger = 'trigger',\n Validation = 'validation',\n}\n\nexport enum KeyboardEventKey {\n Enter = 'Enter',\n Escape = 'Escape',\n ArrowDown = 'ArrowDown',\n ArrowUp = 'ArrowUp',\n Home = 'Home',\n End = 'End',\n}\n"],"names":["IconSize","ZIndex","AVERAGE_CHARACTER_WIDTH_PX","FormMode","FormVariant","AnalyticsId","KeyboardEventKey"],"mappings":"AAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,QAAU,EAAV,EAAA,UACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,EAAT,EAAA,SACAA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,OAAS,GAAT,EAAA,SANUA,IAAAA,GAAA,CAAA,CAAA,EASAC,GAAAA,IACVA,EAAAA,EAAA,MAAQ,IAAR,EAAA,QACAA,EAAAA,EAAA,gBAAkB,GAAlB,EAAA,kBAFUA,IAAAA,GAAA,CAAA,CAAA,EAKL,MAAMC,EAA6B,GAyC9B,IAAAC,GAAAA,IACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,YAAc,cACdA,EAAA,OAAS,SACTA,EAAA,UAAY,YALFA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UAFAA,IAAAA,GAAA,CAAA,CAAA,EAKAC,GAAAA,IACVA,EAAA,WAAa,cACbA,EAAA,OAAS,SACTA,EAAA,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ot":"","sources":["../../src/hooks/usePseudoClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;eAEkC,OAAO;eAAa,OAAO;CAyBzF,CAAC"}
1
+ {"version":3,"file":"usePseudoClasses.d.ts","sourceRoot":"","sources":["../../src/hooks/usePseudoClasses.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;eAEkC,OAAO;eAAa,OAAO;CA6BzF,CAAC"}
@@ -1,2 +1,2 @@
1
- import{useRef as I,useState as L,useEffect as p}from"react";const M=t=>{const e=t||I(null),[h,s]=L(!1),[F,n]=L(!1);return p(()=>{var a,d,v,i;const r=()=>s(!0),u=()=>s(!1),o=()=>n(!0),c=()=>n(!1);return(a=e.current)==null||a.addEventListener("mouseenter",r),(d=e.current)==null||d.addEventListener("mouseleave",u),(v=e.current)==null||v.addEventListener("focusin",o),(i=e.current)==null||i.addEventListener("focusout",c),()=>{var l,f,m,E;(l=e.current)==null||l.removeEventListener("mouseenter",r),(f=e.current)==null||f.removeEventListener("mouseleave",u),(m=e.current)==null||m.removeEventListener("focusin",o),(E=e.current)==null||E.removeEventListener("focusout",c)}},[e]),{refObject:e,isHovered:h,isFocused:F}};export{M as usePseudoClasses};
1
+ import{useRef as O,useState as I,useEffect as b}from"react";const x=r=>{const e=r||O(null),[H,s]=I(!1),[M,o]=I(!1);return b(()=>{var v,a,d,i,l,E;const t=()=>s(!0),n=()=>s(!1),u=()=>o(!0),c=()=>o(!1);return(v=e.current)==null||v.addEventListener("mouseenter",t),(a=e.current)==null||a.addEventListener("mouseleave",n),(d=e.current)==null||d.addEventListener("pointerenter",t),(i=e.current)==null||i.addEventListener("pointerleave",n),(l=e.current)==null||l.addEventListener("focusin",u),(E=e.current)==null||E.addEventListener("focusout",c),()=>{var L,f,m,p,h,F;(L=e.current)==null||L.removeEventListener("mouseenter",t),(f=e.current)==null||f.removeEventListener("mouseleave",n),(m=e.current)==null||m.removeEventListener("pointerenter",t),(p=e.current)==null||p.removeEventListener("pointerleave",n),(h=e.current)==null||h.removeEventListener("focusin",u),(F=e.current)==null||F.removeEventListener("focusout",c)}},[e]),{refObject:e,isHovered:H,isFocused:M}};export{x as usePseudoClasses};
2
2
  //# sourceMappingURL=usePseudoClasses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePseudoClasses.js","sources":["../../src/hooks/usePseudoClasses.ts"],"sourcesContent":["import { useRef, useEffect, useState, RefObject, MutableRefObject } from 'react';\n\n/**\n * Få vite når et element hovres over eller mottar fokus.\n * @param ref Element som skal observeres\n * @returns Objekt med ref og om objekt er hovered/focused\n */\nexport const usePseudoClasses = <T extends HTMLElement | SVGElement>(\n ref?: RefObject<T> | MutableRefObject<T> | null\n): { refObject: RefObject<T> | MutableRefObject<T>; isHovered: boolean; isFocused: boolean } => {\n const refObject = ref ? ref : useRef<T>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n useEffect(() => {\n const handleMouseEnter = (): void => setIsHovered(true);\n const handleMouseLeave = (): void => setIsHovered(false);\n const handleFocusIn = (): void => setIsFocused(true);\n const handleFocusOut = (): void => setIsFocused(false);\n\n refObject.current?.addEventListener('mouseenter', handleMouseEnter);\n refObject.current?.addEventListener('mouseleave', handleMouseLeave);\n refObject.current?.addEventListener('focusin', handleFocusIn);\n refObject.current?.addEventListener('focusout', handleFocusOut);\n\n return (): void => {\n refObject.current?.removeEventListener('mouseenter', handleMouseEnter);\n refObject.current?.removeEventListener('mouseleave', handleMouseLeave);\n refObject.current?.removeEventListener('focusin', handleFocusIn);\n refObject.current?.removeEventListener('focusout', handleFocusOut);\n };\n }, [refObject]);\n\n return { refObject, isHovered, isFocused };\n};\n"],"names":["usePseudoClasses","ref","refObject","useRef","isHovered","setIsHovered","useState","isFocused","setIsFocused","useEffect","handleMouseEnter","handleMouseLeave","handleFocusIn","handleFocusOut","_a","_b","_c","_d"],"mappings":"4DAOa,MAAAA,EACXC,GAC8F,CAC9F,MAAMC,EAAYD,GAAYE,EAAU,IAAI,EACtC,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAC1C,CAACC,EAAWC,CAAY,EAAIF,EAAS,EAAK,EAEhD,OAAAG,EAAU,IAAM,aACR,MAAAC,EAAmB,IAAYL,EAAa,EAAI,EAChDM,EAAmB,IAAYN,EAAa,EAAK,EACjDO,EAAgB,IAAYJ,EAAa,EAAI,EAC7CK,EAAiB,IAAYL,EAAa,EAAK,EAE3C,OAAAM,EAAAZ,EAAA,UAAA,MAAAY,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAb,EAAA,UAAA,MAAAa,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAd,EAAA,UAAA,MAAAc,EAAS,iBAAiB,UAAWJ,IACrCK,EAAAf,EAAA,UAAA,MAAAe,EAAS,iBAAiB,WAAYJ,GAEzC,IAAY,cACPC,EAAAZ,EAAA,UAAA,MAAAY,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAb,EAAA,UAAA,MAAAa,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAd,EAAA,UAAA,MAAAc,EAAS,oBAAoB,UAAWJ,IACxCK,EAAAf,EAAA,UAAA,MAAAe,EAAS,oBAAoB,WAAYJ,EAAc,CACnE,EACC,CAACX,CAAS,CAAC,EAEP,CAAE,UAAAA,EAAW,UAAAE,EAAW,UAAAG,EACjC"}
1
+ {"version":3,"file":"usePseudoClasses.js","sources":["../../src/hooks/usePseudoClasses.ts"],"sourcesContent":["import { useRef, useEffect, useState, RefObject, MutableRefObject } from 'react';\n\n/**\n * Få vite når et element hovres over eller mottar fokus.\n * @param ref Element som skal observeres\n * @returns Objekt med ref og om objekt er hovered/focused\n */\nexport const usePseudoClasses = <T extends HTMLElement | SVGElement>(\n ref?: RefObject<T> | MutableRefObject<T> | null\n): { refObject: RefObject<T> | MutableRefObject<T>; isHovered: boolean; isFocused: boolean } => {\n const refObject = ref ? ref : useRef<T>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n useEffect(() => {\n const handleMouseEnter = (): void => setIsHovered(true);\n const handleMouseLeave = (): void => setIsHovered(false);\n const handleFocusIn = (): void => setIsFocused(true);\n const handleFocusOut = (): void => setIsFocused(false);\n\n refObject.current?.addEventListener('mouseenter', handleMouseEnter);\n refObject.current?.addEventListener('mouseleave', handleMouseLeave);\n refObject.current?.addEventListener('pointerenter', handleMouseEnter);\n refObject.current?.addEventListener('pointerleave', handleMouseLeave);\n refObject.current?.addEventListener('focusin', handleFocusIn);\n refObject.current?.addEventListener('focusout', handleFocusOut);\n\n return (): void => {\n refObject.current?.removeEventListener('mouseenter', handleMouseEnter);\n refObject.current?.removeEventListener('mouseleave', handleMouseLeave);\n refObject.current?.removeEventListener('pointerenter', handleMouseEnter);\n refObject.current?.removeEventListener('pointerleave', handleMouseLeave);\n refObject.current?.removeEventListener('focusin', handleFocusIn);\n refObject.current?.removeEventListener('focusout', handleFocusOut);\n };\n }, [refObject]);\n\n return { refObject, isHovered, isFocused };\n};\n"],"names":["usePseudoClasses","ref","refObject","useRef","isHovered","setIsHovered","useState","isFocused","setIsFocused","useEffect","handleMouseEnter","handleMouseLeave","handleFocusIn","handleFocusOut","_a","_b","_c","_d","_e","_f"],"mappings":"4DAOa,MAAAA,EACXC,GAC8F,CAC9F,MAAMC,EAAYD,GAAYE,EAAU,IAAI,EACtC,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAC1C,CAACC,EAAWC,CAAY,EAAIF,EAAS,EAAK,EAEhD,OAAAG,EAAU,IAAM,iBACR,MAAAC,EAAmB,IAAYL,EAAa,EAAI,EAChDM,EAAmB,IAAYN,EAAa,EAAK,EACjDO,EAAgB,IAAYJ,EAAa,EAAI,EAC7CK,EAAiB,IAAYL,EAAa,EAAK,EAE3C,OAAAM,EAAAZ,EAAA,UAAA,MAAAY,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAb,EAAA,UAAA,MAAAa,EAAS,iBAAiB,aAAcJ,IACxCK,EAAAd,EAAA,UAAA,MAAAc,EAAS,iBAAiB,eAAgBN,IAC1CO,EAAAf,EAAA,UAAA,MAAAe,EAAS,iBAAiB,eAAgBN,IAC1CO,EAAAhB,EAAA,UAAA,MAAAgB,EAAS,iBAAiB,UAAWN,IACrCO,EAAAjB,EAAA,UAAA,MAAAiB,EAAS,iBAAiB,WAAYN,GAEzC,IAAY,kBACPC,EAAAZ,EAAA,UAAA,MAAAY,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAb,EAAA,UAAA,MAAAa,EAAS,oBAAoB,aAAcJ,IAC3CK,EAAAd,EAAA,UAAA,MAAAc,EAAS,oBAAoB,eAAgBN,IAC7CO,EAAAf,EAAA,UAAA,MAAAe,EAAS,oBAAoB,eAAgBN,IAC7CO,EAAAhB,EAAA,UAAA,MAAAgB,EAAS,oBAAoB,UAAWN,IACxCO,EAAAjB,EAAA,UAAA,MAAAiB,EAAS,oBAAoB,WAAYN,EAAc,CACnE,EACC,CAACX,CAAS,CAAC,EAEP,CAAE,UAAAA,EAAW,UAAAE,EAAW,UAAAG,EACjC"}
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/helsenorge/designsystem"
8
8
  },
9
9
  "homepage": "https://helsenorge.design",
10
- "version": "5.8.0",
10
+ "version": "5.9.1",
11
11
  "author": "Helsenorge",
12
12
  "license": "MIT",
13
13
  "dependencies": {