@cupra/ui-react 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
@@ -18,10 +18,9 @@ If you need a **framework-agnostic** solution, consider `@cupra/ui-kit` (Web Com
18
18
 
19
19
  This library currently provides **official support for React 18**.
20
20
 
21
- - **Supported React versions:** `>=18.3.1 <19`
22
- - **React 19:** not officially supported yet. Work is in progress to add full support.
21
+ - **Supported React versions:** `>=18.3.1 <20`
23
22
 
24
- Projects using React 19 may still install and use the library, but behaviour is not guaranteed until official support is released.
23
+ Projects using other React versions may still install and use the library, but behaviour is not guaranteed until official support is released.
25
24
 
26
25
  ## Installation
27
26
 
@@ -1,40 +1,37 @@
1
- import { jsxs as g, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as i } from "react/jsx-runtime";
2
2
  import "../../packages/ui-kit/dist-react/index.js";
3
3
  import "react";
4
- import { useHandleEvent as x } from "../../hooks/useHandleEvent.js";
5
- function H(n) {
4
+ import { useHandleEvent as b } from "../../hooks/useHandleEvent.js";
5
+ function H(l) {
6
6
  const {
7
- className: t,
8
- children: b,
9
- onChange: o,
10
- onInput: s,
7
+ className: d,
8
+ children: w,
9
+ onChange: c,
10
+ onInput: u,
11
11
  inputId: e,
12
- placeHolder: a,
13
- value: p,
14
- label: l,
15
- required: i,
16
- disabled: d,
17
- pattern: c,
18
- maxLength: u,
19
- minLength: h,
12
+ placeHolder: n,
13
+ value: r,
14
+ label: h,
15
+ required: t,
16
+ disabled: o,
17
+ pattern: s,
18
+ maxLength: p,
19
+ minLength: a,
20
20
  ...m
21
- } = n, { ref: f } = x({ change: o, input: s });
22
- return /* @__PURE__ */ g("ds-password-input-react", { ref: f, class: t, ...m, children: [
23
- /* @__PURE__ */ r("label", { htmlFor: e, children: l }),
24
- /* @__PURE__ */ r(
25
- "input",
26
- {
27
- id: e,
28
- type: "password",
29
- placeholder: a,
30
- value: p,
31
- required: i,
32
- disabled: d,
33
- minLength: h,
34
- maxLength: u,
35
- pattern: c
36
- }
37
- )
21
+ } = l, { ref: f } = b({ change: c, input: u }), g = {
22
+ type: "password",
23
+ ...!!e && { id: e },
24
+ ...!!n && { placeholder: n },
25
+ ...!!r && { value: r },
26
+ ...!!t && { required: t },
27
+ ...!!o && { disabled: o },
28
+ ...!!a && { minLength: a },
29
+ ...!!p && { maxLength: p },
30
+ ...!!s && { pattern: s }
31
+ };
32
+ return /* @__PURE__ */ x("ds-password-input-react", { ref: f, class: d, ...m, children: [
33
+ /* @__PURE__ */ i("label", { htmlFor: e, children: h }),
34
+ /* @__PURE__ */ i("input", { ...g })
38
35
  ] });
39
36
  }
40
37
  export {
@@ -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 u, useEffect as l } from "react";
2
+ function d(e) {
3
+ const o = u(null), n = u(e);
4
+ return l(() => {
5
+ n.current = e;
6
+ }, [e]), l(() => {
7
+ const t = o.current;
8
+ if (!t) return;
9
+ const c = {};
10
+ return Object.keys(n.current).forEach((r) => {
11
+ const s = (i) => {
12
+ const f = n.current[r];
13
+ f && f(i);
11
14
  };
12
- n[c] = t, (l = r == null ? void 0 : r.current) == null || l.addEventListener(c, t);
15
+ c[r] = s, t.addEventListener(r, s);
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(c).forEach((r) => {
18
+ t.removeEventListener(r, c[r]);
17
19
  });
18
20
  };
19
- }, [r, o]), { ref: r };
21
+ }, []), { ref: o };
20
22
  }
21
23
  export {
22
- s as useHandleEvent
24
+ d as useHandleEvent
23
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "1.0.0-canary.6",
3
+ "version": "1.0.0-canary.8",
4
4
  "description": "React components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
@@ -31,8 +31,8 @@
31
31
  }
32
32
  ],
33
33
  "peerDependencies": {
34
- "react": ">= 18.3.1 < 19",
35
- "react-dom": ">= 18.3.1 < 19"
34
+ "react": ">= 18.3.1 < 20",
35
+ "react-dom": ">= 18.3.1 < 20"
36
36
  },
37
37
  "dependencies": {
38
38
  "styled-components": "^6.1.16",