alif-ui 2.0.0-alpha.21 → 2.0.0-alpha.22

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 (87) hide show
  1. package/dist/alif-ui.css +1 -1
  2. package/dist/components/Accordion/AccordionContent/AccordionContent.js +6 -6
  3. package/dist/components/Accordion/AccordionTrigger/AccordionTrigger.js +9 -9
  4. package/dist/components/Alert/Alert.js +21 -21
  5. package/dist/components/Dates/InputDatePicker/InputDatePicker.js +4 -4
  6. package/dist/components/Dates/InputMonthPicker/InputMonthPicker.js +4 -4
  7. package/dist/components/Dates/InputMonthYearPicker/InputMonthYearPicker.js +4 -4
  8. package/dist/components/Dates/InputTimePicker/InputTimePicker.js +4 -4
  9. package/dist/components/Dates/InputYearPicker/InputYearPicker.js +4 -4
  10. package/dist/components/Drawer/Drawer.js +6 -6
  11. package/dist/components/Field/InputBaseWrapper/InputBaseWrapper.js +17 -17
  12. package/dist/components/FileUploader/FileUploader.js +4 -4
  13. package/dist/components/List/ListGroup/ListGroup.js +28 -21
  14. package/dist/components/Modal/Modal.js +4 -4
  15. package/dist/components/NativeAccordion/NativeAccordion.context.js +5 -0
  16. package/dist/components/NativeAccordion/NativeAccordion.js +37 -0
  17. package/dist/components/NativeAccordion/NativeAccordion.types.js +0 -0
  18. package/dist/components/NativeAccordion/NativeAccordion.utils.js +9 -0
  19. package/dist/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.js +25 -0
  20. package/dist/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.types.js +0 -0
  21. package/dist/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.js +32 -0
  22. package/dist/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.types.js +0 -0
  23. package/dist/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.js +27 -0
  24. package/dist/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.types.js +0 -0
  25. package/dist/components/Pagination/Pagination.js +10 -10
  26. package/dist/components/Select/SelectMultiple/SelectMultiple.js +6 -6
  27. package/dist/components/Sidebar/Sidebar.js +31 -30
  28. package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.js +30 -21
  29. package/dist/components/Sidebar/SidebarItem/SidebarItem.js +24 -46
  30. package/dist/components/Sidebar/SidebarItem/SidebarItemContent.js +39 -0
  31. package/dist/components/Snackbar/SnackbarCard/SnackbarCard.js +18 -18
  32. package/dist/components/Table/Table.js +27 -43
  33. package/dist/components/Table/TableCollapseRow/TableCollapseRow.js +42 -0
  34. package/dist/components/Textarea/Textarea.js +9 -9
  35. package/dist/icons/components/SolidSystemBookOpen.js +14 -11
  36. package/dist/lib/components/Badge/Badge.module.js +3 -3
  37. package/dist/lib/components/List/ListGroup/ListGroup.module.js +5 -5
  38. package/dist/lib/components/NativeAccordion/NativeAccordion.module.js +13 -0
  39. package/dist/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.module.js +5 -3
  40. package/dist/lib/components/Table/Table.module.js +21 -19
  41. package/dist/main.js +308 -308
  42. package/dist/src/lib/components/List/List.d.ts +1 -1
  43. package/dist/src/lib/components/List/ListGroup/ListGroup.d.ts +1 -1
  44. package/dist/src/lib/components/List/ListGroup/ListGroup.d.ts.map +1 -1
  45. package/dist/src/lib/components/List/ListGroup/ListGroup.types.d.ts +4 -3
  46. package/dist/src/lib/components/List/ListGroup/ListGroup.types.d.ts.map +1 -1
  47. package/dist/src/lib/components/NativeAccordion/NativeAccordion.context.d.ts +22 -0
  48. package/dist/src/lib/components/NativeAccordion/NativeAccordion.context.d.ts.map +1 -0
  49. package/dist/src/lib/components/NativeAccordion/NativeAccordion.d.ts +8 -0
  50. package/dist/src/lib/components/NativeAccordion/NativeAccordion.d.ts.map +1 -0
  51. package/dist/src/lib/components/NativeAccordion/NativeAccordion.types.d.ts +78 -0
  52. package/dist/src/lib/components/NativeAccordion/NativeAccordion.types.d.ts.map +1 -0
  53. package/dist/src/lib/components/NativeAccordion/NativeAccordion.utils.d.ts +6 -0
  54. package/dist/src/lib/components/NativeAccordion/NativeAccordion.utils.d.ts.map +1 -0
  55. package/dist/src/lib/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.d.ts +3 -0
  56. package/dist/src/lib/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.d.ts.map +1 -0
  57. package/dist/src/lib/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.types.d.ts +20 -0
  58. package/dist/src/lib/components/NativeAccordion/NativeAccordionContent/NativeAccordionContent.types.d.ts.map +1 -0
  59. package/dist/src/lib/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.d.ts +3 -0
  60. package/dist/src/lib/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.d.ts.map +1 -0
  61. package/dist/src/lib/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.types.d.ts +28 -0
  62. package/dist/src/lib/components/NativeAccordion/NativeAccordionItem/NativeAccordionItem.types.d.ts.map +1 -0
  63. package/dist/src/lib/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.d.ts +3 -0
  64. package/dist/src/lib/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.d.ts.map +1 -0
  65. package/dist/src/lib/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.types.d.ts +24 -0
  66. package/dist/src/lib/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.types.d.ts.map +1 -0
  67. package/dist/src/lib/components/NativeAccordion/index.d.ts +6 -0
  68. package/dist/src/lib/components/NativeAccordion/index.d.ts.map +1 -0
  69. package/dist/src/lib/components/Sidebar/Sidebar.context.d.ts +1 -0
  70. package/dist/src/lib/components/Sidebar/Sidebar.context.d.ts.map +1 -1
  71. package/dist/src/lib/components/Sidebar/Sidebar.d.ts.map +1 -1
  72. package/dist/src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.d.ts.map +1 -1
  73. package/dist/src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.types.d.ts +2 -1
  74. package/dist/src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.types.d.ts.map +1 -1
  75. package/dist/src/lib/components/Sidebar/SidebarItem/SidebarItem.d.ts.map +1 -1
  76. package/dist/src/lib/components/Sidebar/SidebarItem/SidebarItemContent.d.ts +5 -0
  77. package/dist/src/lib/components/Sidebar/SidebarItem/SidebarItemContent.d.ts.map +1 -0
  78. package/dist/src/lib/components/Table/Table.d.ts +2 -3
  79. package/dist/src/lib/components/Table/Table.d.ts.map +1 -1
  80. package/dist/src/lib/components/Table/Table.types.d.ts +5 -0
  81. package/dist/src/lib/components/Table/Table.types.d.ts.map +1 -1
  82. package/dist/src/lib/components/Table/TableCollapseRow/TableCollapseRow.d.ts +3 -0
  83. package/dist/src/lib/components/Table/TableCollapseRow/TableCollapseRow.d.ts.map +1 -0
  84. package/dist/src/lib/components/index.d.ts +1 -1
  85. package/dist/src/lib/components/index.d.ts.map +1 -1
  86. package/dist/src/lib/utils/get-default-z-index.d.ts +1 -1
  87. package/package.json +4 -2
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { classNames as e } from "../../../utils/class-names.js";
3
+ import { OutlineNavigationChevronDown as t } from "../../../icons/components/OutlineNavigationChevronDown.js";
4
+ import { useNativeAccordionItemContext as n } from "../NativeAccordion.context.js";
5
+ import r from "../../../lib/components/NativeAccordion/NativeAccordion.module.js";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region src/lib/components/NativeAccordion/NativeAccordionTrigger/NativeAccordionTrigger.tsx
8
+ var o = ({ chevron: o, children: s, className: c, style: l, ref: u }) => {
9
+ let { disabled: d, isOpen: f, toggle: p } = n();
10
+ return /* @__PURE__ */ a("summary", {
11
+ ref: u,
12
+ style: l,
13
+ onClick: (e) => {
14
+ e.preventDefault(), d || p();
15
+ },
16
+ "aria-disabled": d || void 0,
17
+ tabIndex: d ? -1 : void 0,
18
+ className: e(r.trigger, d && r.disabled, c),
19
+ children: [/* @__PURE__ */ i("div", { children: s }), /* @__PURE__ */ i("span", {
20
+ className: r.triggerIcon,
21
+ "aria-hidden": "true",
22
+ children: typeof o == "function" ? o(f) : o ?? /* @__PURE__ */ i(t, { className: r.chevron })
23
+ })]
24
+ });
25
+ };
26
+ //#endregion
27
+ export { o as NativeAccordionTrigger };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { classNames as e } from "../../utils/class-names.js";
3
- import { OutlineNavigationChevronLeft as t } from "../../icons/components/OutlineNavigationChevronLeft.js";
4
- import { OutlineNavigationChevronRight as n } from "../../icons/components/OutlineNavigationChevronRight.js";
5
- import { OutlineNavigationDoubleLeft as r } from "../../icons/components/OutlineNavigationDoubleLeft.js";
6
- import { OutlineNavigationDoubleRight as i } from "../../icons/components/OutlineNavigationDoubleRight.js";
7
- import { useLocale as a } from "../../providers/hooks/useLocale/useLocale.js";
3
+ import { useLocale as t } from "../../providers/hooks/useLocale/useLocale.js";
4
+ import { OutlineNavigationChevronLeft as n } from "../../icons/components/OutlineNavigationChevronLeft.js";
5
+ import { OutlineNavigationChevronRight as r } from "../../icons/components/OutlineNavigationChevronRight.js";
6
+ import { OutlineNavigationDoubleLeft as i } from "../../icons/components/OutlineNavigationDoubleLeft.js";
7
+ import { OutlineNavigationDoubleRight as a } from "../../icons/components/OutlineNavigationDoubleRight.js";
8
8
  import { Button as o } from "../Button/Button.js";
9
9
  import { Divider as s } from "../Divider/Divider.js";
10
10
  import { Select as c } from "../Select/Select.js";
@@ -15,7 +15,7 @@ import f from "../../lib/components/Pagination/Pagination.module.js";
15
15
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
16
16
  //#region src/lib/components/Pagination/Pagination.tsx
17
17
  var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y, onPageChange: b, onItemsPerPageChange: x, size: S = "m", className: C, style: w, showFirstLastButtons: T = !1, showPageNumbers: E = !0, siblingCount: D = 1, disableFirstButton: O = !1, disableLastButton: k = !1, disablePreviousButton: A = !1, disableNextButton: j = !1 }) => {
18
- let { locale: M } = a(), N = l[M], P = d({
18
+ let { locale: M } = t(), N = l[M], P = d({
19
19
  currentPage: g,
20
20
  totalPages: _,
21
21
  siblingCount: D
@@ -35,7 +35,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
35
35
  disabled: g === 1 || O,
36
36
  onClick: () => b(1),
37
37
  "aria-label": N.firstPage,
38
- children: /* @__PURE__ */ m(r, {})
38
+ children: /* @__PURE__ */ m(i, {})
39
39
  }),
40
40
  /* @__PURE__ */ m(o, {
41
41
  size: S,
@@ -44,7 +44,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
44
44
  disabled: g === 1 || A,
45
45
  onClick: () => b(g - 1),
46
46
  "aria-label": N.previousPage,
47
- children: /* @__PURE__ */ m(t, {})
47
+ children: /* @__PURE__ */ m(n, {})
48
48
  }),
49
49
  E && P.map((e, t) => e === "..." ? /* @__PURE__ */ m(o, {
50
50
  size: S,
@@ -69,7 +69,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
69
69
  disabled: g === F || j,
70
70
  onClick: () => b(g + 1),
71
71
  "aria-label": N.nextPage,
72
- children: /* @__PURE__ */ m(n, {})
72
+ children: /* @__PURE__ */ m(r, {})
73
73
  }),
74
74
  T && /* @__PURE__ */ m(o, {
75
75
  size: S,
@@ -78,7 +78,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
78
78
  disabled: g === F || k,
79
79
  onClick: () => b(F),
80
80
  "aria-label": N.lastPage,
81
- children: /* @__PURE__ */ m(i, {})
81
+ children: /* @__PURE__ */ m(a, {})
82
82
  })
83
83
  ]
84
84
  }), y && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(s, {
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { classNames as e } from "../../../utils/class-names.js";
3
3
  import { syncRefs as t } from "../../../utils/sync-refs.js";
4
- import { OutlineNavigationChevronDown as ee } from "../../../icons/components/OutlineNavigationChevronDown.js";
5
- import { OutlineSystemClose as n } from "../../../icons/components/OutlineSystemClose.js";
6
- import { Badge as r } from "../../Badge/Badge.js";
4
+ import { Badge as ee } from "../../Badge/Badge.js";
5
+ import { OutlineNavigationChevronDown as n } from "../../../icons/components/OutlineNavigationChevronDown.js";
6
+ import { OutlineSystemClose as r } from "../../../icons/components/OutlineSystemClose.js";
7
7
  import { useComponentId as te } from "../../../hooks/useComponentId/useComponentId.js";
8
8
  import { PopoverWithFallback as i } from "../../NativePopover/PopoverWithFallback.js";
9
9
  import { InputBaseWrapper as ne } from "../../Field/InputBaseWrapper/InputBaseWrapper.js";
@@ -74,11 +74,11 @@ var g = ({ id: g, name: ae, ref: oe, values: _, options: v, label: y, placeholde
74
74
  inputRef: U,
75
75
  hintLeftSection: L,
76
76
  hintRightSection: R,
77
- rightIcon: /* @__PURE__ */ m(ee, { className: e(l.chevron, G && l.chevronActive) }),
77
+ rightIcon: /* @__PURE__ */ m(n, { className: e(l.chevron, G && l.chevronActive) }),
78
78
  children: /* @__PURE__ */ h("div", {
79
79
  ref: H,
80
80
  className: l.tags,
81
- children: [fe.map((e, t) => /* @__PURE__ */ h(r, {
81
+ children: [fe.map((e, t) => /* @__PURE__ */ h(ee, {
82
82
  variant: "light",
83
83
  color: "neutral",
84
84
  size: b === "l" ? "s" : "xs",
@@ -87,7 +87,7 @@ var g = ({ id: g, name: ae, ref: oe, values: _, options: v, label: y, placeholde
87
87
  e.leftSection,
88
88
  e.label,
89
89
  e.rightSection,
90
- /* @__PURE__ */ m(n, {
90
+ /* @__PURE__ */ m(r, {
91
91
  className: l.tagCloseIcon,
92
92
  onClick: (t) => {
93
93
  t.stopPropagation(), me(e.value);
@@ -11,47 +11,48 @@ import { SidebarCollapse as l } from "./SidebarCollapse/SidebarCollapse.js";
11
11
  import { SidebarFooter as u } from "./SidebarFooter/SidebarFooter.js";
12
12
  import { SidebarElement as d } from "./SidebarElement/SidebarElement.js";
13
13
  import { SidebarProfile as f } from "./SidebarProfile/SidebarProfile.js";
14
- import { Children as p, useState as m } from "react";
15
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { Children as p, useId as m, useState as h } from "react";
15
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
16
16
  //#region src/lib/components/Sidebar/Sidebar.tsx
17
- var _ = ({ ref: o, children: c, size: l = "large", color: d = "default", variant: f = "default", withControlButton: _ = !0, hideScrollbar: v = !0, className: y, style: b }) => {
18
- let [x, S] = m(null), [C, w] = m(l), [T, E] = m(C === "compact"), D = C === "compact", O = f === "default", k = p.toArray(c), A = r(k, a), j = r(k, s), M = r(k, u), N = () => {
19
- w(T ? "large" : "compact"), E((e) => !e);
20
- }, P = () => {
21
- T && w("large");
22
- }, F = () => {
23
- T && (w("compact"), S(null));
24
- }, I = e(t.sidebar, v && "hideScrollbar", t.absoluteContent, T && !D && t.shadow, y);
25
- return /* @__PURE__ */ h(n, {
17
+ var v = ({ ref: o, children: c, size: l = "large", color: d = "default", variant: f = "default", withControlButton: v = !0, hideScrollbar: y = !0, className: b, style: x }) => {
18
+ let S = m(), [C, w] = h(null), [T, E] = h(l), [D, O] = h(T === "compact"), k = T === "compact", A = f === "default", j = p.toArray(c), M = r(j, a), N = r(j, s), P = r(j, u), F = () => {
19
+ E(D ? "large" : "compact"), O((e) => !e);
20
+ }, I = () => {
21
+ D && E("large");
22
+ }, L = () => {
23
+ D && (E("compact"), w(null));
24
+ }, R = e(t.sidebar, y && "hideScrollbar", t.absoluteContent, D && !k && t.shadow, b);
25
+ return /* @__PURE__ */ g(n, {
26
26
  value: {
27
27
  color: d,
28
- isCompactSize: D,
29
- isDefaultVariant: O,
30
- hoverEnabled: T,
31
- withControlButton: _,
32
- openCollapseId: x,
33
- setOpenCollapseId: S,
34
- handleToggleHover: N
28
+ isCompactSize: k,
29
+ isDefaultVariant: A,
30
+ hoverEnabled: D,
31
+ withControlButton: v,
32
+ openCollapseId: C,
33
+ setOpenCollapseId: w,
34
+ collapseGroupName: S,
35
+ handleToggleHover: F
35
36
  },
36
- children: /* @__PURE__ */ g("div", {
37
+ children: /* @__PURE__ */ _("div", {
37
38
  className: t.root,
38
39
  ref: o,
39
- children: [/* @__PURE__ */ h("div", { className: e(t.placeholder, T ? t.compactWidth : t.largeWidth) }), /* @__PURE__ */ g("aside", {
40
- className: I,
41
- onMouseEnter: P,
42
- onMouseLeave: F,
43
- style: i(C, d, f, b),
44
- children: [/* @__PURE__ */ g("div", {
40
+ children: [/* @__PURE__ */ g("div", { className: e(t.placeholder, D ? t.compactWidth : t.largeWidth) }), /* @__PURE__ */ _("aside", {
41
+ className: R,
42
+ onMouseEnter: I,
43
+ onMouseLeave: L,
44
+ style: i(T, d, f, x),
45
+ children: [/* @__PURE__ */ _("div", {
45
46
  className: t.mainSection,
46
- children: [_ && (!O || !A) && /* @__PURE__ */ h(a, {}), /* @__PURE__ */ g("nav", {
47
+ children: [v && (!A || !M) && /* @__PURE__ */ g(a, {}), /* @__PURE__ */ _("nav", {
47
48
  className: t.mainSectionWrapper,
48
- children: [O && A, j]
49
+ children: [A && M, N]
49
50
  })]
50
- }), M]
51
+ }), P]
51
52
  })]
52
53
  })
53
54
  });
54
55
  };
55
- _.Header = a, _.Items = s, _.Item = c, _.Group = o, _.Collapse = l, _.Footer = u, _.Element = d, _.Profile = f;
56
+ v.Header = a, v.Items = s, v.Item = c, v.Group = o, v.Collapse = l, v.Footer = u, v.Element = d, v.Profile = f;
56
57
  //#endregion
57
- export { _ as Sidebar };
58
+ export { v as Sidebar };
@@ -2,39 +2,48 @@
2
2
  import { classNames as e } from "../../../utils/class-names.js";
3
3
  import { SolidNavigationChevronUp as t } from "../../../icons/components/SolidNavigationChevronUp.js";
4
4
  import { SolidNavigationChevronDown as n } from "../../../icons/components/SolidNavigationChevronDown.js";
5
- import { Collapse as r } from "../../Collapse/Collapse.js";
6
- import { useSidebarContext as i } from "../Sidebar.context.js";
7
- import { SidebarItem as a } from "../SidebarItem/SidebarItem.js";
5
+ import { useSidebarContext as r } from "../Sidebar.context.js";
6
+ import i from "../../../lib/components/Sidebar/SidebarItem/SidebarItem.module.js";
7
+ import { SidebarItemContent as a } from "../SidebarItem/SidebarItemContent.js";
8
8
  import o from "../../../lib/components/Sidebar/SidebarCollapse/SidebarCollapse.module.js";
9
9
  import { Children as s, isValidElement as c, useEffect as l, useId as u } from "react";
10
10
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
11
  //#region src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.tsx
12
12
  var p = ({ children: p, icon: m, label: h, counter: g, className: _, style: v }) => {
13
- let y = u(), { isCompactSize: b, openCollapseId: x, setOpenCollapseId: S } = i(), C = y === x, w = s.toArray(p).map((e) => c(e) ? e.props.active : !1).find(Boolean);
13
+ let y = u(), { isCompactSize: b, openCollapseId: x, setOpenCollapseId: S, collapseGroupName: C } = r(), w = y === x, T = s.toArray(p).map((e) => c(e) ? e.props.active : !1).find(Boolean);
14
14
  return l(() => {
15
- w && S(y);
15
+ T && S(y);
16
16
  }, [
17
- w,
17
+ T,
18
18
  y,
19
19
  S
20
- ]), /* @__PURE__ */ f("div", {
20
+ ]), /* @__PURE__ */ f("details", {
21
+ open: w,
22
+ name: C,
21
23
  style: v,
24
+ onToggle: (e) => {
25
+ let { open: t } = e.currentTarget;
26
+ e.target !== e.currentTarget || t === w || S(t ? y : null);
27
+ },
22
28
  className: e(o.sidebarCollapse, _),
23
- children: [/* @__PURE__ */ d(a, {
24
- icon: m,
25
- counter: g,
26
- active: !!(w && (b || !C)),
27
- onClick: () => {
28
- b || S(y === x ? null : y);
29
+ children: [/* @__PURE__ */ d("summary", {
30
+ "aria-label": h,
31
+ onClick: (e) => {
32
+ e.preventDefault(), !b && S(w ? null : y);
29
33
  },
30
- rightSection: /* @__PURE__ */ d("span", {
31
- className: o.collapseIcon,
32
- "aria-hidden": "true",
33
- children: d(C ? t : n, {})
34
- }),
35
- children: h
36
- }), !b && /* @__PURE__ */ d(r, {
37
- isOpen: C,
34
+ className: e(i.sidebarItem, b && i.sidebarItemCompact, T && (b || !w) && i.itemActive, o.summary),
35
+ children: /* @__PURE__ */ d(a, {
36
+ icon: m,
37
+ counter: g,
38
+ rightSection: /* @__PURE__ */ d("span", {
39
+ className: o.collapseIcon,
40
+ "aria-hidden": "true",
41
+ children: d(w ? t : n, {})
42
+ }),
43
+ children: h
44
+ })
45
+ }), !b && /* @__PURE__ */ d("div", {
46
+ className: o.clip,
38
47
  children: /* @__PURE__ */ d("div", {
39
48
  id: y,
40
49
  role: "group",
@@ -1,54 +1,32 @@
1
1
  "use client";
2
2
  import { classNames as e } from "../../../utils/class-names.js";
3
3
  import { UnstyledButton as t } from "../../UnstyledButton/UnstyledButton.js";
4
- import { Indicator as n } from "../../Indicator/Indicator.js";
5
- import { useSidebarContext as r } from "../Sidebar.context.js";
6
- import i from "../../../lib/components/Sidebar/SidebarItem/SidebarItem.module.js";
7
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ import { useSidebarContext as n } from "../Sidebar.context.js";
5
+ import r from "../../../lib/components/Sidebar/SidebarItem/SidebarItem.module.js";
6
+ import { SidebarItemContent as i } from "./SidebarItemContent.js";
7
+ import { jsx as a } from "react/jsx-runtime";
8
8
  //#region src/lib/components/Sidebar/SidebarItem/SidebarItem.tsx
9
- var c = ({ children: c, icon: l, counter: u, rightSection: d, path: f = "", active: p, onClick: m, className: h, style: g, linkComponent: _, linkProps: v }) => {
10
- let { isCompactSize: y } = r(), b = {
11
- style: g,
12
- className: e(i.sidebarItem, y && i.sidebarItemCompact, p && i.itemActive, h),
13
- onClick: () => m?.(f),
14
- "aria-label": c
15
- }, x = /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s("div", {
16
- className: i.itemContent,
17
- children: [
18
- l && /* @__PURE__ */ o("span", {
19
- className: i.itemIcon,
20
- children: y && u ? /* @__PURE__ */ o(n, {
21
- size: "s",
22
- color: "danger",
23
- label: u,
24
- children: l
25
- }) : l
26
- }),
27
- !l && y && u ? /* @__PURE__ */ o(n, {
28
- size: "s",
29
- color: "danger",
30
- label: u,
31
- children: /* @__PURE__ */ o("span", { children: c.slice(0, 2).toLocaleUpperCase() })
32
- }) : !l && y && /* @__PURE__ */ o("span", { children: c.slice(0, 2).toLocaleUpperCase() }),
33
- !y && c
34
- ]
35
- }), !y && (d || u) && /* @__PURE__ */ s("div", {
36
- className: i.rightSection,
37
- children: [!!u && /* @__PURE__ */ o(n, {
38
- size: "s",
39
- color: "danger",
40
- label: u
41
- }), d]
42
- })] });
43
- return _ ? /* @__PURE__ */ o(_, {
44
- ...b,
45
- ...v ? v(f) : {},
46
- children: x
47
- }) : /* @__PURE__ */ o(t, {
9
+ var o = ({ children: o, icon: s, counter: c, rightSection: l, path: u = "", active: d, onClick: f, className: p, style: m, linkComponent: h, linkProps: g }) => {
10
+ let { isCompactSize: _ } = n(), v = {
11
+ style: m,
12
+ className: e(r.sidebarItem, _ && r.sidebarItemCompact, d && r.itemActive, p),
13
+ onClick: () => f?.(u),
14
+ "aria-label": o
15
+ }, y = /* @__PURE__ */ a(i, {
16
+ icon: s,
17
+ counter: c,
18
+ rightSection: l,
19
+ children: o
20
+ });
21
+ return h ? /* @__PURE__ */ a(h, {
22
+ ...v,
23
+ ...g ? g(u) : {},
24
+ children: y
25
+ }) : /* @__PURE__ */ a(t, {
48
26
  type: "button",
49
- ...b,
50
- children: x
27
+ ...v,
28
+ children: y
51
29
  });
52
30
  };
53
31
  //#endregion
54
- export { c as SidebarItem };
32
+ export { o as SidebarItem };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { Indicator as e } from "../../Indicator/Indicator.js";
3
+ import { useSidebarContext as t } from "../Sidebar.context.js";
4
+ import n from "../../../lib/components/Sidebar/SidebarItem/SidebarItem.module.js";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region src/lib/components/Sidebar/SidebarItem/SidebarItemContent.tsx
7
+ var o = ({ children: o, icon: s, counter: c, rightSection: l }) => {
8
+ let { isCompactSize: u } = t();
9
+ return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
10
+ className: n.itemContent,
11
+ children: [
12
+ s && /* @__PURE__ */ i("span", {
13
+ className: n.itemIcon,
14
+ children: u && c ? /* @__PURE__ */ i(e, {
15
+ size: "s",
16
+ color: "danger",
17
+ label: c,
18
+ children: s
19
+ }) : s
20
+ }),
21
+ !s && u && c ? /* @__PURE__ */ i(e, {
22
+ size: "s",
23
+ color: "danger",
24
+ label: c,
25
+ children: /* @__PURE__ */ i("span", { children: o.slice(0, 2).toLocaleUpperCase() })
26
+ }) : !s && u && /* @__PURE__ */ i("span", { children: o.slice(0, 2).toLocaleUpperCase() }),
27
+ !u && o
28
+ ]
29
+ }), !u && (l || c) && /* @__PURE__ */ a("div", {
30
+ className: n.rightSection,
31
+ children: [!!c && /* @__PURE__ */ i(e, {
32
+ size: "s",
33
+ color: "danger",
34
+ label: c
35
+ }), l]
36
+ })] });
37
+ };
38
+ //#endregion
39
+ export { o as SidebarItemContent };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { resolveTypography as e } from "../../../utils/typography.js";
3
3
  import { classNames as t } from "../../../utils/class-names.js";
4
- import { OutlineSystemClose as n } from "../../../icons/components/OutlineSystemClose.js";
5
- import { SolidSystemCheckCircle as r } from "../../../icons/components/SolidSystemCheckCircle.js";
6
- import { SolidSystemInfo as i } from "../../../icons/components/SolidSystemInfo.js";
7
- import { SolidSystemRemoveCircle as a } from "../../../icons/components/SolidSystemRemoveCircle.js";
8
- import { SolidSystemAlertCircle as o } from "../../../icons/components/SolidSystemAlertCircle.js";
9
- import { useLocale as s } from "../../../providers/hooks/useLocale/useLocale.js";
4
+ import { useLocale as n } from "../../../providers/hooks/useLocale/useLocale.js";
5
+ import { OutlineSystemClose as r } from "../../../icons/components/OutlineSystemClose.js";
6
+ import { SolidSystemCheckCircle as i } from "../../../icons/components/SolidSystemCheckCircle.js";
7
+ import { SolidSystemInfo as a } from "../../../icons/components/SolidSystemInfo.js";
8
+ import { SolidSystemRemoveCircle as o } from "../../../icons/components/SolidSystemRemoveCircle.js";
9
+ import { SolidSystemAlertCircle as s } from "../../../icons/components/SolidSystemAlertCircle.js";
10
10
  import { Loader as c } from "../../Loader/Loader.js";
11
11
  import { Button as l } from "../../Button/Button.js";
12
12
  import u from "../../../lib/components/Snackbar/Snackbar.module.js";
@@ -14,18 +14,18 @@ import { SnackbarTimer as d } from "../SnackbarTimer/SnackbarTimer.js";
14
14
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
15
15
  //#region src/lib/components/Snackbar/SnackbarCard/SnackbarCard.tsx
16
16
  var m = {
17
- success: /* @__PURE__ */ f(r, {}),
18
- error: /* @__PURE__ */ f(a, {}),
19
- warning: /* @__PURE__ */ f(o, {}),
20
- info: /* @__PURE__ */ f(i, {})
17
+ success: /* @__PURE__ */ f(i, {}),
18
+ error: /* @__PURE__ */ f(o, {}),
19
+ warning: /* @__PURE__ */ f(s, {}),
20
+ info: /* @__PURE__ */ f(a, {})
21
21
  }, h = {
22
22
  en: "Close notification",
23
23
  ru: "Закрыть уведомление",
24
24
  tj: "Пӯшидани огоҳӣ"
25
- }, g = ({ item: r, onDismiss: i }) => {
26
- let { locale: a } = s(), { id: o, message: g, type: _, leftSlot: v, description: y, rightSlot: b, actionSlot: x, withCloseButton: S = !0, loading: C, custom: w, render: T, mounted: E } = r;
25
+ }, g = ({ item: i, onDismiss: a }) => {
26
+ let { locale: o } = n(), { id: s, message: g, type: _, leftSlot: v, description: y, rightSlot: b, actionSlot: x, withCloseButton: S = !0, loading: C, custom: w, render: T, mounted: E } = i;
27
27
  if (w) {
28
- let e = T ? T(o) : g;
28
+ let e = T ? T(s) : g;
29
29
  return /* @__PURE__ */ f("div", {
30
30
  role: "status",
31
31
  className: t(u.scaleIn, !E && u.scaleOut),
@@ -39,13 +39,13 @@ var m = {
39
39
  "aria-hidden": "true",
40
40
  className: t(u.typeIcon, u[_]),
41
41
  children: m[_]
42
- }) : r.withTimer && r.duration > 0 ? /* @__PURE__ */ f(d, { duration: r.duration }) : null : /* @__PURE__ */ f("div", {
42
+ }) : i.withTimer && i.duration > 0 ? /* @__PURE__ */ f(d, { duration: i.duration }) : null : /* @__PURE__ */ f("div", {
43
43
  className: u.leftSlot,
44
44
  children: v
45
45
  });
46
46
  return /* @__PURE__ */ p("div", {
47
47
  role: "status",
48
- style: r.style,
48
+ style: i.style,
49
49
  className: t(u.root, u.scaleIn, !E && u.scaleOut),
50
50
  children: [
51
51
  D,
@@ -69,9 +69,9 @@ var m = {
69
69
  S && /* @__PURE__ */ f(l, {
70
70
  variant: "function",
71
71
  color: "tertiary",
72
- onClick: () => i(o),
73
- "aria-label": h[a],
74
- children: /* @__PURE__ */ f(n, {})
72
+ onClick: () => a(s),
73
+ "aria-label": h[o],
74
+ children: /* @__PURE__ */ f(r, {})
75
75
  })
76
76
  ]
77
77
  });
@@ -1,48 +1,32 @@
1
1
  import { classNames as e } from "../../utils/class-names.js";
2
- import { Collapse as t } from "../Collapse/Collapse.js";
3
- import { Divider as n } from "../Divider/Divider.js";
4
- import r from "../../lib/components/Table/Table.module.js";
5
- import { getTableStyles as i } from "./Table.utils.js";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import t from "../../lib/components/Table/Table.module.js";
3
+ import { getTableStyles as n } from "./Table.utils.js";
4
+ import { TableCollapseRow as r } from "./TableCollapseRow/TableCollapseRow.js";
5
+ import { jsx as i } from "react/jsx-runtime";
7
6
  //#region src/lib/components/Table/Table.tsx
8
- var s = ({ className: t, ...n }) => /* @__PURE__ */ a("td", {
9
- className: e(r.td, "uiFont", t),
10
- ...n
11
- }), c = ({ className: t, ...n }) => /* @__PURE__ */ a("th", {
12
- className: e(r.th, "uiFont", t),
13
- ...n
14
- }), l = ({ className: t, ...n }) => /* @__PURE__ */ a("tr", {
15
- className: e(r.tr, t),
16
- ...n
17
- }), u = ({ className: t, ...n }) => /* @__PURE__ */ a("thead", {
18
- className: e(r.thead, t),
19
- ...n
20
- }), d = ({ className: t, ...n }) => /* @__PURE__ */ a("tbody", {
21
- className: e(r.tbody, t),
22
- ...n
23
- }), f = ({ className: t, ...n }) => /* @__PURE__ */ a("tfoot", {
24
- className: e(r.tfoot, t),
25
- ...n
26
- }), p = ({ isOpen: i, colSpan: c, children: u, className: d, ...f }) => /* @__PURE__ */ a(l, {
27
- ...f,
28
- className: e(r.collapseRow, i && r.collapseRowOpen, d),
29
- children: /* @__PURE__ */ a(s, {
30
- colSpan: c,
31
- className: e(r.collapseCell, i && r.collapseCellOpen),
32
- children: /* @__PURE__ */ o(t, {
33
- isOpen: i,
34
- className: r.collapseContent,
35
- children: [/* @__PURE__ */ a(n, {
36
- className: r.collapseDivider,
37
- color: "secondary"
38
- }), u]
39
- })
40
- })
41
- }), m = ({ variant: t = "default", headerColor: n = "primary", verticalSpacing: o = "m", rowGap: s, withRowBorders: c = !0, withColumnBorders: l = !1, highlightOnHover: u = !1, stickyHeader: d = !1, stickyFooter: f = !1, className: p, style: m, ...h }) => /* @__PURE__ */ a("table", {
42
- style: i(t, n, o, s, c, m),
43
- className: e(r.table, c && r.withRowBorders, l && r.withColumnBorders, u && r.highlightOnHover, d && r.stickyHeader, f && r.stickyFooter, s && r.withRowGap, p),
7
+ var a = ({ className: n, ...r }) => /* @__PURE__ */ i("td", {
8
+ className: e(t.td, "uiFont", n),
9
+ ...r
10
+ }), o = ({ className: n, ...r }) => /* @__PURE__ */ i("th", {
11
+ className: e(t.th, "uiFont", n),
12
+ ...r
13
+ }), s = ({ className: n, ...r }) => /* @__PURE__ */ i("tr", {
14
+ className: e(t.tr, n),
15
+ ...r
16
+ }), c = ({ className: n, ...r }) => /* @__PURE__ */ i("thead", {
17
+ className: e(t.thead, n),
18
+ ...r
19
+ }), l = ({ className: n, ...r }) => /* @__PURE__ */ i("tbody", {
20
+ className: e(t.tbody, n),
21
+ ...r
22
+ }), u = ({ className: n, ...r }) => /* @__PURE__ */ i("tfoot", {
23
+ className: e(t.tfoot, n),
24
+ ...r
25
+ }), d = ({ variant: r = "default", headerColor: a = "primary", verticalSpacing: o = "m", rowGap: s, withRowBorders: c = !0, withColumnBorders: l = !1, highlightOnHover: u = !1, stickyHeader: d = !1, stickyFooter: f = !1, className: p, style: m, ...h }) => /* @__PURE__ */ i("table", {
26
+ style: n(r, a, o, s, c, m),
27
+ className: e(t.table, c && t.withRowBorders, l && t.withColumnBorders, u && t.highlightOnHover, d && t.stickyHeader, f && t.stickyFooter, s && t.withRowGap, p),
44
28
  ...h
45
29
  });
46
- m.Td = s, m.Th = c, m.Tr = l, m.CollapseRow = p, m.Thead = u, m.Tbody = d, m.Tfoot = f;
30
+ d.Td = a, d.Th = o, d.Tr = s, d.CollapseRow = r, d.Thead = c, d.Tbody = l, d.Tfoot = u;
47
31
  //#endregion
48
- export { m as Table, p as TableCollapseRow };
32
+ export { d as Table };
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { classNames as e } from "../../../utils/class-names.js";
3
+ import { Divider as t } from "../../Divider/Divider.js";
4
+ import { useDelayedUnmount as n } from "../../../hooks/useDelayedUnmount/useDelayedUnmount.js";
5
+ import r from "../../../lib/components/Table/Table.module.js";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ //#region src/lib/components/Table/TableCollapseRow/TableCollapseRow.tsx
8
+ var o = ({ isOpen: o, colSpan: s, keepMounted: c = !1, children: l, className: u, ...d }) => {
9
+ let f = n({
10
+ keepMounted: c,
11
+ isOpen: o,
12
+ exitDuration: 300
13
+ }), p = (e) => {
14
+ let t = e.currentTarget;
15
+ e.target !== t || t.open === o || (t.open = o);
16
+ };
17
+ return /* @__PURE__ */ i("tr", {
18
+ ...d,
19
+ className: e(r.tr, r.collapseRow, o && r.collapseRowOpen, u),
20
+ children: /* @__PURE__ */ i("td", {
21
+ colSpan: s,
22
+ className: e(r.td, "uiFont", r.collapseCell, o && r.collapseCellOpen),
23
+ children: /* @__PURE__ */ a("details", {
24
+ open: o,
25
+ onToggle: p,
26
+ className: r.collapse,
27
+ children: [/* @__PURE__ */ i("summary", { hidden: !0 }), f && /* @__PURE__ */ i("div", {
28
+ className: r.clip,
29
+ children: /* @__PURE__ */ a("div", {
30
+ className: r.collapseContent,
31
+ children: [/* @__PURE__ */ i(t, {
32
+ className: r.collapseDivider,
33
+ color: "secondary"
34
+ }), l]
35
+ })
36
+ })]
37
+ })
38
+ })
39
+ });
40
+ };
41
+ //#endregion
42
+ export { o as TableCollapseRow };