xtreme-ui 0.0.107 → 0.0.108

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
- {"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,8GA4GpB,CAAC"}
1
+ {"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,8GAgHpB,CAAC"}
@@ -1,102 +1,104 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as r } from "react/jsx-runtime";
3
- import { forwardRef as k, useId as D, useMemo as f } from "react";
4
- import L from "clsx";
5
- import { Icon as U } from "../Icon/Icon.js";
2
+ import { jsxs as I, jsx as r } from "react/jsx-runtime";
3
+ import { forwardRef as D, useId as L, useMemo as f } from "react";
4
+ import U from "clsx";
5
+ import { Icon as B } from "../Icon/Icon.js";
6
6
  /* empty css */
7
- const B = k((g, T) => {
7
+ const M = D((m, T) => {
8
8
  const {
9
- className: I,
10
- style: v,
9
+ className: v,
10
+ style: C,
11
11
  type: e = "text",
12
- textarea: o,
12
+ textarea: t,
13
13
  placeholder: n,
14
- autoComplete: m = "off",
15
- active: C,
16
- autoFocus: d,
14
+ autoComplete: h = "off",
15
+ active: E,
16
+ autoFocus: x,
17
17
  icon: a,
18
- iconType: E = "regular",
18
+ iconType: F = "regular",
19
19
  value: l,
20
- onChange: h,
21
- onFocus: x,
22
- onBlur: y,
23
- onKeyUp: s,
24
- onKeyDown: c,
20
+ onChange: y,
21
+ onFocus: b,
22
+ onBlur: N,
23
+ onKeyUp: c,
24
+ onKeyDown: s,
25
25
  onEnterKey: i
26
- } = g, u = D(), p = f(() => {
27
- if (o === !0) return null;
26
+ } = m, K = L(), u = m.id ?? K, p = f(() => {
27
+ if (t === !0) return null;
28
28
  if (a) return a;
29
29
  if (e === "number") return "23";
30
30
  if (e === "search") return "f002";
31
31
  if (e === "password") return "f30d";
32
- }, [o, a, e]), F = f(() => {
32
+ }, [t, a, e]), d = f(() => {
33
33
  if (n) return n;
34
34
  if (e === "number") return "Enter a number";
35
35
  if (e === "search") return "Search";
36
36
  if (e === "password") return "Enter password";
37
37
  if (e === "phone") return "Enter phone number";
38
- }, [n, e]), K = f(() => e === "phone" ? "number" : e, [e]), b = (t) => {
39
- s == null || s(t);
40
- }, N = (t) => {
41
- t.key === "Enter" && (i == null || i(t)), c == null || c(t);
42
- }, j = L(
38
+ }, [n, e]), j = f(() => e === "phone" ? "number" : e, [e]), g = (o) => {
39
+ c == null || c(o);
40
+ }, w = (o) => {
41
+ o.key === "Enter" && (i == null || i(o)), s == null || s(o);
42
+ }, k = U(
43
43
  "xtrTextfield",
44
44
  p && "withIcon",
45
- o && "textarea",
45
+ t && "textarea",
46
46
  l && "hasValue",
47
47
  e === "phone" && "phone",
48
- C && "active",
49
- I
48
+ E && "active",
49
+ v
50
50
  );
51
- return /* @__PURE__ */ w(
51
+ return /* @__PURE__ */ I(
52
52
  "div",
53
53
  {
54
54
  ref: T,
55
- className: j,
55
+ className: k,
56
56
  role: "textbox",
57
- style: v,
57
+ style: C,
58
58
  children: [
59
- p && !o && /* @__PURE__ */ r(U, { code: p, type: E }),
60
- e === "phone" && /* @__PURE__ */ w("div", { className: "dialCode", children: [
59
+ /* @__PURE__ */ r("label", { className: "placeholder", htmlFor: u, children: d }),
60
+ p && !t && /* @__PURE__ */ r(B, { code: p, type: F }),
61
+ e === "phone" && /* @__PURE__ */ I("div", { className: "dialCode", children: [
61
62
  /* @__PURE__ */ r("span", { style: { backgroundImage: "url(https://flagcdn.com/in.svg)" } }),
62
63
  /* @__PURE__ */ r("p", { children: "+91" })
63
64
  ] }),
64
- o ? /* @__PURE__ */ r(
65
+ t ? /* @__PURE__ */ r(
65
66
  "textarea",
66
67
  {
67
68
  className: "input",
68
69
  id: u,
69
- autoFocus: d,
70
- autoComplete: m,
70
+ autoFocus: x,
71
+ autoComplete: h,
71
72
  value: l,
72
- onChange: h,
73
- onFocus: x,
74
- onBlur: y,
75
- onKeyUp: b,
76
- onKeyDown: N
73
+ onChange: y,
74
+ onFocus: b,
75
+ onBlur: N,
76
+ onKeyUp: g,
77
+ onKeyDown: w,
78
+ "aria-label": d
77
79
  }
78
80
  ) : /* @__PURE__ */ r(
79
81
  "input",
80
82
  {
81
83
  className: "input",
82
84
  id: u,
83
- type: K,
84
- autoFocus: d,
85
- autoComplete: m,
85
+ type: j,
86
+ autoFocus: x,
87
+ autoComplete: h,
86
88
  value: l,
87
- onChange: h,
88
- onFocus: x,
89
- onBlur: y,
90
- onKeyUp: b,
91
- onKeyDown: N
89
+ onChange: y,
90
+ onFocus: b,
91
+ onBlur: N,
92
+ onKeyUp: g,
93
+ onKeyDown: w,
94
+ "aria-label": d
92
95
  }
93
- ),
94
- /* @__PURE__ */ r("label", { className: "placeholder", htmlFor: u, children: F })
96
+ )
95
97
  ]
96
98
  }
97
99
  );
98
100
  });
99
- B.displayName = "Textfield";
101
+ M.displayName = "Textfield";
100
102
  export {
101
- B as Textfield
103
+ M as Textfield
102
104
  };
@@ -12,6 +12,7 @@ export type TTextfieldProps = {
12
12
  icon?: string;
13
13
  iconType?: keyof typeof EIconType;
14
14
  value?: string;
15
+ id?: string;
15
16
  onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
16
17
  onFocus?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
17
18
  onBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src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AQ,aAAa;IACrB,MAAM,WAAW;CACjB;AAED,oBAAY,sBAAsB;IACjC,KAAK,QAAQ;IACb,IAAI,OAAO;IACX,MAAM,SAAS;IACf,kBAAkB,qBAAqB;IACvC,YAAY,eAAe;IAC3B,iBAAiB,oBAAoB;IACrC,aAAa,gBAAgB;IAC7B,kBAAkB,qBAAqB;IACvC,UAAU,aAAa;IACvB,OAAO,UAAU;IACjB,UAAU,aAAa;IACvB,cAAc,iBAAiB;IAC/B,kBAAkB,qBAAqB;IACvC,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,cAAc,iBAAiB;IAC/B,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,SAAS,YAAY;IACrB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,SAAS,YAAY;IACrB,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,gBAAgB,mBAAmB;IACnC,WAAW,cAAc;IACzB,QAAQ,WAAW;IACnB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,QAAQ,WAAW;IACnB,SAAS,YAAY;IACrB,sBAAsB,yBAAyB;IAC/C,oBAAoB,uBAAuB;IAC3C,UAAU,aAAa;IACvB,MAAM,SAAS;IACf,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,KAAK,QAAQ;IACb,kBAAkB,qBAAqB;IACvC,cAAc,iBAAiB;IAC/B,eAAe,kBAAkB;IACjC,WAAW,cAAc;IACzB,eAAe,kBAAkB;CACjC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EA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C,KAAK,QAAQ;IACb,IAAI,OAAO;IACX,MAAM,SAAS;IACf,kBAAkB,qBAAqB;IACvC,YAAY,eAAe;IAC3B,iBAAiB,oBAAoB;IACrC,aAAa,gBAAgB;IAC7B,kBAAkB,qBAAqB;IACvC,UAAU,aAAa;IACvB,OAAO,UAAU;IACjB,UAAU,aAAa;IACvB,cAAc,iBAAiB;IAC/B,kBAAkB,qBAAqB;IACvC,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,cAAc,iBAAiB;IAC/B,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,eAAe,kBAAkB;IACjC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;IACnC,SAAS,YAAY;IACrB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,SAAS,YAAY;IACrB,eAAe,kBAAkB;IACjC,oBAAoB,uBAAuB;IAC3C,gBAAgB,mBAAmB;IACnC,WAAW,cAAc;IACzB,QAAQ,WAAW;IACnB,cAAc,iBAAiB;IAC/B,aAAa,gBAAgB;IAC7B,QAAQ,WAAW;IACnB,SAAS,YAAY;IACrB,sBAAsB,yBAAyB;IAC/C,oBAAoB,uBAAuB;IAC3C,UAAU,aAAa;IACvB,MAAM,SAAS;IACf,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,WAAW,cAAc;IACzB,KAAK,QAAQ;IACb,kBAAkB,qBAAqB;IACvC,cAAc,iBAAiB;IAC/B,eAAe,kBAAkB;IACjC,WAAW,cAAc;IACzB,eAAe,kBAAkB;CACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtreme-ui",
3
- "version": "0.0.107",
3
+ "version": "0.0.108",
4
4
  "type": "module",
5
5
  "description": "Collection of reusable components that can be used in web projects",
6
6
  "main": "dist/index.js",