@cupra/ui-react 1.0.0-canary.2 → 1.0.0-canary.21

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 (108) hide show
  1. package/README.md +21 -8
  2. package/{THIRD-PARTY-LICENSES.MD → THIRD_PARTY_LICENSES.MD} +3 -3
  3. package/dist/components/Accordion/Accordion.d.ts +1 -1
  4. package/dist/components/Accordion/Accordion.js +1 -1
  5. package/dist/components/Avatar/Avatar.d.ts +1 -1
  6. package/dist/components/Avatar/Avatar.js +8 -7
  7. package/dist/components/Bullets/Bullets.d.ts +1 -1
  8. package/dist/components/Bullets/Bullets.js +1 -1
  9. package/dist/components/Button/Button.d.ts +1 -1
  10. package/dist/components/Button/Button.js +7 -6
  11. package/dist/components/CarouselIndicator/CarouselIndicator.d.ts +1 -1
  12. package/dist/components/CarouselIndicator/CarouselIndicator.js +1 -1
  13. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  14. package/dist/components/Checkbox/Checkbox.js +7 -6
  15. package/dist/components/Chip/Chip.d.ts +1 -1
  16. package/dist/components/Chip/Chip.js +1 -1
  17. package/dist/components/Chips/Chips.d.ts +1 -1
  18. package/dist/components/Chips/Chips.js +7 -6
  19. package/dist/components/Currency/Currency.d.ts +1 -1
  20. package/dist/components/Currency/Currency.js +1 -1
  21. package/dist/components/Dialog/Dialog.d.ts +1 -1
  22. package/dist/components/Dialog/Dialog.js +4 -3
  23. package/dist/components/DialogBody/DialogBody.d.ts +1 -1
  24. package/dist/components/DialogBody/DialogBody.js +1 -1
  25. package/dist/components/DialogFooter/DialogFooter.d.ts +1 -1
  26. package/dist/components/DialogFooter/DialogFooter.js +1 -1
  27. package/dist/components/DialogHeader/DialogHeader.d.ts +1 -1
  28. package/dist/components/DialogHeader/DialogHeader.js +1 -1
  29. package/dist/components/Divider/Divider.d.ts +1 -1
  30. package/dist/components/Divider/Divider.js +1 -1
  31. package/dist/components/Hyperlink/Hyperlink.d.ts +1 -1
  32. package/dist/components/Hyperlink/Hyperlink.js +6 -5
  33. package/dist/components/Icon/Icon.d.ts +1 -1
  34. package/dist/components/Icon/Icon.js +1 -1
  35. package/dist/components/IconButton/IconButton.d.ts +1 -1
  36. package/dist/components/IconButton/IconButton.js +7 -6
  37. package/dist/components/Input/Input.d.ts +1 -1
  38. package/dist/components/Input/Input.js +1 -1
  39. package/dist/components/InteractiveCard/InteractiveCard.d.ts +1 -1
  40. package/dist/components/InteractiveCard/InteractiveCard.js +5 -4
  41. package/dist/components/LinkButton/LinkButton.d.ts +1 -1
  42. package/dist/components/LinkButton/LinkButton.js +4 -3
  43. package/dist/components/Loader/Loader.d.ts +4 -1
  44. package/dist/components/Loader/Loader.js +16 -13
  45. package/dist/components/Logo/Logo.d.ts +1 -1
  46. package/dist/components/Logo/Logo.js +1 -1
  47. package/dist/components/MapPin/MapPin.d.ts +1 -1
  48. package/dist/components/MapPin/MapPin.js +8 -7
  49. package/dist/components/Modal/Modal.d.ts +1 -1
  50. package/dist/components/Modal/Modal.js +2 -1
  51. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
  52. package/dist/components/PasswordInput/PasswordInput.js +33 -35
  53. package/dist/components/PickerItem/PickerItem.d.ts +1 -1
  54. package/dist/components/PickerItem/PickerItem.js +1 -1
  55. package/dist/components/Radio/Radio.d.ts +1 -1
  56. package/dist/components/Radio/Radio.js +7 -6
  57. package/dist/components/RadioButton/RadioButton.d.ts +1 -1
  58. package/dist/components/RadioButton/RadioButton.js +1 -1
  59. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
  60. package/dist/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  61. package/dist/components/Search/Search.d.ts +1 -1
  62. package/dist/components/Search/Search.js +1 -1
  63. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  64. package/dist/components/SearchInput/SearchInput.js +8 -7
  65. package/dist/components/SecondaryNavigation/SecondaryNavigation.d.ts +1 -1
  66. package/dist/components/SecondaryNavigation/SecondaryNavigation.js +2 -1
  67. package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
  68. package/dist/components/SegmentedControl/SegmentedControl.js +8 -7
  69. package/dist/components/Select/Select.d.ts +1 -1
  70. package/dist/components/Select/Select.js +1 -1
  71. package/dist/components/Selection/Selection.d.ts +1 -1
  72. package/dist/components/Selection/Selection.js +1 -1
  73. package/dist/components/SidebarNavigation/SidebarNavigation.d.ts +1 -1
  74. package/dist/components/SidebarNavigation/SidebarNavigation.js +1 -1
  75. package/dist/components/Slider/Slider.d.ts +2 -2
  76. package/dist/components/Slider/Slider.js +1 -1
  77. package/dist/components/StaticBox/StaticBox.d.ts +1 -1
  78. package/dist/components/StaticBox/StaticBox.js +7 -6
  79. package/dist/components/Stepper/Stepper.d.ts +1 -1
  80. package/dist/components/Stepper/Stepper.js +1 -1
  81. package/dist/components/Tabs/Tabs.d.ts +1 -1
  82. package/dist/components/Tabs/Tabs.js +11 -10
  83. package/dist/components/Tag/Tag.d.ts +1 -1
  84. package/dist/components/Tag/Tag.js +8 -7
  85. package/dist/components/Text/Text.d.ts +1 -1
  86. package/dist/components/Text/Text.js +1 -1
  87. package/dist/components/TextInput/TextInput.d.ts +1 -1
  88. package/dist/components/TextInput/TextInput.js +15 -14
  89. package/dist/components/Textarea/Textarea.d.ts +1 -1
  90. package/dist/components/Textarea/Textarea.js +4 -3
  91. package/dist/components/ThemeProvider/ThemeProvider.d.ts +1 -1
  92. package/dist/components/ThemeProvider/ThemeProvider.js +1 -1
  93. package/dist/components/Toast/Toast.d.ts +1 -1
  94. package/dist/components/Toast/Toast.js +1 -1
  95. package/dist/components/ToastMessage/ToastMessage.d.ts +1 -1
  96. package/dist/components/ToastMessage/ToastMessage.js +7 -6
  97. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
  98. package/dist/components/ToggleButton/ToggleButton.js +4 -3
  99. package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  100. package/dist/components/ToggleSwitch/ToggleSwitch.js +9 -8
  101. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  102. package/dist/components/Tooltip/Tooltip.js +6 -5
  103. package/dist/hooks/useBreakpoint.js +13 -13
  104. package/dist/hooks/useHandleEvent.js +18 -16
  105. package/package.json +20 -9
  106. package/dist/packages/ui-kit/dist-react/index.js +0 -9221
  107. package/dist/packages/ui-kit/dist-react/utils/breakpoints.js +0 -11
  108. package/dist/packages/ui-kit/dist-react/utils/debounce.js +0 -11
@@ -1,8 +1,9 @@
1
1
  import { jsxs as E, jsx as r } from "react/jsx-runtime";
2
- import "../../packages/ui-kit/dist-react/index.js";
2
+ import "@cupra/ui-kit/react/ds-textarea";
3
+ import "@cupra/ui-kit/react/utils/breakpoints";
3
4
  import "react";
4
5
  import { useHandleEvent as j } from "../../hooks/useHandleEvent.js";
5
- function C(t) {
6
+ function F(t) {
6
7
  const {
7
8
  className: o,
8
9
  children: I,
@@ -53,5 +54,5 @@ function C(t) {
53
54
  );
54
55
  }
55
56
  export {
56
- C as Textarea
57
+ F as Textarea
57
58
  };
@@ -1,4 +1,4 @@
1
- import '@cupra/ui-kit/react';
1
+ import '@cupra/ui-kit/react/ds-theme-provider';
2
2
  import { DsThemeProviderAttrs } from '@cupra/ui-kit/react/types/ds-theme-provider';
3
3
  import { type ReactElement } from 'react';
4
4
  type Children = JSX.Element | JSX.Element[] | string;
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import "../../packages/ui-kit/dist-react/index.js";
2
+ import "@cupra/ui-kit/react/ds-theme-provider";
3
3
  const i = ({ children: r, ...e }) => /* @__PURE__ */ o("ds-theme-provider-react", { ...e, children: r });
4
4
  export {
5
5
  i as ThemeProvider
@@ -1,6 +1,6 @@
1
1
  import type { DsToastAttrs, ToastOptions } from '@cupra/ui-kit/react/types/ds-toast';
2
2
  import { type ReactNode } from 'react';
3
- import '@cupra/ui-kit/react';
3
+ import '@cupra/ui-kit/react/ds-toast';
4
4
  type ToastProps = DsToastAttrs & {
5
5
  className?: string;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import "../../packages/ui-kit/dist-react/index.js";
2
+ import "@cupra/ui-kit/react/ds-toast";
3
3
  function e(t) {
4
4
  const { className: o, ...s } = t;
5
5
  return /* @__PURE__ */ a("ds-toast-react", { class: o, ...s });
@@ -1,6 +1,6 @@
1
1
  import { DsToastMessageAttrs } from '@cupra/ui-kit/react/types/ds-toast-message';
2
2
  import { type ReactNode } from 'react';
3
- import '@cupra/ui-kit/react';
3
+ import '@cupra/ui-kit/react/ds-toast-message';
4
4
  export type ToastMessageProps = DsToastMessageAttrs & {
5
5
  className?: string;
6
6
  children?: ReactNode;
@@ -1,13 +1,14 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import "../../packages/ui-kit/dist-react/index.js";
2
+ import "@cupra/ui-kit/react/ds-toast-message";
3
+ import "@cupra/ui-kit/react/utils/breakpoints";
3
4
  import "react";
4
5
  import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
5
- function f(o) {
6
- const { className: s, children: e, onClose: t, ...r } = o, { ref: a } = n({
7
- "toast:remove": t
6
+ function d(o) {
7
+ const { className: s, children: t, onClose: e, ...r } = o, { ref: a } = n({
8
+ "toast:remove": e
8
9
  });
9
- return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children: e });
10
+ return /* @__PURE__ */ m("ds-toast-message-react", { ref: a, class: s, ...r, children: t });
10
11
  }
11
12
  export {
12
- f as ToastMessage
13
+ d as ToastMessage
13
14
  };
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import '@cupra/ui-kit/react';
2
+ import '@cupra/ui-kit/react/ds-toggle-button';
3
3
  import { type DsToggleButtonAttrs } from '@cupra/ui-kit/react/types/ds-toggle-button';
4
4
  type ToggleButtonProps = DsToggleButtonAttrs & {
5
5
  onChange?: (event: CustomEvent) => void;
@@ -1,11 +1,12 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
2
3
  import "react";
3
4
  import { useHandleEvent as n } from "../../hooks/useHandleEvent.js";
4
- import "../../packages/ui-kit/dist-react/index.js";
5
- function u({ onChange: t, ...o }) {
5
+ import "@cupra/ui-kit/react/ds-toggle-button";
6
+ function c({ onChange: t, ...o }) {
6
7
  const { ref: r } = n({ change: t });
7
8
  return /* @__PURE__ */ e("ds-toggle-button-react", { ref: r, ...o });
8
9
  }
9
10
  export {
10
- u as ToggleButton
11
+ c as ToggleButton
11
12
  };
@@ -1,5 +1,5 @@
1
1
  import { type ChangeEvent, type ReactElement } from 'react';
2
- import '@cupra/ui-kit/react';
2
+ import '@cupra/ui-kit/react/ds-toggle-switch';
3
3
  import { DsToggleSwitchAttrs } from '@cupra/ui-kit/react/types/ds-toggle-switch';
4
4
  type Children = JSX.Element | JSX.Element[] | string;
5
5
  interface ToggleSwitchProps extends DsToggleSwitchAttrs {
@@ -1,19 +1,20 @@
1
- import { jsxs as f, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as n } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
2
3
  import "react";
3
4
  import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
4
- import "../../packages/ui-kit/dist-react/index.js";
5
- function r({ label: n, onChange: i, ...o }) {
5
+ import "@cupra/ui-kit/react/ds-toggle-switch";
6
+ function r({ label: t, onChange: i, ...o }) {
6
7
  const { ref: e } = c({ change: i });
7
8
  return /* @__PURE__ */ f("ds-toggle-switch-react", { ref: e, ...o, children: [
8
- n && /* @__PURE__ */ t("div", { slot: "label", children: n }),
9
+ t && /* @__PURE__ */ n("div", { slot: "label", children: t }),
9
10
  o.children
10
11
  ] });
11
12
  }
12
- function l({ children: n }) {
13
- return /* @__PURE__ */ t("div", { slot: "off", children: n });
13
+ function l({ children: t }) {
14
+ return /* @__PURE__ */ n("div", { slot: "off", children: t });
14
15
  }
15
- function s({ children: n }) {
16
- return /* @__PURE__ */ t("div", { slot: "on", children: n });
16
+ function s({ children: t }) {
17
+ return /* @__PURE__ */ n("div", { slot: "on", children: t });
17
18
  }
18
19
  r.Off = l;
19
20
  r.On = s;
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import '@cupra/ui-kit/react';
2
+ import '@cupra/ui-kit/react/ds-tooltip';
3
3
  import { DsTooltipAttrs } from '@cupra/ui-kit/react/types/ds-tooltip';
4
4
  type Children = JSX.Element | JSX.Element[] | string;
5
5
  interface TooltipProps extends DsTooltipAttrs {
@@ -1,13 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
+ import "@cupra/ui-kit/react/utils/breakpoints";
2
3
  import "react";
3
4
  import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
4
5
  import p from "../../node_modules/.pnpm/styled-components@6.1.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js";
5
- import "../../packages/ui-kit/dist-react/index.js";
6
- const l = p.div`
6
+ import "@cupra/ui-kit/react/ds-tooltip";
7
+ const m = p.div`
7
8
  display: flex;
8
9
  align-items: center;
9
10
  `;
10
- function u({
11
+ function x({
11
12
  children: o,
12
13
  onClickCancelButton: r,
13
14
  onClickConfirmButton: i,
@@ -17,8 +18,8 @@ function u({
17
18
  "click-cancel-button": r,
18
19
  "click-confirm-button": i
19
20
  });
20
- return /* @__PURE__ */ t("ds-tooltip-react", { ref: n, ...e, children: /* @__PURE__ */ t(l, { children: o }) });
21
+ return /* @__PURE__ */ t("ds-tooltip-react", { ref: n, ...e, children: /* @__PURE__ */ t(m, { children: o }) });
21
22
  }
22
23
  export {
23
- u as Tooltip
24
+ x as Tooltip
24
25
  };
@@ -1,20 +1,20 @@
1
- import { breakpoints as o } from "../packages/ui-kit/dist-react/utils/breakpoints.js";
1
+ import { breakpoints as a } from "@cupra/ui-kit/react/utils/breakpoints";
2
2
  import { useState as m, useLayoutEffect as d } from "react";
3
- const a = ["xs", "s", "m", "l", "xl", "xxl"];
3
+ const o = ["xs", "s", "m", "l", "xl", "xxl"];
4
4
  function c() {
5
- const s = {};
6
- return a.forEach((n, t) => {
7
- const r = `(min-width: ${o[n]}px)`;
5
+ const n = {};
6
+ return o.forEach((s, t) => {
7
+ const r = `(min-width: ${a[s]}px)`;
8
8
  let e = "";
9
- if (t < a.length - 1) {
10
- const i = a[t + 1];
11
- e = ` and (max-width: ${o[i] - 1}px)`;
9
+ if (t < o.length - 1) {
10
+ const i = o[t + 1];
11
+ e = ` and (max-width: ${a[i] - 1}px)`;
12
12
  }
13
- s[n] = window.matchMedia(r + e);
14
- }), s;
13
+ n[s] = window.matchMedia(r + e);
14
+ }), n;
15
15
  }
16
16
  const p = () => {
17
- const [s, n] = m(() => {
17
+ const [n, s] = m(() => {
18
18
  const t = c();
19
19
  let r = "";
20
20
  return Object.keys(t).forEach((e) => {
@@ -24,7 +24,7 @@ const p = () => {
24
24
  return d(() => {
25
25
  const t = c(), r = Object.keys(t).map((e) => {
26
26
  const i = (u) => {
27
- u.matches && n(e);
27
+ u.matches && s(e);
28
28
  };
29
29
  return t[e].addListener(i), () => {
30
30
  t[e].removeListener(i);
@@ -35,7 +35,7 @@ const p = () => {
35
35
  e();
36
36
  });
37
37
  };
38
- }, []), s;
38
+ }, []), n;
39
39
  };
40
40
  export {
41
41
  p as useBreakpoint
@@ -1,23 +1,25 @@
1
- import { useRef as d, useEffect as f } from "react";
2
- function s(o) {
3
- const r = d(null);
4
- return f(() => {
5
- const n = {};
6
- return Object.keys(o).forEach((c) => {
7
- var l;
8
- const t = (E) => {
9
- var u;
10
- (u = o[c]) == null || u.call(o, E);
1
+ import { useRef as f, useEffect as l } from "react";
2
+ function d(n) {
3
+ const t = f(null), e = f(n);
4
+ return l(() => {
5
+ e.current = n;
6
+ }, [n]), l(() => {
7
+ const c = t.current;
8
+ if (!c) return;
9
+ const o = {};
10
+ return Object.keys(e.current).forEach((r) => {
11
+ const u = (i) => {
12
+ const s = e.current[r];
13
+ s && s(i);
11
14
  };
12
- n[c] = t, (l = r == null ? void 0 : r.current) == null || l.addEventListener(c, t);
15
+ o[r] = u, c.addEventListener(r, u);
13
16
  }), () => {
14
- Object.keys(n).forEach((c) => {
15
- var t;
16
- (t = r == null ? void 0 : r.current) == null || t.removeEventListener(c, n[c]);
17
+ Object.keys(o).forEach((r) => {
18
+ c.removeEventListener(r, o[r]);
17
19
  });
18
20
  };
19
- }, [r, o]), { ref: r };
21
+ }, [t.current, e.current]), { ref: t };
20
22
  }
21
23
  export {
22
- s as useHandleEvent
24
+ d as useHandleEvent
23
25
  };
package/package.json CHANGED
@@ -1,15 +1,26 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "1.0.0-canary.2",
3
+ "version": "1.0.0-canary.21",
4
4
  "description": "React components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./*": {
16
+ "import": "./dist/components/*/*.js",
17
+ "types": "./dist/components/*/*.d.ts"
18
+ },
19
+ "./hooks/*": "./dist/hooks/*.js"
20
+ },
10
21
  "files": [
11
22
  "LICENSE",
12
- "THIRD-PARTY-LICENSES.MD",
23
+ "THIRD_PARTY_LICENSES.MD",
13
24
  "README.md",
14
25
  "dist"
15
26
  ],
@@ -31,12 +42,12 @@
31
42
  }
32
43
  ],
33
44
  "peerDependencies": {
34
- "react": ">= 18.3.1 < 19",
35
- "react-dom": ">= 18.3.1 < 19"
45
+ "react": ">= 18.3.1 < 20",
46
+ "react-dom": ">= 18.3.1 < 20",
47
+ "@cupra/ui-kit": "1.0.0-canary.12"
36
48
  },
37
49
  "dependencies": {
38
- "styled-components": "^6.1.16",
39
- "@cupra/ui-kit": "1.0.0-canary.2"
50
+ "styled-components": "^6.1.16"
40
51
  },
41
52
  "devDependencies": {
42
53
  "@storybook/addon-docs": "^8.6.14",
@@ -49,18 +60,18 @@
49
60
  "@testing-library/user-event": "^14.6.1",
50
61
  "@types/react": "^18.3.20",
51
62
  "@types/react-dom": "^18.3.5",
52
- "generate-license-file": "^4.1.0",
53
63
  "react": "^18.3.1",
54
64
  "react-dom": "^18.3.1",
55
65
  "shadow-dom-testing-library": "^1.0.0",
56
66
  "storybook": "^8.6.14",
57
67
  "typescript": "^5.8.2",
58
- "vite": "^6.4.1"
68
+ "vite": "^6.4.1",
69
+ "@cupra/ui-kit": "1.0.0-canary.12"
59
70
  },
60
71
  "scripts": {
61
72
  "build": "rm -rf dist && tsc --declaration --emitDeclarationOnly && vite build --emptyOutDir false",
62
73
  "test": "npx vitest run",
63
- "generate-licenses": "pnpm generate-license-file --input package.json --output THIRD_PARTY_LICENSES.MD --overwrite --ci",
74
+ "generate-licenses": "npx generate-license-file --input package.json --output THIRD_PARTY_LICENSES.MD --overwrite --ci",
64
75
  "storybook": "storybook dev -p 6006",
65
76
  "build-storybook:cupra-diagonal": "storybook build --output-dir dist-storybook/cupra-diagonal"
66
77
  }