@cupra/ui-kit 1.0.0-canary.6 → 1.0.0-canary.8

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.
package/README.md CHANGED
@@ -115,30 +115,29 @@ How to consume the package, either through the CDN or your application build.
115
115
  <script src="https://ds-assets.cupra.com/[version]/dist/index.iife.js"></script>
116
116
  ```
117
117
 
118
- 2) Load the theme CSS (link preferred for performance):
118
+ 2) Wrap your UI with the theme provider.
119
119
 
120
- ```html
121
- <link rel="stylesheet" href="https://ds-assets.cupra.com/[version]/styles/[theme]/theme.css" />
122
- ```
123
-
124
- 3) Wrap your UI with the theme provider.
125
- `load-fonts` and `load-styles` control whether the provider loads assets automatically.
120
+ `load-fonts` and `load-styles` control whether the provider loads assets automatically.
121
+ Replace `[theme]` with your theme name (e.g. `cupra-diagonal`).
126
122
 
127
123
  ```html
128
- <ds-theme-provider theme="cupra" load-fonts="true" load-styles="true">
124
+ <ds-theme-provider theme="[theme]" load-fonts="true" load-styles="true">
129
125
  <ds-button variant="destructive" icon-name="filters-background">Hello</ds-button>
130
126
  <ds-icon icon-name="filters-background"></ds-icon>
131
127
  </ds-theme-provider>
132
128
  ```
133
129
 
134
130
  **Performance note:**
135
- For optimal behaviour, manually preload the CSS (and fonts if required) and set the provider to not load them:
131
+ For optimal behaviour, manually preload the fonts and load the theme CSS via a stylesheet link.
136
132
 
137
133
  ```html
138
- <link rel="preload" as="style" href="https://ds-assets.cupra.com/[version]/styles/cupra/theme.css" />
139
- <link rel="stylesheet" href="https://ds-assets.cupra.com/[version]/styles/cupra/theme.css" />
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 />
136
+
137
+ <!-- Load the theme stylesheet normally -->
138
+ <link rel="stylesheet" href="https://ds-assets.cupra.com/[version]/styles/[theme]/theme.css" />
140
139
 
141
- <ds-theme-provider theme="cupra" load-fonts="false" load-styles="false">
140
+ <ds-theme-provider theme="[theme]" load-fonts="false" load-styles="false">
142
141
  <!-- components -->
143
142
  </ds-theme-provider>
144
143
  ```
@@ -152,11 +151,18 @@ Install the package:
152
151
  npm install @cupra/ui-kit
153
152
  ```
154
153
 
155
- Then include the theme provider as in the CDN example.
156
- CSS may be loaded manually (recommended) or automatically via the provider:
154
+ Import the package once so the custom elements are registered:
155
+
156
+ ```js
157
+ import '@cupra/ui-kit';
158
+ ```
159
+
160
+ Then include the theme provider:
161
+
162
+ Replace `[theme]` with your theme name (e.g. `cupra-diagonal`).
157
163
 
158
164
  ```html
159
- <ds-theme-provider theme="cupra" load-fonts="true" load-styles="true">
165
+ <ds-theme-provider theme="[theme]" load-fonts="true" load-styles="true">
160
166
  <ds-button variant="primary">Button</ds-button>
161
167
  </ds-theme-provider>
162
168
  ```
package/dist/index.js CHANGED
@@ -191,7 +191,7 @@ class se {
191
191
  theme: s
192
192
  }) => {
193
193
  if (!s || !e) return;
194
- const i = `https://ds-assets.cupra.com/1.0.0-canary.6/styles/${s}/components/${e}.css`, o = this.getCachedStyleSheetPromise({ url: i });
194
+ const i = `https://ds-assets.cupra.com/1.0.0-canary.8/styles/${s}/components/${e}.css`, o = this.getCachedStyleSheetPromise({ url: i });
195
195
  if (o) return o;
196
196
  const n = this.fetchStyle({ url: i }).then((h) => (h || this.stylePromises.delete(i), h));
197
197
  return this.stylePromises.set(i, n), this.stylePromises.get(i);
@@ -1226,7 +1226,7 @@ let Ts = class extends Fs {
1226
1226
  Ts.directiveName = "unsafeHTML", Ts.resultType = 1;
1227
1227
  const os = js(Ts);
1228
1228
  function k(t, ...e) {
1229
- const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-6"), i = os(r);
1229
+ const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-8"), i = os(r);
1230
1230
  return l`${i}`;
1231
1231
  }
1232
1232
  /**
@@ -3978,7 +3978,7 @@ Ae = zo([
3978
3978
  v("ds-loader-bar", { skipTagAsComponentName: !0 })
3979
3979
  ], Ae);
3980
3980
  function Jt(t, ...e) {
3981
- const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-6"), i = vi(r);
3981
+ const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-8"), i = vi(r);
3982
3982
  return u`${i}`;
3983
3983
  }
3984
3984
  const Ao = Jt`
@@ -7944,7 +7944,7 @@ let Wt = class extends pt {
7944
7944
  }
7945
7945
  loadThemeStyles() {
7946
7946
  return this.loadStyles ? new Promise((t, e) => {
7947
- const s = "/1.0.0-canary.6", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
7947
+ const s = "/1.0.0-canary.8", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
7948
7948
  if (document.head.querySelector(`link[href="${r}"]`)) t();
7949
7949
  else {
7950
7950
  const i = `ui-kit-theme-${s}`, o = document.getElementById(i), n = document.createElement("link");
@@ -191,7 +191,7 @@ class se {
191
191
  theme: s
192
192
  }) => {
193
193
  if (!s || !e) return;
194
- const i = `https://ds-assets.cupra.com/1.0.0-canary.6/styles/${s}/components/${e}.css`, o = this.getCachedStyleSheetPromise({ url: i });
194
+ const i = `https://ds-assets.cupra.com/1.0.0-canary.8/styles/${s}/components/${e}.css`, o = this.getCachedStyleSheetPromise({ url: i });
195
195
  if (o) return o;
196
196
  const n = this.fetchStyle({ url: i }).then((h) => (h || this.stylePromises.delete(i), h));
197
197
  return this.stylePromises.set(i, n), this.stylePromises.get(i);
@@ -1150,7 +1150,7 @@ let Ts = class extends Fs {
1150
1150
  Ts.directiveName = "unsafeHTML", Ts.resultType = 1;
1151
1151
  const os = js(Ts);
1152
1152
  function C(t, ...e) {
1153
- const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-6"), i = os(r);
1153
+ const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-8"), i = os(r);
1154
1154
  return l`${i}`;
1155
1155
  }
1156
1156
  /**
@@ -3902,7 +3902,7 @@ Ae = Po([
3902
3902
  v("ds-loader-bar", { skipTagAsComponentName: !0 })
3903
3903
  ], Ae);
3904
3904
  function Jt(t, ...e) {
3905
- const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-6"), i = vi(r);
3905
+ const r = String.raw({ raw: t }, ...e).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-8"), i = vi(r);
3906
3906
  return u`${i}`;
3907
3907
  }
3908
3908
  const Io = Jt`
@@ -7868,7 +7868,7 @@ let Wt = class extends pt {
7868
7868
  }
7869
7869
  loadThemeStyles() {
7870
7870
  return this.loadStyles ? new Promise((t, e) => {
7871
- const s = "/1.0.0-canary.6", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
7871
+ const s = "/1.0.0-canary.8", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
7872
7872
  if (document.head.querySelector(`link[href="${r}"]`)) t();
7873
7873
  else {
7874
7874
  const i = `ui-kit-theme-${s}`, o = document.getElementById(i), n = document.createElement("link");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-kit",
3
- "version": "1.0.0-canary.6",
3
+ "version": "1.0.0-canary.8",
4
4
  "description": "Web components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
@@ -20,10 +20,19 @@
20
20
  "type": "module",
21
21
  "types": "./dist/index.d.ts",
22
22
  "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./react": {
29
+ "types": "./dist-react/index.d.ts",
30
+ "import": "./dist-react/index.js",
31
+ "default": "./dist-react/index.js"
32
+ },
23
33
  "./*": "./dist/*.js",
24
34
  "./types/*": "./dist/components/*/*.types.d.ts",
25
35
  "./utils/*": "./dist/utils/*.js",
26
- "./react": "./dist-react/index.js",
27
36
  "./react/types/*": "./dist-react/components/*/*.types.d.ts",
28
37
  "./react/utils/*": "./dist-react/utils/*.js"
29
38
  },