welcome-ui 10.0.0-alpha.10 → 10.0.0-alpha.12

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.
Files changed (37) hide show
  1. package/dist/Alert.css +1 -1
  2. package/dist/Alert.js +62 -62
  3. package/dist/Checkbox.js +12 -11
  4. package/dist/DatePicker.js +69 -68
  5. package/dist/DateTimePicker.js +10 -10
  6. package/dist/Field.css +1 -1
  7. package/dist/Field.js +48 -49
  8. package/dist/FileDrop.js +7 -1
  9. package/dist/Icon.js +212 -211
  10. package/dist/InputText.js +6 -6
  11. package/dist/Modal.js +65 -56
  12. package/dist/Search.js +1 -1
  13. package/dist/Select.js +350 -332
  14. package/dist/Slider.js +1 -1
  15. package/dist/Swiper.js +201 -191
  16. package/dist/Tabs.css +1 -1
  17. package/dist/Tabs.js +320 -319
  18. package/dist/Textarea.js +14 -13
  19. package/dist/TimePicker.js +46 -45
  20. package/dist/Toggle.js +11 -11
  21. package/dist/types/components/Icon/icons.d.ts +2 -2
  22. package/dist/types/components/Modal/Assets/AssetContent.d.ts +1 -1
  23. package/dist/types/components/Modal/Assets/index.d.ts +1 -1
  24. package/dist/types/components/Modal/components/Content.d.ts +1 -1
  25. package/dist/types/components/Modal/index.d.ts +2 -2
  26. package/dist/types/components/Modal/types.d.ts +1 -1
  27. package/dist/types/components/Select/types.d.ts +1 -0
  28. package/dist/types/components/Tabs/Tab.d.ts +2 -0
  29. package/dist/types/components/Tabs/{components/TabPanel/index.d.ts → TabPanel.d.ts} +1 -1
  30. package/dist/types/components/Tabs/index.d.ts +6 -5
  31. package/dist/types/components/Tabs/types.d.ts +6 -12
  32. package/dist/types/components/Tabs/utils.d.ts +4 -7
  33. package/package.json +1 -1
  34. package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +0 -5
  35. package/dist/types/components/Tabs/components/TabList/index.d.ts +0 -3
  36. package/dist/use-viewport-CgrficYB.js +0 -17
  37. package/dist/useForkRef-D807AV7D.js +0 -22
package/dist/Alert.css CHANGED
@@ -1 +1 @@
1
- @layer components{._root_hm7mj_2{position:relative;display:flex;align-items:flex-start;width:100%;gap:var(--gap, var(--components-dimensions-alert-gap-content-md));border-radius:var(--components-dimensions-alert-border-radius);border-width:var(--border-width-sm);border-style:solid;padding:var(--padding);max-width:var(--maxWidth, max-content);background-color:var(--backgroundColor, var(--components-colors-alert-color-background-brand));border-color:var(--borderColor, var(--components-colors-alert-color-background-brand));color:var(--color, var(--components-colors-alert-color-text-brand-body))}._size-md_hm7mj_18{--padding: var(--components-dimensions-alert-padding-inline-md)}._size-md_hm7mj_18 ._content-actions_hm7mj_21{--gap: var(--components-dimensions-alert-gap-actions-md)}._size-md_hm7mj_18 ._without-title_hm7mj_24 ._icon-wrapper_hm7mj_24{margin-top:-2px}._size-lg_hm7mj_27{--padding: var(--components-dimensions-alert-padding-inline-lg);--gap: var(--components-dimensions-alert-gap-content-lg)}._size-lg_hm7mj_27 ._content-actions_hm7mj_21{--gap: var(--components-dimensions-alert-gap-actions-lg)}._variant-ai_hm7mj_34{--backgroundColor: var(--components-colors-alert-color-background-ai);--borderColor: transparent;background:linear-gradient(var(--components-colors-alert-color-background-ai) 0 0) padding-box,linear-gradient(90deg,var(--color-green-30) 0%,var(--color-teal-40) 20%,var(--color-blue-40) 40%,var(--color-violet-40) 60%,var(--color-pink-40) 80%,var(--color-red-orange-40) 100%) border-box}._variant-danger_hm7mj_39{--backgroundColor: var(--components-colors-alert-color-background-danger);--borderColor: var(--components-colors-alert-color-background-danger);--color: var(--color-icon-danger-primary)}._variant-info_hm7mj_44{--backgroundColor: var(--components-colors-alert-color-background-information);--borderColor: var(--components-colors-alert-color-background-information);--color: var(--color-icon-accent-blue-primary)}._variant-success_hm7mj_49{--backgroundColor: var(--components-colors-alert-color-background-success);--borderColor: var(--components-colors-alert-color-background-success);--color: var(--color-icon-accent-green-primary)}._variant-warning_hm7mj_54{--backgroundColor: var(--components-colors-alert-color-background-warning);--borderColor: var(--components-colors-alert-color-background-warning);--color: var(--color-icon-warning-primary)}._full-width_hm7mj_59{--maxWidth: 100%}._content_hm7mj_21{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_hm7mj_70{display:flex;flex-direction:column;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_hm7mj_70._without-title_hm7mj_24{flex-direction:row}._content-text_hm7mj_70._without-title_hm7mj_24 ._icon-wrapper_hm7mj_24{align-self:flex-start}._content-actions_hm7mj_21{display:flex;align-items:center;gap:var(--gap)}._title-close-button_hm7mj_87{margin-right:var(--spacing-xl)}._title-with-icon_hm7mj_90{display:flex;align-items:center;gap:var(--spacing-sm)}._close-button_hm7mj_96{position:absolute;right:var(--spacing-sm);top:var(--spacing-sm)}._icon-wrapper_hm7mj_24{flex-shrink:0;padding:var(--components-dimensions-alert-icon-padding-block);border-radius:var(--components-dimensions-alert-icon-border-radius);background-color:var(--iconWrapperBackgroundColor, var(--components-colors-alert-icon-color-background-brand));color:var(--iconWrapperColor, var(--components-colors-alert-icon-color-icon-brand))}._icon-wrapper-success_hm7mj_109{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-success);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-success)}._icon-wrapper-danger_hm7mj_113{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-danger);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-danger)}._icon-wrapper-info_hm7mj_117{--iconWrapperBackgroundColor: var( --components-colors-alert-icon-color-background-information );--iconWrapperColor: var(--components-colors-alert-icon-color-icon-information)}._icon-wrapper-warning_hm7mj_123{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-warning);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-warning)}._icon-wrapper-ai_hm7mj_127{background:conic-gradient(from 30deg at 50% 50%,var(--color-green-30) 0deg,var(--color-blue-40) 25.96deg,var(--color-violet-40) 51.92deg,var(--color-pink-40) 76.15deg,var(--color-red-orange-40) 110.77deg,var(--color-pink-40) 162.69deg,var(--color-violet-40) 209.42deg,var(--color-blue-40) 254.42deg,var(--color-teal-40) 306.35deg,var(--color-green-30) 360deg);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-ai)}}
1
+ @layer components{._root_8fyu4_2{position:relative;display:flex;align-items:flex-start;width:100%;gap:var(--gap, var(--components-dimensions-alert-gap-content-md));border-radius:var(--components-dimensions-alert-border-radius);border-width:var(--border-width-sm);border-style:solid;padding:var(--padding);max-width:var(--maxWidth, max-content);background-color:var(--backgroundColor, var(--components-colors-alert-color-background-brand));border-color:var(--borderColor, var(--components-colors-alert-color-background-brand));color:var(--color, var(--components-colors-alert-color-text-brand-body))}._size-md_8fyu4_18{--padding: var(--components-dimensions-alert-padding-inline-md)}._size-md_8fyu4_18 ._content-actions_8fyu4_21{--gap: var(--components-dimensions-alert-gap-actions-md)}._size-md_8fyu4_18 ._without-title_8fyu4_24 ._icon-wrapper_8fyu4_24{margin-top:-2px}._size-lg_8fyu4_27{--padding: var(--components-dimensions-alert-padding-inline-lg);--gap: var(--components-dimensions-alert-gap-content-lg)}._size-lg_8fyu4_27 ._content-actions_8fyu4_21{--gap: var(--components-dimensions-alert-gap-actions-lg)}._variant-ai_8fyu4_34{--backgroundColor: var(--components-colors-alert-color-background-ai);--borderColor: transparent;background:linear-gradient(var(--components-colors-alert-color-background-ai) 0 0) padding-box,linear-gradient(90deg,var(--color-green-30) 0%,var(--color-teal-40) 20%,var(--color-blue-40) 40%,var(--color-violet-40) 60%,var(--color-pink-40) 80%,var(--color-red-orange-40) 100%) border-box}._variant-danger_8fyu4_39{--backgroundColor: var(--components-colors-alert-color-background-danger);--borderColor: var(--components-colors-alert-color-background-danger);--color: var(--color-icon-danger-primary)}._variant-info_8fyu4_44{--backgroundColor: var(--components-colors-alert-color-background-information);--borderColor: var(--components-colors-alert-color-background-information);--color: var(--color-icon-accent-blue-primary)}._variant-success_8fyu4_49{--backgroundColor: var(--components-colors-alert-color-background-success);--borderColor: var(--components-colors-alert-color-background-success);--color: var(--color-icon-accent-green-primary)}._variant-warning_8fyu4_54{--backgroundColor: var(--components-colors-alert-color-background-warning);--borderColor: var(--components-colors-alert-color-background-warning);--color: var(--color-icon-warning-primary)}._full-width_8fyu4_59{--maxWidth: 100%}._content_8fyu4_21{overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_8fyu4_71{display:flex;flex-direction:column;gap:var(--gap, var(--components-dimensions-alert-gap-content-md))}._content-text_8fyu4_71._without-title_8fyu4_24{flex-direction:row}._content-text_8fyu4_71._without-title_8fyu4_24 ._icon-wrapper_8fyu4_24{align-self:flex-start}._content-actions_8fyu4_21{display:flex;align-items:center;gap:var(--gap)}._title-close-button_8fyu4_88{margin-right:var(--spacing-xl)}._title-with-icon_8fyu4_91{display:flex;align-items:center;gap:var(--spacing-sm)}._close-button_8fyu4_97{position:absolute;right:var(--spacing-sm);top:var(--spacing-sm)}._icon-wrapper_8fyu4_24{display:flex;flex-shrink:0;padding:var(--components-dimensions-alert-icon-padding-block);border-radius:var(--components-dimensions-alert-icon-border-radius);background-color:var(--iconWrapperBackgroundColor, var(--components-colors-alert-icon-color-background-brand));color:var(--iconWrapperColor, var(--components-colors-alert-icon-color-icon-brand))}._icon-wrapper-success_8fyu4_111{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-success);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-success)}._icon-wrapper-danger_8fyu4_115{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-danger);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-danger)}._icon-wrapper-info_8fyu4_119{--iconWrapperBackgroundColor: var( --components-colors-alert-icon-color-background-information );--iconWrapperColor: var(--components-colors-alert-icon-color-icon-information)}._icon-wrapper-warning_8fyu4_125{--iconWrapperBackgroundColor: var(--components-colors-alert-icon-color-background-warning);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-warning)}._icon-wrapper-ai_8fyu4_129{background:conic-gradient(from 30deg at 50% 50%,var(--color-green-30) 0deg,var(--color-blue-40) 25.96deg,var(--color-violet-40) 51.92deg,var(--color-pink-40) 76.15deg,var(--color-red-orange-40) 110.77deg,var(--color-pink-40) 162.69deg,var(--color-violet-40) 209.42deg,var(--color-blue-40) 254.42deg,var(--color-teal-40) 306.35deg,var(--color-green-30) 360deg);--iconWrapperColor: var(--components-colors-alert-icon-color-icon-ai)}}
package/dist/Alert.js CHANGED
@@ -1,105 +1,105 @@
1
1
  "use client";
2
2
  import './Alert.css';
3
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
4
- import p, { forwardRef as w, Children as u, cloneElement as h } from "react";
3
+ import { jsx as i, jsxs as l } from "react/jsx-runtime";
4
+ import p, { forwardRef as y, Children as f, cloneElement as m } from "react";
5
5
  import { CloseButton as E } from "./CloseButton.js";
6
6
  import { Icon as V } from "./Icon.js";
7
- import { Text as N } from "./Text.js";
8
- import { c as A } from "./index-PAaZGbyz.js";
9
- import { Button as b } from "./Button.js";
10
- const I = "_root_hm7mj_2", O = "_content_hm7mj_21", x = {
7
+ import { Text as b } from "./Text.js";
8
+ import { c as x } from "./index-PAaZGbyz.js";
9
+ import { Button as h } from "./Button.js";
10
+ const I = "_root_8fyu4_2", O = "_content_8fyu4_21", B = {
11
11
  root: I,
12
- "size-md": "_size-md_hm7mj_18",
13
- "content-actions": "_content-actions_hm7mj_21",
14
- "without-title": "_without-title_hm7mj_24",
15
- "icon-wrapper": "_icon-wrapper_hm7mj_24",
16
- "size-lg": "_size-lg_hm7mj_27",
17
- "variant-ai": "_variant-ai_hm7mj_34",
18
- "variant-danger": "_variant-danger_hm7mj_39",
19
- "variant-info": "_variant-info_hm7mj_44",
20
- "variant-success": "_variant-success_hm7mj_49",
21
- "variant-warning": "_variant-warning_hm7mj_54",
22
- "full-width": "_full-width_hm7mj_59",
12
+ "size-md": "_size-md_8fyu4_18",
13
+ "content-actions": "_content-actions_8fyu4_21",
14
+ "without-title": "_without-title_8fyu4_24",
15
+ "icon-wrapper": "_icon-wrapper_8fyu4_24",
16
+ "size-lg": "_size-lg_8fyu4_27",
17
+ "variant-ai": "_variant-ai_8fyu4_34",
18
+ "variant-danger": "_variant-danger_8fyu4_39",
19
+ "variant-info": "_variant-info_8fyu4_44",
20
+ "variant-success": "_variant-success_8fyu4_49",
21
+ "variant-warning": "_variant-warning_8fyu4_54",
22
+ "full-width": "_full-width_8fyu4_59",
23
23
  content: O,
24
- "content-text": "_content-text_hm7mj_70",
25
- "title-close-button": "_title-close-button_hm7mj_87",
26
- "title-with-icon": "_title-with-icon_hm7mj_90",
27
- "close-button": "_close-button_hm7mj_96",
28
- "icon-wrapper-success": "_icon-wrapper-success_hm7mj_109",
29
- "icon-wrapper-danger": "_icon-wrapper-danger_hm7mj_113",
30
- "icon-wrapper-info": "_icon-wrapper-info_hm7mj_117",
31
- "icon-wrapper-warning": "_icon-wrapper-warning_hm7mj_123",
32
- "icon-wrapper-ai": "_icon-wrapper-ai_hm7mj_127"
33
- }, d = w(
34
- ({ variant: t = "primary", ...o }, n) => /* @__PURE__ */ i(b, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
24
+ "content-text": "_content-text_8fyu4_71",
25
+ "title-close-button": "_title-close-button_8fyu4_88",
26
+ "title-with-icon": "_title-with-icon_8fyu4_91",
27
+ "close-button": "_close-button_8fyu4_97",
28
+ "icon-wrapper-success": "_icon-wrapper-success_8fyu4_111",
29
+ "icon-wrapper-danger": "_icon-wrapper-danger_8fyu4_115",
30
+ "icon-wrapper-info": "_icon-wrapper-info_8fyu4_119",
31
+ "icon-wrapper-warning": "_icon-wrapper-warning_8fyu4_125",
32
+ "icon-wrapper-ai": "_icon-wrapper-ai_8fyu4_129"
33
+ }, w = y(
34
+ ({ variant: t = "primary", ...o }, n) => /* @__PURE__ */ i(h, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
35
35
  );
36
- d.displayName = "Alert.Button";
37
- const f = w(
38
- ({ variant: t = "secondary", ...o }, n) => /* @__PURE__ */ i(b, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
36
+ w.displayName = "Alert.Button";
37
+ const d = y(
38
+ ({ variant: t = "secondary", ...o }, n) => /* @__PURE__ */ i(h, { className: "shrink-0 w-fit", ref: n, variant: t, ...o })
39
39
  );
40
- f.displayName = "Alert.SecondaryButton";
41
- const R = A(x), l = ({ children: t, hasCloseButton: o, ...n }) => /* @__PURE__ */ i(N, { as: "span", className: R(o && "title-close-button"), ...n, children: t });
42
- l.displayName = "Alert.Title";
43
- const a = A(x), z = {
40
+ d.displayName = "Alert.SecondaryButton";
41
+ const R = x(B), _ = ({ children: t, hasCloseButton: o, ...n }) => /* @__PURE__ */ i(b, { as: "span", className: R(o && "title-close-button"), ...n, children: t });
42
+ _.displayName = "Alert.Title";
43
+ const a = x(B), z = {
44
44
  ai: "sparkles",
45
45
  brand: "lightbulb-alt",
46
46
  danger: "exclamation-octagon",
47
47
  info: "info-circle",
48
48
  success: "check-circle",
49
49
  warning: "exclamation-triangle"
50
- }, B = w(
51
- ({ children: t, className: o, cta: n, handleClose: _, isFullWidth: $, size: c = "md", variant: s = "brand", ...k }, T) => {
52
- const C = s === "ai", j = u.toArray(t).some((e) => p.isValidElement(e) ? e.type === l : !1), y = /* @__PURE__ */ i("div", { className: a("icon-wrapper", `icon-wrapper-${s}`), children: /* @__PURE__ */ i(V, { name: z[s] }) }), S = u.toArray(t).map((e) => e.type === l ? /* @__PURE__ */ m("div", { className: a("title-with-icon"), children: [
53
- y,
54
- h(e, {
55
- hasCloseButton: !!_,
50
+ }, $ = y(
51
+ ({ children: t, className: o, cta: n, handleClose: u, isFullWidth: k, size: c = "md", variant: s = "brand", ...T }, C) => {
52
+ const S = s === "ai", g = f.toArray(t).some((e) => p.isValidElement(e) ? e.type === _ : !1), v = /* @__PURE__ */ i("div", { className: a("icon-wrapper", `icon-wrapper-${s}`), children: /* @__PURE__ */ i(V, { name: z[s] }) }), j = f.toArray(t).map((e) => e.type === _ ? /* @__PURE__ */ l("div", { className: a("title-with-icon"), children: [
53
+ v,
54
+ m(e, {
55
+ hasCloseButton: !!u,
56
56
  variant: `body-${c}-strong`
57
57
  })
58
- ] }) : e), g = (e) => u.toArray(e).flatMap((r) => p.isValidElement(r) && r.type === p.Fragment ? g(r.props.children) : r.type === d ? h(r, {
58
+ ] }) : e), N = (e) => f.toArray(e).flatMap((r) => p.isValidElement(r) && r.type === p.Fragment ? N(r.props.children) : r.type === w ? m(r, {
59
59
  size: c,
60
- variant: C ? "primary-ai" : void 0
61
- }) : r.type === f ? h(r, {
60
+ variant: S ? "primary-ai" : void 0
61
+ }) : r.type === d ? m(r, {
62
62
  size: c
63
- }) : r), v = !!n && g(n);
64
- return /* @__PURE__ */ m(
63
+ }) : r), A = !!n && N(n);
64
+ return /* @__PURE__ */ l(
65
65
  "div",
66
66
  {
67
67
  className: a(
68
68
  "root",
69
- $ && "full-width",
69
+ k && "full-width",
70
70
  `size-${c}`,
71
71
  s && `variant-${s}`,
72
72
  o
73
73
  ),
74
- ref: T,
75
- ...k,
74
+ ref: C,
75
+ ...T,
76
76
  children: [
77
- !!_ && /* @__PURE__ */ i(E, { className: a("close-button"), onClick: _ }),
78
- /* @__PURE__ */ m("div", { className: a("content"), children: [
79
- /* @__PURE__ */ m(
80
- N,
77
+ !!u && /* @__PURE__ */ i(E, { className: a("close-button"), onClick: u }),
78
+ /* @__PURE__ */ l("div", { className: a("content"), children: [
79
+ /* @__PURE__ */ l(
80
+ b,
81
81
  {
82
82
  as: "div",
83
- className: a("content-text", !j && "without-title"),
83
+ className: a("content-text", !g && "without-title"),
84
84
  variant: `body-${c}`,
85
85
  children: [
86
- !j && y,
87
- S
86
+ !g && v,
87
+ j
88
88
  ]
89
89
  }
90
90
  ),
91
- !!v && /* @__PURE__ */ i("div", { className: a("content-actions"), children: v })
91
+ !!A && /* @__PURE__ */ i("div", { className: a("content-actions"), children: A })
92
92
  ] })
93
93
  ]
94
94
  }
95
95
  );
96
96
  }
97
97
  );
98
- B.displayName = "Alert";
99
- const K = Object.assign(B, {
100
- Button: d,
101
- SecondaryButton: f,
102
- Title: l
98
+ $.displayName = "Alert";
99
+ const K = Object.assign($, {
100
+ Button: w,
101
+ SecondaryButton: d,
102
+ Title: _
103
103
  });
104
104
  export {
105
105
  K as Alert,
package/dist/Checkbox.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import './Checkbox.css';
3
- import { jsxs as b, jsx as s } from "react/jsx-runtime";
3
+ import { jsxs as b, jsx as i } from "react/jsx-runtime";
4
4
  import { a as x } from "./KPUWHTQJ-Dv3cAqjP.js";
5
5
  import { forwardRef as C, useState as l } from "react";
6
6
  import { useField as g } from "./Field.js";
@@ -14,9 +14,9 @@ const y = "_root_luk8p_2", F = "_indeterminate_luk8p_67", I = {
14
14
  "variant-success": "_variant-success_luk8p_61",
15
15
  indeterminate: F
16
16
  }, N = w(I), j = C(
17
- ({ checked: m = !1, className: u, indeterminate: a = !1, onChange: i, variant: f, ...o }, p) => {
18
- const [e, _] = l(m), [k, t] = l(!1), { getInputProps: n, variant: v } = g(), r = v || f, { disabled: c } = n(o), h = () => {
19
- _(!e), i && i(!e);
17
+ ({ checked: m = !1, className: u, indeterminate: s = !1, onChange: a, variant: f, ...t }, p) => {
18
+ const [e, _] = l(m), [k, n] = l(!1), { getInputProps: o, variant: v } = g(), r = v || f, { disabled: c } = o(t), h = () => {
19
+ _(!e), a && a(!e);
20
20
  };
21
21
  return /* @__PURE__ */ b(
22
22
  "div",
@@ -26,24 +26,25 @@ const y = "_root_luk8p_2", F = "_indeterminate_luk8p_67", I = {
26
26
  className: N(
27
27
  "root",
28
28
  r && `variant-${r}`,
29
- a && "indeterminate",
29
+ s && "indeterminate",
30
+ "field-input",
30
31
  u
31
32
  ),
32
33
  "data-focus-visible": k || void 0,
33
34
  onClick: c ? void 0 : h,
34
35
  children: [
35
- /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(
36
+ /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
36
37
  x,
37
38
  {
38
- ...n(o),
39
+ ...o(t),
39
40
  checked: e,
40
- onBlur: () => t(!1),
41
- onFocusVisible: () => t(!0),
41
+ onBlur: () => n(!1),
42
+ onFocusVisible: () => n(!0),
42
43
  ref: p
43
44
  }
44
45
  ) }),
45
- e ? /* @__PURE__ */ s(d, { name: "check", size: "sm" }) : null,
46
- !e && a ? /* @__PURE__ */ s(d, { name: "minus", size: "sm" }) : null
46
+ e ? /* @__PURE__ */ i(d, { name: "check", size: "sm" }) : null,
47
+ !e && s ? /* @__PURE__ */ i(d, { name: "minus", size: "sm" }) : null
47
48
  ]
48
49
  }
49
50
  );
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import './DatePicker.css';
3
- import { jsxs as q, jsx as l } from "react/jsx-runtime";
4
- import { useState as $, useMemo as k, useEffect as j, forwardRef as G, useRef as J } from "react";
5
- import { D as Q, C as V } from "./CustomPopper-C1wIDHbM.js";
6
- import { Button as F } from "./Button.js";
7
- import { Icon as M } from "./Icon.js";
8
- import { Select as w } from "./Select.js";
9
- import { c as P } from "./index-PAaZGbyz.js";
10
- import { g as W, a as X, s as v, b as Z, D as K } from "./utils-BD597oo6.js";
11
- import { InputText as Y } from "./InputText.js";
12
- const g = P(v), B = ({
3
+ import { jsxs as G, jsx as l } from "react/jsx-runtime";
4
+ import { useState as A, useMemo as $, useEffect as S, forwardRef as J, useRef as Q } from "react";
5
+ import { D as V, C as W } from "./CustomPopper-C1wIDHbM.js";
6
+ import { Button as j } from "./Button.js";
7
+ import { Icon as F } from "./Icon.js";
8
+ import { Select as M } from "./Select.js";
9
+ import { c as v } from "./index-PAaZGbyz.js";
10
+ import { g as X, a as Z, s as B, b as Y, D as K } from "./utils-BD597oo6.js";
11
+ import { InputText as g } from "./InputText.js";
12
+ const C = v(B), L = ({
13
13
  changeMonth: x,
14
14
  changeYear: N,
15
15
  date: f,
@@ -22,49 +22,49 @@ const g = P(v), B = ({
22
22
  locale: D,
23
23
  startYear: a
24
24
  }) => {
25
- const [u, R] = $(null), [i, E] = $(null), o = k(() => W(D), [D]), r = k(() => X(a, c), [a, c]), m = (t || u === o[0].label) && i === a, H = (t || u === o[o.length - 1].label) && i === c;
26
- return j(() => {
27
- const b = new Date(f), d = o[b.getMonth()].label, A = b.getFullYear();
28
- R(d), E(A);
29
- }, [f, o]), /* @__PURE__ */ q("div", { className: g("custom-header"), children: [
25
+ const [p, R] = A(null), [m, w] = A(null), i = $(() => X(D), [D]), r = $(() => Z(a, c), [a, c]), o = (t || p === i[0].label) && m === a, E = (t || p === i[i.length - 1].label) && m === c;
26
+ return S(() => {
27
+ const b = new Date(f), u = i[b.getMonth()].label, H = b.getFullYear();
28
+ R(u), w(H);
29
+ }, [f, i]), /* @__PURE__ */ G("div", { className: C("custom-header"), children: [
30
30
  /* @__PURE__ */ l(
31
- F,
31
+ j,
32
32
  {
33
- disabled: m,
33
+ disabled: o,
34
34
  onClick: t ? z : T,
35
35
  size: "sm",
36
36
  title: `Previous ${t ? "year" : "month"}`,
37
37
  variant: "tertiary",
38
- children: /* @__PURE__ */ l(M, { name: "angle-left-b", size: "xs" })
38
+ children: /* @__PURE__ */ l(F, { name: "angle-left-b", size: "xs" })
39
39
  }
40
40
  ),
41
41
  !t && /* @__PURE__ */ l(
42
- w,
42
+ M,
43
43
  {
44
44
  id: "month",
45
45
  name: "month",
46
46
  onChange: x,
47
- options: o,
47
+ options: i,
48
48
  size: "md",
49
- value: u
49
+ value: p
50
50
  }
51
51
  ),
52
- /* @__PURE__ */ l(w, { id: "year", name: "year", onChange: N, options: r, size: "md", value: i }),
52
+ /* @__PURE__ */ l(M, { id: "year", name: "year", onChange: N, options: r, size: "md", value: m }),
53
53
  /* @__PURE__ */ l(
54
- F,
54
+ j,
55
55
  {
56
- disabled: H,
56
+ disabled: E,
57
57
  onClick: t ? y : I,
58
58
  size: "sm",
59
59
  title: `Next ${t ? "year" : "month"}`,
60
60
  variant: "tertiary",
61
- children: /* @__PURE__ */ l(M, { name: "angle-right-b", size: "xs" })
61
+ children: /* @__PURE__ */ l(F, { name: "angle-right-b", size: "xs" })
62
62
  }
63
63
  )
64
64
  ] });
65
65
  };
66
- B.displayName = "DateTimePicker.CustomHeader";
67
- const h = P(v), C = G(
66
+ L.displayName = "DateTimePicker.CustomHeader";
67
+ const P = v(B), h = J(
68
68
  ({
69
69
  autoFocus: x,
70
70
  className: N,
@@ -77,93 +77,94 @@ const h = P(v), C = G(
77
77
  onChange: t,
78
78
  placeholder: D,
79
79
  preventVirtualKeyboard: a = !1,
80
- showMonthYearPicker: u,
80
+ showMonthYearPicker: p,
81
81
  size: R = "md",
82
- startYear: i = 1900,
83
- transparent: E,
84
- useWeekdaysShort: o = !0,
82
+ startYear: m = 1900,
83
+ transparent: w,
84
+ useWeekdaysShort: i = !0,
85
85
  value: r = K,
86
- ...m
87
- }, H) => {
88
- const b = m == null ? void 0 : m.timeIntervals, d = (e) => Z(e, b), [A, n] = $(d(r)), L = J(), S = H || L;
89
- j(() => {
90
- t == null || t(d(r));
91
- }, []), j(() => {
92
- var p;
93
- const e = d(r), s = typeof r == "object" ? r == null ? void 0 : r.toISOString() : r;
94
- ((p = new Date(Date.parse(s))) == null ? void 0 : p.getTime()) - (e == null ? void 0 : e.getTime()) !== 0 && (t == null || t(e)), n(e);
86
+ ...o
87
+ }, E) => {
88
+ const b = o == null ? void 0 : o.timeIntervals, u = (e) => Y(e, b), [H, d] = A(u(r)), O = Q(), k = E || O;
89
+ S(() => {
90
+ t == null || t(u(r));
91
+ }, []), S(() => {
92
+ var n;
93
+ const e = u(r), s = typeof r == "object" ? r == null ? void 0 : r.toISOString() : r;
94
+ ((n = new Date(Date.parse(s))) == null ? void 0 : n.getTime()) - (e == null ? void 0 : e.getTime()) !== 0 && (t == null || t(e)), d(e);
95
95
  }, [r]);
96
- const O = (e) => {
96
+ const U = (e) => {
97
97
  var s;
98
- ["Enter", "Escape"].includes(e.key) && ((s = S.current) == null || s.blur());
99
- }, U = (e) => {
100
- var s;
101
- e.preventDefault(), (s = S.current) == null || s.blur(), n(null), t == null || t(null);
98
+ ["Enter", "Escape"].includes(e.key) && ((s = k.current) == null || s.blur());
102
99
  }, _ = (e) => {
100
+ var s;
101
+ e.preventDefault(), (s = k.current) == null || s.blur(), d(null), t == null || t(null);
102
+ }, q = (e) => {
103
103
  if (!e) {
104
- n(null), t == null || t(null);
104
+ d(null), t == null || t(null);
105
105
  return;
106
106
  }
107
107
  const s = Array.isArray(e) ? e[0] : e;
108
108
  if (!s) {
109
- n(null), t == null || t(null);
109
+ d(null), t == null || t(null);
110
110
  return;
111
111
  }
112
- const p = d(s);
113
- s.setHours(p.getHours(), p.getMinutes()), n(s), t == null || t(new Date(s));
112
+ const n = u(s);
113
+ s.setHours(n.getHours(), n.getMinutes()), d(s), t == null || t(new Date(s));
114
114
  };
115
115
  return (
116
116
  // type issue in react-datepicker (https://github.com/Hacker0x01/react-datepicker/issues/5391)
117
117
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
118
118
  // @ts-expect-error
119
119
  /* @__PURE__ */ l(
120
- Q,
120
+ V,
121
121
  {
122
122
  autoComplete: "off",
123
123
  calendarClassName: "date-picker-popper",
124
124
  customInput: /* @__PURE__ */ l(
125
- Y,
125
+ g,
126
126
  {
127
127
  autoFocus: x,
128
- className: h("date-picker", N),
129
- "data-testid": m["data-testid"],
128
+ className: P("date-picker", N),
129
+ "data-testid": o["data-testid"],
130
130
  disabled: T,
131
131
  icon: c,
132
132
  iconPlacement: I,
133
133
  inputMode: a ? "none" : "text",
134
134
  isClearable: !0,
135
- onReset: U,
135
+ onReset: _,
136
136
  placeholder: D,
137
- ref: S,
137
+ ref: k,
138
138
  size: R,
139
- transparent: E
139
+ transparent: w
140
140
  }
141
141
  ),
142
142
  dateFormat: f,
143
143
  locale: y,
144
- onChange: _,
145
- onKeyDown: O,
146
- popperContainer: V,
144
+ onChange: q,
145
+ onKeyDown: U,
146
+ popperContainer: W,
147
147
  renderCustomHeader: (e) => /* @__PURE__ */ l(
148
- B,
148
+ L,
149
149
  {
150
150
  endYear: z,
151
- isMonthYearPicker: u,
151
+ isMonthYearPicker: p,
152
152
  locale: y,
153
- startYear: i,
153
+ startYear: m,
154
154
  ...e
155
155
  }
156
156
  ),
157
- selected: A,
158
- showMonthYearPicker: u,
159
- useWeekdaysShort: o,
160
- ...m
157
+ selected: H,
158
+ showMonthYearPicker: p,
159
+ useWeekdaysShort: i,
160
+ ...o,
161
+ wrapperClassName: P(o.wrapperClassName, "date-picker-wrapper", "field-input")
161
162
  }
162
163
  )
163
164
  );
164
165
  }
165
166
  );
166
- C.displayName = "DatePicker";
167
+ h.displayName = "DatePicker";
167
168
  export {
168
- C as DatePicker
169
+ h as DatePicker
169
170
  };
@@ -10,11 +10,11 @@ const L = F(j), M = E(
10
10
  locale: p,
11
11
  onChange: s,
12
12
  size: D = "md",
13
- transparent: k,
14
- value: r = b,
13
+ transparent: n,
14
+ value: i = b,
15
15
  ...l
16
- }, n) => {
17
- const u = l == null ? void 0 : l.timeIntervals, i = (t) => I(t, u), [T, c] = P(i(r)), y = x(), R = n || y, m = (t) => {
16
+ }, k) => {
17
+ const u = l == null ? void 0 : l.timeIntervals, r = (t) => I(t, u), [T, c] = P(r(i)), y = x(), R = k || y, m = (t) => {
18
18
  if (!t) {
19
19
  c(null), s == null || s(null);
20
20
  return;
@@ -24,16 +24,16 @@ const L = F(j), M = E(
24
24
  c(null), s == null || s(null);
25
25
  return;
26
26
  }
27
- const f = i(e);
27
+ const f = r(e);
28
28
  e.setHours(f.getHours(), f.getMinutes()), c(e), s == null || s(new Date(e));
29
29
  };
30
30
  return a(() => {
31
- m(i(r));
31
+ m(r(i));
32
32
  }, []), a(() => {
33
33
  var e;
34
- const t = i(r);
35
- ((e = new Date(r)) == null ? void 0 : e.getTime()) - (t == null ? void 0 : t.getTime()) !== 0 && m(t), c(t);
36
- }, [r]), /* @__PURE__ */ A("div", { className: L("date-time-picker"), children: N.map(o, (t, e) => H(t, {
34
+ const t = r(i);
35
+ ((e = new Date(i)) == null ? void 0 : e.getTime()) - (t == null ? void 0 : t.getTime()) !== 0 && m(t), c(t);
36
+ }, [i]), /* @__PURE__ */ A("div", { className: L("date-time-picker", "field-input"), children: N.map(o, (t, e) => H(t, {
37
37
  disabled: d,
38
38
  inputRef: e === 0 ? R : null,
39
39
  // give ref only to the DatePicker
@@ -42,7 +42,7 @@ const L = F(j), M = E(
42
42
  onChange: m,
43
43
  size: D,
44
44
  timeIntervals: u,
45
- transparent: k,
45
+ transparent: n,
46
46
  value: T
47
47
  })) });
48
48
  }
package/dist/Field.css CHANGED
@@ -1 +1 @@
1
- @layer components{._root_6ifwm_2{display:grid;grid-template-areas:"label" "input";width:100%}._root_6ifwm_2:has(._label_6ifwm_7):has(._hint_6ifwm_7){grid-template-areas:"label" "input" "hint"}._root_6ifwm_2:not(:has(._label_6ifwm_7)):has(._hint_6ifwm_7){grid-template-areas:"input" "hint"}._root_6ifwm_2:not(._inline_6ifwm_13) ._hint_6ifwm_7{margin-top:var(--components-dimensions-field-gap-assistive)}._root_6ifwm_2:not(._inline_6ifwm_13) ._label_6ifwm_7{margin-bottom:var(--components-dimensions-field-gap-label)}._inline_6ifwm_13{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--components-dimensions-field-gap-assistive);grid-column-gap:var(--components-dimensions-field-gap-label)}._inline_6ifwm_13:has(._label_6ifwm_7):has(._hint_6ifwm_7){grid-template-areas:"input label" ". hint"}._inline_6ifwm_13:not(:has(._label_6ifwm_7)):has(._hint_6ifwm_7){grid-template-areas:"input ." ". hint"}._label_6ifwm_7{grid-area:label}._input_6ifwm_35{display:flex;align-items:center;grid-area:input;width:100%}._hint_6ifwm_7{grid-area:hint}._visuallyHidden_6ifwm_44{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}
1
+ @layer components{._root_wx4cj_2{display:grid;grid-template-areas:"label" "input";width:100%}._root_wx4cj_2:has(._label_wx4cj_7):has(._hint_wx4cj_7){grid-template-areas:"label" "input" "hint"}._root_wx4cj_2:not(:has(._label_wx4cj_7)):has(._hint_wx4cj_7){grid-template-areas:"input" "hint"}._root_wx4cj_2:not(._inline_wx4cj_13) ._hint_wx4cj_7{margin-top:var(--components-dimensions-field-gap-assistive)}._root_wx4cj_2:not(._inline_wx4cj_13) ._label_wx4cj_7{margin-bottom:var(--components-dimensions-field-gap-label)}._root_wx4cj_2 .field-input{align-self:center;grid-area:input}._root_wx4cj_2 .field-input.date-picker-wrapper{justify-self:start}._inline_wx4cj_13{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--components-dimensions-field-gap-assistive);grid-column-gap:var(--components-dimensions-field-gap-label)}._inline_wx4cj_13:has(._label_wx4cj_7):has(._hint_wx4cj_7){grid-template-areas:"input label" ". hint"}._inline_wx4cj_13:not(:has(._label_wx4cj_7)):has(._hint_wx4cj_7){grid-template-areas:"input ." ". hint"}._label_wx4cj_7{grid-area:label}._hint_wx4cj_7{grid-area:hint}._visuallyHidden_wx4cj_45{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}