@descope/web-components-ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/cjs/index.cjs.js +18314 -0
  4. package/dist/cjs/index.cjs.js.map +1 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/index.d.ts +72 -0
  7. package/dist/index.esm.js +20157 -0
  8. package/dist/index.esm.js.map +1 -0
  9. package/dist/umd/1172.js +240 -0
  10. package/dist/umd/1172.js.LICENSE.txt +23 -0
  11. package/dist/umd/1396.js +37 -0
  12. package/dist/umd/1396.js.LICENSE.txt +11 -0
  13. package/dist/umd/1402.js +1 -0
  14. package/dist/umd/1484.js +148 -0
  15. package/dist/umd/1484.js.LICENSE.txt +17 -0
  16. package/dist/umd/189.js +338 -0
  17. package/dist/umd/189.js.LICENSE.txt +11 -0
  18. package/dist/umd/201.js +73 -0
  19. package/dist/umd/201.js.LICENSE.txt +23 -0
  20. package/dist/umd/2159.js +608 -0
  21. package/dist/umd/2159.js.LICENSE.txt +23 -0
  22. package/dist/umd/2540.js +1 -0
  23. package/dist/umd/2570.js +338 -0
  24. package/dist/umd/2570.js.LICENSE.txt +11 -0
  25. package/dist/umd/2666.js +148 -0
  26. package/dist/umd/2666.js.LICENSE.txt +11 -0
  27. package/dist/umd/2755.js +1 -0
  28. package/dist/umd/3110.js +275 -0
  29. package/dist/umd/3110.js.LICENSE.txt +23 -0
  30. package/dist/umd/3191.js +506 -0
  31. package/dist/umd/3191.js.LICENSE.txt +17 -0
  32. package/dist/umd/3437.js +2 -0
  33. package/dist/umd/3437.js.LICENSE.txt +15 -0
  34. package/dist/umd/3638.js +2 -0
  35. package/dist/umd/3638.js.LICENSE.txt +5 -0
  36. package/dist/umd/404.js +148 -0
  37. package/dist/umd/404.js.LICENSE.txt +17 -0
  38. package/dist/umd/4114.js +124 -0
  39. package/dist/umd/4114.js.LICENSE.txt +33 -0
  40. package/dist/umd/4127.js +449 -0
  41. package/dist/umd/4127.js.LICENSE.txt +17 -0
  42. package/dist/umd/4187.js +2 -0
  43. package/dist/umd/4187.js.LICENSE.txt +5 -0
  44. package/dist/umd/4218.js +129 -0
  45. package/dist/umd/4218.js.LICENSE.txt +23 -0
  46. package/dist/umd/4455.js +422 -0
  47. package/dist/umd/4455.js.LICENSE.txt +11 -0
  48. package/dist/umd/4480.js +1 -0
  49. package/dist/umd/4554.js +303 -0
  50. package/dist/umd/4554.js.LICENSE.txt +11 -0
  51. package/dist/umd/4574.js +400 -0
  52. package/dist/umd/4574.js.LICENSE.txt +23 -0
  53. package/dist/umd/4619.js +1 -0
  54. package/dist/umd/4902.js +170 -0
  55. package/dist/umd/4902.js.LICENSE.txt +23 -0
  56. package/dist/umd/507.js +279 -0
  57. package/dist/umd/507.js.LICENSE.txt +11 -0
  58. package/dist/umd/5096.js +109 -0
  59. package/dist/umd/5096.js.LICENSE.txt +5 -0
  60. package/dist/umd/5318.js +1 -0
  61. package/dist/umd/5414.js +2 -0
  62. package/dist/umd/5414.js.LICENSE.txt +1 -0
  63. package/dist/umd/5563.js +319 -0
  64. package/dist/umd/5563.js.LICENSE.txt +55 -0
  65. package/dist/umd/7097.js +338 -0
  66. package/dist/umd/7097.js.LICENSE.txt +11 -0
  67. package/dist/umd/7150.js +2 -0
  68. package/dist/umd/7150.js.LICENSE.txt +485 -0
  69. package/dist/umd/731.js +832 -0
  70. package/dist/umd/731.js.LICENSE.txt +17 -0
  71. package/dist/umd/742.js +2 -0
  72. package/dist/umd/742.js.LICENSE.txt +21 -0
  73. package/dist/umd/7979.js +419 -0
  74. package/dist/umd/7979.js.LICENSE.txt +11 -0
  75. package/dist/umd/8823.js +1 -0
  76. package/dist/umd/9030.js +381 -0
  77. package/dist/umd/9030.js.LICENSE.txt +17 -0
  78. package/dist/umd/9243.js +202 -0
  79. package/dist/umd/9243.js.LICENSE.txt +51 -0
  80. package/dist/umd/9478.js +338 -0
  81. package/dist/umd/9478.js.LICENSE.txt +11 -0
  82. package/dist/umd/DescopeDev.js +1 -0
  83. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -0
  84. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -0
  85. package/dist/umd/boolean-fields-descope-checkbox-index-js.js.LICENSE.txt +5 -0
  86. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -0
  87. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt +5 -0
  88. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -0
  89. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -0
  90. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -0
  91. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -0
  92. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -0
  93. package/dist/umd/descope-alert-index-js.js +1 -0
  94. package/dist/umd/descope-apps-list-index-js.js +1 -0
  95. package/dist/umd/descope-avatar.js +1 -0
  96. package/dist/umd/descope-badge-index-js.js +1 -0
  97. package/dist/umd/descope-button-index-js.js +338 -0
  98. package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
  99. package/dist/umd/descope-code-snippet-index-js.js +1 -0
  100. package/dist/umd/descope-combo-box-index-js.js +113 -0
  101. package/dist/umd/descope-combo-box-index-js.js.LICENSE.txt +11 -0
  102. package/dist/umd/descope-container-index-js.js +1 -0
  103. package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -0
  104. package/dist/umd/descope-date-field-index-js.js +1 -0
  105. package/dist/umd/descope-divider-index-js.js +1 -0
  106. package/dist/umd/descope-email-field-index-js.js +54 -0
  107. package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
  108. package/dist/umd/descope-enriched-text-index-js.js +1 -0
  109. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -0
  110. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt +17 -0
  111. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +105 -0
  112. package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js.LICENSE.txt +29 -0
  113. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -0
  114. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
  115. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -0
  116. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
  117. package/dist/umd/descope-grid-index-js.js +1 -0
  118. package/dist/umd/descope-hybrid-field-index-js.js +19 -0
  119. package/dist/umd/descope-hybrid-field-index-js.js.LICENSE.txt +5 -0
  120. package/dist/umd/descope-icon-index-js.js +1 -0
  121. package/dist/umd/descope-image-index-js.js +1 -0
  122. package/dist/umd/descope-link-index-js.js +1 -0
  123. package/dist/umd/descope-list-index-js.js +1 -0
  124. package/dist/umd/descope-loader-linear-index-js.js +1 -0
  125. package/dist/umd/descope-loader-radial-index-js.js +1 -0
  126. package/dist/umd/descope-logo-index-js.js +1 -0
  127. package/dist/umd/descope-modal-index-js.js +1 -0
  128. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -0
  129. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -0
  130. package/dist/umd/descope-new-password-index-js.js +1 -0
  131. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -0
  132. package/dist/umd/descope-notification-index-js.js +1 -0
  133. package/dist/umd/descope-notp-image-index-js.js +1 -0
  134. package/dist/umd/descope-number-field-index-js.js +1 -0
  135. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -0
  136. package/dist/umd/descope-passcode-index-js.js +1 -0
  137. package/dist/umd/descope-password-index-js.js +1 -0
  138. package/dist/umd/descope-policy-validation-index-js.js +1 -0
  139. package/dist/umd/descope-radio-group-index-js.js +1 -0
  140. package/dist/umd/descope-recaptcha-index-js.js +1 -0
  141. package/dist/umd/descope-scopes-list-index-js.js +2 -0
  142. package/dist/umd/descope-scopes-list-index-js.js.LICENSE.txt +5 -0
  143. package/dist/umd/descope-security-questions-setup-index-js.js +1 -0
  144. package/dist/umd/descope-security-questions-verify-index-js.js +37 -0
  145. package/dist/umd/descope-security-questions-verify-index-js.js.LICENSE.txt +11 -0
  146. package/dist/umd/descope-text-area-index-js.js +1 -0
  147. package/dist/umd/descope-text-field-index-js.js +37 -0
  148. package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
  149. package/dist/umd/descope-text.js +1 -0
  150. package/dist/umd/descope-third-party-app-logo-index-js.js +1 -0
  151. package/dist/umd/descope-totp-image-index-js.js +1 -0
  152. package/dist/umd/descope-upload-file-index-js.js +1 -0
  153. package/dist/umd/descope-user-attribute-index-js.js +1 -0
  154. package/dist/umd/descope-user-auth-method-index-js.js +1 -0
  155. package/dist/umd/index.js +1 -0
  156. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -0
  157. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -0
  158. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -0
  159. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -0
  160. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -0
  161. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -0
  162. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -0
  163. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -0
  164. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
  165. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +148 -0
  166. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js.LICENSE.txt +17 -0
  167. package/node_modules/common/.eslintrc.json +18 -0
  168. package/node_modules/common/README.md +7 -0
  169. package/node_modules/common/package.json +34 -0
  170. package/node_modules/common/project.json +7 -0
  171. package/node_modules/common/src/baseClasses/baseClasses/createBaseClass.js +66 -0
  172. package/node_modules/common/src/baseClasses/baseClasses/createBaseInputClass.js +14 -0
  173. package/node_modules/common/src/baseClasses/baseClasses/createCssVarImageClass.js +55 -0
  174. package/node_modules/common/src/baseClasses/index.js +3 -0
  175. package/node_modules/common/src/componentsHelpers/index.js +95 -0
  176. package/node_modules/common/src/componentsMixins/helpers/mixinsHelpers.js +10 -0
  177. package/node_modules/common/src/componentsMixins/index.js +1 -0
  178. package/node_modules/common/src/componentsMixins/mixins/activableMixin.js +14 -0
  179. package/node_modules/common/src/componentsMixins/mixins/changeMixin.js +22 -0
  180. package/node_modules/common/src/componentsMixins/mixins/componentNameValidationMixin.js +23 -0
  181. package/node_modules/common/src/componentsMixins/mixins/componentsContextMixin.js +12 -0
  182. package/node_modules/common/src/componentsMixins/mixins/createDynamicDataMixin.js +100 -0
  183. package/node_modules/common/src/componentsMixins/mixins/createProxy.js +58 -0
  184. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/helpers.js +106 -0
  185. package/node_modules/common/src/componentsMixins/mixins/createStyleMixin/index.js +167 -0
  186. package/node_modules/common/src/componentsMixins/mixins/draggableMixin.js +62 -0
  187. package/node_modules/common/src/componentsMixins/mixins/externalInputHelpers.js +93 -0
  188. package/node_modules/common/src/componentsMixins/mixins/externalInputMixin.js +170 -0
  189. package/node_modules/common/src/componentsMixins/mixins/hoverableMixin.js +13 -0
  190. package/node_modules/common/src/componentsMixins/mixins/index.js +14 -0
  191. package/node_modules/common/src/componentsMixins/mixins/inputEventsDispatchingMixin.js +76 -0
  192. package/node_modules/common/src/componentsMixins/mixins/inputValidationMixin.js +210 -0
  193. package/node_modules/common/src/componentsMixins/mixins/lifecycleEventsMixin.js +23 -0
  194. package/node_modules/common/src/componentsMixins/mixins/normalizeBooleanAttributesMixin.js +57 -0
  195. package/node_modules/common/src/componentsMixins/mixins/portalMixin.js +112 -0
  196. package/node_modules/common/src/componentsMixins/mixins/proxyInputMixin.js +242 -0
  197. package/node_modules/common/src/constants.js +4 -0
  198. package/node_modules/common/src/icons/errorMessageIconBase64.js +1 -0
  199. package/node_modules/common/src/sbControls.js +302 -0
  200. package/node_modules/common/src/themeHelpers/colorsHelpers.js +94 -0
  201. package/node_modules/common/src/themeHelpers/componentsThemeManager.js +45 -0
  202. package/node_modules/common/src/themeHelpers/index.js +176 -0
  203. package/node_modules/common/src/utils/index.js +68 -0
  204. package/node_modules/descope-avatar/e2e/descope-avatar.spec.ts +54 -0
  205. package/node_modules/descope-avatar/package.json +34 -0
  206. package/node_modules/descope-avatar/project.json +7 -0
  207. package/node_modules/descope-avatar/src/component/AvatarClass.js +109 -0
  208. package/node_modules/descope-avatar/src/component/index.js +8 -0
  209. package/node_modules/descope-avatar/src/theme.js +44 -0
  210. package/node_modules/descope-avatar/stories/avatar.jpeg +0 -0
  211. package/node_modules/descope-avatar/stories/descope-avatar.stories.js +32 -0
  212. package/node_modules/descope-text/e2e/descope-text.spec.ts +35 -0
  213. package/node_modules/descope-text/package.json +31 -0
  214. package/node_modules/descope-text/project.json +7 -0
  215. package/node_modules/descope-text/src/component/TextClass.js +63 -0
  216. package/node_modules/descope-text/src/component/index.js +5 -0
  217. package/node_modules/descope-text/src/theme.js +91 -0
  218. package/node_modules/descope-text/stories/descope-text.stories.js +55 -0
  219. package/package.json +151 -0
  220. package/src/baseClasses/createBaseClass.js +66 -0
  221. package/src/baseClasses/createBaseInputClass.js +16 -0
  222. package/src/baseClasses/createCssVarImageClass.js +53 -0
  223. package/src/components/boolean-fields/booleanFieldMixin.js +36 -0
  224. package/src/components/boolean-fields/commonStyles.js +50 -0
  225. package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +77 -0
  226. package/src/components/boolean-fields/descope-boolean-field-internal/index.js +3 -0
  227. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +133 -0
  228. package/src/components/boolean-fields/descope-checkbox/index.js +8 -0
  229. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +154 -0
  230. package/src/components/boolean-fields/descope-switch-toggle/index.js +8 -0
  231. package/src/components/button-selection-group-fields/baseButtonSelectionGroup.js +171 -0
  232. package/src/components/button-selection-group-fields/createBaseButtonSelectionGroupInternalClass.js +101 -0
  233. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/ButtonMultiSelectionGroupClass.js +67 -0
  234. package/src/components/button-selection-group-fields/descope-button-multi-selection-group/index.js +7 -0
  235. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/ButtonMultiSelectionGroupInternalClass.js +108 -0
  236. package/src/components/button-selection-group-fields/descope-button-multi-selection-group-internal/index.js +8 -0
  237. package/src/components/button-selection-group-fields/descope-button-selection-group/ButtonSelectionGroupClass.js +67 -0
  238. package/src/components/button-selection-group-fields/descope-button-selection-group/index.js +7 -0
  239. package/src/components/button-selection-group-fields/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +77 -0
  240. package/src/components/button-selection-group-fields/descope-button-selection-group-internal/index.js +8 -0
  241. package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +115 -0
  242. package/src/components/button-selection-group-fields/descope-button-selection-group-item/index.js +6 -0
  243. package/src/components/descope-alert/AlertClass.js +105 -0
  244. package/src/components/descope-alert/index.js +6 -0
  245. package/src/components/descope-apps-list/AppsListClass.js +97 -0
  246. package/src/components/descope-apps-list/index.js +8 -0
  247. package/src/components/descope-badge/BadgeClass.js +57 -0
  248. package/src/components/descope-badge/index.js +5 -0
  249. package/src/components/descope-button/ButtonClass.js +163 -0
  250. package/src/components/descope-button/clickableMixin.js +10 -0
  251. package/src/components/descope-button/index.js +6 -0
  252. package/src/components/descope-code-snippet/CodeSnippetClass.js +238 -0
  253. package/src/components/descope-code-snippet/helpers.js +9 -0
  254. package/src/components/descope-code-snippet/index.js +5 -0
  255. package/src/components/descope-combo-box/ComboBoxClass.js +543 -0
  256. package/src/components/descope-combo-box/index.js +6 -0
  257. package/src/components/descope-container/ContainerClass.js +65 -0
  258. package/src/components/descope-container/index.js +5 -0
  259. package/src/components/descope-date-field/DateCounterClass.js +83 -0
  260. package/src/components/descope-date-field/DateFieldClass.js +702 -0
  261. package/src/components/descope-date-field/consts.js +55 -0
  262. package/src/components/descope-date-field/descope-calendar/CalendarClass.js +668 -0
  263. package/src/components/descope-date-field/descope-calendar/helpers.js +186 -0
  264. package/src/components/descope-date-field/descope-calendar/index.js +9 -0
  265. package/src/components/descope-date-field/formats.js +49 -0
  266. package/src/components/descope-date-field/helpers.js +72 -0
  267. package/src/components/descope-date-field/icons.js +14 -0
  268. package/src/components/descope-date-field/index.js +10 -0
  269. package/src/components/descope-divider/DividerClass.js +105 -0
  270. package/src/components/descope-divider/index.js +6 -0
  271. package/src/components/descope-email-field/EmailFieldClass.js +90 -0
  272. package/src/components/descope-email-field/index.js +6 -0
  273. package/src/components/descope-enriched-text/EnrichedTextClass.js +204 -0
  274. package/src/components/descope-enriched-text/consts.js +14 -0
  275. package/src/components/descope-enriched-text/helpers.js +5 -0
  276. package/src/components/descope-enriched-text/index.js +5 -0
  277. package/src/components/descope-grid/GridClass.js +368 -0
  278. package/src/components/descope-grid/descope-grid-custom-column/GridCustomColumnClass.js +31 -0
  279. package/src/components/descope-grid/descope-grid-custom-column/index.js +7 -0
  280. package/src/components/descope-grid/descope-grid-item-details-column/GridItemDetailsColumnClass.js +37 -0
  281. package/src/components/descope-grid/descope-grid-item-details-column/index.js +8 -0
  282. package/src/components/descope-grid/descope-grid-selection-column/GridSelectionColumnClass.js +58 -0
  283. package/src/components/descope-grid/descope-grid-selection-column/index.js +7 -0
  284. package/src/components/descope-grid/descope-grid-text-column/GridTextColumnClass.js +26 -0
  285. package/src/components/descope-grid/descope-grid-text-column/index.js +6 -0
  286. package/src/components/descope-grid/helpers.js +74 -0
  287. package/src/components/descope-grid/index.js +12 -0
  288. package/src/components/descope-hybrid-field/HybridFieldClass.js +363 -0
  289. package/src/components/descope-hybrid-field/helpers.js +5 -0
  290. package/src/components/descope-hybrid-field/index.js +9 -0
  291. package/src/components/descope-icon/IconClass.js +82 -0
  292. package/src/components/descope-icon/helpers.js +51 -0
  293. package/src/components/descope-icon/index.js +5 -0
  294. package/src/components/descope-image/ImageClass.js +48 -0
  295. package/src/components/descope-image/index.js +5 -0
  296. package/src/components/descope-link/LinkClass.js +71 -0
  297. package/src/components/descope-link/index.js +6 -0
  298. package/src/components/descope-list/ListClass.js +154 -0
  299. package/src/components/descope-list/ListItemClass.js +56 -0
  300. package/src/components/descope-list/index.js +7 -0
  301. package/src/components/descope-loader-linear/LoaderLinearClass.js +69 -0
  302. package/src/components/descope-loader-linear/index.js +5 -0
  303. package/src/components/descope-loader-radial/LoaderRadialClass.js +50 -0
  304. package/src/components/descope-loader-radial/index.js +5 -0
  305. package/src/components/descope-logo/LogoClass.js +10 -0
  306. package/src/components/descope-logo/index.js +5 -0
  307. package/src/components/descope-modal/ModalClass.js +112 -0
  308. package/src/components/descope-modal/index.js +6 -0
  309. package/src/components/descope-multi-select-combo-box/MultiSelectComboBoxClass.js +676 -0
  310. package/src/components/descope-multi-select-combo-box/index.js +6 -0
  311. package/src/components/descope-new-password/NewPasswordClass.js +218 -0
  312. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +246 -0
  313. package/src/components/descope-new-password/descope-new-password-internal/componentName.js +3 -0
  314. package/src/components/descope-new-password/descope-new-password-internal/index.js +4 -0
  315. package/src/components/descope-new-password/index.js +9 -0
  316. package/src/components/descope-notification/NotificationClass.js +107 -0
  317. package/src/components/descope-notification/descope-notification-card/NotificationCardClass.js +115 -0
  318. package/src/components/descope-notification/descope-notification-card/index.js +6 -0
  319. package/src/components/descope-notification/descope-notification-container.js +13 -0
  320. package/src/components/descope-notification/index.js +8 -0
  321. package/src/components/descope-notp-image/NotpImageClass.js +10 -0
  322. package/src/components/descope-notp-image/index.js +5 -0
  323. package/src/components/descope-number-field/NumberFieldClass.js +54 -0
  324. package/src/components/descope-number-field/index.js +6 -0
  325. package/src/components/descope-passcode/PasscodeClass.js +209 -0
  326. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +231 -0
  327. package/src/components/descope-passcode/descope-passcode-internal/helpers.js +41 -0
  328. package/src/components/descope-passcode/descope-passcode-internal/index.js +3 -0
  329. package/src/components/descope-passcode/index.js +8 -0
  330. package/src/components/descope-password/PasswordClass.js +302 -0
  331. package/src/components/descope-password/index.js +6 -0
  332. package/src/components/descope-password/passwordDraggableMixin.js +40 -0
  333. package/src/components/descope-policy-validation/PolicyValidationClass.js +220 -0
  334. package/src/components/descope-policy-validation/helpers.js +2 -0
  335. package/src/components/descope-policy-validation/index.js +5 -0
  336. package/src/components/descope-radio-group/RadioButtonClass.js +77 -0
  337. package/src/components/descope-radio-group/RadioGroupClass.js +192 -0
  338. package/src/components/descope-radio-group/index.js +8 -0
  339. package/src/components/descope-recaptcha/RecaptchaClass.js +230 -0
  340. package/src/components/descope-recaptcha/index.js +5 -0
  341. package/src/components/descope-scopes-list/ScopesListClass.js +131 -0
  342. package/src/components/descope-scopes-list/index.js +7 -0
  343. package/src/components/descope-security-questions-setup/SecurityQuestionsSetupClass.js +240 -0
  344. package/src/components/descope-security-questions-setup/index.js +7 -0
  345. package/src/components/descope-security-questions-verify/SecurityQuestionsVerifyClass.js +232 -0
  346. package/src/components/descope-security-questions-verify/index.js +7 -0
  347. package/src/components/descope-text-area/TextAreaClass.js +102 -0
  348. package/src/components/descope-text-area/index.js +6 -0
  349. package/src/components/descope-text-field/TextFieldClass.js +142 -0
  350. package/src/components/descope-text-field/index.js +9 -0
  351. package/src/components/descope-text-field/textFieldMappings.js +151 -0
  352. package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +103 -0
  353. package/src/components/descope-third-party-app-logo/arrows.svg +4 -0
  354. package/src/components/descope-third-party-app-logo/index.js +7 -0
  355. package/src/components/descope-totp-image/TotpImageClass.js +10 -0
  356. package/src/components/descope-totp-image/index.js +5 -0
  357. package/src/components/descope-upload-file/UploadFileClass.js +236 -0
  358. package/src/components/descope-upload-file/helpers.js +11 -0
  359. package/src/components/descope-upload-file/index.js +6 -0
  360. package/src/components/descope-user-attribute/UserAttributeClass.js +245 -0
  361. package/src/components/descope-user-attribute/delete.svg +3 -0
  362. package/src/components/descope-user-attribute/edit.svg +3 -0
  363. package/src/components/descope-user-attribute/index.js +9 -0
  364. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +204 -0
  365. package/src/components/descope-user-auth-method/green-v.svg +3 -0
  366. package/src/components/descope-user-auth-method/index.js +9 -0
  367. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +188 -0
  368. package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/MappingItem.js +167 -0
  369. package/src/components/mapping-fields/descope-mappings-field/descope-mapping-item/index.js +3 -0
  370. package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/MappingsFieldInternal.js +257 -0
  371. package/src/components/mapping-fields/descope-mappings-field/descope-mappings-field-internal/index.js +3 -0
  372. package/src/components/mapping-fields/descope-mappings-field/index.js +14 -0
  373. package/src/components/mapping-fields/descope-saml-group-mappings/SamlGroupMappingsClass.js +116 -0
  374. package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/SamlGroupMappingsInternal.js +136 -0
  375. package/src/components/mapping-fields/descope-saml-group-mappings/descope-saml-group-mappings-internal/index.js +3 -0
  376. package/src/components/mapping-fields/descope-saml-group-mappings/index.js +10 -0
  377. package/src/components/phone-fields/CountryCodes.js +1215 -0
  378. package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +313 -0
  379. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +272 -0
  380. package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/index.js +6 -0
  381. package/src/components/phone-fields/descope-phone-field/helpers.js +52 -0
  382. package/src/components/phone-fields/descope-phone-field/index.js +9 -0
  383. package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +236 -0
  384. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/PhoneFieldInternalInputBox.js +172 -0
  385. package/src/components/phone-fields/descope-phone-input-box-field/descope-phone-input-box-internal/index.js +5 -0
  386. package/src/components/phone-fields/descope-phone-input-box-field/index.js +9 -0
  387. package/src/components/phone-fields/helpers.js +5 -0
  388. package/src/constants.js +4 -0
  389. package/src/darkTheme.js +52 -0
  390. package/src/dev/index.js +3 -0
  391. package/src/helpers/componentHelpers.js +95 -0
  392. package/src/helpers/index.js +68 -0
  393. package/src/helpers/mixinsHelpers.js +10 -0
  394. package/src/helpers/themeHelpers/colorsHelpers.js +94 -0
  395. package/src/helpers/themeHelpers/index.js +175 -0
  396. package/src/helpers/themeHelpers/resetHelpers.js +144 -0
  397. package/src/index.cjs.js +60 -0
  398. package/src/index.d.ts +72 -0
  399. package/src/index.js +62 -0
  400. package/src/index.umd.js +28 -0
  401. package/src/mixins/activableMixin.js +14 -0
  402. package/src/mixins/changeMixin.js +22 -0
  403. package/src/mixins/componentNameValidationMixin.js +23 -0
  404. package/src/mixins/componentsContextMixin.js +12 -0
  405. package/src/mixins/createDynamicDataMixin.js +100 -0
  406. package/src/mixins/createProxy.js +58 -0
  407. package/src/mixins/createStyleMixin/helpers.js +106 -0
  408. package/src/mixins/createStyleMixin/index.js +167 -0
  409. package/src/mixins/draggableMixin.js +62 -0
  410. package/src/mixins/externalInputHelpers.js +93 -0
  411. package/src/mixins/externalInputMixin.js +170 -0
  412. package/src/mixins/hoverableMixin.js +13 -0
  413. package/src/mixins/index.js +13 -0
  414. package/src/mixins/inputEventsDispatchingMixin.js +76 -0
  415. package/src/mixins/inputValidationMixin.js +210 -0
  416. package/src/mixins/lifecycleEventsMixin.js +23 -0
  417. package/src/mixins/normalizeBooleanAttributesMixin.js +59 -0
  418. package/src/mixins/portalMixin.js +111 -0
  419. package/src/mixins/proxyInputMixin.js +242 -0
  420. package/src/theme/components/alert.js +88 -0
  421. package/src/theme/components/appsList.js +36 -0
  422. package/src/theme/components/badge.js +71 -0
  423. package/src/theme/components/button.js +133 -0
  424. package/src/theme/components/buttonSelectionGroup/baseButtonSelectionGroup.js +23 -0
  425. package/src/theme/components/buttonSelectionGroup/buttonMultiSelectionGroup.js +11 -0
  426. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +11 -0
  427. package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +34 -0
  428. package/src/theme/components/calendar.js +91 -0
  429. package/src/theme/components/checkbox.js +39 -0
  430. package/src/theme/components/codeSnippet.js +145 -0
  431. package/src/theme/components/comboBox.js +93 -0
  432. package/src/theme/components/container.js +127 -0
  433. package/src/theme/components/dateField.js +32 -0
  434. package/src/theme/components/divider.js +49 -0
  435. package/src/theme/components/emailField.js +50 -0
  436. package/src/theme/components/enrichedText.js +40 -0
  437. package/src/theme/components/grid.js +52 -0
  438. package/src/theme/components/hybridField.js +22 -0
  439. package/src/theme/components/icon.js +7 -0
  440. package/src/theme/components/image.js +8 -0
  441. package/src/theme/components/index.js +124 -0
  442. package/src/theme/components/inputWrapper.js +130 -0
  443. package/src/theme/components/link.js +36 -0
  444. package/src/theme/components/list/list.js +56 -0
  445. package/src/theme/components/list/listItem.js +41 -0
  446. package/src/theme/components/loader/index.js +4 -0
  447. package/src/theme/components/loader/loaderLinear.js +45 -0
  448. package/src/theme/components/loader/loaderRadial.js +57 -0
  449. package/src/theme/components/logo.js +10 -0
  450. package/src/theme/components/mappingsField.js +30 -0
  451. package/src/theme/components/modal.js +19 -0
  452. package/src/theme/components/multiSelectComboBox.js +86 -0
  453. package/src/theme/components/newPassword.js +40 -0
  454. package/src/theme/components/notificationCard.js +54 -0
  455. package/src/theme/components/notpImage.js +10 -0
  456. package/src/theme/components/numberField.js +50 -0
  457. package/src/theme/components/passcode.js +47 -0
  458. package/src/theme/components/password.js +55 -0
  459. package/src/theme/components/phoneField.js +44 -0
  460. package/src/theme/components/phoneInputBoxField.js +50 -0
  461. package/src/theme/components/policyValidation.js +29 -0
  462. package/src/theme/components/radioGroup/radioButton.js +44 -0
  463. package/src/theme/components/radioGroup/radioGroup.js +42 -0
  464. package/src/theme/components/samlGroupMappings.js +20 -0
  465. package/src/theme/components/scopesList.js +15 -0
  466. package/src/theme/components/securityQuestionsSetup.js +12 -0
  467. package/src/theme/components/securityQuestionsVerify.js +16 -0
  468. package/src/theme/components/switchToggle.js +77 -0
  469. package/src/theme/components/textArea.js +48 -0
  470. package/src/theme/components/textField.js +63 -0
  471. package/src/theme/components/thirdPartyAppLogo.js +36 -0
  472. package/src/theme/components/totpImage.js +10 -0
  473. package/src/theme/components/uploadFile.js +66 -0
  474. package/src/theme/components/userAttribute.js +20 -0
  475. package/src/theme/components/userAuthMethod.js +20 -0
  476. package/src/theme/globals.js +181 -0
  477. package/src/theme/index.js +5 -0
@@ -0,0 +1,236 @@
1
+ import { componentName as descopeInternalComponentName } from './descope-phone-input-box-internal/PhoneFieldInternalInputBox';
2
+ import { forwardAttrs, getComponentName } from '../../../helpers/componentHelpers';
3
+ import { compose } from '../../../helpers';
4
+ import { createProxy, createStyleMixin, draggableMixin, proxyInputMixin } from '../../../mixins';
5
+ import { TextFieldClass } from '../../descope-text-field/TextFieldClass';
6
+ import CountryCodes from '../CountryCodes';
7
+ import {
8
+ resetInputLabelPosition,
9
+ resetInputCursor,
10
+ resetInputFieldDefaultWidth,
11
+ resetInputFieldInvalidBackgroundColor,
12
+ useHostExternalPadding,
13
+ inputFloatingLabelStyle,
14
+ } from '../../../helpers/themeHelpers/resetHelpers';
15
+
16
+ const textVars = TextFieldClass.cssVarList;
17
+
18
+ export const componentName = getComponentName('phone-input-box-field');
19
+
20
+ const customMixin = (superclass) =>
21
+ class PhoneInputBoxFieldMixinClass extends superclass {
22
+ static get CountryCodes() {
23
+ return CountryCodes;
24
+ }
25
+
26
+ init() {
27
+ super.init?.();
28
+
29
+ const template = document.createElement('template');
30
+
31
+ template.innerHTML = `
32
+ <${descopeInternalComponentName}
33
+ tabindex="-1"
34
+ slot="input"
35
+ ></${descopeInternalComponentName}>
36
+ `;
37
+
38
+ this.baseElement.appendChild(template.content.cloneNode(true));
39
+
40
+ this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);
41
+
42
+ forwardAttrs(this.shadowRoot.host, this.inputElement, {
43
+ includeAttrs: [
44
+ 'size',
45
+ 'bordered',
46
+ 'invalid',
47
+ 'minlength',
48
+ 'maxlength',
49
+ 'default-code',
50
+ 'disabled',
51
+ 'phone-input-placeholder',
52
+ 'label',
53
+ 'label-type',
54
+ 'allow-alphanumeric-input',
55
+ ],
56
+ });
57
+ }
58
+
59
+ get phoneNumberInputEle() {
60
+ return this.inputElement?.phoneNumberInputEle;
61
+ }
62
+ };
63
+
64
+ const {
65
+ host,
66
+ label,
67
+ inputElement,
68
+ requiredIndicator,
69
+ inputField,
70
+ inputFieldInternal,
71
+ phoneInput,
72
+ errorMessage,
73
+ helperText,
74
+ } = {
75
+ host: { selector: () => ':host' },
76
+ label: { selector: '::part(label)' },
77
+ placeholder: { selector: '> input:placeholder-shown' },
78
+ inputElement: { selector: 'input' },
79
+ requiredIndicator: { selector: '[required]::part(required-indicator)::after' },
80
+ inputField: { selector: () => 'vaadin-text-field::part(input-field)' },
81
+ inputFieldInternal: {
82
+ selector: () => 'descope-phone-field-internal-input-box vaadin-text-field::part(input-field)',
83
+ },
84
+ phoneInput: { selector: () => 'descope-text-field' },
85
+ helperText: { selector: '::part(helper-text)' },
86
+ errorMessage: { selector: '::part(error-message)' },
87
+ };
88
+
89
+ export const PhoneFieldInputBoxClass = compose(
90
+ createStyleMixin({
91
+ mappings: {
92
+ fontSize: [
93
+ host,
94
+ inputField,
95
+ {
96
+ selector: TextFieldClass.componentName,
97
+ property: TextFieldClass.cssVarList.fontSize,
98
+ },
99
+ ],
100
+ fontFamily: [label, errorMessage, helperText],
101
+ hostWidth: { ...host, property: 'width' },
102
+ hostMinWidth: { ...host, property: 'min-width' },
103
+ hostDirection: { ...host, property: 'direction' },
104
+
105
+ inputBorderStyle: { ...inputFieldInternal, property: 'border-style' },
106
+ inputBorderWidth: { ...inputFieldInternal, property: 'border-width' },
107
+ inputBorderColor: { ...inputFieldInternal, property: 'border-color' },
108
+ inputBorderRadius: [
109
+ { ...inputField, property: 'border-radius' },
110
+ { ...inputFieldInternal, property: 'border-radius' },
111
+ ],
112
+
113
+ inputHorizontalPadding: [
114
+ { ...phoneInput, property: 'padding-left' },
115
+ { ...phoneInput, property: 'padding-right' },
116
+ ],
117
+
118
+ labelFontSize: { ...label, property: 'font-size' },
119
+ labelFontWeight: { ...label, property: 'font-weight' },
120
+ labelTextColor: [
121
+ { ...label, property: 'color' },
122
+ { ...requiredIndicator, property: 'color' },
123
+ ],
124
+ labelRequiredIndicator: { ...requiredIndicator, property: 'content' },
125
+ errorMessageTextColor: { ...errorMessage, property: 'color' },
126
+
127
+ errorMessageIcon: { ...errorMessage, property: 'background-image' },
128
+ errorMessageIconSize: { ...errorMessage, property: 'background-size' },
129
+ errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },
130
+ errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },
131
+ errorMessageIconPosition: { ...errorMessage, property: 'background-position' },
132
+
133
+ inputValueTextColor: { ...phoneInput, property: textVars.inputValueTextColor },
134
+
135
+ inputPlaceholderTextColor: { ...phoneInput, property: textVars.inputPlaceholderColor },
136
+
137
+ inputOutlineStyle: { ...inputField, property: 'outline-style' },
138
+ inputOutlineColor: { ...inputField, property: 'outline-color' },
139
+ inputOutlineWidth: { ...inputField, property: 'outline-width' },
140
+ inputOutlineOffset: { ...inputField, property: 'outline-offset' },
141
+
142
+ labelPosition: { ...label, property: 'position' },
143
+ labelTopPosition: { ...label, property: 'top' },
144
+ labelHorizontalPosition: [
145
+ { ...label, property: 'left' },
146
+ { ...label, property: 'right' },
147
+ ],
148
+ inputTransformY: { ...label, property: 'transform' },
149
+ inputTransition: { ...label, property: 'transition' },
150
+ marginInlineStart: { ...label, property: 'margin-inline-start' },
151
+ valueInputHeight: { ...inputElement, property: 'height' },
152
+ valueInputMarginBottom: {
153
+ selector: TextFieldClass.componentName,
154
+ property: textVars.valueInputMarginBottom,
155
+ },
156
+ },
157
+ }),
158
+ draggableMixin,
159
+ proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),
160
+ customMixin
161
+ )(
162
+ createProxy({
163
+ slots: [],
164
+ wrappedEleName: 'vaadin-text-field',
165
+ style: () => `
166
+ :host {
167
+ display: inline-flex;
168
+ max-width: 100%;
169
+ box-sizing: border-box;
170
+ }
171
+ ${useHostExternalPadding(PhoneFieldInputBoxClass.cssVarList)}
172
+ ${resetInputCursor('vaadin-text-field')}
173
+ ${resetInputFieldInvalidBackgroundColor('vaadin-text-field')}
174
+ ${resetInputFieldDefaultWidth()}
175
+
176
+ vaadin-text-field {
177
+ width: 100%;
178
+ box-sizing: border-box;
179
+ padding: 0;
180
+ }
181
+ vaadin-text-field[focus-ring]::part(input-field) {
182
+ box-shadow: none;
183
+ }
184
+ vaadin-text-field::before {
185
+ height: 0;
186
+ }
187
+ vaadin-text-field::part(input-field) {
188
+ padding: 0;
189
+ background: transparent;
190
+ overflow: hidden;
191
+ -webkit-mask-image: none;
192
+ }
193
+ descope-phone-field-internal-input-box {
194
+ -webkit-mask-image: none;
195
+ padding: 0;
196
+ width: 100%;
197
+ }
198
+ descope-phone-field-internal-input-box > div {
199
+ width: 100%;
200
+ }
201
+ descope-phone-field-internal-input-box .separator {
202
+ flex: 0;
203
+ border: none;
204
+ }
205
+ descope-phone-field-internal-input-box descope-text-field {
206
+ ${textVars.inputOutlineWidth}: 0;
207
+ ${textVars.inputOutlineOffset}: 0;
208
+ }
209
+ descope-text-field {
210
+ flex-grow: 1;
211
+ width: 100%;
212
+ direction: ltr;
213
+ }
214
+ vaadin-text-field[readonly] > input:placeholder-shown {
215
+ opacity: 1;
216
+ }
217
+ vaadin-text-field::part(input-field)::after {
218
+ border: none;
219
+ }
220
+
221
+ vaadin-text-field[label-type="floating"]:not([focused])[readonly] input:placeholder-shown {
222
+ opacity: 0;
223
+ }
224
+ vaadin-text-field[label-type="floating"]:not([focused])[disabled] input:placeholder-shown {
225
+ opacity: 0;
226
+ }
227
+
228
+ ${resetInputLabelPosition('vaadin-text-field')}
229
+ ${inputFloatingLabelStyle()}
230
+ `,
231
+ excludeAttrsSync: ['tabindex'],
232
+ componentName,
233
+ })
234
+ );
235
+
236
+ export default PhoneFieldInputBoxClass;
@@ -0,0 +1,172 @@
1
+ import { createBaseInputClass } from '../../../../baseClasses/createBaseInputClass';
2
+ import { getComponentName } from '../../../../helpers/componentHelpers';
3
+ import { getCountryByCodeId } from '../../helpers';
4
+
5
+ export const componentName = getComponentName('phone-field-internal-input-box');
6
+
7
+ const observedAttributes = [
8
+ 'disabled',
9
+ 'size',
10
+ 'bordered',
11
+ 'invalid',
12
+ 'readonly',
13
+ 'phone-input-placeholder',
14
+ 'name',
15
+ 'autocomplete',
16
+ 'label-type',
17
+ 'allow-alphanumeric-input',
18
+ ];
19
+ const mapAttrs = {
20
+ 'phone-input-placeholder': 'placeholder',
21
+ };
22
+
23
+ const BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });
24
+
25
+ class PhoneFieldInternal extends BaseInputClass {
26
+ static get observedAttributes() {
27
+ return [].concat(BaseInputClass.observedAttributes || [], observedAttributes);
28
+ }
29
+
30
+ constructor() {
31
+ super();
32
+
33
+ this.innerHTML = `
34
+ <div>
35
+ <descope-text-field tabindex="1"></descope-text-field>
36
+ </div>
37
+ `;
38
+
39
+ this.phoneNumberInput = this.querySelector('descope-text-field');
40
+ }
41
+
42
+ get defaultCountryCode() {
43
+ return getCountryByCodeId(this.getAttribute('default-code'));
44
+ }
45
+
46
+ get hasDefaultCode() {
47
+ return !!this.getAttribute('default-code');
48
+ }
49
+
50
+ get allowAlphanumericInput() {
51
+ return this.getAttribute('allow-alphanumeric-input') === 'true';
52
+ }
53
+
54
+ get value() {
55
+ if (!this.phoneNumberValue) {
56
+ return '';
57
+ }
58
+
59
+ if (this.hasDefaultCode) {
60
+ // we want to transform phone numbers to a valid {dialCode}-{phoneNumber} format
61
+ // e.g.:
62
+ // +972-12345 => +972-12345
63
+ // 972-12345 => +972-12345
64
+ // 12345 => +972-12345
65
+ //
66
+ // we also want to handle any extra dash if added in the start of the phone number
67
+ // e.g.:
68
+ // +972--12345 => +972-12345
69
+ const pattern = new RegExp(`\\+?${parseInt(this.defaultCountryCode, 10)}--?`);
70
+ return `${this.defaultCountryCode}-${this.phoneNumberInput.value.replace(pattern, '')}`;
71
+ }
72
+
73
+ return this.phoneNumberInput.value;
74
+ }
75
+
76
+ set value(val) {
77
+ this.phoneNumberInput.value = val;
78
+ }
79
+
80
+ get phoneNumberValue() {
81
+ return this.phoneNumberInput.value;
82
+ }
83
+
84
+ get phoneNumberInputEle() {
85
+ return this.phoneNumberInput.shadowRoot.querySelector('input');
86
+ }
87
+
88
+ get minLength() {
89
+ return parseInt(this.getAttribute('minlength'), 10) || 0;
90
+ }
91
+
92
+ get maxLength() {
93
+ return parseInt(this.getAttribute('maxlength'), 10) || 50;
94
+ }
95
+
96
+ getValidity() {
97
+ const validPhonePattern = /^\+?\d{1,4}-?(?:\d-?){1,15}$/;
98
+ const stripValue = this.value.replace(/\D/g, '');
99
+
100
+ if (this.isRequired && !this.value) {
101
+ return { valueMissing: true };
102
+ }
103
+
104
+ if (stripValue.length < this.minLength) {
105
+ return { tooShort: true };
106
+ }
107
+
108
+ if (stripValue.length > this.maxLength) {
109
+ return { tooLong: true };
110
+ }
111
+
112
+ if (!validPhonePattern.test(this.value)) {
113
+ return { patternMismatch: true };
114
+ }
115
+
116
+ return {};
117
+ }
118
+
119
+ init() {
120
+ this.addEventListener('focus', (e) => {
121
+ // we want to ignore focus events we are dispatching
122
+ if (e.isTrusted) this.phoneNumberInput.focus();
123
+ });
124
+
125
+ super.init?.();
126
+ this.initInputs();
127
+ }
128
+
129
+ getCountryByDialCode(countryDialCode) {
130
+ return this.countryCodeInput.items?.find(
131
+ (c) => c.getAttribute('data-country-code') === countryDialCode
132
+ );
133
+ }
134
+
135
+ initInputs() {
136
+ // Sanitize phone input value to filter everything but digits
137
+ this.phoneNumberInput.addEventListener('input', (e) => {
138
+ if (e.target.value.length === 1 && e.target.value === '-') {
139
+ e.target.value = '';
140
+ }
141
+
142
+ e.target.value = e.target.value
143
+ .replace(/(?!^)\+/g, '')
144
+ .replace('--', '-')
145
+ .replace('+-', '+');
146
+
147
+ let sanitizedInput = e.target.value;
148
+ if (!this.allowAlphanumericInput) {
149
+ const telDigitsRegExp = /^[+\d-]+$/;
150
+ sanitizedInput = e.target.value
151
+ .split('')
152
+ .filter((char) => telDigitsRegExp.test(char))
153
+ .join('');
154
+ }
155
+
156
+ e.target.value = sanitizedInput;
157
+ });
158
+
159
+ this.handleFocusEventsDispatching([this.phoneNumberInput]);
160
+ }
161
+
162
+ attributeChangedCallback(attrName, oldValue, newValue) {
163
+ super.attributeChangedCallback(attrName, oldValue, newValue);
164
+
165
+ if (oldValue !== newValue && observedAttributes.includes(attrName)) {
166
+ const attr = mapAttrs[attrName] || attrName;
167
+ this.phoneNumberInput.setAttribute(attr, newValue);
168
+ }
169
+ }
170
+ }
171
+
172
+ export default PhoneFieldInternal;
@@ -0,0 +1,5 @@
1
+ import '../../../descope-text-field';
2
+
3
+ import PhoneFieldInternalInputBox, { componentName } from './PhoneFieldInternalInputBox';
4
+
5
+ customElements.define(componentName, PhoneFieldInternalInputBox);
@@ -0,0 +1,9 @@
1
+ import './descope-phone-input-box-internal';
2
+ import '../../descope-combo-box';
3
+ import '../../descope-text-field';
4
+
5
+ import { componentName, PhoneFieldInputBoxClass } from './PhoneFieldInputBoxClass';
6
+
7
+ customElements.define(componentName, PhoneFieldInputBoxClass);
8
+
9
+ export { PhoneFieldInputBoxClass };
@@ -0,0 +1,5 @@
1
+ import CountryCodes from './CountryCodes';
2
+
3
+ export const getCountryByCodeId = (countryCode) => {
4
+ return CountryCodes.find((c) => c.code === countryCode)?.dialCode;
5
+ };
@@ -0,0 +1,4 @@
1
+ export const DESCOPE_PREFIX = 'descope';
2
+ export const CSS_SELECTOR_SPECIFIER_MULTIPLY = 3;
3
+ export const BASE_THEME_SECTION = 'host';
4
+ export const PORTAL_THEME_PREFIX = '@';
@@ -0,0 +1,52 @@
1
+ import merge from 'lodash.merge';
2
+ import { defaultTheme } from './theme';
3
+ import { codeSnippetDarkThemeOverrides } from './theme/components/codeSnippet';
4
+
5
+ export const colors = {
6
+ surface: {
7
+ main: '#181a1c',
8
+ dark: '#bec4ca',
9
+ light: '#555f68',
10
+ highlight: '#22262a',
11
+ contrast: '#f5f6f7',
12
+ },
13
+ primary: {
14
+ main: '#1f80ff',
15
+ dark: '#71aeff',
16
+ light: '#004094',
17
+ highlight: '#00214d',
18
+ contrast: '#000000',
19
+ },
20
+ secondary: {
21
+ main: '#a665eb',
22
+ dark: '#b9a0f3',
23
+ light: '#683ae6',
24
+ highlight: '#361299',
25
+ contrast: '#000000',
26
+ },
27
+ success: {
28
+ main: '#27963c',
29
+ dark: '#8bc3a2',
30
+ light: '#004d0f',
31
+ highlight: '#001f00',
32
+ contrast: '#000000',
33
+ },
34
+ error: {
35
+ main: '#f85249',
36
+ dark: '#fa7c75',
37
+ light: '#c51107',
38
+ highlight: '#4a0603',
39
+ contrast: '#000000',
40
+ },
41
+ };
42
+
43
+ const darkTheme = merge({}, defaultTheme, {
44
+ globals: {
45
+ colors,
46
+ },
47
+ components: {
48
+ ...codeSnippetDarkThemeOverrides,
49
+ },
50
+ });
51
+
52
+ export default darkTheme;
@@ -0,0 +1,3 @@
1
+ export { defaultTheme } from '../theme';
2
+ export { default as darkTheme } from '../darkTheme';
3
+ export { themeToStyle } from '../helpers/themeHelpers';
@@ -0,0 +1,95 @@
1
+ import { kebabCaseJoin } from '.';
2
+ import { DESCOPE_PREFIX } from '../constants';
3
+
4
+ export const observeAttributes = (ele, callback, { excludeAttrs = [], includeAttrs = [] }) => {
5
+ // sync all attrs on init
6
+ const filteredAttrs = Array.from(ele.attributes)
7
+ .filter(
8
+ (attr) =>
9
+ !excludeAttrs.includes(attr.name) &&
10
+ (!includeAttrs.length || includeAttrs.includes(attr.name))
11
+ )
12
+ .map((attr) => attr.name);
13
+
14
+ callback(filteredAttrs);
15
+
16
+ const observer = new MutationObserver((mutationsList) => {
17
+ mutationsList.forEach((mutation) => {
18
+ if (
19
+ mutation.type === 'attributes' &&
20
+ !excludeAttrs.includes(mutation.attributeName) &&
21
+ (!includeAttrs.length || includeAttrs.includes(mutation.attributeName))
22
+ ) {
23
+ callback([mutation.attributeName]);
24
+ }
25
+ });
26
+ });
27
+
28
+ observer.observe(ele, { attributes: true });
29
+ };
30
+
31
+ // calling the callback with this object: { addedNodes, removedNodes }
32
+ export const observeChildren = (ele, callback) => {
33
+ callback({ addedNodes: Array.from(ele.children), removedNodes: [] });
34
+
35
+ const observer = new MutationObserver((mutationsList) => {
36
+ mutationsList.forEach((mutation) => {
37
+ if (mutation.type === 'childList' || mutation.type === 'characterData') {
38
+ callback(mutation);
39
+ }
40
+ });
41
+ });
42
+
43
+ observer.observe(ele, { childList: true, characterData: true, subtree: true });
44
+ };
45
+
46
+ const createSyncAttrsCb =
47
+ (srcEle, targetEle, mapAttrs = {}) =>
48
+ (attrNames) => {
49
+ attrNames.forEach((attrName) => {
50
+ const targetAttrName = mapAttrs[attrName] || attrName;
51
+ const srcAttrVal = srcEle.getAttribute(attrName);
52
+ if (srcAttrVal !== null) {
53
+ if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
54
+ targetEle.setAttribute(targetAttrName, srcAttrVal);
55
+ }
56
+ } else {
57
+ targetEle.removeAttribute(targetAttrName);
58
+ }
59
+ });
60
+ };
61
+
62
+ export const syncAttrs = (ele1, ele2, options) => {
63
+ observeAttributes(ele1, createSyncAttrsCb(ele1, ele2), options);
64
+ observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);
65
+ };
66
+
67
+ export const getComponentName = (name) => kebabCaseJoin(DESCOPE_PREFIX, name);
68
+
69
+ export const getCssVarName = (...args) => `--${kebabCaseJoin(...args)}`;
70
+
71
+ export const forwardAttrs = (source, dest, options = {}) => {
72
+ observeAttributes(source, createSyncAttrsCb(source, dest, options.mapAttrs), options);
73
+ };
74
+
75
+ export const forwardProps = (src, target, props = []) => {
76
+ if (!props.length) return;
77
+
78
+ const config = props.reduce(
79
+ (acc, prop) =>
80
+ Object.assign(acc, {
81
+ [prop]: {
82
+ get() {
83
+ return src[prop];
84
+ },
85
+ set(v) {
86
+ // eslint-disable-next-line no-param-reassign
87
+ src[prop] = v;
88
+ },
89
+ },
90
+ }),
91
+ {}
92
+ );
93
+
94
+ Object.defineProperties(target, config);
95
+ };
@@ -0,0 +1,68 @@
1
+ export const kebabCase = (str) =>
2
+ str
3
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
4
+ .replace(/[\s_.]+/g, '-')
5
+ .toLowerCase();
6
+
7
+ export const kebabCaseJoin = (...args) => kebabCase(args.filter((arg) => !!arg).join('-'));
8
+
9
+ export const upperFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1);
10
+
11
+ export const camelCaseJoin = (...args) =>
12
+ args
13
+ .filter(Boolean)
14
+ .map((arg, index) => (index === 0 ? arg : upperFirst(arg)))
15
+ .join('');
16
+
17
+ export const compose =
18
+ (...fns) =>
19
+ (val) =>
20
+ fns.reduceRight((res, fn) => fn(res), val);
21
+
22
+ export const isFunction = (maybeFunc) => typeof maybeFunc === 'function';
23
+
24
+ export const isUrl = (maybeUrl) => {
25
+ try {
26
+ // eslint-disable-next-line no-new
27
+ new URL(maybeUrl);
28
+
29
+ return true;
30
+ } catch (e) {
31
+ return false;
32
+ }
33
+ };
34
+
35
+ /**
36
+ * Compares two arrays unorderedly.
37
+ * @param {Array} arr1 - The first array to compare.
38
+ * @param {Array} arr2 - The second array to compare.
39
+ * @returns {boolean} - Returns true if the arrays are equal unorderedly, false otherwise.
40
+ */
41
+ export const compareArraysUnordered = (arr1, arr2) => {
42
+ if (!Array.isArray(arr1) || !Array.isArray(arr2)) {
43
+ return false;
44
+ }
45
+
46
+ if (arr1.length !== arr2.length) {
47
+ return false;
48
+ }
49
+
50
+ const sortedArr1 = arr1.slice().sort();
51
+ const sortedArr2 = arr2.slice().sort();
52
+
53
+ for (let i = 0; i < sortedArr1.length; i++) {
54
+ if (sortedArr1[i] !== sortedArr2[i]) {
55
+ return false;
56
+ }
57
+ }
58
+
59
+ return true;
60
+ };
61
+
62
+ export const toTitle = (str) =>
63
+ str
64
+ .replace(/([A-Z])/g, ' $1')
65
+ .trim()
66
+ .split(' ')
67
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
68
+ .join(' ');
@@ -0,0 +1,10 @@
1
+ // create a dispatch event function that also calls to the onevent function in case it's set
2
+ // usage example:
3
+ // #dispatchSomething = createDispatchEvent.bind(this, 'something' { ...options })
4
+ // this will dispatch a new event when called, but also call to "onsomething"
5
+ export function createDispatchEvent(eventName, options = {}) {
6
+ const event = new Event(eventName, options);
7
+
8
+ this[`on${eventName}`]?.(event); // in case we got an event callback as property
9
+ this.dispatchEvent(event);
10
+ }