@descope/web-components-ui 1.0.101 → 1.0.103

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/README.md +2 -156
  2. package/dist/cjs/index.cjs.js +1 -1
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +411 -370
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/241.js +1 -0
  7. package/dist/umd/447.js +1 -1
  8. package/dist/umd/878.js +1 -1
  9. package/dist/umd/890.js +1 -1
  10. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  11. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  12. package/dist/umd/descope-button-index-js.js +1 -1
  13. package/dist/umd/descope-combo-box-index-js.js +1 -1
  14. package/dist/umd/descope-container-index-js.js +1 -1
  15. package/dist/umd/descope-date-picker-index-js.js +1 -1
  16. package/dist/umd/descope-divider-index-js.js +1 -1
  17. package/dist/umd/descope-email-field-index-js.js +1 -1
  18. package/dist/umd/descope-image-index-js.js +1 -1
  19. package/dist/umd/descope-link-index-js.js +1 -1
  20. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  21. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  22. package/dist/umd/descope-logo-index-js.js +1 -1
  23. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  24. package/dist/umd/descope-number-field-index-js.js +1 -1
  25. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  26. package/dist/umd/descope-passcode-index-js.js +1 -1
  27. package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  28. package/dist/umd/descope-phone-field-index-js.js +1 -1
  29. package/dist/umd/descope-text-area-index-js.js +1 -1
  30. package/dist/umd/descope-text-field-index-js.js +1 -1
  31. package/dist/umd/descope-text-index-js.js +1 -1
  32. package/dist/umd/index.js +1 -1
  33. package/package.json +1 -1
  34. package/src/components/descope-combo-box/ComboBox.js +1 -1
  35. package/src/components/descope-container/Container.js +2 -1
  36. package/src/components/descope-divider/Divider.js +1 -0
  37. package/src/components/descope-email-field/EmailField.js +6 -8
  38. package/src/components/descope-new-password/NewPassword.js +15 -13
  39. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +2 -1
  40. package/src/components/descope-number-field/NumberField.js +7 -10
  41. package/src/components/descope-passcode/Passcode.js +83 -67
  42. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +3 -7
  43. package/src/components/descope-password-field/PasswordField.js +17 -13
  44. package/src/components/descope-phone-field/PhoneField.js +15 -1
  45. package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +5 -2
  46. package/src/components/descope-text-area/TextArea.js +6 -7
  47. package/src/components/descope-text-field/TextField.js +4 -10
  48. package/src/components/descope-text-field/textFieldMappings.js +1 -0
  49. package/src/helpers/themeHelpers/index.js +1 -1
  50. package/src/mixins/createStyleMixin/index.js +4 -1
  51. package/src/mixins/inputValidationMixin.js +15 -6
  52. package/src/mixins/normalizeBooleanAttributesMixin.js +29 -4
  53. package/src/mixins/proxyInputMixin.js +3 -1
  54. package/src/theme/components/comboBox.js +4 -10
  55. package/src/theme/components/logo.js +1 -0
  56. package/src/theme/components/newPassword.js +11 -24
  57. package/src/theme/components/passcode.js +3 -3
  58. package/src/theme/components/passwordField.js +4 -8
  59. package/src/theme/components/phoneField.js +8 -16
  60. package/src/theme/components/text.js +0 -2
  61. package/src/theme/components/textArea.js +9 -2
  62. package/src/theme/components/textField.js +3 -5
  63. package/dist/umd/0.js +0 -1
@@ -1,5 +1,26 @@
1
1
  import { observeAttributes } from "../helpers/componentHelpers";
2
2
 
3
+ const booleanAttributesList = [
4
+ 'readonly',
5
+ 'focused',
6
+ 'invalid',
7
+ 'has-label',
8
+ 'required',
9
+ 'disabled',
10
+ 'checked',
11
+ 'has-helper',
12
+ 'has-value',
13
+ 'step-buttons-visible',
14
+ 'hover',
15
+ 'has-error-message',
16
+ 'focus-ring',
17
+ 'opened',
18
+ 'active'
19
+ ]
20
+
21
+ const isBooleanAttribute = (attr) => {
22
+ return booleanAttributesList.includes(attr)
23
+ }
3
24
  // we want all the valueless attributes to have "true" value
4
25
  // and all the falsy attribute to be removed
5
26
  export const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBooleanAttributesMixinClass extends superclass {
@@ -10,10 +31,14 @@ export const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBo
10
31
  attrs.forEach(attr => {
11
32
  const attrVal = this.getAttribute(attr)
12
33
 
13
- if (attrVal === '') {
14
- this.setAttribute(attr, 'true')
15
- } else if (attrVal === 'false') {
16
- this.removeAttribute(attr)
34
+ if (isBooleanAttribute(attr)) {
35
+ if (attrVal === '') {
36
+ this.setAttribute(attr, 'true')
37
+ } else if (attrVal === 'false') {
38
+ this.removeAttribute(attr)
39
+ }
40
+ } else if (!attrVal) {
41
+ console.warn(`attribute "${attr}" has no value, should it be added to the boolean attributes list?`)
17
42
  }
18
43
  }), {})
19
44
  }
@@ -1,3 +1,4 @@
1
+ import { forwardAttrs } from "../helpers/componentHelpers";
1
2
  import { createDispatchEvent } from "../helpers/mixinsHelpers";
2
3
  import { inputValidationMixin } from "./inputValidationMixin";
3
4
 
@@ -63,7 +64,6 @@ export const proxyInputMixin = (superclass) =>
63
64
 
64
65
  this.#inputElement ??= getNestedInput(inputSlot) || getNestedInput(textAreaSlot)
65
66
 
66
-
67
67
  return this.#inputElement
68
68
  }
69
69
 
@@ -130,5 +130,7 @@ export const proxyInputMixin = (superclass) =>
130
130
  propertyObserver(this, this.inputElement, 'value');
131
131
  propertyObserver(this, this.inputElement, 'selectionStart');
132
132
  this.setSelectionRange = this.inputElement.setSelectionRange?.bind(this.inputElement);
133
+
134
+ forwardAttrs(this, this.inputElement, {includeAttrs: ['inputmode']})
133
135
  }
134
136
  };
@@ -16,31 +16,25 @@ export const comboBox = {
16
16
  [vars.toggleColor]: globalRefs.colors.surface.contrast,
17
17
  [vars.toggleCursor]: 'pointer',
18
18
  [vars.inputBackgroundColor]: globalRefs.colors.surface.light,
19
+ [vars.padding]: `0 ${globalRefs.spacing.xs}`,
20
+
21
+ [vars.height]: '2em',
22
+
19
23
  size: {
20
24
  xs: {
21
- [vars.height]: '14px',
22
25
  [vars.fontSize]: '8px',
23
- [vars.padding]: `0 ${globalRefs.spacing.xs}`
24
26
  },
25
27
  sm: {
26
- [vars.height]: '20px',
27
28
  [vars.fontSize]: '10px',
28
- [vars.padding]: `0 ${globalRefs.spacing.sm}`
29
29
  },
30
30
  md: {
31
- [vars.height]: '30px',
32
31
  [vars.fontSize]: '14px',
33
- [vars.padding]: `0 ${globalRefs.spacing.md}`
34
32
  },
35
33
  lg: {
36
- [vars.height]: '40px',
37
34
  [vars.fontSize]: '20px',
38
- [vars.padding]: `0 ${globalRefs.spacing.lg}`
39
35
  },
40
36
  xl: {
41
- [vars.height]: '50px',
42
37
  [vars.fontSize]: '25px',
43
- [vars.padding]: `0 ${globalRefs.spacing.xl}`
44
38
  }
45
39
  },
46
40
 
@@ -3,6 +3,7 @@ import Logo from "../../components/descope-logo/Logo";
3
3
  const vars = Logo.cssVarList
4
4
 
5
5
  const logo = {
6
+ [vars.width]: '100%',
6
7
  [vars.fallbackUrl]: 'url(https://content.app.descope.com/assets/flows/noLogoPlaceholder.svg)'
7
8
  };
8
9
 
@@ -1,48 +1,35 @@
1
- import globals from '../globals';
2
- import { getThemeRefs } from '../../helpers/themeHelpers';
3
1
  import NewPassword from '../../components/descope-new-password/NewPassword';
4
2
 
5
- const globalRefs = getThemeRefs(globals);
6
-
7
3
  const vars = NewPassword.cssVarList;
8
4
 
9
5
  const newPassword = {
6
+ [vars.inputsGap]: '1em',
7
+
10
8
  _required: {
11
9
  [vars.requiredContent]: "'*'",
12
10
  },
13
11
 
14
- [vars.inputLabelTextColor]: globalRefs.colors.surface.contrast,
15
- [vars.inputTextColor]: globalRefs.colors.surface.contrast,
16
- [vars.placeholderTextColor]: globalRefs.colors.surface.main,
17
- [vars.inputsGap]: '1em',
12
+ _fullWidth: {
13
+ [vars.componentWidth]: '100%'
14
+ },
18
15
 
19
16
  size: {
20
17
  xs: {
21
- [vars.fieldsMargin]: '0',
18
+ [vars.fontSize]: '8px',
22
19
  },
23
20
  sm: {
24
- [vars.fieldsMargin]: '0',
21
+ [vars.fontSize]: '10px',
25
22
  },
26
23
  md: {
27
- [vars.fieldsMargin]: '0.5em',
24
+ [vars.fontSize]: '14px',
28
25
  },
29
26
  lg: {
30
- [vars.fieldsMargin]: '1em',
27
+ [vars.fontSize]: '20px',
31
28
  },
32
29
  xl: {
33
- [vars.fieldsMargin]: '2em',
34
- },
35
- },
36
-
37
- _fullWidth: {
38
- [vars.componentWidth]: '100%'
30
+ [vars.fontSize]: '25px',
31
+ }
39
32
  },
40
-
41
- _invalid: {
42
- [vars.inputLabelTextColor]: globalRefs.colors.error.main,
43
- [vars.inputTextColor]: globalRefs.colors.error.main,
44
- [vars.placeholderTextColor]: globalRefs.colors.error.light,
45
- }
46
33
  };
47
34
 
48
35
  export default newPassword;
@@ -12,8 +12,8 @@ const passcode = {
12
12
  [vars.padding]: '0',
13
13
  [vars.textAlign]: 'center',
14
14
  [vars.borderColor]: 'transparent',
15
- [vars.digitsGap]: '4px',
16
- [vars.focusedDigitFieldBorderColor]: globalRefs.colors.primary.main,
15
+ [vars.digitsGap]: '0',
16
+ [vars.focusedDigitFieldOutlineColor]: globalRefs.colors.surface.main,
17
17
  [vars.color]: globalRefs.colors.surface.contrast,
18
18
 
19
19
  _hideCursor: {
@@ -35,7 +35,7 @@ const passcode = {
35
35
  _invalid: {
36
36
  [vars.borderColor]: globalRefs.colors.error.main,
37
37
  [vars.color]: globalRefs.colors.error.main,
38
- [vars.focusedDigitFieldBorderColor]: globalRefs.colors.error.light,
38
+ [vars.focusedDigitFieldOutlineColor]: globalRefs.colors.error.light,
39
39
  },
40
40
  }
41
41
 
@@ -23,33 +23,29 @@ const passwordField = {
23
23
 
24
24
  [vars.pointerCursor]: 'pointer',
25
25
 
26
- [vars.padding]: `0`,
26
+ [vars.padding]: '0',
27
+ [vars.height]: '2em',
27
28
 
28
29
  size: {
29
30
  xs: {
30
- [vars.height]: '14px',
31
31
  [vars.fontSize]: '8px',
32
32
  },
33
33
  sm: {
34
- [vars.height]: '20px',
35
34
  [vars.fontSize]: '10px',
36
35
  },
37
36
  md: {
38
- [vars.height]: '30px',
39
37
  [vars.fontSize]: '14px',
40
38
  },
41
39
  lg: {
42
- [vars.height]: '40px',
43
40
  [vars.fontSize]: '20px',
44
41
  },
45
42
  xl: {
46
- [vars.height]: '50px',
47
43
  [vars.fontSize]: '25px',
48
44
  }
49
45
  },
50
46
 
51
47
  _bordered: {
52
- [vars.padding]: `0 0.5em`,
48
+ [vars.padding]: '0 0.5em',
53
49
  [vars.wrapperBorderColor]: globalRefs.colors.surface.main
54
50
  },
55
51
 
@@ -66,7 +62,7 @@ const passwordField = {
66
62
  [vars.inputTextColor]: globalRefs.colors.error.main,
67
63
  [vars.placeholderTextColor]: globalRefs.colors.error.light,
68
64
  [vars.wrapperBorderColor]: globalRefs.colors.error.main,
69
- [vars.outlineColor]: globalRefs.colors.error.main,
65
+ [vars.outlineColor]: globalRefs.colors.error.light,
70
66
  },
71
67
  };
72
68
 
@@ -9,39 +9,31 @@ const phoneField = {
9
9
  [vars.wrapperBorderStyle]: 'solid',
10
10
  [vars.wrapperBorderWidth]: '1px',
11
11
  [vars.wrapperBorderColor]: 'transparent',
12
- [vars.wrapperBorderRadius]: globalRefs.radius.sm,
12
+ [vars.wrapperBorderRadius]: globalRefs.radius.xs,
13
13
  [vars.placeholderColor]: globalRefs.colors.surface.main,
14
+ [vars.color]: globalRefs.colors.surface.contrast,
14
15
 
15
- [vars.padding]: '0',
16
+ [vars.phoneInputWidth]: '10em',
17
+ [vars.countryCodeInputWidth]: '5em',
16
18
 
17
- [vars.phoneInputWidth]: '15em',
18
- [vars.countryCodeInputWidth]: '7em',
19
+ [vars.inputHeight]: '2em',
20
+ [vars.countryCodeDropdownWidth]: '12em',
19
21
 
20
22
  size: {
21
23
  xs: {
22
- [vars.inputHeight]: '14px',
23
24
  [vars.fontSize]: '8px',
24
- [vars.countryCodeDropdownWidth]: '200px',
25
25
  },
26
26
  sm: {
27
- [vars.inputHeight]: '20px',
28
- [vars.fontSize]: '10px',
29
- [vars.countryCodeDropdownWidth]: '240px',
27
+ [vars.fontSize]: '20px',
30
28
  },
31
29
  md: {
32
- [vars.inputHeight]: '30px',
33
30
  [vars.fontSize]: '14px',
34
- [vars.countryCodeDropdownWidth]: '250px',
35
31
  },
36
32
  lg: {
37
- [vars.inputHeight]: '40px',
38
- [vars.fontSize]: '46px',
39
- [vars.countryCodeDropdownWidth]: '250px',
33
+ [vars.fontSize]: '20px',
40
34
  },
41
35
  xl: {
42
- [vars.inputHeight]: '50px',
43
36
  [vars.fontSize]: '25px',
44
- [vars.countryCodeDropdownWidth]: '400px',
45
37
  }
46
38
  },
47
39
 
@@ -8,7 +8,6 @@ const vars = Text.cssVarList;
8
8
 
9
9
  const text = {
10
10
  [vars.lineHeight]: '1em',
11
- [vars.display]: 'inline-block',
12
11
  [vars.textAlign]: 'left',
13
12
  [vars.color]: globalRefs.colors.surface.dark,
14
13
  variant: {
@@ -69,7 +68,6 @@ const text = {
69
68
  },
70
69
  _fullWidth: {
71
70
  [vars.width]: '100%',
72
- [vars.display]: 'block'
73
71
  },
74
72
  _italic: {
75
73
  [vars.fontStyle]: 'italic'
@@ -9,6 +9,7 @@ const textArea = {
9
9
  [vars.labelColor]: globalRefs.colors.surface.contrast,
10
10
  [vars.placeholderColor]: globalRefs.colors.surface.main,
11
11
  [vars.color]: globalRefs.colors.surface.contrast,
12
+ [vars.fontSize]: '14px',
12
13
 
13
14
  [vars.backgroundColor]: globalRefs.colors.surface.light,
14
15
  [vars.resize]: 'vertical',
@@ -20,7 +21,7 @@ const textArea = {
20
21
  [vars.outlineWidth]: '2px',
21
22
  [vars.outlineStyle]: 'solid',
22
23
  [vars.outlineColor]: 'transparent',
23
- [vars.outlineOffset]: '0px',
24
+ [vars.outlineOffset]: '0',
24
25
 
25
26
  _fullWidth: {
26
27
  [vars.width]: '100%'
@@ -40,7 +41,13 @@ const textArea = {
40
41
 
41
42
  _invalid: {
42
43
  [vars.labelColor]: globalRefs.colors.error.main,
43
- [vars.outlineColor]: globalRefs.colors.error.main
44
+ [vars.borderColor]: globalRefs.colors.error.main,
45
+ [vars.outlineColor]: globalRefs.colors.error.light,
46
+ [vars.placeholderColor]: globalRefs.colors.error.light,
47
+ },
48
+
49
+ _readonly: {
50
+ [vars.resize]: 'none',
44
51
  }
45
52
  };
46
53
 
@@ -13,30 +13,28 @@ export const textField = (vars) => ({
13
13
  [vars.outlineStyle]: 'solid',
14
14
  [vars.outlineColor]: 'transparent',
15
15
 
16
+ [vars.height]: '2em',
17
+
16
18
  size: {
17
19
  xs: {
18
- [vars.height]: '14px',
19
20
  [vars.fontSize]: '8px',
20
21
  },
21
22
  sm: {
22
- [vars.height]: '20px',
23
23
  [vars.fontSize]: '10px',
24
24
  },
25
25
  md: {
26
- [vars.height]: '30px',
27
26
  [vars.fontSize]: '14px',
28
27
  },
29
28
  lg: {
30
- [vars.height]: '40px',
31
29
  [vars.fontSize]: '20px',
32
30
  },
33
31
  xl: {
34
- [vars.height]: '50px',
35
32
  [vars.fontSize]: '25px',
36
33
  }
37
34
  },
38
35
 
39
36
  [vars.color]: globalRefs.colors.surface.contrast,
37
+ [vars.labelTextColor]: globalRefs.colors.surface.contrast,
40
38
  [vars.placeholderColor]: globalRefs.colors.surface.main,
41
39
 
42
40
  [vars.backgroundColor]: globalRefs.colors.surface.light,
package/dist/umd/0.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[0],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}};var a=s(8084);const o=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,r,a.Q)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#s(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#s()}}},1e3:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>L,wX:()=>b,QT:()=>C.Q,Iw:()=>S,dj:()=>f});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>t+`${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t))),this.#u(),this.#d(),this.#m()}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#p(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#p.bind(this)),this.#p()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#g(t,s){const i=this.#i?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#b(t=[]){for(const e of t)this.#c.includes(e)&&this.#g(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#u(){const s=document.createElement("style");s.id="style-mixin-mappings",s.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h))}))})),i.toString()})((0,n.E3)(e.componentName,this.#a),this.#h,t),this.#l.prepend(s)}#E(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#E(e.componentName),(0,r.FX)(this,this.#b.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}get isDraggable(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.isDraggable){const e=this.baseElement.getAttribute("tabindex");this.baseElement.setAttribute("tabindex","-1");const s=()=>{e?this.baseElement.setAttribute("tabindex",e):this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",s),t.target.removeEventListener("dragend",s)};t.target.addEventListener("mouseup",s,{once:!0}),t.target.addEventListener("dragend",s,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#f=m.C.bind(this,"blur");#A=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#f()})),this.baseElement.addEventListener("focus",(t=>{this.#A()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],b=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#S;constructor(){super(),this.#S=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#M(){const t=this.isReadOnly?{}:this.getValidity();this.#S.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#S.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#S.validity.valid}reportValidity(){return this.#S.reportValidity()}get validity(){return this.#S.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#S.setValidity({customError:!0},t,this.validationTarget):(this.#S.setValidity({}),this.#M())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#S.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#M()}init(){super.init?.(),this.addEventListener("change",this.#M),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#M),setTimeout((()=>this.#M()))}},E=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(b(t)){static get observedAttributes(){return[...t.observedAttributes||[],...E]}#C;#L=m.C.bind(this,"change");constructor(){super(),this.#C=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#C&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#C??=y(t)||y(e),this.#C}set inputElement(t){this.#C=t}getValidity(){return this.inputElement?.validity||{}}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#T(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#T())})),this.baseElement.addEventListener("change",(()=>{this.#L()})),this.#C.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#T())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#T()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#x;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#x=(s=t(this)).host||s}#N(){this.#x.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#x.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#x,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#N()}}},M=t=>class extends t{#L=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#L(),this.prevValue=this.value)}))}};var C=s(8084);const L=t=>class extends t{init(){this.#w(),super.init?.()}#w(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);