@dnb/eufemia 10.63.2 → 10.63.3

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 (111) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cjs/components/avatar/Avatar.d.ts +1 -1
  3. package/cjs/components/avatar/Avatar.js.map +1 -1
  4. package/cjs/components/avatar/AvatarGroup.d.ts +1 -1
  5. package/cjs/components/avatar/AvatarGroup.js.map +1 -1
  6. package/cjs/components/badge/Badge.d.ts +1 -1
  7. package/cjs/components/badge/Badge.js.map +1 -1
  8. package/cjs/components/lib.d.ts +2 -2
  9. package/cjs/components/section/Section.js +1 -1
  10. package/cjs/components/section/Section.js.map +1 -1
  11. package/cjs/components/tag/Tag.d.ts +2 -2
  12. package/cjs/components/tag/Tag.js.map +1 -1
  13. package/cjs/components/tag/TagGroup.d.ts +1 -1
  14. package/cjs/components/tag/TagGroup.js.map +1 -1
  15. package/cjs/extensions/forms/DataContext/Provider/Provider.d.ts +3 -0
  16. package/cjs/extensions/forms/DataContext/Provider/Provider.js +31 -28
  17. package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  18. package/cjs/extensions/forms/Form/Visibility/useVisibility.js +6 -6
  19. package/cjs/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  20. package/cjs/extensions/forms/Form/data-context/useData.js +14 -10
  21. package/cjs/extensions/forms/Form/data-context/useData.js.map +1 -1
  22. package/cjs/shared/Eufemia.d.ts +1 -1
  23. package/cjs/shared/Eufemia.js +2 -2
  24. package/cjs/shared/Eufemia.js.map +1 -1
  25. package/cjs/shared/error-helper.d.ts +0 -6
  26. package/cjs/shared/error-helper.js +6 -3
  27. package/cjs/shared/error-helper.js.map +1 -1
  28. package/cjs/style/core/scopes.scss +1 -1
  29. package/cjs/style/dnb-ui-basis.css +1 -1
  30. package/cjs/style/dnb-ui-basis.min.css +1 -1
  31. package/cjs/style/dnb-ui-body.css +1 -1
  32. package/cjs/style/dnb-ui-body.min.css +1 -1
  33. package/cjs/style/dnb-ui-core.css +1 -1
  34. package/cjs/style/dnb-ui-core.min.css +1 -1
  35. package/components/avatar/Avatar.d.ts +1 -1
  36. package/components/avatar/Avatar.js.map +1 -1
  37. package/components/avatar/AvatarGroup.d.ts +1 -1
  38. package/components/avatar/AvatarGroup.js.map +1 -1
  39. package/components/badge/Badge.d.ts +1 -1
  40. package/components/badge/Badge.js.map +1 -1
  41. package/components/lib.d.ts +2 -2
  42. package/components/section/Section.js +1 -1
  43. package/components/section/Section.js.map +1 -1
  44. package/components/tag/Tag.d.ts +2 -2
  45. package/components/tag/Tag.js.map +1 -1
  46. package/components/tag/TagGroup.d.ts +1 -1
  47. package/components/tag/TagGroup.js.map +1 -1
  48. package/es/components/avatar/Avatar.d.ts +1 -1
  49. package/es/components/avatar/Avatar.js.map +1 -1
  50. package/es/components/avatar/AvatarGroup.d.ts +1 -1
  51. package/es/components/avatar/AvatarGroup.js.map +1 -1
  52. package/es/components/badge/Badge.d.ts +1 -1
  53. package/es/components/badge/Badge.js.map +1 -1
  54. package/es/components/lib.d.ts +2 -2
  55. package/es/components/section/Section.js +1 -1
  56. package/es/components/section/Section.js.map +1 -1
  57. package/es/components/tag/Tag.d.ts +2 -2
  58. package/es/components/tag/Tag.js.map +1 -1
  59. package/es/components/tag/TagGroup.d.ts +1 -1
  60. package/es/components/tag/TagGroup.js.map +1 -1
  61. package/es/extensions/forms/DataContext/Provider/Provider.d.ts +3 -0
  62. package/es/extensions/forms/DataContext/Provider/Provider.js +31 -28
  63. package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  64. package/es/extensions/forms/Form/Visibility/useVisibility.js +6 -6
  65. package/es/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  66. package/es/extensions/forms/Form/data-context/useData.js +14 -10
  67. package/es/extensions/forms/Form/data-context/useData.js.map +1 -1
  68. package/es/shared/Eufemia.d.ts +1 -1
  69. package/es/shared/Eufemia.js +2 -2
  70. package/es/shared/Eufemia.js.map +1 -1
  71. package/es/shared/error-helper.d.ts +0 -6
  72. package/es/shared/error-helper.js +6 -3
  73. package/es/shared/error-helper.js.map +1 -1
  74. package/es/style/core/scopes.scss +1 -1
  75. package/es/style/dnb-ui-basis.css +1 -1
  76. package/es/style/dnb-ui-basis.min.css +1 -1
  77. package/es/style/dnb-ui-body.css +1 -1
  78. package/es/style/dnb-ui-body.min.css +1 -1
  79. package/es/style/dnb-ui-core.css +1 -1
  80. package/es/style/dnb-ui-core.min.css +1 -1
  81. package/esm/dnb-ui-basis.min.mjs +1 -1
  82. package/esm/dnb-ui-components.min.mjs +1 -1
  83. package/esm/dnb-ui-elements.min.mjs +1 -1
  84. package/esm/dnb-ui-extensions.min.mjs +2 -2
  85. package/esm/dnb-ui-lib.min.mjs +1 -1
  86. package/extensions/forms/DataContext/Provider/Provider.d.ts +3 -0
  87. package/extensions/forms/DataContext/Provider/Provider.js +31 -28
  88. package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  89. package/extensions/forms/Form/Visibility/useVisibility.js +6 -6
  90. package/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  91. package/extensions/forms/Form/data-context/useData.js +14 -10
  92. package/extensions/forms/Form/data-context/useData.js.map +1 -1
  93. package/package.json +1 -1
  94. package/shared/Eufemia.d.ts +1 -1
  95. package/shared/Eufemia.js +2 -2
  96. package/shared/Eufemia.js.map +1 -1
  97. package/shared/error-helper.d.ts +0 -6
  98. package/shared/error-helper.js +6 -3
  99. package/shared/error-helper.js.map +1 -1
  100. package/style/core/scopes.scss +1 -1
  101. package/style/dnb-ui-basis.css +1 -1
  102. package/style/dnb-ui-basis.min.css +1 -1
  103. package/style/dnb-ui-body.css +1 -1
  104. package/style/dnb-ui-body.min.css +1 -1
  105. package/style/dnb-ui-core.css +1 -1
  106. package/style/dnb-ui-core.min.css +1 -1
  107. package/umd/dnb-ui-basis.min.js +1 -1
  108. package/umd/dnb-ui-components.min.js +1 -1
  109. package/umd/dnb-ui-elements.min.js +1 -1
  110. package/umd/dnb-ui-extensions.min.js +2 -2
  111. package/umd/dnb-ui-lib.min.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useData.js","names":["_react","require","_jsonPointer","_interopRequireDefault","_useSharedState","_useMountEffect","_Context","_structuredClone","obj","__esModule","default","useData","id","arguments","length","undefined","initialData","sharedDataRef","useRef","sharedAttachmentsRef","forceUpdate","useReducer","current","useSharedState","createReferenceKey","rerenderUseDataHook","dataContext","useContext","DataContext","hasContext","Error","data","filterDataHandler","updateDataValue","setData","set","useCallback","newData","update","path","value","existingData","structuredClone","existingValue","pointer","has","get","newValue","extend","remove","reduceToVisibleFields","_dataContext$visibleD","options","_sharedAttachmentsRef","_sharedAttachmentsRef2","visibleDataHandler","call","filterData","filter","_dataContext$filterDa","_sharedAttachmentsRef3","_sharedAttachmentsRef4","getValue","useMountEffect","hadInitialData","useMemo"],"sources":["../../../../../../src/extensions/forms/Form/data-context/useData.tsx"],"sourcesContent":["import {\n useCallback,\n useContext,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport pointer, { JsonObject } from '../../utils/json-pointer'\nimport {\n SharedStateId,\n createReferenceKey,\n useSharedState,\n} from '../../../../shared/helpers/useSharedState'\nimport useMountEffect from '../../../../shared/helpers/useMountEffect'\nimport type { Path } from '../../types'\nimport DataContext, {\n FilterData,\n VisibleDataHandler,\n} from '../../DataContext/Context'\nimport { SharedAttachments } from '../../DataContext/Provider'\n\n/**\n * Deprecated, as it is supported by all major browsers and Node.js >=v18\n * So it's a question of time, when we will remove this polyfill\n */\nimport structuredClone from '@ungap/structured-clone'\n\ntype PathImpl<T, P extends string> = P extends `${infer Key}/${infer Rest}`\n ? Key extends keyof T\n ? Rest extends ''\n ? T[Key]\n : PathImpl<T[Key], Rest>\n : never\n : T[P & keyof T]\n\nexport type PathType<T, P extends string> = P extends `/${infer Rest}`\n ? PathImpl<T, Rest>\n : never\n\nexport type UseDataReturnUpdate<Data> = <P extends Path>(\n path: P,\n value: ((value: PathType<Data, P>) => unknown) | unknown\n) => void\n\nexport type UseDataReturnGetValue<Data> = <P extends Path>(\n path: P\n) => PathType<Data, P> | any\n\nexport type UseDataReturnFilterData<Data> = (\n filterDataHandler: FilterData,\n data?: Data\n) => Partial<Data>\n\nexport type UseDataReturnVisibleData<Data> = VisibleDataHandler<Data>\n\ntype UseDataReturn<Data> = {\n data: Data\n set: (newData: Data) => void\n update: UseDataReturnUpdate<Data>\n remove: (path: Path) => void\n getValue: UseDataReturnGetValue<Data>\n filterData: UseDataReturnFilterData<Data>\n reduceToVisibleFields: UseDataReturnVisibleData<Data>\n}\n\n/**\n * Custom hook that provides form data management functionality.\n *\n * @template Data - The type of data being managed.\n * @param {SharedStateId} id - The identifier for the data.\n * @param {Data} initialData - The initial data value (optional).\n * @returns {UseDataReturn<Data>} An object containing the data and data management functions.\n */\nexport default function useData<Data = JsonObject>(\n id: SharedStateId = undefined,\n initialData: Data = undefined\n): UseDataReturn<Data> {\n const sharedDataRef =\n useRef<ReturnType<typeof useSharedState<Data>>>(null)\n const sharedAttachmentsRef =\n useRef<ReturnType<typeof useSharedState<SharedAttachments<Data>>>>(\n null\n )\n const [, forceUpdate] = useReducer(() => ({}), {})\n\n sharedDataRef.current = useSharedState<Data>(\n id,\n initialData,\n forceUpdate\n )\n\n sharedAttachmentsRef.current = useSharedState<SharedAttachments<Data>>(\n createReferenceKey(id, 'attachments'),\n { rerenderUseDataHook: forceUpdate }\n )\n\n // If no id is provided, use the context data\n const dataContext = useContext(DataContext)\n if (!id) {\n if (!dataContext.hasContext) {\n throw new Error(\n 'useData needs to run inside DataContext (Form.Handler) or have a valid id'\n )\n }\n\n sharedDataRef.current.data = dataContext.data\n sharedAttachmentsRef.current.data.filterDataHandler =\n dataContext.filterDataHandler\n }\n\n const updateDataValue = dataContext?.updateDataValue\n const setData = dataContext?.setData\n\n const set = useCallback(\n (newData: Data) => {\n if (id) {\n sharedDataRef.current.update(newData)\n } else {\n setData?.(newData)\n }\n },\n [id, setData]\n )\n\n const update = useCallback<UseDataReturnUpdate<Data>>(\n (path, value = undefined) => {\n const existingData = structuredClone(\n sharedDataRef.current.data || {}\n ) as Data & JsonObject\n const existingValue = pointer.has(existingData, path)\n ? pointer.get(existingData, path)\n : undefined\n\n // Get new value\n const newValue =\n typeof value === 'function' ? value(existingValue) : value\n\n if (newValue !== existingValue) {\n // Update existing data\n pointer.set(existingData, path, newValue)\n\n // Update provider with new data\n if (id) {\n sharedDataRef.current.extend(existingData)\n } else {\n updateDataValue(path, newValue)\n }\n }\n },\n [id, updateDataValue]\n )\n\n const remove = useCallback<UseDataReturn<Data>['remove']>(\n (path) => {\n const existingData = structuredClone(\n sharedDataRef.current.data || {}\n ) as Data & JsonObject\n\n if (pointer.has(existingData, path)) {\n // Remove existing data\n pointer.remove(existingData, path)\n\n // Update provider with new data\n if (id) {\n sharedDataRef.current.set(existingData)\n } else {\n updateDataValue(path, undefined)\n }\n }\n },\n [id, updateDataValue]\n )\n\n const reduceToVisibleFields = useCallback<\n UseDataReturn<Data>['reduceToVisibleFields']\n >(\n (data, options = {}) => {\n if (id) {\n return sharedAttachmentsRef.current.data?.visibleDataHandler?.(\n data,\n options\n )\n }\n\n return dataContext?.visibleDataHandler?.(data, options)\n },\n [dataContext, id]\n )\n\n const filterData = useCallback<UseDataReturn<Data>['filterData']>(\n (filter, data = sharedDataRef.current.data) => {\n if (id) {\n return sharedAttachmentsRef.current.data?.filterDataHandler?.(\n data,\n filter\n )\n }\n\n return dataContext?.filterDataHandler?.(data, filter)\n },\n [dataContext, id]\n )\n\n const getValue = useCallback<UseDataReturn<Data>['getValue']>((path) => {\n if (pointer.has(sharedDataRef.current.data, path)) {\n return pointer.get(sharedDataRef.current.data, path)\n }\n\n return undefined\n }, [])\n\n useMountEffect(() => {\n if (id && !sharedDataRef.current.hadInitialData && initialData) {\n sharedDataRef.current.extend(initialData)\n }\n })\n\n const { data } = sharedDataRef.current\n\n return useMemo(\n () => ({\n data,\n remove,\n update,\n set,\n getValue,\n reduceToVisibleFields,\n filterData,\n }),\n [\n data,\n remove,\n update,\n set,\n getValue,\n reduceToVisibleFields,\n filterData,\n ]\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AAUA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAqD,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAgDtC,SAASG,OAAOA,CAAA,EAGR;EAAA,IAFrBC,EAAiB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGE,SAAS;EAAA,IAC7BC,WAAiB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGE,SAAS;EAE7B,MAAME,aAAa,GACjB,IAAAC,aAAM,EAA0C,IAAI,CAAC;EACvD,MAAMC,oBAAoB,GACxB,IAAAD,aAAM,EACJ,IACF,CAAC;EACH,MAAM,GAAGE,WAAW,CAAC,GAAG,IAAAC,iBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAElDJ,aAAa,CAACK,OAAO,GAAG,IAAAC,8BAAc,EACpCX,EAAE,EACFI,WAAW,EACXI,WACF,CAAC;EAEDD,oBAAoB,CAACG,OAAO,GAAG,IAAAC,8BAAc,EAC3C,IAAAC,kCAAkB,EAACZ,EAAE,EAAE,aAAa,CAAC,EACrC;IAAEa,mBAAmB,EAAEL;EAAY,CACrC,CAAC;EAGD,MAAMM,WAAW,GAAG,IAAAC,iBAAU,EAACC,gB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,aAAa,CAACK,OAAO,CAACS,IAAI,EAAEQ,IAAI,CAAC;IACtD;IAEA,OAAOxB,SAAS;EAClB,CAAC,EAAE,EAAE,CAAC;EAEN,IAAAgD,uBAAc,EAAC,MAAM;IACnB,IAAInD,EAAE,IAAI,CAACK,aAAa,CAACK,OAAO,CAAC0C,cAAc,IAAIhD,WAAW,EAAE;MAC9DC,aAAa,CAACK,OAAO,CAAC0B,MAAM,CAAChC,WAAW,CAAC;IAC3C;EACF,CAAC,CAAC;EAEF,MAAM;IAAEe;EAAK,CAAC,GAAGd,aAAa,CAACK,OAAO;EAEtC,OAAO,IAAA2C,cAAO,EACZ,OAAO;IACLlC,IAAI;IACJkB,MAAM;IACNX,MAAM;IACNH,GAAG;IACH2B,QAAQ;IACRZ,qBAAqB;IACrBO;EACF,CAAC,CAAC,EACF,CACE1B,IAAI,EACJkB,MAAM,EACNX,MAAM,EACNH,GAAG,EACH2B,QAAQ,EACRZ,qBAAqB,EACrBO,UAAU,CAEd,CAAC;AACH"}
1
+ {"version":3,"file":"useData.js","names":["_react","require","_jsonPointer","_interopRequireDefault","_useSharedState","_useMountEffect","_Context","_structuredClone","obj","__esModule","default","useData","id","arguments","length","undefined","initialData","sharedDataRef","useRef","sharedAttachmentsRef","forceUpdate","useReducer","current","useSharedState","createReferenceKey","rerenderUseDataHook","dataContext","useContext","DataContext","hasContext","Error","data","filterDataHandler","updateDataValue","setData","getExistingData","useCallback","_sharedAttachmentsRef","_sharedAttachmentsRef2","_sharedAttachmentsRef3","structuredClone","internalDataRef","set","newData","update","path","value","existingData","existingValue","pointer","has","get","newValue","extend","remove","reduceToVisibleFields","_dataContext$visibleD","options","_sharedAttachmentsRef4","_sharedAttachmentsRef5","visibleDataHandler","call","filterData","filter","_dataContext$filterDa","_sharedAttachmentsRef6","_sharedAttachmentsRef7","getValue","useMountEffect","hadInitialData","useMemo"],"sources":["../../../../../../src/extensions/forms/Form/data-context/useData.tsx"],"sourcesContent":["import {\n useCallback,\n useContext,\n useMemo,\n useReducer,\n useRef,\n} from 'react'\nimport pointer, { JsonObject } from '../../utils/json-pointer'\nimport {\n SharedStateId,\n createReferenceKey,\n useSharedState,\n} from '../../../../shared/helpers/useSharedState'\nimport useMountEffect from '../../../../shared/helpers/useMountEffect'\nimport type { Path } from '../../types'\nimport DataContext, {\n FilterData,\n VisibleDataHandler,\n} from '../../DataContext/Context'\nimport { SharedAttachments } from '../../DataContext/Provider'\n\n/**\n * Deprecated, as it is supported by all major browsers and Node.js >=v18\n * So it's a question of time, when we will remove this polyfill\n */\nimport structuredClone from '@ungap/structured-clone'\n\ntype PathImpl<T, P extends string> = P extends `${infer Key}/${infer Rest}`\n ? Key extends keyof T\n ? Rest extends ''\n ? T[Key]\n : PathImpl<T[Key], Rest>\n : never\n : T[P & keyof T]\n\nexport type PathType<T, P extends string> = P extends `/${infer Rest}`\n ? PathImpl<T, Rest>\n : never\n\nexport type UseDataReturnUpdate<Data> = <P extends Path>(\n path: P,\n value: ((value: PathType<Data, P>) => unknown) | unknown\n) => void\n\nexport type UseDataReturnGetValue<Data> = <P extends Path>(\n path: P\n) => PathType<Data, P> | any\n\nexport type UseDataReturnFilterData<Data> = (\n filterDataHandler: FilterData,\n data?: Data\n) => Partial<Data>\n\nexport type UseDataReturnVisibleData<Data> = VisibleDataHandler<Data>\n\ntype UseDataReturn<Data> = {\n data: Data\n set: (newData: Data) => void\n update: UseDataReturnUpdate<Data>\n remove: (path: Path) => void\n getValue: UseDataReturnGetValue<Data>\n filterData: UseDataReturnFilterData<Data>\n reduceToVisibleFields: UseDataReturnVisibleData<Data>\n}\n\n/**\n * Custom hook that provides form data management functionality.\n *\n * @template Data - The type of data being managed.\n * @param {SharedStateId} id - The identifier for the data.\n * @param {Data} initialData - The initial data value (optional).\n * @returns {UseDataReturn<Data>} An object containing the data and data management functions.\n */\nexport default function useData<Data = JsonObject>(\n id: SharedStateId = undefined,\n initialData: Data = undefined\n): UseDataReturn<Data> {\n const sharedDataRef =\n useRef<ReturnType<typeof useSharedState<Data>>>(null)\n const sharedAttachmentsRef =\n useRef<ReturnType<typeof useSharedState<SharedAttachments<Data>>>>(\n null\n )\n const [, forceUpdate] = useReducer(() => ({}), {})\n\n sharedDataRef.current = useSharedState<Data>(\n id,\n initialData,\n forceUpdate\n )\n\n sharedAttachmentsRef.current = useSharedState<SharedAttachments<Data>>(\n createReferenceKey(id, 'attachments'),\n { rerenderUseDataHook: forceUpdate }\n )\n\n // If no id is provided, use the context data\n const dataContext = useContext(DataContext)\n if (!id) {\n if (!dataContext.hasContext) {\n throw new Error(\n 'useData needs to run inside DataContext (Form.Handler) or have a valid id'\n )\n }\n\n sharedDataRef.current.data = dataContext.data\n sharedAttachmentsRef.current.data.filterDataHandler =\n dataContext.filterDataHandler\n }\n\n const updateDataValue = dataContext?.updateDataValue\n const setData = dataContext?.setData\n\n const getExistingData = useCallback(() => {\n return structuredClone(\n sharedAttachmentsRef.current?.data?.internalDataRef?.current ||\n sharedDataRef.current.data ||\n {}\n ) as Data & JsonObject\n }, [])\n\n const set = useCallback(\n (newData: Data) => {\n if (id) {\n sharedDataRef.current.update(newData)\n } else {\n setData?.(newData)\n }\n },\n [id, setData]\n )\n\n const update = useCallback<UseDataReturnUpdate<Data>>(\n (path, value = undefined) => {\n const existingData = getExistingData()\n const existingValue = pointer.has(existingData, path)\n ? pointer.get(existingData, path)\n : undefined\n\n // Get new value\n const newValue =\n typeof value === 'function' ? value(existingValue) : value\n\n if (newValue !== existingValue) {\n // Update existing data\n pointer.set(existingData, path, newValue)\n\n // Update provider with new data\n if (id) {\n sharedDataRef.current.extend(existingData)\n } else {\n updateDataValue?.(path, newValue)\n }\n }\n },\n [getExistingData, id, updateDataValue]\n )\n\n const remove = useCallback<UseDataReturn<Data>['remove']>(\n (path) => {\n const existingData = getExistingData()\n\n if (pointer.has(existingData, path)) {\n // Remove existing data\n pointer.remove(existingData, path)\n\n // Update provider with new data\n if (id) {\n sharedDataRef.current.set(existingData)\n } else {\n setData?.(existingData)\n }\n }\n },\n [getExistingData, id, setData]\n )\n\n const reduceToVisibleFields = useCallback<\n UseDataReturn<Data>['reduceToVisibleFields']\n >(\n (data, options = {}) => {\n if (id) {\n return sharedAttachmentsRef.current.data?.visibleDataHandler?.(\n data,\n options\n )\n }\n\n return dataContext?.visibleDataHandler?.(data, options)\n },\n [dataContext, id]\n )\n\n const filterData = useCallback<UseDataReturn<Data>['filterData']>(\n (filter, data = sharedDataRef.current.data) => {\n if (id) {\n return sharedAttachmentsRef.current.data?.filterDataHandler?.(\n data,\n filter\n )\n }\n\n return dataContext?.filterDataHandler?.(data, filter)\n },\n [dataContext, id]\n )\n\n const getValue = useCallback<UseDataReturn<Data>['getValue']>((path) => {\n if (pointer.has(sharedDataRef.current.data, path)) {\n return pointer.get(sharedDataRef.current.data, path)\n }\n\n return undefined\n }, [])\n\n useMountEffect(() => {\n if (id && !sharedDataRef.current.hadInitialData && initialData) {\n sharedDataRef.current.extend(initialData)\n }\n })\n\n const { data } = sharedDataRef.current\n\n return useMemo(\n () => ({\n data,\n remove,\n update,\n set,\n getValue,\n reduceToVisibleFields,\n filterData,\n }),\n [\n data,\n remove,\n update,\n set,\n getValue,\n reduceToVisibleFields,\n filterData,\n ]\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AAUA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAqD,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAgDtC,SAASG,OAAOA,CAAA,EAGR;EAAA,IAFrBC,EAAiB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,S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OAAO,CAAC+C,cAAc,IAAIrD,WAAW,EAAE;MAC9DC,aAAa,CAACK,OAAO,CAAC+B,MAAM,CAACrC,WAAW,CAAC;IAC3C;EACF,CAAC,CAAC;EAEF,MAAM;IAAEe;EAAK,CAAC,GAAGd,aAAa,CAACK,OAAO;EAEtC,OAAO,IAAAgD,cAAO,EACZ,OAAO;IACLvC,IAAI;IACJuB,MAAM;IACNV,MAAM;IACNF,GAAG;IACHyB,QAAQ;IACRZ,qBAAqB;IACrBO;EACF,CAAC,CAAC,EACF,CACE/B,IAAI,EACJuB,MAAM,EACNV,MAAM,EACNF,GAAG,EACHyB,QAAQ,EACRZ,qBAAqB,EACrBO,UAAU,CAEd,CAAC;AACH"}
@@ -1,2 +1,2 @@
1
- export declare const version = "10.63.2";
1
+ export declare const version = "10.63.3";
2
2
  export declare function init(): void;
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.init = init;
7
7
  exports.version = void 0;
8
- const version = '10.63.2';
8
+ const version = '10.63.3';
9
9
  exports.version = version;
10
10
  function init() {
11
11
  if (typeof window !== 'undefined') {
12
12
  class Eufemia {
13
13
  get version() {
14
- return '10.63.2';
14
+ return '10.63.3';
15
15
  }
16
16
  }
17
17
  window.Eufemia = new Eufemia();
@@ -1 +1 @@
1
- {"version":3,"file":"Eufemia.js","names":["version","exports","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.ts"],"sourcesContent":["export const version = '10.63.2'\n\nexport function init() {\n if (typeof window !== 'undefined') {\n class Eufemia {\n get version() {\n return '10.63.2'\n }\n }\n\n window.Eufemia = new Eufemia()\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,SAAS;AAAAC,OAAA,CAAAD,OAAA,GAAAA,OAAA;AAEzB,SAASE,IAAIA,CAAA,EAAG;EACrB,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,OAAO,CAAC;MACZ,IAAIJ,OAAOA,CAAA,EAAG;QACZ,OAAO,SAAS;MAClB;IACF;IAEAG,MAAM,CAACC,OAAO,GAAG,IAAIA,OAAO,CAAC,CAAC;EAChC;AACF"}
1
+ {"version":3,"file":"Eufemia.js","names":["version","exports","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.ts"],"sourcesContent":["export const version = '10.63.3'\n\nexport function init() {\n if (typeof window !== 'undefined') {\n class Eufemia {\n get version() {\n return '10.63.3'\n }\n }\n\n window.Eufemia = new Eufemia()\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,SAAS;AAAAC,OAAA,CAAAD,OAAA,GAAAA,OAAA;AAEzB,SAASE,IAAIA,CAAA,EAAG;EACrB,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,OAAO,CAAC;MACZ,IAAIJ,OAAOA,CAAA,EAAG;QACZ,OAAO,SAAS;MAClB;IACF;IAEAG,MAAM,CAACC,OAAO,GAAG,IAAIA,OAAO,CAAC,CAAC;EAChC;AACF"}
@@ -1,12 +1,6 @@
1
1
  export function ErrorHandler(error: any, { message }?: {
2
2
  message: any;
3
3
  }, code?: number): void;
4
- export class ErrorHandler {
5
- constructor(error: any, { message }?: {
6
- message: any;
7
- }, code?: number);
8
- err: Error;
9
- }
10
4
  /**
11
5
  * Global Error helper functions
12
6
  *
@@ -16,14 +16,17 @@ function ErrorHandler(error) {
16
16
  message: null
17
17
  };
18
18
  let code = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ERROR_HARMLESS;
19
+ let thisError = this && this.err;
19
20
  if (typeof error === 'object') {
20
21
  message = error.message;
21
22
  }
22
- this.err = new Error(`${error}\n\n${message}`);
23
+ if (thisError) {
24
+ thisError = new Error(`${error}\n\n${message}`);
25
+ }
23
26
  if (code === ERROR_FATAL) {
24
- throw this.err;
27
+ throw thisError;
25
28
  } else {
26
- console.log(this.err);
29
+ console.log(thisError);
27
30
  }
28
31
  }
29
32
  //# sourceMappingURL=error-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-helper.js","names":["ERROR_HARMLESS","exports","ERROR_FATAL","ErrorHandler","error","message","arguments","length","undefined","code","err","Error","console","log"],"sources":["../../../src/shared/error-helper.js"],"sourcesContent":["/**\n * Global Error helper functions\n *\n */\n\nexport const ERROR_HARMLESS = 100\nexport const ERROR_FATAL = 500\n\nexport function ErrorHandler(\n error,\n { message } = { message: null },\n code = ERROR_HARMLESS\n) {\n if (typeof error === 'object') {\n message = error.message\n }\n this.err = new Error(`${error}\\n\\n${message}`)\n if (code === ERROR_FATAL) {\n throw this.err\n } else {\n console.log(this.err)\n }\n}\n"],"mappings":";;;;;;;AAKO,MAAMA,cAAc,GAAG,GAAG;AAAAC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAC1B,MAAME,WAAW,GAAG,GAAG;AAAAD,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEvB,SAASC,YAAYA,CAC1BC,KAAK,EAGL;EAAA,IAFA;IAAEC;EAAQ,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IAAED,OAAO,EAAE;EAAK,CAAC;EAAA,IAC/BI,IAAI,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGN,cAAc;EAErB,IAAI,OAAOI,KAAK,KAAK,QAAQ,EAAE;IAC7BC,OAAO,GAAGD,KAAK,CAACC,OAAO;EACzB;EACA,IAAI,CAACK,GAAG,GAAG,IAAIC,KAAK,CAAE,GAAEP,KAAM,OAAMC,OAAQ,EAAC,CAAC;EAC9C,IAAII,IAAI,KAAKP,WAAW,EAAE;IACxB,MAAM,IAAI,CAACQ,GAAG;EAChB,CAAC,MAAM;IACLE,OAAO,CAACC,GAAG,CAAC,IAAI,CAACH,GAAG,CAAC;EACvB;AACF"}
1
+ {"version":3,"file":"error-helper.js","names":["ERROR_HARMLESS","exports","ERROR_FATAL","ErrorHandler","error","message","arguments","length","undefined","code","thisError","err","Error","console","log"],"sources":["../../../src/shared/error-helper.js"],"sourcesContent":["/**\n * Global Error helper functions\n *\n */\n\nexport const ERROR_HARMLESS = 100\nexport const ERROR_FATAL = 500\n\nexport function ErrorHandler(\n error,\n { message } = { message: null },\n code = ERROR_HARMLESS\n) {\n let thisError = this && this.err\n if (typeof error === 'object') {\n message = error.message\n }\n if (thisError) {\n thisError = new Error(`${error}\\n\\n${message}`)\n }\n if (code === ERROR_FATAL) {\n throw thisError\n } else {\n console.log(thisError)\n }\n}\n"],"mappings":";;;;;;;AAKO,MAAMA,cAAc,GAAG,GAAG;AAAAC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAC1B,MAAME,WAAW,GAAG,GAAG;AAAAD,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAEvB,SAASC,YAAYA,CAC1BC,KAAK,EAGL;EAAA,IAFA;IAAEC;EAAQ,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;IAAED,OAAO,EAAE;EAAK,CAAC;EAAA,IAC/BI,IAAI,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGN,cAAc;EAErB,IAAIU,SAAS,GAAG,IAAI,IAAI,IAAI,CAACC,GAAG;EAChC,IAAI,OAAOP,KAAK,KAAK,QAAQ,EAAE;IAC7BC,OAAO,GAAGD,KAAK,CAACC,OAAO;EACzB;EACA,IAAIK,SAAS,EAAE;IACbA,SAAS,GAAG,IAAIE,KAAK,CAAE,GAAER,KAAM,OAAMC,OAAQ,EAAC,CAAC;EACjD;EACA,IAAII,IAAI,KAAKP,WAAW,EAAE;IACxB,MAAMQ,SAAS;EACjB,CAAC,MAAM;IACLG,OAAO,CAACC,GAAG,CAACJ,SAAS,CAAC;EACxB;AACF"}
@@ -45,7 +45,7 @@
45
45
  word-break: break-word;
46
46
 
47
47
  // Will add this to the body tag – later we can test for a version mismatch
48
- --eufemia-version: '10.63.2';
48
+ --eufemia-version: '10.63.3';
49
49
 
50
50
  @content;
51
51
  }
@@ -248,7 +248,7 @@ body {
248
248
  /* stylelint-disable-next-line */
249
249
  -webkit-text-size-adjust: 100%;
250
250
  word-break: break-word;
251
- --eufemia-version: "10.63.2";
251
+ --eufemia-version: "10.63.3";
252
252
  }
253
253
  .dnb-core-style *,
254
254
  .dnb-core-style ::before,
@@ -1 +1 @@
1
- @charset "UTF-8";html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}body{margin:0}.dnb-core-style{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.2";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr{height:0;overflow:visible}.dnb-core-style main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul{list-style:none}.dnb-core-style abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video{display:inline-block}.dnb-core-style audio:not([controls]){display:none;height:0}.dnb-core-style img{border-style:none}.dnb-core-style svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root){overflow:hidden}.dnb-core-style table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select{margin:0}.dnb-core-style button{overflow:visible;text-transform:none}.dnb-core-style input{overflow:visible;word-break:normal}.dnb-core-style legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress{display:inline-block;vertical-align:baseline}.dnb-core-style select{text-transform:none}.dnb-core-style textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio]{padding:0}.dnb-core-style input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details{display:block}.dnb-core-style summary{display:list-item}.dnb-core-style canvas{display:inline-block}.dnb-core-style template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea{touch-action:manipulation}.dnb-core-style [hidden]{display:none}.dnb-core-style [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:"‌"}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
1
+ @charset "UTF-8";html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}body{margin:0}.dnb-core-style{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.3";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr{height:0;overflow:visible}.dnb-core-style main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul{list-style:none}.dnb-core-style abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video{display:inline-block}.dnb-core-style audio:not([controls]){display:none;height:0}.dnb-core-style img{border-style:none}.dnb-core-style svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root){overflow:hidden}.dnb-core-style table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select{margin:0}.dnb-core-style button{overflow:visible;text-transform:none}.dnb-core-style input{overflow:visible;word-break:normal}.dnb-core-style legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress{display:inline-block;vertical-align:baseline}.dnb-core-style select{text-transform:none}.dnb-core-style textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio]{padding:0}.dnb-core-style input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details{display:block}.dnb-core-style summary{display:list-item}.dnb-core-style canvas{display:inline-block}.dnb-core-style template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea{touch-action:manipulation}.dnb-core-style [hidden]{display:none}.dnb-core-style [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:"‌"}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
@@ -274,7 +274,7 @@ body {
274
274
  /* stylelint-disable-next-line */
275
275
  -webkit-text-size-adjust: 100%;
276
276
  word-break: break-word;
277
- --eufemia-version: "10.63.2";
277
+ --eufemia-version: "10.63.3";
278
278
  }
279
279
  body *,
280
280
  body ::before,
@@ -1 +1 @@
1
- html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);-moz-tab-size:4;tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.2";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}body :after,body :before{text-decoration:inherit;vertical-align:inherit}body hr{height:0;overflow:visible}body main{display:block}body nav ol,body nav ul{list-style:none}body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}body b,body strong{font-weight:bolder}body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}body audio,body video{display:inline-block}body audio:not([controls]){display:none;height:0}body img{border-style:none}body svg:not([fill]){fill:currentcolor}body svg:not(:root){overflow:hidden}body table{border-collapse:collapse}body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}body button,body figure,body input,body select{margin:0}body button{overflow:visible;text-transform:none}body input{overflow:visible;word-break:normal}body legend{color:inherit;display:table;max-width:100%;white-space:normal}body progress{display:inline-block;vertical-align:baseline}body select{text-transform:none}body textarea{overflow:auto;resize:vertical}body [type=checkbox],body [type=radio]{padding:0}body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}body ::input-placeholder{color:inherit;opacity:.54}body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}body ::-moz-focus-inner{border-style:none;padding:0}body details{display:block}body summary{display:list-item}body canvas{display:inline-block}body template{display:none}body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}body [hidden]{display:none}body [aria-busy=true]{cursor:progress}body [aria-controls]:not(input){cursor:pointer}body [aria-disabled=true],body [disabled]{cursor:not-allowed}body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{body{background-color:#fff;color:#000}}body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}
1
+ html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);-moz-tab-size:4;tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.3";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}body :after,body :before{text-decoration:inherit;vertical-align:inherit}body hr{height:0;overflow:visible}body main{display:block}body nav ol,body nav ul{list-style:none}body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}body b,body strong{font-weight:bolder}body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}body audio,body video{display:inline-block}body audio:not([controls]){display:none;height:0}body img{border-style:none}body svg:not([fill]){fill:currentcolor}body svg:not(:root){overflow:hidden}body table{border-collapse:collapse}body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}body button,body figure,body input,body select{margin:0}body button{overflow:visible;text-transform:none}body input{overflow:visible;word-break:normal}body legend{color:inherit;display:table;max-width:100%;white-space:normal}body progress{display:inline-block;vertical-align:baseline}body select{text-transform:none}body textarea{overflow:auto;resize:vertical}body [type=checkbox],body [type=radio]{padding:0}body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}body ::input-placeholder{color:inherit;opacity:.54}body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}body ::-moz-focus-inner{border-style:none;padding:0}body details{display:block}body summary{display:list-item}body canvas{display:inline-block}body template{display:none}body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}body [hidden]{display:none}body [aria-busy=true]{cursor:progress}body [aria-controls]:not(input){cursor:pointer}body [aria-disabled=true],body [disabled]{cursor:not-allowed}body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{body{background-color:#fff;color:#000}}body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}
@@ -273,7 +273,7 @@ body,
273
273
  /* stylelint-disable-next-line */
274
274
  -webkit-text-size-adjust: 100%;
275
275
  word-break: break-word;
276
- --eufemia-version: "10.63.2";
276
+ --eufemia-version: "10.63.3";
277
277
  }
278
278
  body *,
279
279
  body ::before,
@@ -1 +1 @@
1
- @charset "UTF-8";html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);-moz-tab-size:4;tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}.dnb-core-style,body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.2";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before,body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before,body :after,body :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr,body hr{height:0;overflow:visible}.dnb-core-style main,body main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul,body nav ol,body nav ul{list-style:none}.dnb-core-style abbr[title],body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong,body b,body strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp,body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection,body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video,body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video,body audio,body video{display:inline-block}.dnb-core-style audio:not([controls]),body audio:not([controls]){display:none;height:0}.dnb-core-style img,body img{border-style:none}.dnb-core-style svg:not([fill]),body svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root),body svg:not(:root){overflow:hidden}.dnb-core-style table,body table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea,body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select,body button,body figure,body input,body select{margin:0}.dnb-core-style button,body button{overflow:visible;text-transform:none}.dnb-core-style input,body input{overflow:visible;word-break:normal}.dnb-core-style legend,body legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress,body progress{display:inline-block;vertical-align:baseline}.dnb-core-style select,body select{text-transform:none}.dnb-core-style textarea,body textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio],body [type=checkbox],body [type=radio]{padding:0}.dnb-core-style input[type=search],body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button,body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder,body ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration,body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button,body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner,body ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details,body details{display:block}.dnb-core-style summary,body summary{display:list-item}.dnb-core-style canvas,body canvas{display:inline-block}.dnb-core-style template,body template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea,body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}.dnb-core-style [hidden],body [hidden]{display:none}.dnb-core-style [aria-busy=true],body [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input),body [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled],body [aria-disabled=true],body [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus),body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style,body{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme,body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:"‌"}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
1
+ @charset "UTF-8";html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);-moz-tab-size:4;tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] a:hover{-webkit-text-decoration:none;text-decoration:none}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{max-width:60rem;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}.dnb-core-style,body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.63.3";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before,body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before,body :after,body :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr,body hr{height:0;overflow:visible}.dnb-core-style main,body main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul,body nav ol,body nav ul{list-style:none}.dnb-core-style abbr[title],body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong,body b,body strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp,body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection,body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video,body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video,body audio,body video{display:inline-block}.dnb-core-style audio:not([controls]),body audio:not([controls]){display:none;height:0}.dnb-core-style img,body img{border-style:none}.dnb-core-style svg:not([fill]),body svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root),body svg:not(:root){overflow:hidden}.dnb-core-style table,body table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea,body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select,body button,body figure,body input,body select{margin:0}.dnb-core-style button,body button{overflow:visible;text-transform:none}.dnb-core-style input,body input{overflow:visible;word-break:normal}.dnb-core-style legend,body legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress,body progress{display:inline-block;vertical-align:baseline}.dnb-core-style select,body select{text-transform:none}.dnb-core-style textarea,body textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio],body [type=checkbox],body [type=radio]{padding:0}.dnb-core-style input[type=search],body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button,body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder,body ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration,body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button,body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner,body ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details,body details{display:block}.dnb-core-style summary,body summary{display:list-item}.dnb-core-style canvas,body canvas{display:inline-block}.dnb-core-style template,body template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea,body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}.dnb-core-style [hidden],body [hidden]{display:none}.dnb-core-style [aria-busy=true],body [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input),body [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled],body [aria-disabled=true],body [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus),body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style,body{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme,body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:"‌"}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
@@ -6,7 +6,7 @@ import AvatarGroup from './AvatarGroup';
6
6
  export type AvatarSizes = 'small' | 'medium' | 'large' | 'x-large';
7
7
  export type AvatarVariants = 'primary' | 'secondary' | 'tertiary';
8
8
  export type AvatarImgProps = ImgProps;
9
- export interface AvatarProps {
9
+ export interface AvatarProps extends Omit<React.HTMLProps<HTMLElement>, 'size'> {
10
10
  /**
11
11
  * Used in combination with `src` to provide an alt attribute for the `img` element.
12
12
  * Default: null
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","names":["React","classnames","createSpacingClasses","createSkeletonClass","Img","Context","validateDOMAttributes","extendPropsWithContext","warn","AvatarGroup","AvatarGroupContext","defaultProps","size","variant","skeleton","Avatar","localProps","context","useContext","avatarGroupContext","allProps","alt","className","children","childrenProp","src","imgProps","hasLabel","props","_objectWithoutProperties","_excluded","skeletonClasses","spacingClasses","childrenIsString","imageProps","_objectSpread","createElement","firstLetterUpperCase","charAt","toUpperCase","_extends","Group","_supportsSpacingProps"],"sources":["../../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { createSkeletonClass } from '../skeleton/SkeletonHelper'\n\n// Elements\nimport Img, { ImgProps } from '../../elements/img/Img'\n\n// Shared\nimport Context from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\nimport {\n validateDOMAttributes,\n extendPropsWithContext,\n warn,\n} from '../../shared/component-helper'\n\n// Internal\nimport AvatarGroup, { AvatarGroupContext } from './AvatarGroup'\n\nexport type AvatarSizes = 'small' | 'medium' | 'large' | 'x-large'\nexport type AvatarVariants = 'primary' | 'secondary' | 'tertiary'\n\nexport type AvatarImgProps = ImgProps\n\nexport interface AvatarProps {\n /**\n * Used in combination with `src` to provide an alt attribute for the `img` element.\n * Default: null\n */\n alt?: string\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Skeleton should be applied when loading content\n * Default: null\n */\n skeleton?: SkeletonShow\n\n /**\n * The content of the component. Can be used instead of prop \"data\".\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the component.\n * Default: medium.\n */\n size?: AvatarSizes\n\n /**\n * Specifies the path to the image\n * Default: null\n */\n src?: string\n\n /**\n * Props applied to the `img` element if the component is used to display an image.\n * Default: null\n */\n imgProps?: ImgProps\n\n /**\n * The variant of the component.\n * Default: primary.\n */\n variant?: AvatarVariants\n\n /**\n * If an avatar is hidden from the screen reader (by setting aria-hidden={true}) or if label is given, typical inside a table or dl (definition list), then you can disable Avatar.Group as a dependent of Avatar.\n * Use `true` to omit the `Avatar group required:` warning.\n * Default: null\n */\n hasLabel?: boolean\n}\n\nexport const defaultProps = {\n size: 'medium',\n variant: 'primary',\n skeleton: false,\n}\n\nconst Avatar = (localProps: AvatarProps & SpacingProps) => {\n // Every component should have a context\n const context = React.useContext(Context)\n const avatarGroupContext = React.useContext(AvatarGroupContext)\n\n // Extract additional props from global context\n const allProps = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.Avatar,\n { skeleton: context?.skeleton },\n avatarGroupContext\n )\n\n const {\n alt,\n className,\n children: childrenProp,\n size,\n skeleton,\n variant,\n src,\n imgProps,\n hasLabel,\n ...props\n } = allProps\n\n let children = null\n\n const skeletonClasses = createSkeletonClass('shape', skeleton, context)\n const spacingClasses = createSpacingClasses(props)\n\n const childrenIsString = typeof childrenProp === 'string'\n\n if (src || imgProps) {\n const imageProps = { src, alt, ...imgProps }\n children = <Img {...imageProps} />\n } else if (childrenIsString) {\n const firstLetterUpperCase = childrenProp.charAt(0).toUpperCase()\n children = <span aria-hidden>{firstLetterUpperCase}</span>\n } else {\n children = childrenProp\n }\n\n if (!avatarGroupContext && !hasLabel) {\n warn(\n `Avatar group required: An Avatar requires an Avatar.Group with label description as a parent component. This is to ensure correct semantic and accessibility.`\n )\n }\n\n validateDOMAttributes(allProps, props)\n\n return (\n <span\n className={classnames(\n 'dnb-avatar',\n `dnb-avatar--${variant || 'primary'}`,\n `dnb-avatar--size-${size || 'medium'}`,\n skeletonClasses,\n spacingClasses,\n className\n )}\n {...props}\n >\n {childrenIsString && (\n <span className=\"dnb-sr-only\">{childrenProp}</span>\n )}\n {children}\n </span>\n )\n}\n\nAvatar.Group = AvatarGroup\n\nexport { AvatarGroup }\n\nAvatar._supportsSpacingProps = true\n\nexport default Avatar\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wB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AAU,GAAAC,aAAA;MAAKV,GAAG;MAAEJ;IAAG,GAAKK,QAAQ,CAAE;IAC5CH,QAAQ,GAAGvB,KAAA,CAAAoC,aAAA,CAAChC,GAAG,EAAK8B,UAAa,CAAC;EACpC,CAAC,MAAM,IAAID,gBAAgB,EAAE;IAC3B,MAAMI,oBAAoB,GAAGb,YAAY,CAACc,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;IACjEhB,QAAQ,GAAGvB,KAAA,CAAAoC,aAAA;MAAM;IAAW,GAAEC,oBAA2B,CAAC;EAC5D,CAAC,MAAM;IACLd,QAAQ,GAAGC,YAAY;EACzB;EAEA,IAAI,CAACL,kBAAkB,IAAI,CAACQ,QAAQ,EAAE;IACpCnB,IAAI,CACD,+JACH,CAAC;EACH;EAEAF,qBAAqB,CAACc,QAAQ,EAAEQ,KAAK,CAAC;EAEtC,OACE5B,KAAA,CAAAoC,aAAA,SAAAI,QAAA;IACElB,SAAS,EAAErB,UAAU,2BAEJY,OAAO,IAAI,SAAS,qBACfD,IAAI,IAAI,QAAS,IACrCmB,eAAe,EACfC,cAAc,EACdV,SACF;EAAE,GACEM,KAAK,GAERK,gBAAgB,IACfjC,KAAA,CAAAoC,aAAA;IAAMd,SAAS,EAAC;EAAa,GAAEE,YAAmB,CACnD,EACAD,QACG,CAAC;AAEX,CAAC;AAEDR,MAAM,CAAC0B,KAAK,GAAGhC,WAAW;AAE1B,SAASA,WAAW;AAEpBM,MAAM,CAAC2B,qBAAqB,GAAG,IAAI;AAEnC,eAAe3B,MAAM"}
1
+ {"version":3,"file":"Avatar.js","names":["React","classnames","createSpacingClasses","createSkeletonClass","Img","Context","validateDOMAttributes","extendPropsWithContext","warn","AvatarGroup","AvatarGroupContext","defaultProps","size","variant","skeleton","Avatar","localProps","context","useContext","avatarGroupContext","allProps","alt","className","children","childrenProp","src","imgProps","hasLabel","props","_objectWithoutProperties","_excluded","skeletonClasses","spacingClasses","childrenIsString","imageProps","_objectSpread","createElement","firstLetterUpperCase","charAt","toUpperCase","_extends","Group","_supportsSpacingProps"],"sources":["../../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { createSkeletonClass } from '../skeleton/SkeletonHelper'\n\n// Elements\nimport Img, { ImgProps } from '../../elements/img/Img'\n\n// Shared\nimport Context from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\nimport {\n validateDOMAttributes,\n extendPropsWithContext,\n warn,\n} from '../../shared/component-helper'\n\n// Internal\nimport AvatarGroup, { AvatarGroupContext } from './AvatarGroup'\n\nexport type AvatarSizes = 'small' | 'medium' | 'large' | 'x-large'\nexport type AvatarVariants = 'primary' | 'secondary' | 'tertiary'\n\nexport type AvatarImgProps = ImgProps\n\nexport interface AvatarProps\n extends Omit<React.HTMLProps<HTMLElement>, 'size'> {\n /**\n * Used in combination with `src` to provide an alt attribute for the `img` element.\n * Default: null\n */\n alt?: string\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Skeleton should be applied when loading content\n * Default: null\n */\n skeleton?: SkeletonShow\n\n /**\n * The content of the component. Can be used instead of prop \"data\".\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the component.\n * Default: medium.\n */\n size?: AvatarSizes\n\n /**\n * Specifies the path to the image\n * Default: null\n */\n src?: string\n\n /**\n * Props applied to the `img` element if the component is used to display an image.\n * Default: null\n */\n imgProps?: ImgProps\n\n /**\n * The variant of the component.\n * Default: primary.\n */\n variant?: AvatarVariants\n\n /**\n * If an avatar is hidden from the screen reader (by setting aria-hidden={true}) or if label is given, typical inside a table or dl (definition list), then you can disable Avatar.Group as a dependent of Avatar.\n * Use `true` to omit the `Avatar group required:` warning.\n * Default: null\n */\n hasLabel?: boolean\n}\n\nexport const defaultProps = {\n size: 'medium',\n variant: 'primary',\n skeleton: false,\n}\n\nconst Avatar = (localProps: AvatarProps & SpacingProps) => {\n // Every component should have a context\n const context = React.useContext(Context)\n const avatarGroupContext = React.useContext(AvatarGroupContext)\n\n // Extract additional props from global context\n const allProps = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.Avatar,\n { skeleton: context?.skeleton },\n avatarGroupContext\n )\n\n const {\n alt,\n className,\n children: childrenProp,\n size,\n skeleton,\n variant,\n src,\n imgProps,\n hasLabel,\n ...props\n } = allProps\n\n let children = null\n\n const skeletonClasses = createSkeletonClass('shape', skeleton, context)\n const spacingClasses = createSpacingClasses(props)\n\n const childrenIsString = typeof childrenProp === 'string'\n\n if (src || imgProps) {\n const imageProps = { src, alt, ...imgProps }\n children = <Img {...imageProps} />\n } else if (childrenIsString) {\n const firstLetterUpperCase = childrenProp.charAt(0).toUpperCase()\n children = <span aria-hidden>{firstLetterUpperCase}</span>\n } else {\n children = childrenProp\n }\n\n if (!avatarGroupContext && !hasLabel) {\n warn(\n `Avatar group required: An Avatar requires an Avatar.Group with label description as a parent component. This is to ensure correct semantic and accessibility.`\n )\n }\n\n validateDOMAttributes(allProps, props)\n\n return (\n <span\n className={classnames(\n 'dnb-avatar',\n `dnb-avatar--${variant || 'primary'}`,\n `dnb-avatar--size-${size || 'medium'}`,\n skeletonClasses,\n spacingClasses,\n className\n )}\n {...props}\n >\n {childrenIsString && (\n <span className=\"dnb-sr-only\">{childrenProp}</span>\n )}\n {children}\n </span>\n )\n}\n\nAvatar.Group = AvatarGroup\n\nexport { AvatarGroup }\n\nAvatar._supportsSpacingProps = true\n\nexport default Avatar\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAA4B;AAGhE,OAAOC,GAAG,MAAoB,wBAAwB;AAGtD,OAAOC,OAAO,MAAM,sBAAsB;AAG1C,SACEC,qBAAqB,EACrBC,sBAA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C,CAAC,MAAM,IAAID,gBAAgB,EAAE;IAC3B,MAAMI,oBAAoB,GAAGb,YAAY,CAACc,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;IACjEhB,QAAQ,GAAGvB,KAAA,CAAAoC,aAAA;MAAM;IAAW,GAAEC,oBAA2B,CAAC;EAC5D,CAAC,MAAM;IACLd,QAAQ,GAAGC,YAAY;EACzB;EAEA,IAAI,CAACL,kBAAkB,IAAI,CAACQ,QAAQ,EAAE;IACpCnB,IAAI,CACD,+JACH,CAAC;EACH;EAEAF,qBAAqB,CAACc,QAAQ,EAAEQ,KAAK,CAAC;EAEtC,OACE5B,KAAA,CAAAoC,aAAA,SAAAI,QAAA;IACElB,SAAS,EAAErB,UAAU,2BAEJY,OAAO,IAAI,SAAS,qBACfD,IAAI,IAAI,QAAS,IACrCmB,eAAe,EACfC,cAAc,EACdV,SACF;EAAE,GACEM,KAAK,GAERK,gBAAgB,IACfjC,KAAA,CAAAoC,aAAA;IAAMd,SAAS,EAAC;EAAa,GAAEE,YAAmB,CACnD,EACAD,QACG,CAAC;AAEX,CAAC;AAEDR,MAAM,CAAC0B,KAAK,GAAGhC,WAAW;AAE1B,SAASA,WAAW;AAEpBM,MAAM,CAAC2B,qBAAqB,GAAG,IAAI;AAEnC,eAAe3B,MAAM"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { AvatarSizes, AvatarVariants } from './Avatar';
3
3
  import type { SpacingProps } from '../../shared/types';
4
4
  import type { SkeletonShow } from '../skeleton/Skeleton';
5
- export interface AvatarGroupProps {
5
+ export interface AvatarGroupProps extends Omit<React.HTMLProps<HTMLElement>, 'size' | 'label'> {
6
6
  /**
7
7
  * Label to describe the avatar group
8
8
  * Default: null
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarGroup.js","names":["React","classnames","createSpacingClasses","validateDOMAttributes","extendPropsWithContext","Context","defaultProps","label","className","maxElements","size","children","variant","skeleton","AvatarGroupContext","createContext","AvatarGroup","localProps","context","useContext","_extendPropsWithConte","childrenProp","maxElementsProp","props","_objectWithoutProperties","_excluded","numOfHiddenAvatars","Array","isArray","total","length","slice","map","child","i","appliedSize","appliedVariant","cloneElement","style","_objectSpread","zIndex","key","spacingClasses","_validateDOMAttribute","attributes","_excluded2","createElement","Provider","value","_extends","ElementsHidden","_supportsSpacingProps"],"sources":["../../../../src/components/avatar/AvatarGroup.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { AvatarSizes, AvatarVariants } from './Avatar'\n\n// Shared\nimport {\n validateDOMAttributes,\n extendPropsWithContext,\n} from '../../shared/component-helper'\nimport Context from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\n\nexport interface AvatarGroupProps {\n /**\n * Label to describe the avatar group\n * Default: null\n */\n label: React.ReactNode\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Number of max displayed elements, including the \"elements hidden text (+x)\".\n * Default: 4\n */\n maxElements?: number\n\n /**\n * The avatars to group.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the Avatars, and \"elements hidden text (+x)\".\n * Default: medium.\n */\n size?: AvatarSizes\n\n /**\n * The variant of the Avatars.\n * Default: primary.\n */\n variant?: AvatarVariants\n\n /**\n * Skeleton should be applied when loading content\n * Default: false\n */\n skeleton?: SkeletonShow\n}\n\nexport const defaultProps = {\n label: null,\n className: null,\n maxElements: 4,\n size: 'medium',\n children: null,\n variant: 'primary',\n skeleton: false,\n}\n\nexport const AvatarGroupContext = React.createContext(null)\n\nconst AvatarGroup = (localProps: AvatarGroupProps & SpacingProps) => {\n // Every component should have a context\n const context = React.useContext(Context)\n // Extract additional props from global context\n const {\n label,\n className,\n children: childrenProp,\n size,\n maxElements: maxElementsProp,\n variant,\n ...props\n } = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.AvatarGroup,\n {\n skeleton: context?.skeleton,\n }\n )\n\n const maxElements =\n maxElementsProp && maxElementsProp > 0 ? maxElementsProp : 4\n\n let children = childrenProp\n let numOfHiddenAvatars = 0\n\n if (Array.isArray(childrenProp)) {\n const total = childrenProp.length\n\n if (total > maxElements) {\n numOfHiddenAvatars = total - maxElements + 1\n }\n\n children = childrenProp\n .slice(0, total - numOfHiddenAvatars)\n .map((child, i) => {\n const appliedSize = child.props.size ? child.props.size : size\n const appliedVariant = child.props.variant\n ? child.props.variant\n : variant\n return React.cloneElement(child, {\n size: appliedSize,\n variant: appliedVariant,\n style: { ...child.props.style, zIndex: total - i },\n key: i,\n })\n })\n }\n\n const spacingClasses = createSpacingClasses(props)\n const {\n skeleton, // eslint-disable-line\n ...attributes\n } = validateDOMAttributes({}, props)\n\n return (\n <AvatarGroupContext.Provider value={props}>\n <span\n className={classnames(\n 'dnb-avatar__group',\n spacingClasses,\n className\n )}\n {...attributes}\n >\n <span className=\"dnb-sr-only\">{label}</span>\n\n {children}\n\n {numOfHiddenAvatars ? (\n <ElementsHidden size={size}>\n +{numOfHiddenAvatars}\n </ElementsHidden>\n ) : null}\n </span>\n </AvatarGroupContext.Provider>\n )\n}\n\nexport interface ElementsHiddenProps {\n /**\n * The avatars to group.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the \"elements hidden text (+x)\".\n * Default: medium.\n */\n size?: AvatarSizes\n}\n\nfunction ElementsHidden(props: ElementsHiddenProps) {\n const { size, children } = props\n return (\n <span\n className={classnames(\n 'dnb-avatar__group--elements-left',\n `dnb-avatar__group--elements-left--size-${size || 'medium'}`\n )}\n >\n {children}\n </span>\n )\n}\n\nAvatarGroup._supportsSpacingProps = true\n\nexport default AvatarGroup\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAI7D,SACEC,qBAAqB,EACrBC,sBAAsB,QACjB,+BAA+B;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Y,CAAC,GACf,IACA,CACqB,CAAC;AAElC,CAAC;AAgBD,SAASwB,cAAcA,CAAC3B,KAA0B,EAAE;EAClD,MAAM;IAAEb,IAAI;IAAEC;EAAS,CAAC,GAAGY,KAAK;EAChC,OACEvB,KAAA,CAAA8C,aAAA;IACEtC,SAAS,6EAEmCE,IAAI,IAAI,QAAS;EAC3D,GAEDC,QACG,CAAC;AAEX;AAEAK,WAAW,CAACmC,qBAAqB,GAAG,IAAI;AAExC,eAAenC,WAAW"}
1
+ {"version":3,"file":"AvatarGroup.js","names":["React","classnames","createSpacingClasses","validateDOMAttributes","extendPropsWithContext","Context","defaultProps","label","className","maxElements","size","children","variant","skeleton","AvatarGroupContext","createContext","AvatarGroup","localProps","context","useContext","_extendPropsWithConte","childrenProp","maxElementsProp","props","_objectWithoutProperties","_excluded","numOfHiddenAvatars","Array","isArray","total","length","slice","map","child","i","appliedSize","appliedVariant","cloneElement","style","_objectSpread","zIndex","key","spacingClasses","_validateDOMAttribute","attributes","_excluded2","createElement","Provider","value","_extends","ElementsHidden","_supportsSpacingProps"],"sources":["../../../../src/components/avatar/AvatarGroup.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { AvatarSizes, AvatarVariants } from './Avatar'\n\n// Shared\nimport {\n validateDOMAttributes,\n extendPropsWithContext,\n} from '../../shared/component-helper'\nimport Context from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\n\nexport interface AvatarGroupProps\n extends Omit<React.HTMLProps<HTMLElement>, 'size' | 'label'> {\n /**\n * Label to describe the avatar group\n * Default: null\n */\n label: React.ReactNode\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Number of max displayed elements, including the \"elements hidden text (+x)\".\n * Default: 4\n */\n maxElements?: number\n\n /**\n * The avatars to group.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the Avatars, and \"elements hidden text (+x)\".\n * Default: medium.\n */\n size?: AvatarSizes\n\n /**\n * The variant of the Avatars.\n * Default: primary.\n */\n variant?: AvatarVariants\n\n /**\n * Skeleton should be applied when loading content\n * Default: false\n */\n skeleton?: SkeletonShow\n}\n\nexport const defaultProps = {\n label: null,\n className: null,\n maxElements: 4,\n size: 'medium',\n children: null,\n variant: 'primary',\n skeleton: false,\n}\n\nexport const AvatarGroupContext = React.createContext(null)\n\nconst AvatarGroup = (localProps: AvatarGroupProps & SpacingProps) => {\n // Every component should have a context\n const context = React.useContext(Context)\n // Extract additional props from global context\n const {\n label,\n className,\n children: childrenProp,\n size,\n maxElements: maxElementsProp,\n variant,\n ...props\n } = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.AvatarGroup,\n {\n skeleton: context?.skeleton,\n }\n )\n\n const maxElements =\n maxElementsProp && maxElementsProp > 0 ? maxElementsProp : 4\n\n let children = childrenProp\n let numOfHiddenAvatars = 0\n\n if (Array.isArray(childrenProp)) {\n const total = childrenProp.length\n\n if (total > maxElements) {\n numOfHiddenAvatars = total - maxElements + 1\n }\n\n children = childrenProp\n .slice(0, total - numOfHiddenAvatars)\n .map((child, i) => {\n const appliedSize = child.props.size ? child.props.size : size\n const appliedVariant = child.props.variant\n ? child.props.variant\n : variant\n return React.cloneElement(child, {\n size: appliedSize,\n variant: appliedVariant,\n style: { ...child.props.style, zIndex: total - i },\n key: i,\n })\n })\n }\n\n const spacingClasses = createSpacingClasses(props)\n const {\n skeleton, // eslint-disable-line\n ...attributes\n } = validateDOMAttributes({}, props)\n\n return (\n <AvatarGroupContext.Provider value={props}>\n <span\n className={classnames(\n 'dnb-avatar__group',\n spacingClasses,\n className\n )}\n {...attributes}\n >\n <span className=\"dnb-sr-only\">{label}</span>\n\n {children}\n\n {numOfHiddenAvatars ? (\n <ElementsHidden size={size}>\n +{numOfHiddenAvatars}\n </ElementsHidden>\n ) : null}\n </span>\n </AvatarGroupContext.Provider>\n )\n}\n\nexport interface ElementsHiddenProps {\n /**\n * The avatars to group.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The size of the \"elements hidden text (+x)\".\n * Default: medium.\n */\n size?: AvatarSizes\n}\n\nfunction ElementsHidden(props: ElementsHiddenProps) {\n const { size, children } = props\n return (\n <span\n className={classnames(\n 'dnb-avatar__group--elements-left',\n `dnb-avatar__group--elements-left--size-${size || 'medium'}`\n )}\n >\n {children}\n </span>\n )\n}\n\nAvatarGroup._supportsSpacingProps = true\n\nexport default AvatarGroup\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAI7D,SACEC,qBAAqB,EACrBC,sBAAsB,QACjB,+BAA+B;AACtC,OAAOC,OAAO,MAAM,sBAAsB;AAiD1C,OAAO,MAAMC,YAAY,GAAG;EAC1BC,KAAK,EAAE,IAAI;EACXC,SAAS,EAAE,IAAI;EACfC,WAAW,EAAE,CAAC;EACdC,IAAI,EAAE,QAAQ;EACdC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGd,KAAK,CAACe,aAAa,CAAC,IAAI,CAAC;AAE3D,MAAMC,WAAW,GAAIC,UAA2C,IAAK;EAEnE,MAAMC,OAAO,GAAGlB,KAAK,CAACmB,UAAU,CAACd,OAAO,CAAC;EAEzC,MAAAe,qBAAA,GAQIhB,sBAAsB,CACxBa,UAAU,EACVX,YAAY,EACZY,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEF,WAAW,EACpB;MACEH,QAAQ,EAAEK,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEL;IACrB,CACF,CAAC;IAfK;MACJN,KAAK;MACLC,SAAS;MACTG,QAAQ,EAAEU,YAAY;MACtBX,IAAI;MACJD,WAAW,EAAEa,eAAe;MAC5BV;IAEF,C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IAEF,CAAC,GAAA8B,qBAAA;IADIC,UAAU,GAAApB,wBAAA,CAAAmB,qBAAA,EAAAE,UAAA;EAGf,OACE7C,KAAA,CAAA8C,aAAA,CAAChC,kBAAkB,CAACiC,QAAQ;IAACC,KAAK,EAAEzB;EAAM,GACxCvB,KAAA,CAAA8C,aAAA,SAAAG,QAAA;IACEzC,SAAS,EAAEP,UAAU,CACnB,mBAAmB,EACnByC,cAAc,EACdlC,SACF;EAAE,GACEoC,UAAU,GAEd5C,KAAA,CAAA8C,aAAA;IAAMtC,SAAS,EAAC;EAAa,GAAED,KAAY,CAAC,EAE3CI,QAAQ,EAERe,kBAAkB,GACjB1B,KAAA,CAAA8C,aAAA,CAACI,cAAc;IAACxC,IAAI,EAAEA;EAAK,GAAC,GACzB,EAACgB,kBACY,CAAC,GACf,IACA,CACqB,CAAC;AAElC,CAAC;AAgBD,SAASwB,cAAcA,CAAC3B,KAA0B,EAAE;EAClD,MAAM;IAAEb,IAAI;IAAEC;EAAS,CAAC,GAAGY,KAAK;EAChC,OACEvB,KAAA,CAAA8C,aAAA;IACEtC,SAAS,6EAEmCE,IAAI,IAAI,QAAS;EAC3D,GAEDC,QACG,CAAC;AAEX;AAEAK,WAAW,CAACmC,qBAAqB,GAAG,IAAI;AAExC,eAAenC,WAAW"}
@@ -43,7 +43,7 @@ export type BadgeProps = {
43
43
  */
44
44
  variant?: 'information' | 'notification';
45
45
  };
46
- type BadgeAndSpacingProps = BadgeProps & SpacingProps;
46
+ type BadgeAndSpacingProps = BadgeProps & SpacingProps & Omit<React.HTMLProps<HTMLElement>, 'content' | 'label'>;
47
47
  export declare const defaultProps: {
48
48
  label: any;
49
49
  className: any;
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","names":["React","classnames","createSpacingClasses","createSkeletonClass","Context","warn","extendPropsWithContext","validateDOMAttributes","defaultProps","label","className","skeleton","children","content","vertical","horizontal","variant","Badge","localProps","context","useContext","allProps","createElement","BadgeRoot","BadgeElem","_extends","_ref","props","contentProp","restProps","_objectWithoutProperties","_excluded","skeletonClasses","spacingClasses","contentIsNum","variantIsNotification","isInline","role","_supportsSpacingProps"],"sources":["../../../../src/components/badge/Badge.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { createSkeletonClass } from '../skeleton/SkeletonHelper'\n\n// Shared\nimport Context, { ContextProps } from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\nimport {\n warn,\n extendPropsWithContext,\n validateDOMAttributes,\n} from '../../shared/component-helper'\n\nexport type BadgeProps = {\n /**\n * Aria label to describe the badge\n * Default: null\n */\n label?: React.ReactNode\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Skeleton should be applied when loading content\n * Default: null\n */\n skeleton?: SkeletonShow\n\n /**\n * The content to display the badge on top of.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The content of the component.\n * Default: null\n */\n content?: string | number | React.ReactNode\n\n /**\n * The vertical positioning of the component.\n * Default: null\n */\n vertical?: 'bottom' | 'top'\n\n /**\n * The horizontal positioning of the component.\n * Default: null\n */\n horizontal?: 'left' | 'right'\n\n /**\n * The variant of the component.\n * Default: information.\n */\n variant?: 'information' | 'notification'\n}\n\ntype BadgeAndSpacingProps = BadgeProps & SpacingProps\n\nexport const defaultProps = {\n label: null,\n className: null,\n skeleton: false,\n children: null,\n content: null,\n vertical: null,\n horizontal: null,\n variant: 'information',\n}\n\nfunction Badge(localProps: BadgeAndSpacingProps) {\n // Every component should have a context\n const context = React.useContext(Context)\n\n // Extract additional props from global context\n const allProps = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.Badge,\n { skeleton: context?.skeleton }\n )\n const { children } = allProps\n\n if (children) {\n return (\n <BadgeRoot>\n {children}\n <BadgeElem context={context} {...allProps} />\n </BadgeRoot>\n )\n }\n\n return <BadgeElem context={context} {...allProps} />\n}\n\nfunction BadgeRoot({ children }: { children: React.ReactNode }) {\n return <span className=\"dnb-badge__root\">{children}</span>\n}\n\nfunction BadgeElem(\n props: BadgeAndSpacingProps & { context: ContextProps }\n) {\n const {\n label,\n className,\n children,\n skeleton,\n horizontal,\n vertical,\n content: contentProp,\n variant,\n context,\n ...restProps\n } = props\n\n // to remove spacing props, etc.\n validateDOMAttributes(props, restProps)\n\n const skeletonClasses = createSkeletonClass('shape', skeleton, context)\n const spacingClasses = createSpacingClasses(props)\n const contentIsNum = typeof contentProp === 'number'\n const variantIsNotification = variant === 'notification'\n\n const content =\n variantIsNotification && contentIsNum && contentProp > 9\n ? '9+'\n : contentProp\n\n if (variantIsNotification && !contentIsNum) {\n warn(\n `Type of content should be a number: A notification badge is best suited to display content of type number.`\n )\n }\n if (!label && contentIsNum) {\n warn(\n `Label required: A Badge with a number as content requires a label describing the content of the badge. This is to ensure correct semantic and accessibility.`\n )\n }\n\n const isInline = !children && content\n\n return (\n <span\n role=\"status\"\n className={classnames(\n 'dnb-badge',\n `dnb-badge--variant-${variant}`,\n horizontal && `dnb-badge--horizontal-${horizontal}`,\n vertical && `dnb-badge--vertical-${vertical}`,\n isInline && 'dnb-badge--inline',\n skeletonClasses,\n spacingClasses,\n className\n )}\n {...restProps}\n >\n {label && <span className=\"dnb-sr-only\">{label} </span>}\n {content}\n </span>\n )\n}\n\nBadge._supportsSpacingProps = true\n\nexport default Badge\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAA4B;AAGhE,OAAOC,OAAO,MAAwB,sBAAsB;AAG5D,SACEC,IAAI,EACJC,sBAAsB,EACtBC,qBAAqB,QAChB,+BAA+B;AAsDtC,OAAO,MAAMC,YAAY,GAAG;EAC1BC,KAAK,EAAE,IAAI;EACXC,SAAS,EAAE,IAAI;EACfC,QAAQ,EAA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,SAAA;EAGTxB,qBAAqB,CAACoB,KAAK,EAAEE,SAAS,CAAC;EAEvC,MAAMG,eAAe,GAAG7B,mBAAmB,CAAC,OAAO,EAAEQ,QAAQ,EAAEQ,OAAO,CAAC;EACvE,MAAMc,cAAc,GAAG/B,oBAAoB,CAACyB,KAAK,CAAC;EAClD,MAAMO,YAAY,GAAG,OAAON,WAAW,KAAK,QAAQ;EACpD,MAAMO,qBAAqB,GAAGnB,OAAO,KAAK,cAAc;EAExD,MAAMH,OAAO,GACXsB,qBAAqB,IAAID,YAAY,IAAIN,WAAW,GAAG,CAAC,GACpD,IAAI,GACJA,WAAW;EAEjB,IAAIO,qBAAqB,IAAI,CAACD,YAAY,EAAE;IAC1C7B,IAAI,CACD,4GACH,CAAC;EACH;EACA,IAAI,CAACI,KAAK,IAAIyB,YAAY,EAAE;IAC1B7B,IAAI,CACD,8JACH,CAAC;EACH;EAEA,MAAM+B,QAAQ,GAAG,CAACxB,QAAQ,IAAIC,OAAO;EAErC,OACEb,KAAA,CAAAsB,aAAA,SAAAG,QAAA;IACEY,IAAI,EAAC,QAAQ;IACb3B,SAAS,EAAET,UAAU,iCAEGe,OAAQ,IAI9BgB,eAAe,EACfC,cAAc,EACdvB,SAAS,EALTK,UAAU,IAAK,yBAAwBA,UAAW,EAAC,EACnDD,QAAQ,IAAK,uBAAsBA,QAAS,EAAC,EAC7CsB,QAAQ,IAAI,mBAId;EAAE,GACEP,SAAS,GAEZpB,KAAK,IAAIT,KAAA,CAAAsB,aAAA;IAAMZ,SAAS,EAAC;EAAa,GAAED,KAAK,EAAC,GAAO,CAAC,EACtDI,OACG,CAAC;AAEX;AAEAI,KAAK,CAACqB,qBAAqB,GAAG,IAAI;AAElC,eAAerB,KAAK"}
1
+ {"version":3,"file":"Badge.js","names":["React","classnames","createSpacingClasses","createSkeletonClass","Context","warn","extendPropsWithContext","validateDOMAttributes","defaultProps","label","className","skeleton","children","content","vertical","horizontal","variant","Badge","localProps","context","useContext","allProps","createElement","BadgeRoot","BadgeElem","_extends","_ref","props","contentProp","restProps","_objectWithoutProperties","_excluded","skeletonClasses","spacingClasses","contentIsNum","variantIsNotification","isInline","role","_supportsSpacingProps"],"sources":["../../../../src/components/badge/Badge.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\n// Components\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport { createSkeletonClass } from '../skeleton/SkeletonHelper'\n\n// Shared\nimport Context, { ContextProps } from '../../shared/Context'\nimport type { SpacingProps } from '../../shared/types'\nimport type { SkeletonShow } from '../skeleton/Skeleton'\nimport {\n warn,\n extendPropsWithContext,\n validateDOMAttributes,\n} from '../../shared/component-helper'\n\nexport type BadgeProps = {\n /**\n * Aria label to describe the badge\n * Default: null\n */\n label?: React.ReactNode\n\n /**\n * Custom className on the component root\n * Default: null\n */\n className?: string\n\n /**\n * Skeleton should be applied when loading content\n * Default: null\n */\n skeleton?: SkeletonShow\n\n /**\n * The content to display the badge on top of.\n * Default: null\n */\n children?: React.ReactNode\n\n /**\n * The content of the component.\n * Default: null\n */\n content?: string | number | React.ReactNode\n\n /**\n * The vertical positioning of the component.\n * Default: null\n */\n vertical?: 'bottom' | 'top'\n\n /**\n * The horizontal positioning of the component.\n * Default: null\n */\n horizontal?: 'left' | 'right'\n\n /**\n * The variant of the component.\n * Default: information.\n */\n variant?: 'information' | 'notification'\n}\n\ntype BadgeAndSpacingProps = BadgeProps &\n SpacingProps &\n Omit<React.HTMLProps<HTMLElement>, 'content' | 'label'>\n\nexport const defaultProps = {\n label: null,\n className: null,\n skeleton: false,\n children: null,\n content: null,\n vertical: null,\n horizontal: null,\n variant: 'information',\n}\n\nfunction Badge(localProps: BadgeAndSpacingProps) {\n // Every component should have a context\n const context = React.useContext(Context)\n\n // Extract additional props from global context\n const allProps = extendPropsWithContext(\n localProps,\n defaultProps,\n context?.Badge,\n { skeleton: context?.skeleton }\n )\n const { children } = allProps\n\n if (children) {\n return (\n <BadgeRoot>\n {children}\n <BadgeElem context={context} {...allProps} />\n </BadgeRoot>\n )\n }\n\n return <BadgeElem context={context} {...allProps} />\n}\n\nfunction BadgeRoot({ children }: { children: React.ReactNode }) {\n return <span className=\"dnb-badge__root\">{children}</span>\n}\n\nfunction BadgeElem(\n props: BadgeAndSpacingProps & { context: ContextProps }\n) {\n const {\n label,\n className,\n children,\n skeleton,\n horizontal,\n vertical,\n content: contentProp,\n variant,\n context,\n ...restProps\n } = props\n\n // to remove spacing props, etc.\n validateDOMAttributes(props, restProps)\n\n const skeletonClasses = createSkeletonClass('shape', skeleton, context)\n const spacingClasses = createSpacingClasses(props)\n const contentIsNum = typeof contentProp === 'number'\n const variantIsNotification = variant === 'notification'\n\n const content =\n variantIsNotification && contentIsNum && contentProp > 9\n ? '9+'\n : contentProp\n\n if (variantIsNotification && !contentIsNum) {\n warn(\n `Type of content should be a number: A notification badge is best suited to display content of type number.`\n )\n }\n if (!label && contentIsNum) {\n warn(\n `Label required: A Badge with a number as content requires a label describing the content of the badge. This is to ensure correct semantic and accessibility.`\n )\n }\n\n const isInline = !children && content\n\n return (\n <span\n role=\"status\"\n className={classnames(\n 'dnb-badge',\n `dnb-badge--variant-${variant}`,\n horizontal && `dnb-badge--horizontal-${horizontal}`,\n vertical && `dnb-badge--vertical-${vertical}`,\n isInline && 'dnb-badge--inline',\n skeletonClasses,\n spacingClasses,\n className\n )}\n {...restProps}\n >\n {label && <span className=\"dnb-sr-only\">{label} </span>}\n {content}\n </span>\n )\n}\n\nBadge._supportsSpacingProps = true\n\nexport default Badge\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AAGnC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAA4B;AAGhE,OAAOC,OAAO,MAAwB,sBAAsB;AAG5D,SACEC,IAAI,EACJC,sBAAsB,EACtBC,qBAAqB,QAChB,+BAA+B;AAwDtC,OAAO,MAAMC,YAAY,GAAG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EF,CAAC,GAAGQ,KAAK;IADJE,SAAS,GAAAC,wBAAA,CACVH,KAAK,EAAAI,SAAA;EAGTxB,qBAAqB,CAACoB,KAAK,EAAEE,SAAS,CAAC;EAEvC,MAAMG,eAAe,GAAG7B,mBAAmB,CAAC,OAAO,EAAEQ,QAAQ,EAAEQ,OAAO,CAAC;EACvE,MAAMc,cAAc,GAAG/B,oBAAoB,CAACyB,KAAK,CAAC;EAClD,MAAMO,YAAY,GAAG,OAAON,WAAW,KAAK,QAAQ;EACpD,MAAMO,qBAAqB,GAAGnB,OAAO,KAAK,cAAc;EAExD,MAAMH,OAAO,GACXsB,qBAAqB,IAAID,YAAY,IAAIN,WAAW,GAAG,CAAC,GACpD,IAAI,GACJA,WAAW;EAEjB,IAAIO,qBAAqB,IAAI,CAACD,YAAY,EAAE;IAC1C7B,IAAI,CACD,4GACH,CAAC;EACH;EACA,IAAI,CAACI,KAAK,IAAIyB,YAAY,EAAE;IAC1B7B,IAAI,CACD,8JACH,CAAC;EACH;EAEA,MAAM+B,QAAQ,GAAG,CAACxB,QAAQ,IAAIC,OAAO;EAErC,OACEb,KAAA,CAAAsB,aAAA,SAAAG,QAAA;IACEY,IAAI,EAAC,QAAQ;IACb3B,SAAS,EAAET,UAAU,iCAEGe,OAAQ,IAI9BgB,eAAe,EACfC,cAAc,EACdvB,SAAS,EALTK,UAAU,IAAK,yBAAwBA,UAAW,EAAC,EACnDD,QAAQ,IAAK,uBAAsBA,QAAS,EAAC,EAC7CsB,QAAQ,IAAI,mBAId;EAAE,GACEP,SAAS,GAEZpB,KAAK,IAAIT,KAAA,CAAAsB,aAAA;IAAMZ,SAAS,EAAC;EAAa,GAAED,KAAK,EAAC,GAAO,CAAC,EACtDI,OACG,CAAC;AAEX;AAEAI,KAAK,CAACqB,qBAAqB,GAAG,IAAI;AAElC,eAAerB,KAAK"}
@@ -164,12 +164,12 @@ export declare const getComponents: () => {
164
164
  (localProps: import("./tag/Tag").TagProps & import("./space/types").SpacingElementProps & {
165
165
  space?: import("./space/types").SpaceTypeAll;
166
166
  innerSpace?: import("./space/types").SpaceTypeAll | import("./space/types").SpaceTypeMedia;
167
- }): import("react/jsx-runtime").JSX.Element;
167
+ } & import("react").HTMLProps<HTMLElement>): import("react/jsx-runtime").JSX.Element;
168
168
  Group: {
169
169
  (localProps: import("./tag/TagGroup").TagGroupProps & import("./space/types").SpacingElementProps & {
170
170
  space?: import("./space/types").SpaceTypeAll;
171
171
  innerSpace?: import("./space/types").SpaceTypeAll | import("./space/types").SpaceTypeMedia;
172
- }): import("react/jsx-runtime").JSX.Element;
172
+ } & Omit<import("react").HTMLProps<HTMLElement>, "label">): import("react/jsx-runtime").JSX.Element;
173
173
  _supportsSpacingProps: boolean;
174
174
  };
175
175
  _formElement: boolean;
@@ -46,7 +46,7 @@ export function SectionParams(localProps) {
46
46
  }));
47
47
  }
48
48
  function getColor(value) {
49
- if (value.includes('--')) {
49
+ if (String(value).includes('--')) {
50
50
  return value;
51
51
  }
52
52
  return value ? !/#|var/.test(value) ? `var(--color-${value})` : value : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Section.js","names":["React","classnames","Context","isTrue","extendPropsWithContext","Space","defaultProps","element","Section","localProps","createElement","SectionParams","context","useContext","props","variant","breakout","outset","roundedCorner","textColor","backgroundColor","dropShadow","outline","innerRef","className","children","spacing","style_type","inner_ref","attributes","_objectWithoutProperties","_excluded","internalRef","useRef","elementRef","Object","freeze","_objectSpread","style","computeStyle","value","getColor","String","includes","test","undefined","property","name","valueCallback","media","small","medium","large","result","size","_media","_media2","_name","_supportsSpacingProps"],"sources":["../../../../src/components/section/Section.tsx"],"sourcesContent":["/**\n * Web Section Component\n *\n */\n\nimport React from 'react'\nimport classnames from 'classnames'\nimport Context from '../../shared/Context'\nimport {\n isTrue,\n extendPropsWithContext,\n} from '../../shared/component-helper'\nimport type {\n DynamicElement,\n ResponsiveProp,\n SpacingProps,\n} from '../../shared/types'\nimport Space from '../space/Space'\n\nexport type SectionVariants = 'error' | 'info' | 'warning' | 'success'\n\nexport type SectionStyleTypes =\n | 'divider'\n | 'white'\n | 'transparent'\n\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'lavender'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'pistachio'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'emerald-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'sea-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'fire-red'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'fire-red-8'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'sand-yellow'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'black-3'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'mint-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'mint-green-12'\n\nexport type SectionSpacing =\n | boolean\n | 'x-small'\n | 'small'\n | 'medium'\n | 'large'\n | 'x-large'\n | 'xx-large'\n\nexport type TextColor = string\nexport type OutlineColor = string | boolean\nexport type BackgroundColor = string\nexport type DropShadow = boolean\n\nexport type SectionProps = {\n /**\n * Defines the semantic purpose and subsequently the style of the visual helper. Will take precedence over the style_type prop\n */\n variant?: SectionVariants | string\n\n /**\n * Define if the background color should break-out to a fullscreen view. Defaults to `true`.\n */\n breakout?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define if the Card should break out negatively on larger screens. You can not use `breakout` and `outset` together.\n * Defaults to `false`\n */\n outset?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define if the section should have rounded corners. Defaults to `false`.\n */\n roundedCorner?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define a custom border color. Use a Eufemia color.\n */\n outline?: OutlineColor | ResponsiveProp<OutlineColor>\n\n /**\n * Define a custom text color to compliment the backgroundColor. Use a Eufemia color.\n */\n textColor?: TextColor | ResponsiveProp<TextColor>\n\n /**\n * Define a custom background color, instead of a variant. Use a Eufemia color.\n */\n backgroundColor?: BackgroundColor | ResponsiveProp<BackgroundColor>\n\n /**\n * Define a custom drop-shadow.\n */\n dropShadow?: DropShadow | ResponsiveProp<DropShadow>\n\n /**\n * Define what HTML element should be used. Defaults to `<section>`.\n */\n element?: DynamicElement\n\n /**\n * Define a React.Ref.\n */\n innerRef?: React.RefObject<HTMLElement>\n\n /**\n * @deprecated in v11 use \"innerSpace\" prop instead\n */\n spacing?: SectionSpacing | ResponsiveProp<SectionSpacing>\n /**\n * @deprecated in v11 use \"background\" prop instead\n */\n style_type?: SectionStyleTypes | string\n /**\n * @deprecated in v11 use \"innerRef\" prop instead\n */\n inner_ref?: React.RefObject<HTMLElement>\n}\n\nexport type SectionAllProps = SectionProps &\n SpacingProps &\n Omit<React.HTMLProps<HTMLElement>, 'ref'>\n\ntype SectionReturnParams = Record<string, unknown> & {\n className: string\n innerRef: React.RefObject<HTMLElement>\n children: React.ReactNode\n style: React.CSSProperties\n}\n\nconst defaultProps = {\n element: 'section',\n}\n\nexport default function Section(localProps: SectionAllProps) {\n return <Space {...SectionParams(localProps)} />\n}\n\nexport function SectionParams(\n localProps: SectionAllProps\n): SectionReturnParams {\n const context = React.useContext(Context)\n\n // use only the props from context, who are available here anyway\n const props = extendPropsWithContext(\n localProps,\n defaultProps,\n context.Section\n )\n\n const {\n variant,\n breakout = !props.outset,\n outset,\n roundedCorner,\n textColor,\n backgroundColor,\n dropShadow,\n outline,\n innerRef,\n\n className,\n children,\n\n spacing,\n style_type,\n inner_ref,\n\n ...attributes\n } = props\n\n const internalRef = React.useRef<HTMLElement>()\n const elementRef = innerRef || inner_ref || internalRef\n\n return Object.freeze({\n ...attributes,\n className: classnames(\n 'dnb-section',\n `dnb-section--${variant ? variant : style_type || 'default'}`,\n spacing &&\n `dnb-section--spacing-${isTrue(spacing) ? 'large' : spacing}`,\n className\n ),\n style: {\n ...computeStyle(\n breakout,\n 'breakout',\n (value) => `var(--breakout--${value ? 'on' : 'off'})`\n ),\n ...computeStyle(outset, 'outset', (value) => (value ? '1' : '0')),\n ...computeStyle(\n roundedCorner,\n 'rounded-corner',\n (value) => value && 'var(--rounded-corner--value)'\n ),\n ...computeStyle(textColor, 'text-color', (value) => getColor(value)),\n ...computeStyle(backgroundColor, 'background-color', (value) =>\n getColor(value)\n ),\n ...computeStyle(\n dropShadow,\n 'drop-shadow',\n (value) => value && 'var(--shadow-default)'\n ),\n ...computeStyle(outline, 'outline-color', (value) =>\n String(value) === 'true'\n ? 'var(--outline-color--value)'\n : getColor(value)\n ),\n ...attributes?.style,\n } as React.CSSProperties,\n innerRef: elementRef,\n children,\n })\n}\n\nfunction getColor(value: string) {\n if (value.includes('--')) {\n return value\n }\n return value\n ? !/#|var/.test(value)\n ? `var(--color-${value})`\n : value\n : undefined\n}\n\nfunction computeStyle(\n property: ResponsiveProp<unknown> | boolean | string,\n name: string,\n valueCallback: (value: string) => string | undefined\n) {\n let media = property as ResponsiveProp<unknown>\n\n if (media !== null && typeof media !== 'object') {\n media = {\n small: property,\n medium: property,\n large: property,\n } as ResponsiveProp<unknown>\n }\n\n const result = {}\n\n for (const size in media as ResponsiveProp<unknown>) {\n if (typeof media?.[size] !== 'undefined') {\n const value = valueCallback(media?.[size])\n if (typeof value === 'string') {\n result[`--${name}--${size}`] = value\n }\n }\n }\n\n return result\n}\n\nSection._name = 'Section'\nSection._supportsSpacingProps = true\n"],"mappings":";;;;;;;AAKA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,SACEC,MAAM,EACNC,sBAAsB,QACjB,+BAA+B;AAMtC,OAAOC,KAAK,MAAM,gBAAgB;AAyHlC,MAAMC,YAAY,GAAG;EACnBC,OAAO,EAAE;AACX,CAAC;AAED,eAAe,SAASC,OAAOA,CAACC,UAA2B,EAAE;E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MAAMC,IAAI,IAAIL,KAAK,EAA6B;IAAA,IAAAM,MAAA;IACnD,IAAI,SAAAA,MAAA,GAAON,KAAK,cAAAM,MAAA,uBAALA,MAAA,CAAQD,IAAI,CAAC,MAAK,WAAW,EAAE;MAAA,IAAAE,OAAA;MACxC,MAAMhB,KAAK,GAAGQ,aAAa,EAAAQ,OAAA,GAACP,KAAK,cAAAO,OAAA,uBAALA,OAAA,CAAQF,IAAI,CAAC,CAAC;MAC1C,IAAI,OAAOd,KAAK,KAAK,QAAQ,EAAE;QAC7Ba,MAAM,CAAE,KAAIN,IAAK,KAAIO,IAAK,EAAC,CAAC,GAAGd,KAAK;MACtC;IACF;EACF;EAEA,OAAOa,MAAM;AACf;AAEA7C,OAAO,CAACiD,KAAK,GAAG,SAAS;AACzBjD,OAAO,CAACkD,qBAAqB,GAAG,IAAI"}
1
+ {"version":3,"file":"Section.js","names":["React","classnames","Context","isTrue","extendPropsWithContext","Space","defaultProps","element","Section","localProps","createElement","SectionParams","context","useContext","props","variant","breakout","outset","roundedCorner","textColor","backgroundColor","dropShadow","outline","innerRef","className","children","spacing","style_type","inner_ref","attributes","_objectWithoutProperties","_excluded","internalRef","useRef","elementRef","Object","freeze","_objectSpread","style","computeStyle","value","getColor","String","includes","test","undefined","property","name","valueCallback","media","small","medium","large","result","size","_media","_media2","_name","_supportsSpacingProps"],"sources":["../../../../src/components/section/Section.tsx"],"sourcesContent":["/**\n * Web Section Component\n *\n */\n\nimport React from 'react'\nimport classnames from 'classnames'\nimport Context from '../../shared/Context'\nimport {\n isTrue,\n extendPropsWithContext,\n} from '../../shared/component-helper'\nimport type {\n DynamicElement,\n ResponsiveProp,\n SpacingProps,\n} from '../../shared/types'\nimport Space from '../space/Space'\n\nexport type SectionVariants = 'error' | 'info' | 'warning' | 'success'\n\nexport type SectionStyleTypes =\n | 'divider'\n | 'white'\n | 'transparent'\n\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'lavender'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'pistachio'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'emerald-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'sea-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'fire-red'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'fire-red-8'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'sand-yellow'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'black-3'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'mint-green'\n /** @deprecated in v11 use \"variant\" or \"backgroundColor\" prop instead */\n | 'mint-green-12'\n\nexport type SectionSpacing =\n | boolean\n | 'x-small'\n | 'small'\n | 'medium'\n | 'large'\n | 'x-large'\n | 'xx-large'\n\nexport type TextColor = string\nexport type OutlineColor = string | boolean\nexport type BackgroundColor = string\nexport type DropShadow = boolean\n\nexport type SectionProps = {\n /**\n * Defines the semantic purpose and subsequently the style of the visual helper. Will take precedence over the style_type prop\n */\n variant?: SectionVariants | string\n\n /**\n * Define if the background color should break-out to a fullscreen view. Defaults to `true`.\n */\n breakout?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define if the Card should break out negatively on larger screens. You can not use `breakout` and `outset` together.\n * Defaults to `false`\n */\n outset?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define if the section should have rounded corners. Defaults to `false`.\n */\n roundedCorner?: boolean | ResponsiveProp<boolean>\n\n /**\n * Define a custom border color. Use a Eufemia color.\n */\n outline?: OutlineColor | ResponsiveProp<OutlineColor>\n\n /**\n * Define a custom text color to compliment the backgroundColor. Use a Eufemia color.\n */\n textColor?: TextColor | ResponsiveProp<TextColor>\n\n /**\n * Define a custom background color, instead of a variant. Use a Eufemia color.\n */\n backgroundColor?: BackgroundColor | ResponsiveProp<BackgroundColor>\n\n /**\n * Define a custom drop-shadow.\n */\n dropShadow?: DropShadow | ResponsiveProp<DropShadow>\n\n /**\n * Define what HTML element should be used. Defaults to `<section>`.\n */\n element?: DynamicElement\n\n /**\n * Define a React.Ref.\n */\n innerRef?: React.RefObject<HTMLElement>\n\n /**\n * @deprecated in v11 use \"innerSpace\" prop instead\n */\n spacing?: SectionSpacing | ResponsiveProp<SectionSpacing>\n /**\n * @deprecated in v11 use \"background\" prop instead\n */\n style_type?: SectionStyleTypes | string\n /**\n * @deprecated in v11 use \"innerRef\" prop instead\n */\n inner_ref?: React.RefObject<HTMLElement>\n}\n\nexport type SectionAllProps = SectionProps &\n SpacingProps &\n Omit<React.HTMLProps<HTMLElement>, 'ref'>\n\ntype SectionReturnParams = Record<string, unknown> & {\n className: string\n innerRef: React.RefObject<HTMLElement>\n children: React.ReactNode\n style: React.CSSProperties\n}\n\nconst defaultProps = {\n element: 'section',\n}\n\nexport default function Section(localProps: SectionAllProps) {\n return <Space {...SectionParams(localProps)} />\n}\n\nexport function SectionParams(\n localProps: SectionAllProps\n): SectionReturnParams {\n const context = React.useContext(Context)\n\n // use only the props from context, who are available here anyway\n const props = extendPropsWithContext(\n localProps,\n defaultProps,\n context.Section\n )\n\n const {\n variant,\n breakout = !props.outset,\n outset,\n roundedCorner,\n textColor,\n backgroundColor,\n dropShadow,\n outline,\n innerRef,\n\n className,\n children,\n\n spacing,\n style_type,\n inner_ref,\n\n ...attributes\n } = props\n\n const internalRef = React.useRef<HTMLElement>()\n const elementRef = innerRef || inner_ref || internalRef\n\n return Object.freeze({\n ...attributes,\n className: classnames(\n 'dnb-section',\n `dnb-section--${variant ? variant : style_type || 'default'}`,\n spacing &&\n `dnb-section--spacing-${isTrue(spacing) ? 'large' : spacing}`,\n className\n ),\n style: {\n ...computeStyle(\n breakout,\n 'breakout',\n (value) => `var(--breakout--${value ? 'on' : 'off'})`\n ),\n ...computeStyle(outset, 'outset', (value) => (value ? '1' : '0')),\n ...computeStyle(\n roundedCorner,\n 'rounded-corner',\n (value) => value && 'var(--rounded-corner--value)'\n ),\n ...computeStyle(textColor, 'text-color', (value) => getColor(value)),\n ...computeStyle(backgroundColor, 'background-color', (value) =>\n getColor(value)\n ),\n ...computeStyle(\n dropShadow,\n 'drop-shadow',\n (value) => value && 'var(--shadow-default)'\n ),\n ...computeStyle(outline, 'outline-color', (value) =>\n String(value) === 'true'\n ? 'var(--outline-color--value)'\n : getColor(value)\n ),\n ...attributes?.style,\n } as React.CSSProperties,\n innerRef: elementRef,\n children,\n })\n}\n\nfunction getColor(value: string) {\n if (String(value).includes('--')) {\n return value\n }\n return value\n ? !/#|var/.test(value)\n ? `var(--color-${value})`\n : value\n : undefined\n}\n\nfunction computeStyle(\n property: ResponsiveProp<unknown> | boolean | string,\n name: string,\n valueCallback: (value: string) => string | undefined\n) {\n let media = property as ResponsiveProp<unknown>\n\n if (media !== null && typeof media !== 'object') {\n media = {\n small: property,\n medium: property,\n large: property,\n } as ResponsiveProp<unknown>\n }\n\n const result = {}\n\n for (const size in media as ResponsiveProp<unknown>) {\n if (typeof media?.[size] !== 'undefined') {\n const value = valueCallback(media?.[size])\n if (typeof value === 'string') {\n result[`--${name}--${size}`] = value\n }\n }\n }\n\n return result\n}\n\nSection._name = 'Section'\nSection._supportsSpacingProps = true\n"],"mappings":";;;;;;;AAKA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,SACEC,MAAM,EACNC,sBAAsB,QACjB,+BAA+B;AAMtC,OAAOC,KAAK,MAAM,gBAAgB;AAyHlC,MAAMC,YAAY,GAAG;EACnBC,OAAO,EAAE;AACX,CAAC;AAED,eAAe,SAASC,OAAOA,CAACC,UAA2B,EAAE;EAC3D,OAAOT,KAAA,CAAAU,aAAA,CAACL,KAAK,EAAKM,aAAa,CAACF,UAAU,CAAI,CAAC;AACjD;AAEA,OAAO,SAASE,aAAaA,CAC3BF,UAA2B,EACN;EACrB,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D,IAAI,CAAC,MAAK,WAAW,EAAE;MAAA,IAAAE,OAAA;MACxC,MAAMhB,KAAK,GAAGQ,aAAa,EAAAQ,OAAA,GAACP,KAAK,cAAAO,OAAA,uBAALA,OAAA,CAAQF,IAAI,CAAC,CAAC;MAC1C,IAAI,OAAOd,KAAK,KAAK,QAAQ,EAAE;QAC7Ba,MAAM,CAAE,KAAIN,IAAK,KAAIO,IAAK,EAAC,CAAC,GAAGd,KAAK;MACtC;IACF;EACF;EAEA,OAAOa,MAAM;AACf;AAEA7C,OAAO,CAACiD,KAAK,GAAG,SAAS;AACzBjD,OAAO,CAACkD,qBAAqB,GAAG,IAAI"}
@@ -70,12 +70,12 @@ export declare const defaultProps: {
70
70
  omitOnKeyUpDeleteEvent: boolean;
71
71
  };
72
72
  declare const Tag: {
73
- (localProps: TagProps & SpacingProps): import("react/jsx-runtime").JSX.Element;
73
+ (localProps: TagProps & SpacingProps & React.HTMLProps<HTMLElement>): import("react/jsx-runtime").JSX.Element;
74
74
  Group: {
75
75
  (localProps: import("./TagGroup").TagGroupProps & import("../space/types").SpacingElementProps & {
76
76
  space?: import("../space/types").SpaceTypeAll;
77
77
  innerSpace?: import("../space/types").SpaceTypeAll | import("../space/types").SpaceTypeMedia;
78
- }): import("react/jsx-runtime").JSX.Element;
78
+ } & Omit<React.HTMLProps<HTMLElement>, "label">): import("react/jsx-runtime").JSX.Element;
79
79
  _supportsSpacingProps: boolean;
80
80
  };
81
81
  _formElement: boolean;