xtreme-ui 0.0.106 → 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":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAeA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,2CA2EhD"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Select/Select.tsx"],"names":[],"mappings":"AAeA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,MAAM,CAAC,CAAC,EAAG,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,2CA6EhD"}
@@ -1,61 +1,62 @@
1
1
  "use client";
2
- import { jsxs as I, jsx as c } from "react/jsx-runtime";
3
- import { useState as O, useMemo as j } from "react";
4
- import y from "clsx";
5
- import z from "react-select";
6
- import { isEqual as d } from "../../../utils/function/common.js";
7
- import { Icon as H } from "../Icon/Icon.js";
2
+ import { jsxs as O, jsx as c } from "react/jsx-runtime";
3
+ import { useId as j, useState as y, useMemo as z } from "react";
4
+ import H from "clsx";
5
+ import q from "react-select";
6
+ import { isEqual as h } from "../../../utils/function/common.js";
7
+ import { Icon as D } from "../Icon/Icon.js";
8
8
  /* empty css */
9
- function $(h) {
9
+ function k(S) {
10
10
  const {
11
- className: S,
11
+ className: v,
12
12
  multi: l = !1,
13
13
  placeholder: a = "Select an option",
14
- noOptionsMessage: v,
14
+ noOptionsMessage: x,
15
15
  icon: n,
16
16
  size: i = "default",
17
- iconType: x = "regular",
18
- clearable: g = !0,
17
+ iconType: g = "regular",
18
+ clearable: b = !0,
19
19
  searchable: m = !0,
20
20
  disabled: C = !1,
21
- loading: b = !1,
21
+ loading: N = !1,
22
22
  options: o,
23
23
  value: t,
24
24
  onChange: p
25
- } = h, [u, f] = O(!1), N = j(() => {
25
+ } = S, u = j(), [f, d] = y(!1), I = z(() => {
26
26
  if (l) {
27
27
  const e = t ?? [];
28
- return o.filter((s) => e.some((r) => d(s.value, r)));
28
+ return o.filter((s) => e.some((r) => h(s.value, r)));
29
29
  } else
30
- return o.find((e) => d(e.value, t)) || null;
31
- }, [l, o, t]), M = y(
30
+ return o.find((e) => h(e.value, t)) || null;
31
+ }, [l, o, t]), M = H(
32
32
  "xtrSelectWrapper",
33
33
  i && `${i}Size`,
34
34
  l ? "multi" : "single",
35
35
  n && "withIcon",
36
36
  !!t && "withValue",
37
- u && "open",
37
+ f && "open",
38
38
  !m && "noSearch",
39
- S
39
+ v
40
40
  );
41
- return /* @__PURE__ */ I("div", { className: M, children: [
41
+ return /* @__PURE__ */ O("div", { className: M, children: [
42
42
  /* @__PURE__ */ c(
43
- z,
43
+ q,
44
44
  {
45
45
  className: "xtrSelect",
46
46
  classNamePrefix: "xtrSelect",
47
+ id: u,
47
48
  isMulti: l,
48
- menuIsOpen: u,
49
- onMenuOpen: () => f(!0),
50
- onMenuClose: () => f(!1),
51
- noOptionsMessage: v,
49
+ menuIsOpen: f,
50
+ onMenuOpen: () => d(!0),
51
+ onMenuClose: () => d(!1),
52
+ noOptionsMessage: x,
52
53
  placeholder: a,
53
- isClearable: g,
54
+ isClearable: b,
54
55
  isSearchable: m,
55
56
  isDisabled: C,
56
- isLoading: b,
57
+ isLoading: N,
57
58
  options: o,
58
- value: N,
59
+ value: I,
59
60
  onChange: (e) => {
60
61
  if (l) {
61
62
  const s = (e == null ? void 0 : e.map((r) => r.value)) ?? [];
@@ -67,10 +68,10 @@ function $(h) {
67
68
  }
68
69
  }
69
70
  ),
70
- a && !l && /* @__PURE__ */ c("p", { className: "placeholder", children: a }),
71
- n && /* @__PURE__ */ c(H, { className: "xtrSelectIcon", code: n, type: x })
71
+ a && !l && /* @__PURE__ */ c("label", { className: "placeholder", htmlFor: u, children: a }),
72
+ n && /* @__PURE__ */ c(D, { className: "xtrSelectIcon", code: n, type: g })
72
73
  ] });
73
74
  }
74
75
  export {
75
- $ as Select
76
+ k as Select
76
77
  };
@@ -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,8GAwGpB,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,100 +1,104 @@
1
1
  "use client";
2
- import { jsxs as N, jsx as r } from "react/jsx-runtime";
3
- import { forwardRef as k, useMemo as p } from "react";
4
- import D from "clsx";
5
- import { Icon as F } 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 L = k((w, g) => {
7
+ const M = D((m, T) => {
8
8
  const {
9
- className: T,
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: f = "off",
15
- active: C,
16
- autoFocus: m,
14
+ autoComplete: h = "off",
15
+ active: E,
16
+ autoFocus: x,
17
17
  icon: a,
18
- iconType: I = "regular",
18
+ iconType: F = "regular",
19
19
  value: l,
20
- onChange: d,
21
- onFocus: h,
22
- onBlur: x,
20
+ onChange: y,
21
+ onFocus: b,
22
+ onBlur: N,
23
23
  onKeyUp: c,
24
24
  onKeyDown: s,
25
25
  onEnterKey: i
26
- } = w, u = p(() => {
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]), E = p(() => {
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 = p(() => e === "phone" ? "number" : e, [e]), y = (t) => {
39
- c == null || c(t);
40
- }, b = (t) => {
41
- t.key === "Enter" && (i == null || i(t)), s == null || s(t);
42
- }, j = D(
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
- u && "withIcon",
45
- o && "textarea",
44
+ p && "withIcon",
45
+ t && "textarea",
46
46
  l && "hasValue",
47
47
  e === "phone" && "phone",
48
- C && "active",
49
- T
48
+ E && "active",
49
+ v
50
50
  );
51
- return /* @__PURE__ */ N(
51
+ return /* @__PURE__ */ I(
52
52
  "div",
53
53
  {
54
- ref: g,
55
- className: j,
54
+ ref: T,
55
+ className: k,
56
56
  role: "textbox",
57
- style: v,
57
+ style: C,
58
58
  children: [
59
- u && !o && /* @__PURE__ */ r(F, { code: u, type: I }),
60
- e === "phone" && /* @__PURE__ */ N("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
- autoFocus: m,
69
- autoComplete: f,
69
+ id: u,
70
+ autoFocus: x,
71
+ autoComplete: h,
70
72
  value: l,
71
- onChange: d,
72
- onFocus: h,
73
- onBlur: x,
74
- onKeyUp: y,
75
- onKeyDown: b
73
+ onChange: y,
74
+ onFocus: b,
75
+ onBlur: N,
76
+ onKeyUp: g,
77
+ onKeyDown: w,
78
+ "aria-label": d
76
79
  }
77
80
  ) : /* @__PURE__ */ r(
78
81
  "input",
79
82
  {
80
83
  className: "input",
81
- type: K,
82
- autoFocus: m,
83
- autoComplete: f,
84
+ id: u,
85
+ type: j,
86
+ autoFocus: x,
87
+ autoComplete: h,
84
88
  value: l,
85
- onChange: d,
86
- onFocus: h,
87
- onBlur: x,
88
- onKeyUp: y,
89
- onKeyDown: b
89
+ onChange: y,
90
+ onFocus: b,
91
+ onBlur: N,
92
+ onKeyUp: g,
93
+ onKeyDown: w,
94
+ "aria-label": d
90
95
  }
91
- ),
92
- /* @__PURE__ */ r("label", { className: "placeholder", children: E })
96
+ )
93
97
  ]
94
98
  }
95
99
  );
96
100
  });
97
- L.displayName = "Textfield";
101
+ M.displayName = "Textfield";
98
102
  export {
99
- L as Textfield
103
+ M as Textfield
100
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":"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AAW;IACjB,KAAK,UAAU;IACf,QAAQ,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,WA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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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtreme-ui",
3
- "version": "0.0.106",
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",