@cupra/ui-kit 0.2.0-canary.0 → 1.0.0-canary.10

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 (351) hide show
  1. package/README.md +97 -778
  2. package/THIRD_PARTY_LICENSES.MD +79 -0
  3. package/dist/components/base/DsUiElement.js +47 -0
  4. package/dist/components/base/UiKitElement.js +80 -0
  5. package/dist/components/base/ds-base-input/ds-base-input.js +112 -0
  6. package/dist/components/base/ds-base-input/styles/common.styles.js +63 -0
  7. package/dist/components/base/ds-base-input/styles/cupra.styles.js +124 -0
  8. package/dist/components/base/ds-base-progress-bar/ds-base-progress-bar.js +64 -0
  9. package/dist/components/base/ds-base-progress-bar/styles/common.styles.js +22 -0
  10. package/dist/components/base/ds-base-progress-bar/styles/cupra-diagonal.styles.js +27 -0
  11. package/dist/components/base/ds-base-progress-bar/styles/cupra.styles.js +27 -0
  12. package/dist/components/base/ds-base-progress-bar/styles/seat.styles.js +8 -0
  13. package/dist/components/ds-accordion/ds-accordion.js +124 -0
  14. package/dist/components/ds-accordion/styles/common.styles.js +64 -0
  15. package/dist/components/ds-accordion/theme-config.js +26 -0
  16. package/dist/components/ds-avatar/ds-avatar.js +102 -0
  17. package/dist/components/ds-avatar/styles/common.styles.js +12 -0
  18. package/dist/components/ds-bullets/ds-bullets.js +79 -0
  19. package/dist/components/ds-bullets/styles/common.styles.js +26 -0
  20. package/dist/components/ds-button/ds-button.js +196 -0
  21. package/dist/components/ds-button/ds-button.types.d.ts +1 -3
  22. package/dist/components/ds-button/styles/common.styles.js +116 -0
  23. package/dist/components/ds-carousel-indicator/ds-carousel-indicator.js +63 -0
  24. package/dist/components/ds-carousel-indicator/styles/common.styles.js +19 -0
  25. package/dist/components/ds-checkbox/ds-checkbox.js +142 -0
  26. package/dist/components/ds-checkbox/styles/common.styles.js +60 -0
  27. package/dist/components/ds-chip/ds-chip.js +130 -0
  28. package/dist/components/ds-chip/styles/common.styles.js +25 -0
  29. package/dist/components/ds-chips/ds-chips.js +143 -0
  30. package/dist/components/ds-chips/styles/common.styles.js +78 -0
  31. package/dist/components/ds-currency/ds-currency.js +139 -0
  32. package/dist/components/ds-currency/styles/common.styles.js +17 -0
  33. package/dist/components/ds-dialog/ds-dialog.js +107 -0
  34. package/dist/components/ds-dialog/styles/common.styles.js +82 -0
  35. package/dist/components/ds-dialog-body/ds-dialog-body.js +46 -0
  36. package/dist/components/ds-dialog-body/styles/common.styles.js +12 -0
  37. package/dist/components/ds-dialog-footer/ds-dialog-footer.js +47 -0
  38. package/dist/components/ds-dialog-footer/styles/common.styles.js +16 -0
  39. package/dist/components/ds-dialog-header/ds-dialog-header.js +68 -0
  40. package/dist/components/ds-dialog-header/styles/common.styles.js +12 -0
  41. package/dist/components/ds-divider/ds-divider.js +58 -0
  42. package/dist/components/ds-divider/styles/common.styles.js +13 -0
  43. package/dist/components/ds-hyperlink/ds-hyperlink.js +93 -0
  44. package/dist/components/ds-hyperlink/styles/common.styles.js +22 -0
  45. package/dist/components/ds-icon/ds-icon.js +100 -0
  46. package/dist/components/ds-icon/iconNames.js +393 -0
  47. package/dist/components/ds-icon-button/ds-icon-button.js +138 -0
  48. package/dist/components/ds-icon-button/ds-icon-button.types.d.ts +1 -3
  49. package/dist/components/ds-icon-button/styles/common.styles.js +24 -0
  50. package/dist/components/ds-input/ds-input.js +138 -0
  51. package/dist/components/ds-interactive-card/ds-interactive-card.js +90 -0
  52. package/dist/components/ds-interactive-card/styles/common.styles.js +12 -0
  53. package/dist/components/ds-link-button/ds-link-button.js +120 -0
  54. package/dist/components/ds-link-button/styles/common.styles.js +24 -0
  55. package/dist/components/ds-loader-bar/ds-loader-bar.js +23 -0
  56. package/dist/components/ds-loader-bar/styles/common.styles.js +23 -0
  57. package/dist/components/ds-loader-dots/ds-loader-dots.js +62 -0
  58. package/dist/components/ds-loader-dots/styles/common.styles.js +35 -0
  59. package/dist/components/ds-loader-logo/ds-loader-logo.js +65 -0
  60. package/dist/components/ds-loader-logo/ds-loader-logo.styles.js +67 -0
  61. package/dist/components/ds-loader-spinner/ds-loader-spinner.js +53 -0
  62. package/dist/components/ds-loader-spinner/styles/common.styles.js +56 -0
  63. package/dist/components/ds-logo/ds-logo.js +69 -0
  64. package/dist/components/ds-logo/styles/common.styles.js +18 -0
  65. package/dist/components/ds-map-pin/ds-map-pin.js +116 -0
  66. package/dist/components/ds-map-pin/styles/common.styles.js +43 -0
  67. package/dist/components/ds-modal/ds-modal.js +215 -0
  68. package/dist/components/ds-modal/styles/common.styles.js +289 -0
  69. package/dist/components/ds-password-input/ds-password-input.js +43 -0
  70. package/dist/components/ds-picker-item/ds-picker-item.js +89 -0
  71. package/dist/components/ds-picker-item/ds-picker-item.types.d.ts +1 -4
  72. package/dist/components/ds-picker-item/styles/common.styles.js +12 -0
  73. package/dist/components/ds-portal/ds-portal.js +41 -0
  74. package/dist/components/ds-progress-bar/ds-progress-bar.js +34 -0
  75. package/dist/components/ds-progress-bar/styles/common.styles.js +12 -0
  76. package/dist/components/ds-radio/ds-radio.js +111 -0
  77. package/dist/components/ds-radio/styles/common.styles.js +44 -0
  78. package/dist/components/ds-radio-button/ds-radio-button.js +185 -0
  79. package/dist/components/ds-radio-button/styles/common.styles.js +52 -0
  80. package/dist/components/ds-radio-button-group/ds-radio-button-group.js +83 -0
  81. package/dist/components/ds-radio-button-group/styles/common.styles.js +25 -0
  82. package/dist/components/ds-radio-group/ds-radio-group.js +79 -0
  83. package/dist/components/ds-radio-group/ds-radio-group.styles.js +21 -0
  84. package/dist/components/ds-search/ds-search.js +210 -0
  85. package/dist/components/ds-search/styles/common.styles.js +61 -0
  86. package/dist/components/ds-search-input/ds-search-input.js +158 -0
  87. package/dist/components/ds-search-input/styles/common.styles.js +12 -0
  88. package/dist/components/ds-secondary-navigation/ds-secondary-navigation.js +233 -0
  89. package/dist/components/ds-secondary-navigation/styles/common.styles.js +12 -0
  90. package/dist/components/ds-segmented-control/ds-segmented-control.js +71 -0
  91. package/dist/components/ds-segmented-control/styles/common.styles.js +56 -0
  92. package/dist/components/ds-select/controllers/SelectKeyboardController.js +33 -0
  93. package/dist/components/ds-select/ds-select.js +274 -0
  94. package/dist/components/ds-select/styles/common.styles.js +29 -0
  95. package/dist/components/ds-selection/ds-selection.js +57 -0
  96. package/dist/components/ds-selection/styles/common.styles.js +17 -0
  97. package/dist/components/ds-sidebar-navigation/ds-sidebar-navigation.js +102 -0
  98. package/dist/components/ds-sidebar-navigation/styles/common.styles.js +25 -0
  99. package/dist/components/ds-slider/ds-slider.js +409 -0
  100. package/dist/components/ds-slider/ds-slider.types.d.ts +1 -3
  101. package/dist/components/ds-slider/styles/common.styles.js +61 -0
  102. package/dist/components/ds-slider/utils/getStepValue/getStepValue.js +28 -0
  103. package/dist/components/ds-slider/utils/roundToDecimals/roundToDecimals.js +7 -0
  104. package/dist/components/ds-static-box/ds-static-box.js +77 -0
  105. package/dist/components/ds-static-box/ds-static-box.types.d.ts +1 -1
  106. package/dist/components/ds-static-box/styles/common.styles.js +12 -0
  107. package/dist/components/ds-stepper/ds-stepper.js +57 -0
  108. package/dist/components/ds-stepper/styles/common.styles.js +12 -0
  109. package/dist/components/ds-tabs/ds-tabs.js +203 -0
  110. package/dist/components/ds-tabs/styles/common.styles.js +97 -0
  111. package/dist/components/ds-tabs/theme-config.js +14 -0
  112. package/dist/components/ds-tag/ds-tag.js +87 -0
  113. package/dist/components/ds-tag/styles/common.styles.js +20 -0
  114. package/dist/components/ds-text/ds-text.js +83 -0
  115. package/dist/components/ds-text/styles/common.styles.js +29 -0
  116. package/dist/components/ds-text-input/ds-text-input.js +100 -0
  117. package/dist/components/ds-text-input/styles/common.styles.js +12 -0
  118. package/dist/components/ds-textarea/ds-textarea.js +87 -0
  119. package/dist/components/ds-textarea/styles/common.styles.js +12 -0
  120. package/dist/components/ds-theme-provider/ds-theme-provider.js +89 -0
  121. package/dist/components/ds-theme-provider/ds-theme-provider.types.d.ts +1 -1
  122. package/dist/components/ds-theme-provider/themeContext.js +5 -0
  123. package/dist/components/ds-toast/ds-toast.js +95 -0
  124. package/dist/components/ds-toast/styles/common.styles.js +112 -0
  125. package/dist/components/ds-toast/utils/ToastManager.js +48 -0
  126. package/dist/components/ds-toast-message/ds-toast-message.js +103 -0
  127. package/dist/components/ds-toast-message/styles/common.styles.js +12 -0
  128. package/dist/components/ds-toggle-button/ds-toggle-button.js +73 -0
  129. package/dist/components/ds-toggle-switch/ds-toggle-switch.js +100 -0
  130. package/dist/components/ds-toggle-switch/styles/common.styles.js +47 -0
  131. package/dist/components/ds-tooltip/ds-tooltip.js +198 -0
  132. package/dist/components/ds-tooltip/styles/common.styles.js +163 -0
  133. package/dist/decorators/customUiKitElement.js +23 -0
  134. package/dist/index.d.ts +1 -0
  135. package/dist/index.js +59 -9285
  136. package/dist/mixins/FormAssociatedMixin.js +14 -0
  137. package/dist/mixins/ViewportMixin.js +32 -0
  138. package/dist/mixins/inputStatesMixin.js +46 -0
  139. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/context-request-event.js +13 -0
  140. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js +29 -0
  141. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js +37 -0
  142. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/create-context.js +11 -0
  143. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js +22 -0
  144. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js +42 -0
  145. package/dist/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/value-notifier.js +36 -0
  146. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +50 -0
  147. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/base.js +9 -0
  148. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +37 -0
  149. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
  150. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js +19 -0
  151. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js +20 -0
  152. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +12 -0
  153. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +252 -0
  154. package/dist/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +51 -0
  155. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +37 -0
  156. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +27 -0
  157. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js +12 -0
  158. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +34 -0
  159. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +10 -0
  160. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +61 -0
  161. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +27 -0
  162. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js +11 -0
  163. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +243 -0
  164. package/dist/styles/fonts-config.js +28 -0
  165. package/dist/utils/IconsManager.js +30 -0
  166. package/dist/utils/PubSub.js +28 -0
  167. package/dist/utils/StylesRegistry/StylesRegistry.js +32 -0
  168. package/dist/utils/arrayConverter.js +19 -0
  169. package/dist/utils/booleanConverter.js +4 -0
  170. package/dist/utils/componentFactory.js +167 -0
  171. package/dist/utils/cssQueries.js +16 -0
  172. package/dist/utils/cssWithTokens.js +11 -0
  173. package/dist/utils/formatNumber/formatNumber.js +54 -0
  174. package/dist/utils/htmlWithTokens.js +11 -0
  175. package/dist/utils/objectConverter.js +11 -0
  176. package/dist/utils/validateMaxLength.js +6 -0
  177. package/dist-react/components/base/DsUiElement.js +47 -0
  178. package/dist-react/components/base/UiKitElement.js +80 -0
  179. package/dist-react/components/base/ds-base-input/ds-base-input.js +112 -0
  180. package/dist-react/components/base/ds-base-input/styles/common.styles.js +63 -0
  181. package/dist-react/components/base/ds-base-input/styles/cupra.styles.js +124 -0
  182. package/dist-react/components/base/ds-base-progress-bar/ds-base-progress-bar.js +64 -0
  183. package/dist-react/components/base/ds-base-progress-bar/styles/common.styles.js +22 -0
  184. package/dist-react/components/base/ds-base-progress-bar/styles/cupra-diagonal.styles.js +27 -0
  185. package/dist-react/components/base/ds-base-progress-bar/styles/cupra.styles.js +27 -0
  186. package/dist-react/components/base/ds-base-progress-bar/styles/seat.styles.js +8 -0
  187. package/dist-react/components/ds-accordion/ds-accordion.js +124 -0
  188. package/dist-react/components/ds-accordion/styles/common.styles.js +64 -0
  189. package/dist-react/components/ds-accordion/theme-config.js +26 -0
  190. package/dist-react/components/ds-avatar/ds-avatar.js +102 -0
  191. package/dist-react/components/ds-avatar/styles/common.styles.js +12 -0
  192. package/dist-react/components/ds-bullets/ds-bullets.js +79 -0
  193. package/dist-react/components/ds-bullets/styles/common.styles.js +26 -0
  194. package/dist-react/components/ds-button/ds-button.js +196 -0
  195. package/dist-react/components/ds-button/ds-button.types.d.ts +1 -3
  196. package/dist-react/components/ds-button/styles/common.styles.js +116 -0
  197. package/dist-react/components/ds-carousel-indicator/ds-carousel-indicator.js +63 -0
  198. package/dist-react/components/ds-carousel-indicator/styles/common.styles.js +19 -0
  199. package/dist-react/components/ds-checkbox/ds-checkbox.js +142 -0
  200. package/dist-react/components/ds-checkbox/styles/common.styles.js +60 -0
  201. package/dist-react/components/ds-chip/ds-chip.js +130 -0
  202. package/dist-react/components/ds-chip/styles/common.styles.js +25 -0
  203. package/dist-react/components/ds-chips/ds-chips.js +143 -0
  204. package/dist-react/components/ds-chips/styles/common.styles.js +78 -0
  205. package/dist-react/components/ds-currency/ds-currency.js +139 -0
  206. package/dist-react/components/ds-currency/styles/common.styles.js +17 -0
  207. package/dist-react/components/ds-dialog/ds-dialog.js +107 -0
  208. package/dist-react/components/ds-dialog/styles/common.styles.js +82 -0
  209. package/dist-react/components/ds-dialog-body/ds-dialog-body.js +46 -0
  210. package/dist-react/components/ds-dialog-body/styles/common.styles.js +12 -0
  211. package/dist-react/components/ds-dialog-footer/ds-dialog-footer.js +47 -0
  212. package/dist-react/components/ds-dialog-footer/styles/common.styles.js +16 -0
  213. package/dist-react/components/ds-dialog-header/ds-dialog-header.js +68 -0
  214. package/dist-react/components/ds-dialog-header/styles/common.styles.js +12 -0
  215. package/dist-react/components/ds-divider/ds-divider.js +58 -0
  216. package/dist-react/components/ds-divider/styles/common.styles.js +13 -0
  217. package/dist-react/components/ds-hyperlink/ds-hyperlink.js +93 -0
  218. package/dist-react/components/ds-hyperlink/styles/common.styles.js +22 -0
  219. package/dist-react/components/ds-icon/ds-icon.js +100 -0
  220. package/dist-react/components/ds-icon/iconNames.js +393 -0
  221. package/dist-react/components/ds-icon-button/ds-icon-button.js +138 -0
  222. package/dist-react/components/ds-icon-button/ds-icon-button.types.d.ts +1 -3
  223. package/dist-react/components/ds-icon-button/styles/common.styles.js +24 -0
  224. package/dist-react/components/ds-input/ds-input.js +138 -0
  225. package/dist-react/components/ds-interactive-card/ds-interactive-card.js +90 -0
  226. package/dist-react/components/ds-interactive-card/styles/common.styles.js +12 -0
  227. package/dist-react/components/ds-link-button/ds-link-button.js +120 -0
  228. package/dist-react/components/ds-link-button/styles/common.styles.js +24 -0
  229. package/dist-react/components/ds-loader-bar/ds-loader-bar.js +23 -0
  230. package/dist-react/components/ds-loader-bar/styles/common.styles.js +23 -0
  231. package/dist-react/components/ds-loader-dots/ds-loader-dots.js +62 -0
  232. package/dist-react/components/ds-loader-dots/styles/common.styles.js +35 -0
  233. package/dist-react/components/ds-loader-logo/ds-loader-logo.js +65 -0
  234. package/dist-react/components/ds-loader-logo/ds-loader-logo.styles.js +67 -0
  235. package/dist-react/components/ds-loader-spinner/ds-loader-spinner.js +53 -0
  236. package/dist-react/components/ds-loader-spinner/styles/common.styles.js +56 -0
  237. package/dist-react/components/ds-logo/ds-logo.js +69 -0
  238. package/dist-react/components/ds-logo/styles/common.styles.js +18 -0
  239. package/dist-react/components/ds-map-pin/ds-map-pin.js +116 -0
  240. package/dist-react/components/ds-map-pin/styles/common.styles.js +43 -0
  241. package/dist-react/components/ds-modal/ds-modal.js +215 -0
  242. package/dist-react/components/ds-modal/styles/common.styles.js +289 -0
  243. package/dist-react/components/ds-password-input/ds-password-input.js +43 -0
  244. package/dist-react/components/ds-picker-item/ds-picker-item.js +89 -0
  245. package/dist-react/components/ds-picker-item/ds-picker-item.types.d.ts +1 -4
  246. package/dist-react/components/ds-picker-item/styles/common.styles.js +12 -0
  247. package/dist-react/components/ds-portal/ds-portal.js +41 -0
  248. package/dist-react/components/ds-progress-bar/ds-progress-bar.js +34 -0
  249. package/dist-react/components/ds-progress-bar/styles/common.styles.js +12 -0
  250. package/dist-react/components/ds-radio/ds-radio.js +111 -0
  251. package/dist-react/components/ds-radio/styles/common.styles.js +44 -0
  252. package/dist-react/components/ds-radio-button/ds-radio-button.js +185 -0
  253. package/dist-react/components/ds-radio-button/styles/common.styles.js +52 -0
  254. package/dist-react/components/ds-radio-button-group/ds-radio-button-group.js +83 -0
  255. package/dist-react/components/ds-radio-button-group/styles/common.styles.js +25 -0
  256. package/dist-react/components/ds-radio-group/ds-radio-group.js +79 -0
  257. package/dist-react/components/ds-radio-group/ds-radio-group.styles.js +21 -0
  258. package/dist-react/components/ds-search/ds-search.js +210 -0
  259. package/dist-react/components/ds-search/styles/common.styles.js +61 -0
  260. package/dist-react/components/ds-search-input/ds-search-input.js +158 -0
  261. package/dist-react/components/ds-search-input/styles/common.styles.js +12 -0
  262. package/dist-react/components/ds-secondary-navigation/ds-secondary-navigation.js +233 -0
  263. package/dist-react/components/ds-secondary-navigation/styles/common.styles.js +12 -0
  264. package/dist-react/components/ds-segmented-control/ds-segmented-control.js +71 -0
  265. package/dist-react/components/ds-segmented-control/styles/common.styles.js +56 -0
  266. package/dist-react/components/ds-select/controllers/SelectKeyboardController.js +33 -0
  267. package/dist-react/components/ds-select/ds-select.js +274 -0
  268. package/dist-react/components/ds-select/styles/common.styles.js +29 -0
  269. package/dist-react/components/ds-selection/ds-selection.js +57 -0
  270. package/dist-react/components/ds-selection/styles/common.styles.js +17 -0
  271. package/dist-react/components/ds-sidebar-navigation/ds-sidebar-navigation.js +102 -0
  272. package/dist-react/components/ds-sidebar-navigation/styles/common.styles.js +25 -0
  273. package/dist-react/components/ds-slider/ds-slider.js +409 -0
  274. package/dist-react/components/ds-slider/ds-slider.types.d.ts +1 -3
  275. package/dist-react/components/ds-slider/styles/common.styles.js +61 -0
  276. package/dist-react/components/ds-slider/utils/getStepValue/getStepValue.js +28 -0
  277. package/dist-react/components/ds-slider/utils/roundToDecimals/roundToDecimals.js +7 -0
  278. package/dist-react/components/ds-static-box/ds-static-box.js +77 -0
  279. package/dist-react/components/ds-static-box/ds-static-box.types.d.ts +1 -1
  280. package/dist-react/components/ds-static-box/styles/common.styles.js +12 -0
  281. package/dist-react/components/ds-stepper/ds-stepper.js +57 -0
  282. package/dist-react/components/ds-stepper/styles/common.styles.js +12 -0
  283. package/dist-react/components/ds-tabs/ds-tabs.js +203 -0
  284. package/dist-react/components/ds-tabs/styles/common.styles.js +97 -0
  285. package/dist-react/components/ds-tabs/theme-config.js +14 -0
  286. package/dist-react/components/ds-tag/ds-tag.js +87 -0
  287. package/dist-react/components/ds-tag/styles/common.styles.js +20 -0
  288. package/dist-react/components/ds-text/ds-text.js +83 -0
  289. package/dist-react/components/ds-text/styles/common.styles.js +29 -0
  290. package/dist-react/components/ds-text-input/ds-text-input.js +100 -0
  291. package/dist-react/components/ds-text-input/styles/common.styles.js +12 -0
  292. package/dist-react/components/ds-textarea/ds-textarea.js +87 -0
  293. package/dist-react/components/ds-textarea/styles/common.styles.js +12 -0
  294. package/dist-react/components/ds-theme-provider/ds-theme-provider.js +89 -0
  295. package/dist-react/components/ds-theme-provider/ds-theme-provider.types.d.ts +1 -1
  296. package/dist-react/components/ds-theme-provider/themeContext.js +5 -0
  297. package/dist-react/components/ds-toast/ds-toast.js +95 -0
  298. package/dist-react/components/ds-toast/styles/common.styles.js +112 -0
  299. package/dist-react/components/ds-toast/utils/ToastManager.js +48 -0
  300. package/dist-react/components/ds-toast-message/ds-toast-message.js +103 -0
  301. package/dist-react/components/ds-toast-message/styles/common.styles.js +12 -0
  302. package/dist-react/components/ds-toggle-button/ds-toggle-button.js +73 -0
  303. package/dist-react/components/ds-toggle-switch/ds-toggle-switch.js +100 -0
  304. package/dist-react/components/ds-toggle-switch/styles/common.styles.js +47 -0
  305. package/dist-react/components/ds-tooltip/ds-tooltip.js +198 -0
  306. package/dist-react/components/ds-tooltip/styles/common.styles.js +163 -0
  307. package/dist-react/decorators/customUiKitElement.js +23 -0
  308. package/dist-react/index.d.ts +1 -0
  309. package/dist-react/index.js +59 -9210
  310. package/dist-react/mixins/FormAssociatedMixin.js +14 -0
  311. package/dist-react/mixins/ViewportMixin.js +32 -0
  312. package/dist-react/mixins/inputStatesMixin.js +46 -0
  313. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/context-request-event.js +13 -0
  314. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js +29 -0
  315. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js +37 -0
  316. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/create-context.js +11 -0
  317. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js +22 -0
  318. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js +42 -0
  319. package/dist-react/node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/value-notifier.js +36 -0
  320. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +50 -0
  321. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/base.js +9 -0
  322. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +37 -0
  323. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
  324. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js +19 -0
  325. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js +20 -0
  326. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +12 -0
  327. package/dist-react/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +252 -0
  328. package/dist-react/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +51 -0
  329. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +37 -0
  330. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +27 -0
  331. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js +12 -0
  332. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +34 -0
  333. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +10 -0
  334. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +61 -0
  335. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +27 -0
  336. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js +11 -0
  337. package/dist-react/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +243 -0
  338. package/dist-react/styles/fonts-config.js +28 -0
  339. package/dist-react/utils/IconsManager.js +30 -0
  340. package/dist-react/utils/PubSub.js +28 -0
  341. package/dist-react/utils/StylesRegistry/StylesRegistry.js +32 -0
  342. package/dist-react/utils/arrayConverter.js +19 -0
  343. package/dist-react/utils/booleanConverter.js +4 -0
  344. package/dist-react/utils/componentFactory.js +90 -0
  345. package/dist-react/utils/cssQueries.js +16 -0
  346. package/dist-react/utils/cssWithTokens.js +11 -0
  347. package/dist-react/utils/formatNumber/formatNumber.js +54 -0
  348. package/dist-react/utils/htmlWithTokens.js +11 -0
  349. package/dist-react/utils/objectConverter.js +11 -0
  350. package/dist-react/utils/validateMaxLength.js +6 -0
  351. package/package.json +27 -13
package/README.md CHANGED
@@ -1,861 +1,180 @@
1
1
  # UI Kit (Web Components)
2
2
 
3
3
  ## Overview
4
- Core Web Components for the DS-UI design system, built with Lit and TypeScript.
4
+ Core Web Components for the DS-UI design system, implemented with Lit and TypeScript.
5
+ This package is framework-agnostic and can be consumed from any modern frontend stack, either via npm or directly from the CDN.
5
6
 
6
7
  ## Audience
7
- Developers who want to use DS-UI as native Web Components in any web framework or plain HTML/JS.
8
+ Use `@cupra/ui-kit` if you want the **smallest, most portable** way to adopt DS-UI across frameworks:
8
9
 
9
- ## Installation
10
- - npm: `npm install @cupra/ui-kit`
11
- - pnpm: `pnpm add @cupra/ui-kit`
12
- - yarn: `yarn add @cupra/ui-kit`
13
-
14
- Access to the @cupra registry is required (see Requirements).
15
-
16
- ## Usage
17
- 1) Load the theme CSS for your chosen theme (e.g., cupra) or use the theme provider.
18
- 2) Wrap components with `<ds-theme-provider theme="cupra">`.
19
-
20
- Example (snippet):
21
- ```html
22
- <link rel="stylesheet" href="https://ds-assets.cupra.com/[version]/styles/cupra/theme.css">
23
- <ds-theme-provider theme="cupra">
24
- <ds-button variant="destructive">Hello</ds-button>
25
- </ds-theme-provider>
26
- ```
27
-
28
- ## Requirements
29
- - Node.js per .nvmrc
30
- - pnpm 9.4.0 or compatible
31
- - Access to GitHub Packages for @cupra (configure .npmrc or .yarnrc.yml with your token)
32
-
33
- ## Versioning
34
- This package follows semantic versioning. See repository releases for changes.
10
+ - Works with any environment (React, Vue, Svelte, Angular, plain JS, HTML).
11
+ - Provides encapsulation through Shadow DOM.
12
+ - Gives full control over when and how assets (CSS, fonts, icons) load.
35
13
 
36
- ## License
37
- License: SEAT S.A. Library EULA 1.0
38
- See LICENSE.md in this package for the full text. Third-party license attributions (if any) may be provided in THIRD_PARTY_LICENSES.md.
39
-
40
- ## Support
41
- Please open issues in the repository issue tracker.
14
+ If your application is **React-only**, and you prefer idiomatic React props & JSX, use `@cupra/ui-react` instead.
42
15
 
43
16
  ## Installation
44
17
 
45
- <details><summary>View installation instructions</summary>
46
-
47
- ### Using npm
48
-
49
- Run the following command to install the library:
50
-
51
- ```bash
52
- npm install @cupra/ui-kit
53
- ```
54
-
55
- ### Using pnpm
56
-
57
- If you're using **pnpm**, install the library with:
58
-
59
- ```bash
60
- pnpm add @cupra/ui-kit
61
- ```
18
+ ### Install the package
19
+ - npm: `npm install @cupra/ui-kit`
20
+ - pnpm: `pnpm add @cupra/ui-kit`
21
+ - yarn: `yarn add @cupra/ui-kit`
62
22
 
63
- ### Using yarn
23
+ ### Registry configuration (only if needed)
64
24
 
65
- To install the library with **yarn**, use:
25
+ **.npmrc**
66
26
 
67
- ```bash
68
- yarn add @cupra/ui-kit
27
+ ```ini
28
+ @cupra:registry=https://registry.npmjs.org
69
29
  ```
70
30
 
71
- ### .NPMRC
72
- >[!Important]
73
- >To be able to install the **ui-kit** library in your project you need access to the **@cupra**. To solve this, you need to have a **.npmrc** file if you are using **npm** or **pnpm** with a code similar to this:
74
- ```code
75
- @cupra:registry=https://npm.pkg.github.com
76
- //npm.pkg.github.com/:_authToken=<your_github_token>
77
- always-auth=true
78
- ```
31
+ **.yarnrc.yml**
79
32
 
80
- ### .YARNRC.YML
81
- >[!Important]
82
- >To be able to install the **ui-kit** library in your project you need access to the **@cupra**. To solve this, you need to have a **.yarnrc.yml** file if you are using **yarn** with a code similar to this:
83
- ```code
33
+ ```yaml
84
34
  npmScopes:
85
- seatcode:
86
- npmRegistryServer: "https://npm.pkg.github.com"
87
- npmAuthToken: "your_github_token"
35
+ cupra:
36
+ npmRegistryServer: "https://registry.npmjs.org"
88
37
  ```
89
- </details>
90
-
91
- ## Component usage
92
38
 
93
- <details><summary>View usage instructions</summary>
39
+ ---
94
40
 
95
- ### Web Components
41
+ ## Documentation & Live Playground
96
42
 
97
- To use the components directly on an HTML page, ensure that the bundle and theme are loaded correctly as shown below. Wrap your components within the `<ds-theme-provider>` component to provide the necessary theme context.
43
+ You can explore all `ui-kit` Web Components, their APIs, theming options and live examples in the online documentation and playground:
98
44
 
99
- #### Loading the Bundle
45
+ [https://diagonal.cupra.com/ui-kit/index.html](https://diagonal.cupra.com/ui-kit/index.html)
100
46
 
101
- The bundle for the components can be loaded directly from the CDN by using the following script:
47
+ ---
102
48
 
103
- ```html
104
- <script src='https://ds-assets.cupra.com/[version]/dist/index.iife.js'></script>
105
- ```
49
+ ## Versioning and Release Channels
106
50
 
107
- - **[version]**: Specify the exact version of the library, such as `1.0`, `1.1.1`, or `2.0`. Wildcards like `1.x` or `1.*` are not supported.
51
+ This package is published to npm under **two channels**: `latest` (stable) and `canary` (early access).
108
52
 
109
- Example:
53
+ ### Stable Releases (`latest`)
54
+ These versions represent production-ready builds:
110
55
 
111
- ```html
112
- <script src='https://ds-assets.cupra.com/1.0.3/dist/index.iife.js'></script>
113
- ```
56
+ - Follow Semantic Versioning
57
+ - Include validated and approved changes
58
+ - Recommended for all production usage
114
59
 
115
- #### Loading the CSS
60
+ Install latest stable:
116
61
 
117
- You can load the CSS directly with a `<link>`, which is the most performant option. Specify the theme and version in the URL:
118
-
119
- ```html
120
- <link rel='stylesheet' href='https://ds-assets.cupra.com/[version]/styles/[theme]/theme.css'>
62
+ ```bash
63
+ npm install @cupra/ui-kit
121
64
  ```
122
65
 
123
- - **[theme]**: Specify the theme name (e.g., `cupra`).
124
- - **[version]**: Use the fixed version, such as `1.0`, `1.1.1`, etc.
125
-
126
- > **Note**: Even when loading the CSS with a `<link>` for better performance, it is still necessary to use the `<ds-theme-provider>` component. This component provides a theme context with the `theme` attribute (e.g., `theme="cupra"`), which is required for certain components, such as `<ds-icon>`, to function correctly.
127
-
128
- Example:
66
+ Specific stable version:
129
67
 
130
- ```html
131
- <ds-theme-provider theme="cupra">
132
- <ds-button variant="destructive" icon-name="filters-background">Hello</ds-button>
133
- <ds-icon icon-name="filters-background"></ds-icon>
134
- <ds-modal open="false">
135
- <p slot="content">Hello</p>
136
- </ds-modal>
137
- <ds-tag icon-name="magnifying-glass">Hello</ds-tag>
138
- <ds-input type="date" label="Hello"></ds-input>
139
- </ds-theme-provider>
68
+ ```bash
69
+ npm install @cupra/ui-kit@0.1.3
140
70
  ```
141
- </details>
142
-
143
- ## Web Components
144
-
145
- <details><summary>View web components documentation</summary>
146
-
147
- Here is the documentation for the [Web Components](https://github.com/seatcode/ds-ui/blob/main/packages/ui-kit/web-components.md).
148
-
149
- >[!NOTE]
150
- >For more information you can access our [Storybook](https://65c4ab0114027d1f28fa89a1-uzhfdyxnjn.chromatic.com/), where you will find detailed documentation and interactive examples for each component, making it easier to use and understand them. Feel free to ask us for [Storybook](https://65c4ab0114027d1f28fa89a1-uzhfdyxnjn.chromatic.com/) **access permissions** or consult us any question about a component implementation.
151
- </details>
152
-
153
- ## Fonts
154
-
155
- <details><summary>View font information</summary>
156
-
157
- The font family is 'cupra-screen'. The following are the CSS tokens that should be used in your project:
158
-
159
- - `--ds-cp-type-display-[weight]`
160
- - `--ds-cp-type-headline-[weight]`
161
- - `--ds-cp-type-title1-[weight]`
162
- - `--ds-cp-type-title2-[weight]`
163
- - `--ds-cp-type-title3-[weight]`
164
- - `--ds-cp-type-title4-[weight]`
165
- - `--ds-cp-type-title5-[weight]`
166
- - `--ds-cp-type-title6-[weight]`
167
- - `--ds-cp-type-quote-[weight]`
168
- - `--ds-cp-type-lead-[weight]`
169
- - `--ds-cp-type-body-[weight]`
170
- - `--ds-cp-type-bodytight-[weight]`
171
- - `--ds-cp-type-small-[weight]`
172
- - `--ds-cp-type-smalltight-[weight]`
173
- - `--ds-cp-type-tiny-[weight]`
174
- - `--ds-cp-type-micro-[weight]`
175
-
176
- Where `[weight]` can be `book`, `regular`, or `medium`. The properties (size, line height, etc.) are automatically adapted based on the viewport.
177
- </details>
178
-
179
- ## Scroll
180
-
181
- <details><summary>View scroll customization</summary>
182
-
183
- ### `.ds-scroll` Class
184
- This class is used to customize the appearance of scrollbars in your web application. Applying `.ds-scroll` will give the scrollbar a modern and consistent look that aligns with the DS-UI.
185
-
186
- ### `.ds-scroll-global` Class
187
- This class extends the customization of scrollbars to **all** elements within the container. By using `.ds-scroll-global`, you ensure that every scrollable area within a specified section shares the same scrollbar styling for a unified user experience.
188
-
189
- ---
190
-
191
- ### Using Dark Mode with `.ds-mode-dark`
192
- > **Note:** This section only applies to themes that support dark mode.
193
-
194
- To activate dark mode for scrollbars, add the `.ds-mode-dark` class in combination with either `.ds-scroll` or `.ds-scroll-global`. This switches the scrollbar styling to a darker palette, suitable for dark-themed interfaces.
195
71
 
196
72
  ---
197
73
 
198
- ### Using Size with `.ds-scroll--size-[size]`
199
- > **Note:** This section only applies to themes that support size.
74
+ ### Canary Releases (`canary`)
75
+ Canary versions include the **most recent changes merged into `main`**.
200
76
 
201
- E.g. To activate 'S' forced size you must use `.ds-scroll--size-s` class in combination with either `.ds-scroll` or `.ds-scroll-global`.
77
+ Choose a canary version if you:
202
78
 
203
- ---
79
+ - Want early access to upcoming features
80
+ - Are testing the next stable release
81
+ - Accept small instability or rapid iteration
204
82
 
205
- ### Usage Example
206
- ```html
207
- <!-- For light mode -->
208
- <div class="ds-scroll">
209
- <!-- Content that requires scrolling -->
210
- </div>
211
-
212
- <!-- For dark mode (only if the theme supports it) -->
213
- <div class="ds-scroll ds-mode-dark">
214
- <!-- Content that requires scrolling -->
215
- </div>
216
-
217
- <!-- For size medium (only if the theme supports it) -->
218
- <div class="ds-scroll ds-scroll--size-m">
219
- <!-- Content that requires scrolling -->
220
- </div>
221
-
222
- <!-- Applying global scroll -->
223
- <div class="ds-scroll-global">
224
- <!-- Content (including children) that requires scrolling -->
225
- </div>
226
-
227
- <!-- Applying global scroll in dark mode (only if the theme supports it) -->
228
- <body class="ds-scroll-global ds-mode-dark">
229
- <!-- Content (including children) that requires scrolling -->
230
- </body>
231
-
232
- <!-- Applying global scroll and size medium (only if the theme supports it) -->
233
- <div class="ds-scroll-global ds-scroll--size-m">
234
- <!-- Content that requires scrolling -->
235
- </div>
83
+ Install latest canary:
236
84
 
85
+ ```bash
86
+ npm install @cupra/ui-kit@canary
237
87
  ```
238
- </details>
239
-
240
- ## Gradients
241
-
242
- <details><summary>View gradient classes</summary>
243
88
 
244
- ### `.ds-gradient-default` Class
245
- This class applies a subtle white-to-transparent gradient, ideal for sections requiring a light-themed overlay. It transitions from transparent at the top to solid white at the bottom, using the `--ds-color-white` variable.
89
+ Specific canary version:
246
90
 
247
- ### `.ds-gradient-inverted` Class
248
- This class creates a dark gradient transitioning from transparent to solid black at the bottom. It is suitable for dark-themed overlays, leveraging the `--ds-color-black` variable.
249
-
250
- ### `.ds-gradient-soft` Class
251
- The `.ds-gradient-soft` class provides a soft grey gradient that fades from transparent to `--ds-color-grey-15`. It is perfect for neutral or subtle styling.
252
-
253
- ### `.ds-gradient-grey` Class
254
- This class offers a slightly more pronounced grey gradient, transitioning from transparent to `--ds-color-grey-50`. Use it for elements requiring a moderate grey tone.
255
-
256
- ### `.ds-gradient-muffled` Class
257
- The `.ds-gradient-muffled` class applies a gradient that fades from transparent to `--ds-cp-color-back-muffled-default`. It is ideal for muted or desaturated color themes.
258
-
259
- ### `.ds-gradient-dark-inverted` Class
260
- This gradient transitions from transparent to a soft grey (`--ds-color-grey-15`), offering a light-grey inverted effect for darker themes.
261
-
262
- ### Usage Example
263
- ```html
264
- <!-- Default gradient -->
265
- <div class="ds-gradient-default">
266
- <!-- Content -->
267
- </div>
268
-
269
- <!-- Inverted gradient -->
270
- <div class="ds-gradient-inverted">
271
- <!-- Content -->
272
- </div>
273
-
274
- <!-- Soft grey gradient -->
275
- <div class="ds-gradient-soft">
276
- <!-- Content -->
277
- </div>
278
-
279
- <!-- Pronounced grey gradient -->
280
- <div class="ds-gradient-grey">
281
- <!-- Content -->
282
- </div>
283
-
284
- <!-- Muffled gradient -->
285
- <div class="ds-gradient-muffled">
286
- <!-- Content -->
287
- </div>
288
-
289
- <!-- Dark inverted gradient -->
290
- <div class="ds-gradient-dark-inverted">
291
- <!-- Content -->
292
- </div>
91
+ ```bash
92
+ npm install @cupra/ui-kit@0.1.4-canary.2
293
93
  ```
294
- </details>
295
-
296
- ## Slider component
297
-
298
- <details><summary>View slider component documentation</summary>
299
-
300
- This component provides a customizable slider for selecting values within a specified range. It supports single-value and range sliders with extensive formatting options.
301
-
302
- ### Attributes
303
-
304
- #### Basic Attributes
305
- | Attribute | Type | Default | Description |
306
- |-------------------------|--------------------|-----------|-----------------------------------------------|
307
- | `min` | `number` | `0` | Minimum value for the slider. |
308
- | `max` | `number` | `100` | Maximum value for the slider. |
309
- | `step` | `number` | `1` | Step size for the slider. |
310
- | `initial-value-min` | `number` | `0` | Initial value for the first thumb. |
311
- | `initial-value-max` | `number` | | Initial value for the second thumb (optional, for range sliders). |
312
-
313
- #### Internationalization (Intl) Attributes
314
94
 
315
- These attributes are directly tied to the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API and are used to format numbers according to locale and style.
95
+ ### Recommended usage
96
+ - **Production:** always use **stable (`latest`)**
97
+ - **Testing upcoming features:** use the **canary channel**
98
+ - **Deterministic builds:** pin exact versions (stable or canary)
316
99
 
317
- | Attribute | Type | Default | Description |
318
- |---------------------------|--------------------|-------------|--------------------------------------------------|
319
- | `locale` | `string` | `undefined` | Locale for formatting values (e.g., `en-US`, `es-ES`). |
320
- | `locale-matcher` | `"lookup"` \| `"best fit"` | `"lookup"` | Algorithm to match locales. |
321
- | `unit-style` | `"decimal"` \| `"currency"` \| `"percent"` \| `"unit"` | | Style for formatting the unit (e.g., percentages, currency). |
322
- | `currency` | `string` | | Currency for formatting values (e.g., `USD`, `EUR`). |
323
- | `unit` | `string` | | Unit of measurement for formatting values (e.g., `kilometer`). |
324
- | `minimum-integer-digits` | `number` | `1` | Minimum number of integer digits to display. |
325
- | `minimum-fraction-digits` | `number` | `0` | Minimum number of fractional digits to display. |
326
- | `maximum-fraction-digits` | `number` | `3` | Maximum number of fractional digits to display. |
327
-
328
- #### Component-Specific ("Manual") Attributes
329
-
330
- These attributes extend the functionality of the standard `Intl` API by introducing additional formatting or display options.
331
-
332
- | Attribute | Type | Default | Description |
333
- |---------------------------|--------------------|-----------------|--------------------------------------------------|
334
- | `unit-symbol` | `string` | | Custom symbol to display alongside values (e.g., "km", "°C"). |
335
- | `unit-symbol-position` | `"left"` \| `"right"` | `"right"` | Position of the custom unit symbol. |
336
- | `thousand-separator` | `string` | | Character used to separate thousands. Overrides Intl's formatting. |
337
- | `fraction-separator` | `string` | | Character used to separate fractional parts. Overrides Intl's formatting. |
338
-
339
- #### Styling Attributes
340
- | Attribute | Type | Default | Description |
341
- |------------|--------------|-----------|----------------------------------------------|
342
- | `mode` | `"dark"` \| `"light"` | `"light"` | Visual mode for the slider. |
343
-
344
- ---
345
-
346
- ### How It Works
347
-
348
- Internally, `<ds-slider>` uses the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API to handle number formatting via a helper named `formatNumber`. Component attributes like `locale`, `currency`, `unit`, and `unit-style` are passed directly to `Intl.NumberFormat`.
349
-
350
- - Intl options drive the core formatting (grouping, decimals, symbol availability and position):
351
- - `unit-style="currency"` with `currency` uses the locale’s currency symbol and spacing.
352
- - `unit-style="percent"` uses the locale’s percent sign and placement.
353
- - `unit-style="unit"` with `unit` uses the locale’s unit label/symbol and placement.
354
- - `minimum-/maximum-fraction-digits` control decimal precision; `minimum-integer-digits` controls integer padding.
355
- - `formatNumber` also returns `unitSymbol` and `unitSymbolPosition` (left/right) when the chosen style implies a symbol (currency/percent/unit).
356
- - Component props `unit-symbol` and `unit-symbol-position` override the Intl‑provided symbol and position. If you don’t set them, the Intl-derived ones will be used when available.
357
- - `thousand-separator` and `fraction-separator` override the group and decimal separators in the final output string (they don’t affect rounding).
358
-
359
- #### Formatting guide (quick reference)
360
- - Currency (managed by Intl): set `unit-style="currency"` and a `currency` code; do not set `unit-symbol`.
361
- - Percent (managed by Intl): set `unit-style="percent"`; no custom symbol needed.
362
- - Unit (managed by Intl): set `unit-style="unit"` and `unit` (e.g., `kilometer`); optionally override with `unit-symbol` like `"km"` and your preferred `unit-symbol-position`.
363
- - Custom symbol (manual): leave `unit-style` unset or `decimal`, set `unit-symbol` (e.g., `"°C"`), and choose `unit-symbol-position`.
364
-
365
- ---
366
-
367
- ### Slots
368
- This component does not have slots.
100
+ ```bash
101
+ npm install @cupra/ui-kit@0.1.4-canary.2
102
+ ```
369
103
 
370
104
  ---
371
105
 
372
- ### Events
373
-
374
- | Event | Description | Detail |
375
- |----------|---------------------------------------|-----------------|
376
- | `change` | Fired when the slider value changes. | `{ targetId, value }` |
106
+ ## Usage
107
+ How to consume the package, either through the CDN or your application build.
377
108
 
378
109
  ---
379
110
 
380
- ### Examples
381
-
382
- #### Single Value Slider
111
+ ### Option A — CDN in plain HTML
112
+ 1) Load the DS-UI Web Components bundle:
383
113
 
384
114
  ```html
385
- <ds-slider
386
- min="0"
387
- max="100"
388
- step="1"
389
- initial-value-min="50"
390
- ></ds-slider>
115
+ <script src="https://ds-assets.cupra.com/[version]/dist/index.iife.js"></script>
391
116
  ```
392
117
 
393
- #### Range Slider
118
+ 2) Wrap your UI with the theme provider.
394
119
 
395
- ```html
396
- <ds-slider
397
- min="0"
398
- max="1000"
399
- step="50"
400
- initial-value-min="100"
401
- initial-value-max="500"
402
- ></ds-slider>
403
- ```
404
-
405
- #### Currency Slider (Intl)
406
-
407
- ```html
408
- <ds-slider
409
- min="0"
410
- max="1000"
411
- step="100"
412
- initial-value-min="200"
413
- locale="en-US"
414
- unit-style="currency"
415
- currency="USD"
416
- ></ds-slider>
417
- ```
418
-
419
- #### Custom Symbol Slider
420
-
421
- ```html
422
- <ds-slider
423
- min="0"
424
- max="100"
425
- step="5"
426
- initial-value-min="20"
427
- unit-symbol="°C"
428
- unit-symbol-position="right"
429
- ></ds-slider>
430
- ```
431
-
432
- #### Percent Slider (Intl)
433
-
434
- ```html
435
- <ds-slider
436
- min="0"
437
- max="1"
438
- step="0.1"
439
- initial-value-min="0.25"
440
- locale="en-US"
441
- unit-style="percent"
442
- ></ds-slider>
443
- ```
444
-
445
- #### Unit Slider (Intl with optional override)
120
+ `load-fonts` and `load-styles` control whether the provider loads assets automatically.
121
+ Replace `[theme]` with your theme name (e.g. `cupra-diagonal`).
446
122
 
447
123
  ```html
448
- <ds-slider
449
- min="0"
450
- max="2000"
451
- step="100"
452
- initial-value-min="1200"
453
- locale="en-GB"
454
- unit-style="unit"
455
- unit="kilometer"
456
- >
457
- </ds-slider>
124
+ <ds-theme-provider theme="[theme]" load-fonts="true" load-styles="true">
125
+ <ds-button variant="destructive" icon-name="filters-background">Hello</ds-button>
126
+ <ds-icon icon-name="filters-background"></ds-icon>
127
+ </ds-theme-provider>
458
128
  ```
459
129
 
460
- To override the Intl-derived unit label with a shorter custom symbol:
130
+ **Performance note:**
131
+ For optimal behaviour, manually preload the fonts and load the theme CSS via a stylesheet link.
461
132
 
462
133
  ```html
463
- <ds-slider
464
- min="0"
465
- max="2000"
466
- step="100"
467
- initial-value-min="1200"
468
- locale="en-GB"
469
- unit-style="unit"
470
- unit="kilometer"
471
- unit-symbol="km"
472
- unit-symbol-position="right"
473
- ></ds-slider>
474
- ```
134
+ <!-- Preload fonts (one line per required font file) -->
135
+ <link rel="preload" as="font" type="font/woff2" href="https://ds-assets.cupra.com/fonts/[theme]/[font-file]" crossorigin />
475
136
 
476
- #### Combined Intl and Manual Formatting
137
+ <!-- Load the theme stylesheet normally -->
138
+ <link rel="stylesheet" href="https://ds-assets.cupra.com/[version]/styles/[theme]/theme.css" />
477
139
 
478
- ```html
479
- <ds-slider
480
- min="0"
481
- max="10000"
482
- step="500"
483
- initial-value-min="2000"
484
- locale="es-ES"
485
- currency="EUR"
486
- unit-symbol="approx."
487
- unit-symbol-position="left"
488
- thousand-separator="."
489
- fraction-separator=","
490
- ></ds-slider>
140
+ <ds-theme-provider theme="[theme]" load-fonts="false" load-styles="false">
141
+ <!-- components -->
142
+ </ds-theme-provider>
491
143
  ```
492
144
 
493
145
  ---
494
146
 
495
- ### When to Use
496
-
497
- - **Single Value Sliders**: Use for selecting a single value within a range, e.g., volume control or brightness.
498
- - **Range Sliders**: Use for selecting a range of values, e.g., price filters.
499
- - **Intl Formatting**: Use `locale`, `currency`, and `unit-style` to format values for international users.
500
- - **Custom Symbols**: Combine `unit-symbol` and Intl formatting for tailored user interfaces.
501
-
502
- ---
147
+ ### Option B — Installed via npm in an application bundle
148
+ Install the package:
503
149
 
504
- ### Notes
505
- - Ensure `min`, `max`, and `step` values are consistent to avoid unexpected behavior.
506
- - `unit-symbol` can complement `Intl` settings to provide additional context (e.g., "approx.").
507
- - Custom separators (e.g., `thousand-separator`) override Intl formatting behavior.
508
- </details>
509
-
510
- ## Z-Index Variables
511
-
512
- <details><summary>View z-index variables documentation</summary>
513
-
514
- These CSS variables help you manage the stacking order of the components.
515
-
516
- ### Introduction
517
-
518
- These predefined z-index variables provide a predictable and consistent layering strategy
519
- for elements such as headers, footers, modals, tooltips, and alerts. By using these variables,
520
- you can avoid arbitrary or conflicting z-index values across different parts of your application.
521
-
522
- ### Provided Variables
523
-
524
- | Variable | Default | Description |
525
- |--------------------------------|---------|------------------------------------------------------------------------------------------------------|
526
- | `--ds-z-index-negative` | -1 | Used for layers placed intentionally behind the base layer (e.g., background images). |
527
- | `--ds-z-index-base` | 0 | The default stacking context; typically used by elements without a specific z-index. |
528
- | `--ds-z-index-default` | 1 | Slightly above base elements, often used for general interactive UI components. |
529
- | `--ds-z-index-app-footer` | 1000 | Used for a main application footer if it needs to overlap default content. |
530
- | `--ds-z-index-app-header` | 1100 | Used for a main application header if it needs to overlap default content. |
531
- | `--ds-z-index-overlay` | 1200 | For overlays (e.g., dimmed backgrounds) that should appear above standard content. |
532
- | `--ds-z-index-tooltip` | 1300 | Ensures tooltips appear above overlays but below modals. |
533
- | `--ds-z-index-modal` | 1400 | Used for modal dialogs, above tooltips but potentially below certain dropdowns. |
534
- | `--ds-z-index-context-menu` | 1500 | For context menus or dropdowns that should appear above most overlays and modals. |
535
- | `--ds-z-index-popover` | 1600 | For popovers that need to appear above context menus or modals. |
536
- | `--ds-z-index-toast` | 1700 | For toast or notification messages, typically over main interactions but under loaders. |
537
- | `--ds-z-index-loader` | 1800 | For loading indicators or progress bars that must overlay standard UI elements. |
538
- | `--ds-z-index-alert-info` | 1900 | For informational alerts that need to appear above loaders. |
539
- | `--ds-z-index-alert-success` | 2000 | For success alerts, higher than info alerts. |
540
- | `--ds-z-index-alert-warning` | 2100 | For warning alerts, stacked above success alerts. |
541
- | `--ds-z-index-alert-error` | 2200 | For error alerts, stacked above warning alerts. |
542
- | `--ds-z-index-top` | 9999 | A very high stacking level for elements that must appear above all other layers. |
543
-
544
- ### Usage
545
-
546
- To apply one of these z-index values, reference the variable in your CSS.
547
- For example, a modal:
548
-
549
- ```css
550
- .my-modal {
551
- position: fixed;
552
- top: 50%;
553
- left: 50%;
554
- transform: translate(-50%, -50%);
555
- z-index: var(--ds-z-index-modal);
556
- }
150
+ ```bash
151
+ npm install @cupra/ui-kit
557
152
  ```
558
153
 
559
- Or a context menu:
154
+ Import only the components you will use so their custom elements are registered:
560
155
 
561
- ```css
562
- .my-context-menu {
563
- position: absolute;
564
- z-index: var(--ds-z-index-context-menu);
565
- /* Additional styling here */
566
- }
156
+ ```js
157
+ import '@cupra/ui-kit/ds-theme-provider';
158
+ import '@cupra/ui-kit/ds-button';
159
+ import '@cupra/ui-kit/ds-icon';
567
160
  ```
568
161
 
569
- By consistently using these shared variables, you can maintain uniform layering logic
570
- across your application.
162
+ Then include the theme provider:
571
163
 
572
- ### When to Use
573
-
574
- - **Overlays and Dialogs**: Assign `--ds-z-index-overlay` for modal backgrounds or overlays,
575
- and `--ds-z-index-modal` for dialogs that appear on top of them.
576
- - **Context Menus**: Utilize `--ds-z-index-context-menu` for right-click or dropdown menus,
577
- ensuring they appear above standard overlays and modals.
578
- - **Tooltips and Popovers**: Use `--ds-z-index-tooltip` for tooltips and `--ds-z-index-popover`
579
- for popovers, maintaining a proper stacking order.
580
- - **Notifications**: Use `--ds-z-index-toast` for toast messages, ensuring they're visible
581
- but do not overshadow modals or popovers.
582
- - **Critical Alerts**: For error or critical alerts, consider the highest relevant index
583
- (`--ds-z-index-alert-error`) to ensure they appear above other elements.
584
- - **Custom Needs**: If you need a layer above or below existing tiers, consider defining
585
- a new variable. However, we recommend using these provided values for clarity and consistency.
586
- </details>
587
-
588
- ## Background Classes (.ds-bg)
589
-
590
- <details><summary>View background classes</summary>
591
-
592
- ### Introduction
593
-
594
- These CSS classes are designed to apply responsive backgrounds to HTML elements. The background image is loaded from a CDN using the base URL defined by the `$cdnBaseUrl` variable, and it adapts automatically to different screen sizes through media queries. The system uses a base class (`.ds-bg`) along with several variant classes to determine which background image to display.
595
-
596
- ### Available Classes
597
-
598
- | **Class** | **Description** |
599
- |----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
600
- | **ds-bg** | The base background class. It applies:<br>- Vertical background repeat (`repeat-y`).<br>- Base background color using `--dg-color-bg-base`.<br>- Background size set to 100% width (auto height). |
601
- | **ds-bg--leon** | Variant that applies the "leon" background image when used together with `ds-bg`. |
602
- | **ds-bg--terramar** | Variant that applies the "terramar" background image when used together with `ds-bg`. |
603
- | **ds-bg--ateca** | Variant that applies the "ateca" background image when used together with `ds-bg`. |
604
- | **ds-bg--born** | Variant that applies the "born" background image when used together with `ds-bg`. |
605
- | **ds-bg--tavascan** | Variant that applies the "tavascan" background image when used together with `ds-bg`. |
606
- | **ds-bg--formentor** | Variant that applies the "formentor" background image when used together with `ds-bg`. |
607
-
608
- ### Responsive Behavior and Breakpoints
609
-
610
- Background images and their positions change automatically based on the screen width. Below is an overview of the breakpoints and how the background is adjusted:
611
-
612
- | **Breakpoint** | **Media Query** | **Image Suffix** | **Background Position** |
613
- |----------------|-----------------------|-----------|----------------|
614
- | **XS** | min-width: 0px | `-xs.svg` | `left top` |
615
- | **S** | min-width: 480px | `-s.svg` | `left top` |
616
- | **M** | min-width: 768px | `-m.svg` | `left -338px` |
617
- | **L** | min-width: 1024px | `-l.svg` | `left -338px` |
618
- | **XL** | min-width: 1440px | `-xl.svg` | `left -595px` |
619
- | **XXL** | min-width: 1920px | `-xxl.svg` | `left -595px` |
620
-
621
- ### Usage Examples
622
-
623
- **Default Background:**
164
+ Replace `[theme]` with your theme name (e.g. `cupra-diagonal`).
624
165
 
625
166
  ```html
626
- <div class="ds-bg"></div>
627
- ```
628
-
629
- **Using a Variant (e.g., "ds-bg--leon"):**
630
-
631
- ```html
632
- <div class="ds-bg ds-bg--leon"></div>
167
+ <ds-theme-provider theme="[theme]" load-fonts="true" load-styles="true">
168
+ <ds-button variant="primary">Button</ds-button>
169
+ </ds-theme-provider>
633
170
  ```
634
171
 
635
- Simply add the base class `ds-bg` to your element. To display a specific background image, combine it with one of the variant classes such as `ds-bg--leon`, `ds-bg--terramar`, `ds-bg--ateca`, `ds-bg--born`, or `ds-bg--tavascan`.
636
- </details>
637
-
638
- ## ds-currency
639
-
640
- <details><summary>View currency component documentation</summary>
641
-
642
- `ds-currency` is a new component designed to display a currency value formatted according to your settings. It handles symbol placement, decimal and thousand separators, and optional period/note.
643
-
644
- ### 🎯 Attributes
645
-
646
- - **currency-code**
647
- ISO 4217 currency code (e.g. `EUR`, `USD`).
648
-
649
- - **locale**
650
- BCP 47 locale tag (ISO 639-1 language + ISO 3166-1 alpha-2 region), e.g. `es-ES`, `en-US`.
651
-
652
- - **amount-number**
653
- Numeric value to format as currency.
654
-
655
- - **amount-text**
656
- Literal text to display instead of the formatted value.
657
-
658
- - **minimum-fraction-digits**
659
- Minimum decimals (default `0`).
660
-
661
- - **maximum-fraction-digits**
662
- Maximum decimals (default `20`).
663
-
664
- - **thousand-separator**
665
- Override default thousands separator.
666
-
667
- - **fraction-separator**
668
- Override default decimal separator.
669
-
670
- - **period**
671
- Field to display after the amount (e.g. `month`, `year`, etc.). Acceptable values: `era`, `year`, `month`, `quarter`, `weekOfYear`, `weekday`, `dayPeriod`, `day`, `hour`, `minute`, `second`. These correspond to the standard ECMA-402 `Intl.DisplayNames` `dateTimeField` values (Unicode CLDR UTS #35) and are transformed according to the locale.
672
-
673
- - **note**
674
- Used to render a superscript number (e.g. "¹", "²") that links to footnotes or explanatory text in the UI.
675
-
676
172
  ---
677
173
 
678
- ### 💻 Example
679
-
680
- <ds-currency
681
- locale="es-ES"
682
- currency-code="EUR"
683
- amount-number="1234.56"
684
- period="month"
685
- note="1">
686
- </ds-currency>
687
-
688
- _Renders:_ **1.234,56€¹/month**
689
-
690
- ---
691
-
692
- ### 🌐 ISO & Standards + Functionality
693
-
694
- - **currency-code** follows **ISO 4217** for currency identifiers
695
- - **locale** uses **BCP 47** (ISO 639-1 + ISO 3166-1 alpha-2) to drive `Intl.NumberFormat` and `Intl.DisplayNames`
696
- - **period** uses **ECMA-402 Intl.DisplayNames** `dateTimeField` values (Unicode CLDR UTS #35) `era`, `year`, `month`… and localizes accordingly
697
- - Formats numbers with proper decimal and thousand separators
698
- - Positions currency symbol automatically (left/right) based on locale
699
- - Supports custom separators, fraction digit limits, plus optional period (`/month`, `/year`) and note text
700
- </details>
701
-
702
- ## Toast System
703
-
704
- <details><summary>Toast</summary>
705
-
706
- The toast system provides a way to display non-intrusive notifications to users. It consists of two components:
707
-
708
- - `<ds-toast>`: The container that manages and displays toast messages
709
- - `<ds-toast-message>`: Individual toast message components
710
-
711
- ### Basic Usage
712
-
713
- 1. Add the toast container to your application:
714
-
715
- ```html
716
- <ds-toast position="top-right"></ds-toast>
717
- ```
718
-
719
- 2. Trigger a toast from anywhere in your JavaScript:
720
-
721
- ```javascript
722
- window.dispatchEvent(
723
- new CustomEvent('toast:add', {
724
- detail: {
725
- title: 'Success',
726
- text: 'Operation completed successfully',
727
- status: 'success',
728
- duration: 5000 // Optional: time in milliseconds before auto-dismissing (default: 10000ms)
729
- }
730
- })
731
- );
732
- ```
733
-
734
- ### Toast Statuses
735
-
736
- There are five possible statuses for a toast message:
737
-
738
- - `success`: Used for successful operations
739
- - `error`: Used for error messages
740
- - `warning`: Used for warning messages
741
- - `info`: Used for informational messages
742
- - `default`: Used when no specific status is needed
743
-
744
- ### Custom Toast Templates
745
-
746
- You can create custom toast templates using the `<ds-toast-message>` component:
747
-
748
- ```html
749
- <ds-toast-message
750
- data-id="custom-toast-template"
751
- data-template="true"
752
- status="default"
753
- title="Custom Toast"
754
- text="This is a custom toast message"
755
- >
756
- <ds-link-button>Action Link</ds-link-button>
757
- </ds-toast-message>
758
- ```
759
-
760
- Then trigger it using:
761
-
762
- ```javascript
763
- window.dispatchEvent(
764
- new CustomEvent('toast:add', {
765
- detail: {
766
- referenceId: 'custom-toast-template',
767
- duration: 10000 // Optional: custom duration
768
- }
769
- })
770
- );
771
- ```
772
-
773
- ### Toast Positioning
774
-
775
- The `<ds-toast>` component supports four positions:
776
-
777
- - `top-right` (default)
778
- - `top-left`
779
- - `bottom-right`
780
- - `bottom-left`
781
-
782
- ```html
783
- <ds-toast position="bottom-left"></ds-toast>
784
- ```
785
-
786
- ### Toast Options
787
-
788
- The `'toast:add'` event `detail` accepts the following options:
789
-
790
- | Option | Type | Description |
791
- |-------------|------|---------------------------------------------------------------------------|
792
- | id | string | Optional custom identifier for the toast. If not provided, the system automatically generates one. Useful when you need to reference or remove a specific toast programmatically.|
793
- | title | string | The title of the toast |
794
- | text | string | The message content of the toast |
795
- | status | string | One of: 'success', 'error', 'warning', 'info', 'default' |
796
- | duration | number | Time in milliseconds before auto-dismissing (default: 10000ms) |
797
- | referenceId | string | ID of a custom toast template to use (will ignore title, text and status) |
798
-
799
- ### React Usage
800
-
801
- If you're using React, you can use the provided React components:
802
-
803
- ```jsx
804
- import { Toast, ToastMessage } from '@cupra/ui-react';
805
-
806
- // In your component:
807
- return (
808
- <>
809
- <Toast position="top-right" />
810
-
811
- {/* Custom template (optional) */}
812
- <ToastMessage
813
- data-id="custom-template"
814
- data-template={true}
815
- title="Custom Toast"
816
- text="This is a custom toast message"
817
- >
818
- <button>Action Button</button>
819
- </ToastMessage>
820
- </>
821
- );
822
-
823
- // Trigger a toast from anywhere:
824
- window.dispatchEvent(
825
- new CustomEvent('toast:add', {
826
- detail: {
827
- title: 'Hello',
828
- text: 'This is a toast message',
829
- status: 'info'
830
- }
831
- })
832
- );
833
- ```
834
-
835
- ### Removing a Toast
836
-
837
- To manually close or remove a toast, dispatch the `'toast:remove'` event.
838
- It accepts either the `id` of a specific toast or the `referenceId` of a custom template.
839
-
840
- ```javascript
841
- // Remove a specific toast by ID
842
- window.dispatchEvent(
843
- new CustomEvent('toast:remove', { detail: { id: 'my-toast-id' } })
844
- );
845
-
846
- // Or remove a toast created from a template
847
- window.dispatchEvent(
848
- new CustomEvent('toast:remove', { detail: { referenceId: 'custom-toast-template' } })
849
- );
850
- ```
851
-
852
- > **Note:**
853
- > This is **not the recommended approach**.
854
- > Toasts are designed to close automatically after their duration expires, or manually by user interaction (for example, clicking a close button).
855
- > The `'toast:remove'` event should only be used in specific cases when programmatic control is required.
856
- >
857
- > When removing by `id`, each toast has a unique identifier (automatically generated unless manually provided).
858
- > When removing by `referenceId`, it refers to a template identifier.
859
- > If multiple toasts have been created using the same `referenceId`, only one instance —the oldest— will be removed.
174
+ ## License
175
+ License: SEAT S.A. Library EULA 1.0
176
+ See `LICENSE.md` for the full license text.
177
+ Third-party license attributions may be listed in `THIRD_PARTY_LICENSES.md`.
860
178
 
861
- </details>
179
+ ## Support
180
+ For any questions or assistance, contact: **ds.support@seat.es**