@descope/web-components-ui 1.0.65 → 1.0.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/dist/cjs/index.cjs.js +6 -4
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +663 -433
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/233.js +5 -1
  6. package/dist/umd/314.js +283 -0
  7. package/dist/umd/314.js.LICENSE.txt +27 -0
  8. package/dist/umd/541.js +744 -0
  9. package/dist/umd/541.js.LICENSE.txt +21 -0
  10. package/dist/umd/725.js +37 -1
  11. package/dist/umd/786.js +1 -1
  12. package/dist/umd/824.js +229 -0
  13. package/dist/umd/{54.js.LICENSE.txt → 824.js.LICENSE.txt} +0 -6
  14. package/dist/umd/840.js +9 -9
  15. package/dist/umd/860.js +1 -0
  16. package/dist/umd/descope-button-index-js.js +1 -1
  17. package/dist/umd/descope-checkbox-index-js.js +1 -1
  18. package/dist/umd/descope-combo-box-index-js.js +1 -0
  19. package/dist/umd/descope-container-index-js.js +1 -1
  20. package/dist/umd/descope-date-picker-index-js.js +1 -1
  21. package/dist/umd/descope-divider-index-js.js +1 -1
  22. package/dist/umd/descope-email-field-index-js.js +1 -1
  23. package/dist/umd/descope-link-index-js.js +1 -1
  24. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  25. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  26. package/dist/umd/descope-logo-index-js.js +1 -1
  27. package/dist/umd/descope-number-field-index-js.js +1 -1
  28. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  29. package/dist/umd/descope-passcode-index-js.js +1 -1
  30. package/dist/umd/descope-password-field-index-js.js +1 -1
  31. package/dist/umd/descope-switch-toggle-index-js.js +1 -1
  32. package/dist/umd/descope-text-area-index-js.js +1 -1
  33. package/dist/umd/descope-text-field-index-js.js +1 -1
  34. package/dist/umd/descope-text-index-js.js +1 -1
  35. package/dist/umd/index.js +1 -1
  36. package/package.json +2 -1
  37. package/src/components/descope-combo-box/ComboBox.js +111 -0
  38. package/src/components/descope-combo-box/index.js +6 -0
  39. package/src/constants.js +3 -1
  40. package/src/helpers/componentHelpers.js +55 -36
  41. package/src/helpers/index.js +2 -1
  42. package/src/helpers/themeHelpers/index.js +3 -3
  43. package/src/mixins/createStyleMixin/index.js +117 -91
  44. package/src/mixins/index.js +1 -0
  45. package/src/mixins/inputMixin.js +2 -3
  46. package/src/mixins/portalMixin.js +62 -0
  47. package/src/theme/components/comboBox.js +32 -0
  48. package/src/theme/components/index.js +3 -1
  49. package/dist/umd/54.js +0 -971
  50. package/dist/umd/666.js +0 -37
  51. /package/dist/umd/{666.js.LICENSE.txt → 725.js.LICENSE.txt} +0 -0
@@ -4,6 +4,8 @@ var merge = require('lodash.merge');
4
4
  var set = require('lodash.set');
5
5
 
6
6
  const DESCOPE_PREFIX = 'descope';
7
+ const BASE_THEME_SECTION = 'host';
8
+ const PORTAL_THEME_PREFIX = '@';
7
9
 
8
10
  const kebabCase = (str) =>
9
11
  str
@@ -11,12 +13,12 @@ const kebabCase = (str) =>
11
13
  .replace(/[\s_.]+/g, '-')
12
14
  .toLowerCase();
13
15
 
14
- const kebabCaseJoin = (...args) => kebabCase(args.join('-'));
16
+ const kebabCaseJoin = (...args) => kebabCase(args.filter((arg) => !!arg).join('-'));
15
17
 
16
18
  const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
17
19
 
18
20
  const getCssVarName = (...args) =>
19
- `--${kebabCaseJoin(...args.filter((arg) => !!arg))}`;
21
+ `--${kebabCaseJoin(...args)}`;
20
22
 
21
23
  class ComponentsThemeManager {
22
24
  static mountOnPropName = 'DescopeThemeManager';
@@ -102,9 +104,9 @@ const componentsThemeToStyleObj = (componentsTheme) =>
102
104
  // this allows us to generate those themes under different sections
103
105
  // if the theme has root level attribute that starts with #
104
106
  // we are generating a new theme
105
- let themeName = 'theme';
107
+ let themeName = BASE_THEME_SECTION;
106
108
 
107
- if (restPath[0] && restPath[0].startsWith('#')) {
109
+ if (restPath[0] && restPath[0].startsWith(PORTAL_THEME_PREFIX)) {
108
110
  themeName = restPath.shift();
109
111
  }
110
112
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../src/constants.js","../../src/helpers/index.js","../../src/helpers/componentHelpers.js","../../src/helpers/themeHelpers/componentsThemeManager.js","../../src/helpers/themeHelpers/index.js"],"sourcesContent":["export const DESCOPE_PREFIX = 'descope';\nexport const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3","\nexport const kebabCase = (str) =>\n\tstr\n\t\t.replace(/([a-z])([A-Z])/g, '$1-$2')\n\t\t.replace(/[\\s_.]+/g, '-')\n\t\t.toLowerCase();\n\nexport const kebabCaseJoin = (...args) => kebabCase(args.join('-'));\n\nexport const compose = (...fns) =>\n\t(val) =>\n\t\tfns.reduceRight((res, fn) => fn(res), val);\n\n","import { kebabCaseJoin } from '.';\nimport { DESCOPE_PREFIX } from '../constants';\n\nconst observeAttributes = (\n\tele,\n\tcallback,\n\t{ excludeAttrs = [], includeAttrs = [] }\n) => {\n\t// sync all attrs on init\n\tcallback(\n\t\t...Array.from(ele.attributes)\n\t\t\t.filter(\n\t\t\t\t(attr) =>\n\t\t\t\t\t!excludeAttrs.includes(attr.name) &&\n\t\t\t\t\t(!includeAttrs.length || includeAttrs.includes(attr.name))\n\t\t\t)\n\t\t\t.map((attr) => attr.name)\n\t);\n\n\tconst observer = new MutationObserver((mutationsList) => {\n\t\tfor (const mutation of mutationsList) {\n\t\t\tif (\n\t\t\t\tmutation.type === 'attributes' &&\n\t\t\t\t!excludeAttrs.includes(mutation.attributeName) &&\n\t\t\t\t(!includeAttrs.length || includeAttrs.includes(mutation.attributeName))\n\t\t\t) {\n\t\t\t\tcallback([mutation.attributeName]);\n\t\t\t}\n\t\t}\n\t});\n\n\tobserver.observe(ele, { attributes: true });\n};\n\nconst createSyncAttrsCb =\n\t(srcEle, targetEle, mapAttrs = {}) =>\n\t(...attrNames) => {\n\t\tattrNames.forEach((attrName) => {\n\t\t\tconst targetAttrName = mapAttrs[attrName] || attrName;\n\t\t\tconst srcAttrVal = srcEle.getAttribute(attrName);\n\t\t\tif (srcAttrVal !== null) {\n\t\t\t\tif (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {\n\t\t\t\t\ttargetEle.setAttribute(targetAttrName, srcAttrVal);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttargetEle.removeAttribute(targetAttrName);\n\t\t\t}\n\t\t});\n\t};\n\nexport const syncAttrs = (ele1, ele2, options) => {\n\tobserveAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);\n\tobserveAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);\n};\n\nexport const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);\n\nexport const getCssVarName = (...args) =>\n `--${kebabCaseJoin(...args.filter((arg) => !!arg))}`;\n\nexport const forwardAttrs = (source, dest, options = {}) => {\n observeAttributes(\n source,\n createSyncAttrsCb(source, dest, options.mapAttrs),\n options\n );\n};\n\nexport const forwardProps = (src, target, props = []) => {\n\tif(!props.length) return;\n\n\tconst config = props.reduce((acc, prop) => Object.assign(acc, {[prop] : {\n\t\tget () {\n\t\t\treturn target[prop]\n\t\t},\n\t\tset (v) {\n\t\t\ttarget[prop] = v\n\t\t}\n\t}}), {})\n\n\tObject.defineProperties(src, config)\n}\n","\nclass ComponentsThemeManager {\n static mountOnPropName = 'DescopeThemeManager';\n\n #themes = {};\n\n #currentThemeName = 'light';\n\n #callbacks = new Set();\n\n #notify() {\n this.#callbacks.forEach(cb => cb?.());\n };\n\n get currentThemeName() {\n return this.#currentThemeName;\n }\n\n set currentThemeName(themeName) {\n this.#currentThemeName = themeName;\n this.#notify();\n }\n\n get currentTheme() {\n return this.#themes[this.currentThemeName];\n }\n\n onCurrentThemeChange(cb) {\n this.#callbacks.add(cb);\n\n return () => { this.#callbacks.delete(cb); };\n };\n\n set themes(themes) {\n this.#themes = themes;\n this.#notify();\n }\n}\n\nexport const componentsThemeManager = new ComponentsThemeManager()\n","import merge from 'lodash.merge';\nimport set from 'lodash.set';\nimport { DESCOPE_PREFIX } from '../../constants';\nimport { kebabCase } from '..';\nimport { getComponentName, getCssVarName } from '../componentHelpers';\n\nconst getVarName = (path) => getCssVarName(DESCOPE_PREFIX, ...path);\n\nconst transformTheme = (theme, path, getTransformation) => {\n\treturn Object.entries(theme).reduce((acc, [key, val]) => {\n\t\tif (val?.constructor !== Object) {\n\t\t\treturn merge(acc, getTransformation(path.concat(key), val));\n\t\t} else {\n\t\t\treturn merge(acc, transformTheme(val, [...path, key], getTransformation));\n\t\t}\n\t}, {});\n};\n\nconst stringifyArray = (strArr) =>\n\tstrArr.map((str) => (str.includes(' ') ? `\"${str}\"` : str)).join(', ');\n\nexport const themeToCSSVarsObj = (theme) =>\n\ttransformTheme(theme, [], (path, val) => ({\n\t\t[getVarName(path)]: Array.isArray(val) ? stringifyArray(val) : val\n\t}));\n\nexport const getThemeRefs = (theme, prefix) =>\n\ttransformTheme(theme, [], (path) =>\n\t\tset({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`)\n\t);\n\nexport const globalsThemeToStyle = (theme, themeName = '') => `\n*[data-theme=\"${themeName}\"] {\n\t${Object.entries(themeToCSSVarsObj(theme)).reduce(\n\t(acc, entry) => (acc += `${entry.join(':')};\\n`),\n\t''\n)}\n}\n`;\n\nconst componentsThemeToStyleObj = (componentsTheme) =>\n\ttransformTheme(componentsTheme, [], (path, val) => {\n\t\tconst [component, ...restPath] = path;\n\t\tconst property = restPath.pop();\n\t\tconst componentName = getComponentName(component);\n\n\t\t// we need a support for portal components theme (e.g. overlay)\n\t\t// this allows us to generate those themes under different sections\n\t\t// if the theme has root level attribute that starts with #\n\t\t// we are generating a new theme\n\t\tlet themeName = 'theme'\n\n\t\tif (restPath[0] && restPath[0].startsWith('#')) {\n\t\t\tthemeName = restPath.shift();\n\t\t}\n\n\t\t// do not start with underscore -> key:value, must have 2 no underscore attrs in a row\n\t\t// starts with underscore -> attribute selector\n\t\tconst attrsSelector = restPath.reduce((acc, section, idx) => {\n\t\t\tif (section.startsWith('_'))\n\t\t\t\treturn (acc += `[${kebabCase(section.replace(/^_/, ''))}=\"true\"]`);\n\n\t\t\tconst nextSection = restPath[idx + 1];\n\n\t\t\tif (typeof nextSection !== 'string' || nextSection.startsWith('_')) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t'theme generator',\n\t\t\t\t\t`your theme structure is invalid, attribute \"${section}\" is followed by \"${nextSection}\" which is not allowed`\n\t\t\t\t);\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\treturn (acc += `[${kebabCase(section)}=\"${restPath\n\t\t\t\t.splice(idx + 1, 1)\n\t\t\t\t.join('')}\"]`);\n\t\t}, '');\n\n\t\tlet selector = `:host${attrsSelector ? `(${attrsSelector})` : ''}`;\n\n\t\treturn {\n\t\t\t[componentName]: {\n\t\t\t\t[themeName]: {\n\t\t\t\t\t[selector]: {\n\t\t\t\t\t\t[property]: val\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\nexport const createComponentsTheme = (componentsTheme) => {\n\tconst styleObj = componentsThemeToStyleObj(componentsTheme);\n\n\treturn Object.keys(styleObj).reduce(\n\t\t(acc, componentName) => {\n\t\t\tconst componentThemes = styleObj[componentName];\n\n\t\t\treturn Object.assign(acc, {\n\t\t\t\t[componentName]: Object.keys(componentThemes)\n\t\t\t\t\t.reduce((acc, theme) =>\n\t\t\t\t\t\tObject.assign(acc, { [theme]: componentsThemeToStyle(componentThemes[theme]) }),\n\t\t\t\t\t\t{})\n\t\t\t})\n\t\t},\n\t\t{}\n\t);\n}\n\nconst componentsThemeToStyle = (componentsTheme) =>\n\tObject.entries(componentsTheme).reduce(\n\t\t(acc, [selector, vars]) =>\n\t\t(acc += `${selector} { \\n${Object.entries(\n\t\t\tvars\n\t\t)\n\t\t\t.map(([key, val]) => `${key}: ${val}`)\n\t\t\t.join(';\\n')} \\n}\\n\\n`),\n\t\t''\n\t);\n\nexport const themeToStyle = ({ globals, components }, themeName) => ({\n\tglobals: globalsThemeToStyle(globals, themeName),\n\tcomponents: createComponentsTheme(components)\n});\n\nconst useVar = (varName) => `var(${varName})`;\n\nexport const createHelperVars = (theme, prefix) => {\n\tconst res = transformTheme(theme, [], (path, value) => {\n\t\tconst modifiedPath = [...path];\n\t\tconst property = modifiedPath.splice(-1);\n\t\tconst varName = getCssVarName(prefix, property);\n\n\t\tconst vars = { [property]: varName };\n\t\tconst theme = set({}, [...modifiedPath, varName], value);\n\t\tconst useVars = { [property]: useVar(varName) };\n\n\t\treturn { theme, useVars, vars };\n\t});\n\n\treturn [res.theme, res.useVars, res.vars];\n};\n\nexport { componentsThemeManager } from './componentsThemeManager'\n"],"names":[],"mappings":";;;;;AAAO,MAAM,cAAc,GAAG,SAAS;;ACChC,MAAM,SAAS,GAAG,CAAC,GAAG;AAC7B,CAAC,GAAG;AACJ,GAAG,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;AACtC,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;AAC3B,GAAG,WAAW,EAAE,CAAC;AACjB;AACO,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;ACgD5D,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC9E;AACO,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI;AACrC,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;ACzDtD,MAAM,sBAAsB,CAAC;AAC7B,EAAE,OAAO,eAAe,GAAG,qBAAqB,CAAC;AACjD;AACA,EAAE,OAAO,GAAG,EAAE,CAAC;AACf;AACA,EAAE,iBAAiB,GAAG,OAAO,CA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,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAC9C;AACY,MAAC,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AACnD,CAAC,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK;AACxD,EAAE,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACjC,EAAE,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,EAAE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAClD;AACA,EAAE,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,GAAG,OAAO,EAAE,CAAC;AACvC,EAAE,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,YAAY,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3D,EAAE,MAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;AAClD;AACA,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAClC,EAAE,CAAC,CAAC;AACJ;AACA,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3C;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/constants.js","../../src/helpers/index.js","../../src/helpers/componentHelpers.js","../../src/helpers/themeHelpers/componentsThemeManager.js","../../src/helpers/themeHelpers/index.js"],"sourcesContent":["export const DESCOPE_PREFIX = 'descope';\nexport const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3\nexport const BASE_THEME_SECTION = 'host'\nexport const PORTAL_THEME_PREFIX = '@'","\nexport const kebabCase = (str) =>\n\tstr\n\t\t.replace(/([a-z])([A-Z])/g, '$1-$2')\n\t\t.replace(/[\\s_.]+/g, '-')\n\t\t.toLowerCase();\n\nexport const kebabCaseJoin = (...args) => kebabCase(args.filter((arg) => !!arg).join('-'));\n\nexport const compose = (...fns) =>\n\t(val) =>\n\t\tfns.reduceRight((res, fn) => fn(res), val);\n\nexport const upperFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1)\n","import { kebabCaseJoin } from '.';\nimport { DESCOPE_PREFIX } from '../constants';\n\nexport const observeAttributes = (\n\tele,\n\tcallback,\n\t{ excludeAttrs = [], includeAttrs = [] }\n) => {\n\t// sync all attrs on init\n\tconst filteredAttrs = Array.from(ele.attributes)\n\t\t.filter((attr) =>\n\t\t\t!excludeAttrs.includes(attr.name) &&\n\t\t\t(!includeAttrs.length || includeAttrs.includes(attr.name))\n\t\t)\n\t\t.map((attr) => attr.name)\n\n\tcallback(filteredAttrs);\n\n\tconst observer = new MutationObserver((mutationsList) => {\n\t\tfor (const mutation of mutationsList) {\n\t\t\tif (\n\t\t\t\tmutation.type === 'attributes' &&\n\t\t\t\t!excludeAttrs.includes(mutation.attributeName) &&\n\t\t\t\t(!includeAttrs.length || includeAttrs.includes(mutation.attributeName))\n\t\t\t) {\n\t\t\t\tcallback([mutation.attributeName]);\n\t\t\t}\n\t\t}\n\t});\n\n\tobserver.observe(ele, { attributes: true });\n};\n\n// calling the callback with this object: { addedNodes, removedNodes }\nexport const observeChildren = (\n\tele,\n\tcallback,\n) => {\n\tcallback({ addedNodes: Array.from(ele.children), removedNodes: [] });\n\n\tconst observer = new MutationObserver((mutationsList) => {\n\t\tfor (const mutation of mutationsList) {\n\t\t\tif (mutation.type === 'childList') {\n\t\t\t\tcallback(mutation);\n\t\t\t}\n\t\t}\n\t});\n\n\tobserver.observe(ele, { childList: true });\n};\n\nconst createSyncAttrsCb =\n\t(srcEle, targetEle, mapAttrs = {}) =>\n\t\t(attrNames) => {\n\t\t\tattrNames.forEach((attrName) => {\n\t\t\t\tconst targetAttrName = mapAttrs[attrName] || attrName;\n\t\t\t\tconst srcAttrVal = srcEle.getAttribute(attrName);\n\t\t\t\tif (srcAttrVal !== null) {\n\t\t\t\t\tif (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {\n\t\t\t\t\t\ttargetEle.setAttribute(targetAttrName, srcAttrVal);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttargetEle.removeAttribute(targetAttrName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\nexport const syncAttrs = (ele1, ele2, options) => {\n\tobserveAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);\n\tobserveAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);\n};\n\nexport const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);\n\nexport const getCssVarName = (...args) =>\n\t`--${kebabCaseJoin(...args)}`;\n\nexport const forwardAttrs = (source, dest, options = {}) => {\n\tobserveAttributes(\n\t\tsource,\n\t\tcreateSyncAttrsCb(source, dest, options.mapAttrs),\n\t\toptions\n\t);\n};\n\nexport const forwardProps = (src, target, props = []) => {\n\tif (!props.length) return;\n\n\tconst config = props.reduce((acc, prop) => Object.assign(acc, {\n\t\t[prop]: {\n\t\t\tget() {\n\t\t\t\treturn target[prop]\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\ttarget[prop] = v\n\t\t\t}\n\t\t}\n\t}), {})\n\n\tObject.defineProperties(src, config)\n}\n","\nclass ComponentsThemeManager {\n static mountOnPropName = 'DescopeThemeManager';\n\n #themes = {};\n\n #currentThemeName = 'light';\n\n #callbacks = new Set();\n\n #notify() {\n this.#callbacks.forEach(cb => cb?.());\n };\n\n get currentThemeName() {\n return this.#currentThemeName;\n }\n\n set currentThemeName(themeName) {\n this.#currentThemeName = themeName;\n this.#notify();\n }\n\n get currentTheme() {\n return this.#themes[this.currentThemeName];\n }\n\n onCurrentThemeChange(cb) {\n this.#callbacks.add(cb);\n\n return () => { this.#callbacks.delete(cb); };\n };\n\n set themes(themes) {\n this.#themes = themes;\n this.#notify();\n }\n}\n\nexport const componentsThemeManager = new ComponentsThemeManager()\n","import merge from 'lodash.merge';\nimport set from 'lodash.set';\nimport { BASE_THEME_SECTION, DESCOPE_PREFIX, PORTAL_THEME_PREFIX } from '../../constants';\nimport { kebabCase } from '..';\nimport { getComponentName, getCssVarName } from '../componentHelpers';\n\nconst getVarName = (path) => getCssVarName(DESCOPE_PREFIX, ...path);\n\nconst transformTheme = (theme, path, getTransformation) => {\n\treturn Object.entries(theme).reduce((acc, [key, val]) => {\n\t\tif (val?.constructor !== Object) {\n\t\t\treturn merge(acc, getTransformation(path.concat(key), val));\n\t\t} else {\n\t\t\treturn merge(acc, transformTheme(val, [...path, key], getTransformation));\n\t\t}\n\t}, {});\n};\n\nconst stringifyArray = (strArr) =>\n\tstrArr.map((str) => (str.includes(' ') ? `\"${str}\"` : str)).join(', ');\n\nexport const themeToCSSVarsObj = (theme) =>\n\ttransformTheme(theme, [], (path, val) => ({\n\t\t[getVarName(path)]: Array.isArray(val) ? stringifyArray(val) : val\n\t}));\n\nexport const getThemeRefs = (theme, prefix) =>\n\ttransformTheme(theme, [], (path) =>\n\t\tset({}, path, `var(${getVarName(prefix ? [prefix, ...path] : path)})`)\n\t);\n\nexport const globalsThemeToStyle = (theme, themeName = '') => `\n*[data-theme=\"${themeName}\"] {\n\t${Object.entries(themeToCSSVarsObj(theme)).reduce(\n\t(acc, entry) => (acc += `${entry.join(':')};\\n`),\n\t''\n)}\n}\n`;\n\nconst componentsThemeToStyleObj = (componentsTheme) =>\n\ttransformTheme(componentsTheme, [], (path, val) => {\n\t\tconst [component, ...restPath] = path;\n\t\tconst property = restPath.pop();\n\t\tconst componentName = getComponentName(component);\n\n\t\t// we need a support for portal components theme (e.g. overlay)\n\t\t// this allows us to generate those themes under different sections\n\t\t// if the theme has root level attribute that starts with #\n\t\t// we are generating a new theme\n\t\tlet themeName = BASE_THEME_SECTION\n\n\t\tif (restPath[0] && restPath[0].startsWith(PORTAL_THEME_PREFIX)) {\n\t\t\tthemeName = restPath.shift();\n\t\t}\n\n\t\t// do not start with underscore -> key:value, must have 2 no underscore attrs in a row\n\t\t// starts with underscore -> attribute selector\n\t\tconst attrsSelector = restPath.reduce((acc, section, idx) => {\n\t\t\tif (section.startsWith('_'))\n\t\t\t\treturn (acc += `[${kebabCase(section.replace(/^_/, ''))}=\"true\"]`);\n\n\t\t\tconst nextSection = restPath[idx + 1];\n\n\t\t\tif (typeof nextSection !== 'string' || nextSection.startsWith('_')) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t'theme generator',\n\t\t\t\t\t`your theme structure is invalid, attribute \"${section}\" is followed by \"${nextSection}\" which is not allowed`\n\t\t\t\t);\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\treturn (acc += `[${kebabCase(section)}=\"${restPath\n\t\t\t\t.splice(idx + 1, 1)\n\t\t\t\t.join('')}\"]`);\n\t\t}, '');\n\n\t\tlet selector = `:host${attrsSelector ? `(${attrsSelector})` : ''}`;\n\n\t\treturn {\n\t\t\t[componentName]: {\n\t\t\t\t[themeName]: {\n\t\t\t\t\t[selector]: {\n\t\t\t\t\t\t[property]: val\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\nexport const createComponentsTheme = (componentsTheme) => {\n\tconst styleObj = componentsThemeToStyleObj(componentsTheme);\n\n\treturn Object.keys(styleObj).reduce(\n\t\t(acc, componentName) => {\n\t\t\tconst componentThemes = styleObj[componentName];\n\n\t\t\treturn Object.assign(acc, {\n\t\t\t\t[componentName]: Object.keys(componentThemes)\n\t\t\t\t\t.reduce((acc, theme) =>\n\t\t\t\t\t\tObject.assign(acc, { [theme]: componentsThemeToStyle(componentThemes[theme]) }),\n\t\t\t\t\t\t{})\n\t\t\t})\n\t\t},\n\t\t{}\n\t);\n}\n\nconst componentsThemeToStyle = (componentsTheme) =>\n\tObject.entries(componentsTheme).reduce(\n\t\t(acc, [selector, vars]) =>\n\t\t(acc += `${selector} { \\n${Object.entries(\n\t\t\tvars\n\t\t)\n\t\t\t.map(([key, val]) => `${key}: ${val}`)\n\t\t\t.join(';\\n')} \\n}\\n\\n`),\n\t\t''\n\t);\n\nexport const themeToStyle = ({ globals, components }, themeName) => ({\n\tglobals: globalsThemeToStyle(globals, themeName),\n\tcomponents: createComponentsTheme(components)\n});\n\nconst useVar = (varName) => `var(${varName})`;\n\nexport const createHelperVars = (theme, prefix) => {\n\tconst res = transformTheme(theme, [], (path, value) => {\n\t\tconst modifiedPath = [...path];\n\t\tconst property = modifiedPath.splice(-1);\n\t\tconst varName = getCssVarName(prefix, property);\n\n\t\tconst vars = { [property]: varName };\n\t\tconst theme = set({}, [...modifiedPath, varName], value);\n\t\tconst useVars = { [property]: useVar(varName) };\n\n\t\treturn { theme, useVars, vars };\n\t});\n\n\treturn [res.theme, res.useVars, res.vars];\n};\n\nexport { componentsThemeManager } from './componentsThemeManager'\n"],"names":[],"mappings":";;;;;AAAO,MAAM,cAAc,GAAG,SAAS,CAAC;AAEjC,MAAM,kBAAkB,GAAG,OAAM;AACjC,MAAM,mBAAmB,GAAG;;ACF5B,MAAM,SAAS,GAAG,CAAC,GAAG;AAC7B,CAAC,GAAG;AACJ,GAAG,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;AACtC,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;AAC3B,GAAG,WAAW,EAAE,CAAC;AACjB;AACO,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;ACiEnF,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC9E;AACO,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI;AACrC,CAAC,CAAC,EAAE,EAAE,aAAa,CAAC,GAAG,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