@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 <
|
|
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
|
|
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
|
|
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
|
|
5
|
-
function H(
|
|
4
|
+
import { useHandleEvent as b } from "../../hooks/useHandleEvent.js";
|
|
5
|
+
function H(l) {
|
|
6
6
|
const {
|
|
7
|
-
className:
|
|
8
|
-
children:
|
|
9
|
-
onChange:
|
|
10
|
-
onInput:
|
|
7
|
+
className: d,
|
|
8
|
+
children: w,
|
|
9
|
+
onChange: c,
|
|
10
|
+
onInput: u,
|
|
11
11
|
inputId: e,
|
|
12
|
-
placeHolder:
|
|
13
|
-
value:
|
|
14
|
-
label:
|
|
15
|
-
required:
|
|
16
|
-
disabled:
|
|
17
|
-
pattern:
|
|
18
|
-
maxLength:
|
|
19
|
-
minLength:
|
|
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
|
-
} =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
+
c[r] = s, t.addEventListener(r, s);
|
|
13
16
|
}), () => {
|
|
14
|
-
Object.keys(
|
|
15
|
-
|
|
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
|
-
}, [
|
|
21
|
+
}, []), { ref: o };
|
|
20
22
|
}
|
|
21
23
|
export {
|
|
22
|
-
|
|
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.
|
|
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 <
|
|
35
|
-
"react-dom": ">= 18.3.1 <
|
|
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",
|