@cupra/ui-react 2.0.0-canary.71 → 2.0.0-canary.73

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-slider");function n(r){const{className:s,children:o,size:e,...i}=r;return t.jsx("ds-slider-react",{size:typeof e=="string"?e:JSON.stringify(e),class:s,...i})}exports.Slider=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-slider");require("@cupra/ui-kit/react/utils/breakpoints");require("react");const u=require("../../hooks/useHandleEvent.cjs");function c(r){const{className:s,children:l,size:e,onChange:n,...t}=r,{ref:i}=u.useHandleEvent({change:n});return o.jsx("ds-slider-react",{ref:i,size:typeof e=="string"?e:JSON.stringify(e),class:s,...t})}exports.Slider=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-text-input");require("@cupra/ui-kit/react/utils/breakpoints");require("react");const y=require("../../hooks/useHandleEvent.cjs");function b(n){const{className:r,children:j,onChange:u,onInput:i,onKeyDown:l,inputId:t,placeHolder:s,type:o,value:a,label:c,required:d,disabled:p,pattern:h,maxLength:x,minLength:g,...m}=n,{ref:q}=y.useHandleEvent({change:u,input:i,keydown:l});return e.jsxs("ds-text-input-react",{ref:q,class:r,...m,children:[e.jsx("label",{htmlFor:t,children:c}),e.jsx("input",{id:t,type:o||"text",placeholder:s,value:a,required:d,disabled:p,minLength:g,maxLength:x,pattern:h})]})}exports.TextInput=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-text-input");require("@cupra/ui-kit/react/utils/breakpoints");require("react");const b=require("../../hooks/useHandleEvent.cjs");function j(n){const{className:r,children:v,onChange:l,onInput:u,onKeyDown:i,inputId:t,placeHolder:s,type:a,value:o,label:d,required:c,disabled:p,readOnly:h,pattern:x,maxLength:y,minLength:g,...m}=n,{ref:q}=b.useHandleEvent({change:l,input:u,keydown:i});return e.jsxs("ds-text-input-react",{ref:q,class:r,...m,children:[e.jsx("label",{htmlFor:t,children:d}),e.jsx("input",{id:t,type:a||"text",placeholder:s,value:o,required:c,disabled:p,readOnly:h,minLength:g,maxLength:y,pattern:x})]})}exports.TextInput=j;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-textarea");require("@cupra/ui-kit/react/utils/breakpoints");require("react");const f=require("../../hooks/useHandleEvent.cjs");function j(t){const{className:a,children:E,onChange:n,onInput:l,textareaId:r,placeholder:o,value:i,label:s,required:c,disabled:d,minLength:u,maxLength:h,rows:x,cols:p,forcedError:g,helperText:m,invalidError:q,...v}=t,{ref:b}=f.useHandleEvent({change:n,input:l});return e.jsxs("ds-textarea-react",{ref:b,class:a,"forced-error":g,"helper-text":m,"invalid-error":q,...v,children:[e.jsx("label",{htmlFor:r,children:s}),e.jsx("textarea",{id:r,placeholder:o,value:i,required:c,disabled:d,minLength:u,maxLength:h,rows:x,cols:p})]})}exports.Textarea=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("@cupra/ui-kit/react/ds-textarea");require("@cupra/ui-kit/react/utils/breakpoints");require("react");const j=require("../../hooks/useHandleEvent.cjs");function E(t){const{className:a,children:T,onChange:n,onInput:l,textareaId:r,placeholder:o,value:i,label:s,required:d,disabled:c,readOnly:u,minLength:h,maxLength:x,rows:p,cols:g,forcedError:m,helperText:q,invalidError:v,...b}=t,{ref:f}=j.useHandleEvent({change:n,input:l});return e.jsxs("ds-textarea-react",{ref:f,class:a,"forced-error":m,"helper-text":q,"invalid-error":v,...b,children:[e.jsx("label",{htmlFor:r,children:s}),e.jsx("textarea",{id:r,placeholder:o,value:i,required:d,disabled:c,readOnly:u,minLength:h,maxLength:x,rows:p,cols:g})]})}exports.Textarea=E;
@@ -1,16 +1,20 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import "@cupra/ui-kit/react/ds-slider";
3
- function l(s) {
4
- const { className: e, children: o, size: r, ...i } = s;
5
- return /* @__PURE__ */ t(
3
+ import "@cupra/ui-kit/react/utils/breakpoints";
4
+ import "react";
5
+ import { useHandleEvent as c } from "../../hooks/useHandleEvent.js";
6
+ function g(e) {
7
+ const { className: t, children: m, size: r, onChange: o, ...s } = e, { ref: i } = c({ change: o });
8
+ return /* @__PURE__ */ n(
6
9
  "ds-slider-react",
7
10
  {
11
+ ref: i,
8
12
  size: typeof r == "string" ? r : JSON.stringify(r),
9
- class: e,
10
- ...i
13
+ class: t,
14
+ ...s
11
15
  }
12
16
  );
13
17
  }
14
18
  export {
15
- l as Slider
19
+ g as Slider
16
20
  };
@@ -1,45 +1,47 @@
1
- import { jsxs as y, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as b, jsx as t } from "react/jsx-runtime";
2
2
  import "@cupra/ui-kit/react/ds-text-input";
3
3
  import "@cupra/ui-kit/react/utils/breakpoints";
4
4
  import "react";
5
- import { useHandleEvent as b } from "../../hooks/useHandleEvent.js";
6
- function k(n) {
5
+ import { useHandleEvent as I } from "../../hooks/useHandleEvent.js";
6
+ function q(n) {
7
7
  const {
8
8
  className: r,
9
- children: I,
9
+ children: j,
10
10
  onChange: o,
11
- onInput: p,
12
- onKeyDown: i,
11
+ onInput: l,
12
+ onKeyDown: p,
13
13
  inputId: e,
14
- placeHolder: l,
14
+ placeHolder: i,
15
15
  type: a,
16
16
  value: d,
17
17
  label: s,
18
18
  required: c,
19
19
  disabled: m,
20
- pattern: u,
21
- maxLength: h,
22
- minLength: x,
20
+ readOnly: u,
21
+ pattern: h,
22
+ maxLength: x,
23
+ minLength: y,
23
24
  ...f
24
- } = n, { ref: g } = b({ change: o, input: p, keydown: i });
25
- return /* @__PURE__ */ y("ds-text-input-react", { ref: g, class: r, ...f, children: [
25
+ } = n, { ref: g } = I({ change: o, input: l, keydown: p });
26
+ return /* @__PURE__ */ b("ds-text-input-react", { ref: g, class: r, ...f, children: [
26
27
  /* @__PURE__ */ t("label", { htmlFor: e, children: s }),
27
28
  /* @__PURE__ */ t(
28
29
  "input",
29
30
  {
30
31
  id: e,
31
32
  type: a || "text",
32
- placeholder: l,
33
+ placeholder: i,
33
34
  value: d,
34
35
  required: c,
35
36
  disabled: m,
36
- minLength: x,
37
- maxLength: h,
38
- pattern: u
37
+ readOnly: u,
38
+ minLength: y,
39
+ maxLength: x,
40
+ pattern: h
39
41
  }
40
42
  )
41
43
  ] });
42
44
  }
43
45
  export {
44
- k as TextInput
46
+ q as TextInput
45
47
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as E, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as j, jsx as r } from "react/jsx-runtime";
2
2
  import "@cupra/ui-kit/react/ds-textarea";
3
3
  import "@cupra/ui-kit/react/utils/breakpoints";
4
4
  import "react";
5
- import { useHandleEvent as j } from "../../hooks/useHandleEvent.js";
5
+ import { useHandleEvent as I } from "../../hooks/useHandleEvent.js";
6
6
  function F(t) {
7
7
  const {
8
8
  className: o,
9
- children: I,
9
+ children: L,
10
10
  onChange: a,
11
11
  onInput: n,
12
12
  textareaId: e,
@@ -15,24 +15,25 @@ function F(t) {
15
15
  label: d,
16
16
  required: s,
17
17
  disabled: c,
18
- minLength: h,
19
- maxLength: p,
20
- rows: m,
21
- cols: x,
22
- forcedError: u,
23
- helperText: f,
24
- invalidError: g,
25
- ...v
26
- } = t, { ref: b } = j({ change: a, input: n });
27
- return /* @__PURE__ */ E(
18
+ readOnly: h,
19
+ minLength: p,
20
+ maxLength: m,
21
+ rows: x,
22
+ cols: u,
23
+ forcedError: f,
24
+ helperText: g,
25
+ invalidError: v,
26
+ ...b
27
+ } = t, { ref: E } = I({ change: a, input: n });
28
+ return /* @__PURE__ */ j(
28
29
  "ds-textarea-react",
29
30
  {
30
- ref: b,
31
+ ref: E,
31
32
  class: o,
32
- "forced-error": u,
33
- "helper-text": f,
34
- "invalid-error": g,
35
- ...v,
33
+ "forced-error": f,
34
+ "helper-text": g,
35
+ "invalid-error": v,
36
+ ...b,
36
37
  children: [
37
38
  /* @__PURE__ */ r("label", { htmlFor: e, children: d }),
38
39
  /* @__PURE__ */ r(
@@ -43,10 +44,11 @@ function F(t) {
43
44
  value: i,
44
45
  required: s,
45
46
  disabled: c,
46
- minLength: h,
47
- maxLength: p,
48
- rows: m,
49
- cols: x
47
+ readOnly: h,
48
+ minLength: p,
49
+ maxLength: m,
50
+ rows: x,
51
+ cols: u
50
52
  }
51
53
  )
52
54
  ]
@@ -3,6 +3,10 @@ import '@cupra/ui-kit/react/ds-slider';
3
3
  import { DsSliderAttrs } from '@cupra/ui-kit/react/types/ds-slider';
4
4
  type SliderProps = DsSliderAttrs & {
5
5
  className?: string;
6
+ onChange?: (event: CustomEvent<{
7
+ role: 'min' | 'max';
8
+ value: number;
9
+ }>) => void;
6
10
  };
7
11
  export declare function Slider(props: SliderProps): ReactElement;
8
12
  export {};
@@ -13,6 +13,7 @@ type TextInputProps = DsTextInputAttrs & {
13
13
  label: string;
14
14
  required?: boolean;
15
15
  disabled?: boolean;
16
+ readOnly?: boolean;
16
17
  minLength?: number;
17
18
  maxLength?: number;
18
19
  pattern?: string;
@@ -11,6 +11,7 @@ type TextareaProps = DsTextareaAttrs & {
11
11
  label: string;
12
12
  required?: boolean;
13
13
  disabled?: boolean;
14
+ readOnly?: boolean;
14
15
  minLength?: number;
15
16
  maxLength?: number;
16
17
  rows?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "2.0.0-canary.71",
3
+ "version": "2.0.0-canary.73",
4
4
  "description": "React components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
@@ -51,7 +51,7 @@
51
51
  "peerDependencies": {
52
52
  "react": ">= 18.3.1 < 20",
53
53
  "react-dom": ">= 18.3.1 < 20",
54
- "@cupra/ui-kit": "2.0.0-canary.62",
54
+ "@cupra/ui-kit": "2.0.0-canary.64",
55
55
  "typescript": ">=5.0.0"
56
56
  },
57
57
  "dependencies": {
@@ -75,7 +75,7 @@
75
75
  "storybook": "^8.6.17",
76
76
  "typescript": "^5.8.2",
77
77
  "vite": "^6.4.1",
78
- "@cupra/ui-kit": "2.0.0-canary.62"
78
+ "@cupra/ui-kit": "2.0.0-canary.64"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "rm -rf dist && pnpm --filter @cupra/ui-kit build:react && tsc --declaration --emitDeclarationOnly && BUILD_FORMAT=esm vite build --emptyOutDir false && BUILD_FORMAT=cjs vite build --emptyOutDir false",