@ztwoint/z-ui 0.1.47 → 0.1.49

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/components/alert/alert.const.d.ts +0 -3
  2. package/dist/components/alert/alert.const.js +16 -31
  3. package/dist/components/alert/alert.js +32 -44
  4. package/dist/components/button/button.d.ts +3 -3
  5. package/dist/components/button/button.js +58 -58
  6. package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +17 -17
  7. package/dist/components/nav-header/nav-item/nav-item.d.ts +4 -2
  8. package/dist/components/nav-header/nav-item/nav-item.js +29 -28
  9. package/dist/components/select/z2-select.js +131 -78
  10. package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
  11. package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.js +33 -0
  12. package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
  13. package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.js +20 -0
  14. package/dist/components/table/components/table-filter/table-filter-button.js +81 -60
  15. package/dist/components/table/components/table-filter/table-filter-column-button.js +85 -56
  16. package/dist/components/table/components/table-filter/table-filter.context.d.ts +1 -0
  17. package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
  18. package/dist/components/table/components/table-filter/table-filter.hook.js +17 -14
  19. package/dist/components/table/components/table-footer.js +6 -6
  20. package/dist/components/table/components/table-header/table-header.js +27 -33
  21. package/dist/components/table/table.const.d.ts +10 -6
  22. package/dist/components/table/table.const.js +10 -6
  23. package/dist/components/table/table.js +39 -28
  24. package/dist/components/table-card/table-card.js +2 -2
  25. package/dist/components/tooltip/tooltip.js +24 -22
  26. package/dist/css/config/colors/backgrounds.css +8 -8
  27. package/dist/css/config/colors/components/avatar.css +12 -12
  28. package/dist/css/config/colors/components/badge.css +42 -42
  29. package/dist/css/config/colors/components/checkbox.css +2 -2
  30. package/dist/css/config/colors/components/featured-icon.css +18 -18
  31. package/dist/css/config/colors/components/progress-bar.css +2 -2
  32. package/dist/css/config/colors/components/radio-button.css +2 -2
  33. package/dist/css/config/colors/components/scroll-overlay.css +4 -4
  34. package/dist/css/config/colors/components/tab.css +7 -7
  35. package/dist/css/config/colors/components/toggle-switch.css +1 -1
  36. package/dist/css/config/colors/components/toggle.css +6 -6
  37. package/dist/css/config/colors/icons.css +20 -20
  38. package/dist/css/config/colors/overlay.css +1 -1
  39. package/dist/css/config/colors/semantic/alert.css +44 -0
  40. package/dist/css/config/colors/semantic/background.css +51 -0
  41. package/dist/css/config/colors/semantic/base.css +395 -0
  42. package/dist/css/config/colors/semantic/button.css +131 -0
  43. package/dist/css/config/colors/semantic/drop-shadow.css +30 -0
  44. package/dist/css/config/colors/semantic/dropdown.css +12 -0
  45. package/dist/css/config/colors/semantic/index.css +16 -0
  46. package/dist/css/config/colors/semantic/input.css +56 -0
  47. package/dist/css/config/colors/semantic/overlay.css +13 -0
  48. package/dist/css/config/colors/semantic/stroke.css +90 -0
  49. package/dist/css/config/colors/semantic/surface.css +135 -0
  50. package/dist/css/config/colors/semantic/text.css +113 -0
  51. package/dist/css/config/colors/semantic/tooltip.css +12 -0
  52. package/dist/css/config/colors/shape.css +40 -40
  53. package/dist/css/config/colors/stroke.css +19 -19
  54. package/dist/css/config/colors/surfaces.css +47 -47
  55. package/dist/css/config/colors/text.css +37 -37
  56. package/dist/css/config/components/index.css +0 -2
  57. package/dist/css/config/config-deprecated.css +3 -5
  58. package/dist/css/config/config.css +5 -3
  59. package/dist/css/config/other-variables.css +9 -0
  60. package/dist/css/config/shadows.css +15 -0
  61. package/dist/css/config/typography/2xl.css +7 -14
  62. package/dist/css/config/typography/3xl.css +7 -14
  63. package/dist/css/config/typography/4xl.css +7 -14
  64. package/dist/css/config/typography/base.css +7 -14
  65. package/dist/css/config/typography/lg.css +7 -14
  66. package/dist/css/config/typography/sm.css +7 -14
  67. package/dist/css/config/typography/xl.css +7 -14
  68. package/dist/css/config/typography/xs.css +7 -14
  69. package/dist/css/styles/tailwind.css +1 -1
  70. package/dist/types/components/alert/alert.const.d.ts +0 -3
  71. package/dist/types/components/button/button.d.ts +3 -3
  72. package/dist/types/components/nav-header/nav-item/nav-item.d.ts +4 -2
  73. package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
  74. package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
  75. package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +1 -0
  76. package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
  77. package/dist/types/components/table/table.const.d.ts +10 -6
  78. package/package.json +1 -1
  79. package/dist/css/config/colors/components/alert.css +0 -84
  80. package/dist/css/config/colors/components/button.css +0 -93
  81. package/dist/css/config/colors/components/select.css +0 -128
  82. package/dist/css/config/colors/components/text-button.css +0 -67
  83. package/dist/css/config/colors/defaults.css +0 -393
  84. package/dist/css/config/colors/semantic-colors.css +0 -353
  85. package/dist/css/config/components/button.css +0 -160
  86. package/dist/css/config/components/input.css +0 -56
  87. /package/dist/css/config/typography/{typography.css → index.css} +0 -0
@@ -4,6 +4,3 @@ export declare const alertVariants: (props?: ({
4
4
  export declare const iconVariants: (props?: ({
5
5
  variant?: "success" | "warning" | "danger" | "accent" | "neutral" | null | undefined;
6
6
  } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
7
- export declare const buttonVariants: (props?: ({
8
- appearance?: "stroke" | "ghost" | null | undefined;
9
- } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
@@ -1,48 +1,33 @@
1
- import { cva as e } from "class-variance-authority";
2
- const a = e(
1
+ import { cva as t } from "class-variance-authority";
2
+ const e = t(
3
3
  "relative w-full rounded-lg border pl-2.5 pr-0.5 py-2.5 text-sm flex flex-col gap-2 items-start",
4
4
  // Flex, column, gap for flexible content & action placement
5
5
  {
6
6
  variants: {
7
7
  variant: {
8
- success: "alert-success-stroke alert-success-bg alert-success-title alert-success-body",
9
- warning: "alert-warning-stroke alert-warning-bg alert-warning-title alert-warning-body",
10
- danger: "alert-danger-stroke alert-danger-bg alert-danger-title alert-danger-body",
11
- accent: "alert-accent-stroke alert-accent-bg alert-accent-title alert-accent-body",
12
- neutral: "alert-neutral-stroke alert-neutral-bg alert-neutral-title alert-neutral-body"
8
+ success: "border-alert-stroke-success bg-alert-surface-success text-text-success-primary",
9
+ warning: "border-alert-stroke-warning bg-alert-surface-warning text-text-warning-primary",
10
+ danger: "border-alert-stroke-danger bg-alert-surface-danger text-text-danger-primary",
11
+ accent: "border-alert-stroke-accent bg-alert-surface-accent text-text-brand-primary",
12
+ neutral: "border-alert-stroke-neutral bg-alert-surface-neutral text-text-neutral-primary"
13
13
  }
14
14
  },
15
15
  defaultVariants: {
16
16
  variant: "accent"
17
17
  }
18
18
  }
19
- ), r = e("h-5 w-5 flex-shrink-0", {
19
+ ), a = t("h-5 w-5 flex-shrink-0", {
20
20
  variants: {
21
21
  variant: {
22
- success: "alert-success-icon",
23
- warning: "alert-warning-icon",
24
- danger: "alert-danger-icon",
25
- accent: "alert-accent-icon",
26
- neutral: "alert-neutral-icon"
22
+ success: "text-text-success-secondary",
23
+ warning: "text-text-warning-secondary",
24
+ danger: "text-text-danger-secondary",
25
+ accent: "text-text-brand-secondary",
26
+ neutral: "text-text-neutral-primary"
27
27
  }
28
28
  }
29
- }), n = e(
30
- "inline-flex items-center justify-center gap-1 rounded-md px-2 py-2 text-sm transition focus:outline-none focus:ring-2",
31
- // Responsive and basic
32
- {
33
- variants: {
34
- appearance: {
35
- ghost: "bg-transparent hover:cursor-pointer",
36
- stroke: "bg-(--color-neutral-00) hover:cursor-pointer"
37
- }
38
- },
39
- defaultVariants: {
40
- appearance: "ghost"
41
- }
42
- }
43
- );
29
+ });
44
30
  export {
45
- a as alertVariants,
46
- n as buttonVariants,
47
- r as iconVariants
31
+ e as alertVariants,
32
+ a as iconVariants
48
33
  };
@@ -1,52 +1,40 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
2
  import * as x from "react";
3
3
  import u from "../assets/icons/x.js";
4
4
  import N from "../assets/icons/left-arrow.js";
5
5
  import { cn as l } from "../../lib/utils.js";
6
- import { iconVariants as c, buttonVariants as h, alertVariants as w } from "./alert.const.js";
7
- function C({
8
- className: a,
6
+ import { iconVariants as n, alertVariants as k } from "./alert.const.js";
7
+ import { Button as h } from "../button/button.js";
8
+ function A({
9
+ className: i,
9
10
  variant: r,
10
- title: f,
11
- description: o,
12
- leadingIcon: t,
11
+ title: c,
12
+ description: f,
13
+ leadingIcon: s,
13
14
  showActions: p = !1,
14
- onClose: i,
15
+ onClose: t,
15
16
  onAction: m,
16
- actionLabel: n,
17
+ actionLabel: o,
17
18
  ...d
18
19
  }) {
19
- return /* @__PURE__ */ e("div", { role: "alert", className: l(w({ variant: r }), a), ...d, children: /* @__PURE__ */ s("div", { className: "flex flex-row flex-wrap w-full items-start gap-1", children: [
20
- t && /* @__PURE__ */ e("span", { className: l(c({ variant: r }), "flex-shrink-0"), children: (x.isValidElement(t), t) }),
21
- /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
22
- f && /* @__PURE__ */ e(k, { className: "flex-shrink-0", children: f }),
23
- /* @__PURE__ */ s("div", { className: "flex flex-row flex-wrap w-full items-center", children: [
24
- o && /* @__PURE__ */ e("span", { className: "flex-shrink-1", children: /* @__PURE__ */ e(b, { children: o }) }),
25
- p && (i || m) && /* @__PURE__ */ s("div", { className: "flex items-center self-end flex-shrink-0", children: [
26
- i && /* @__PURE__ */ e(
27
- "button",
28
- {
29
- type: "button",
30
- onClick: i,
31
- className: l(h({ appearance: "ghost" })),
32
- "aria-label": "Close alert",
33
- children: /* @__PURE__ */ e(u, { className: l(c({ variant: r }), "h-2.2 w-2.2") })
34
- }
35
- ),
36
- m && /* @__PURE__ */ s(
37
- "button",
20
+ return /* @__PURE__ */ e("div", { role: "alert", className: l(k({ variant: r }), i), ...d, children: /* @__PURE__ */ a("div", { className: "flex flex-row flex-wrap w-full items-start gap-1", children: [
21
+ s && /* @__PURE__ */ e("span", { className: l(n({ variant: r }), "flex-shrink-0"), children: (x.isValidElement(s), s) }),
22
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: [
23
+ c && /* @__PURE__ */ e(w, { className: "flex-shrink-0", children: c }),
24
+ /* @__PURE__ */ a("div", { className: "flex flex-row flex-wrap w-full items-center", children: [
25
+ f && /* @__PURE__ */ e("span", { className: "flex-shrink-1", children: /* @__PURE__ */ e(v, { children: f }) }),
26
+ p && (t || m) && /* @__PURE__ */ a("div", { className: "flex items-center self-end flex-shrink-0", children: [
27
+ t && /* @__PURE__ */ e(h, { type: "button", variant: "ghost", size: "medium", onClick: t, children: /* @__PURE__ */ e(u, { className: l(n({ variant: r }), "h-2.2 w-2.2") }) }),
28
+ m && /* @__PURE__ */ e(
29
+ h,
38
30
  {
39
31
  type: "button",
32
+ variant: "stroke",
33
+ size: "medium",
40
34
  onClick: m,
41
- className: l(
42
- h({ appearance: "stroke" }),
43
- "shadow-[0_1px_2px_0_rgba(0,0,0,0.05)]"
44
- ),
45
- "aria-label": n,
46
- children: [
47
- /* @__PURE__ */ e(N, { className: l(c({ variant: r }), "h-2.2 w-2.2") }),
48
- n && n
49
- ]
35
+ "aria-label": o,
36
+ leftIcon: /* @__PURE__ */ e(N, { className: l(n({ variant: r }), "h-2.2 w-2.2") }),
37
+ children: o
50
38
  }
51
39
  )
52
40
  ] })
@@ -55,14 +43,14 @@ function C({
55
43
  d.children
56
44
  ] }) });
57
45
  }
58
- function k({ className: a, ...r }) {
59
- return /* @__PURE__ */ e("div", { className: l("tracking-tight leading-none-medium-sm", a), ...r });
46
+ function w({ className: i, ...r }) {
47
+ return /* @__PURE__ */ e("div", { className: l("tracking-tight leading-none-medium-sm", i), ...r });
60
48
  }
61
- function b({ className: a, ...r }) {
62
- return /* @__PURE__ */ e("div", { className: l("leading-none-regular-sm", a), ...r });
49
+ function v({ className: i, ...r }) {
50
+ return /* @__PURE__ */ e("div", { className: l("leading-none-regular-sm", i), ...r });
63
51
  }
64
52
  export {
65
- C as Alert,
66
- b as AlertDescription,
67
- k as AlertTitle
53
+ A as Alert,
54
+ v as AlertDescription,
55
+ w as AlertTitle
68
56
  };
@@ -1,9 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "stroke" | "ghost" | "filled" | null | undefined;
5
- shade?: "danger" | "neutral" | "brand" | "neutralGhost" | null | undefined;
6
- size?: "small" | "large" | null | undefined;
4
+ variant?: "stroke" | "filled" | "ghost" | null | undefined;
5
+ shade?: "danger" | "neutral" | "brand" | null | undefined;
6
+ size?: "small" | "large" | "medium" | null | undefined;
7
7
  iconOnly?: boolean | null | undefined;
8
8
  } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
9
9
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'iconOnly'> {
@@ -1,26 +1,31 @@
1
- import { jsx as e, jsxs as v, Fragment as h } from "react/jsx-runtime";
2
- import w from "react";
3
- import { Slot as k } from "@radix-ui/react-slot";
4
- import { cva as O } from "class-variance-authority";
1
+ import { jsx as e, jsxs as x, Fragment as h } from "react/jsx-runtime";
2
+ import k from "react";
3
+ import { Slot as w } from "@radix-ui/react-slot";
4
+ import { cva as N } from "class-variance-authority";
5
5
  import { cn as d } from "../../lib/utils.js";
6
- const z = O(
7
- "box-border h-7.5 leading-none-medium-sm flex items-center justify-center whitespace-nowrap rounded-lg select-none hover:cursor-pointer active:outline-none border-solid",
6
+ const C = N(
7
+ "box-border leading-none-medium-sm flex items-center justify-center whitespace-nowrap rounded-lg select-none hover:cursor-pointer disabled:cursor-not-allowed active:outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring-default",
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
- filled: ["border-[.5px] disabled:border-none disabled:shadow-button-disabled"],
12
- stroke: ["disabled:shadow-button-disabled"],
13
- ghost: [""]
11
+ filled: [""],
12
+ stroke: [
13
+ "ring-[0.5px] ring-btn-secondary-stroke-default hover:ring-btn-secondary-stroke-hover active:ring-btn-secondary-stroke-pressed disabled:ring-btn-secondary-stroke-disabled",
14
+ "bg-btn-secondary-surface-default hover:bg-btn-secondary-surface-hover active:bg-btn-secondary-surface-pressed disabled:bg-btn-secondary-surface-disabled"
15
+ ],
16
+ ghost: [
17
+ "hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
18
+ ]
14
19
  },
15
20
  shade: {
16
- brand: "bg-button-primary-brand-surface-default border-button-primary-brand-surface-default text-text-inverted-primary hover:bg-button-primary-brand-surface-hover active:bg-button-primary-brand-surface-pressed disabled:bg-button-primary-brand-surface-disabled disabled:text-text-neutral-muted disabled:border-button-primary-brand-surface-disabled",
17
- neutral: "bg-button-primary-neutral-surface-default border-button-primary-neutral-surface-default disabled:border-none text-text-inverted-primary hover:bg-button-primary-neutral-surface-hover active:bg-button-primary-neutral-surface-pressed disabled:bg-button-primary-neutral-surface-disabled disabled:text-text-neutral-muted",
18
- danger: "bg-button-primary-danger-surface-default border-button-primary-danger-stroke-default text-text-inverted-primary hover:bg-button-primary-danger-surface-hover active:bg-button-primary-danger-surface-pressed disabled:bg-button-primary-danger-surface-disabled disabled:text-text-neutral-muted",
19
- neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
21
+ brand: "",
22
+ neutral: "",
23
+ danger: ""
20
24
  },
21
25
  size: {
22
- large: "gap-1",
23
- small: "gap-1"
26
+ large: "gap-1.5 p-2.5 h-8.5",
27
+ medium: "gap-1 p-2 h-7.5",
28
+ small: "gap-0.5 p-1.5 h-6.5"
24
29
  },
25
30
  iconOnly: {
26
31
  true: "[&>span]:m-0"
@@ -28,89 +33,84 @@ const z = O(
28
33
  },
29
34
  compoundVariants: [
30
35
  {
31
- iconOnly: !0,
32
- size: "large",
33
- class: "p-2"
34
- },
35
- {
36
- iconOnly: !0,
37
- size: "small",
38
- class: "p-1.5 h-6.5"
36
+ variant: "filled",
37
+ shade: "brand",
38
+ class: "bg-btn-primary-brand-surface-default hover:bg-btn-primary-brand-surface-hover active:bg-btn-primary-brand-surface-pressed disabled:bg-btn-primary-brand-surface-disabled ring-[0.5px] ring-btn-primary-brand-stroke-default hover:ring-btn-primary-brand-stroke-hover active:ring-btn-primary-brand-stroke-pressed disabled:ring-btn-primary-brand-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
39
39
  },
40
40
  {
41
- iconOnly: !1,
42
- size: "large",
43
- class: "p-2 gap-1"
41
+ variant: "filled",
42
+ shade: "neutral",
43
+ class: "bg-btn-primary-neutral-surface-default hover:bg-btn-primary-neutral-surface-hover active:bg-btn-primary-neutral-surface-pressed disabled:bg-btn-primary-neutral-surface-disabled ring-[0.5px] ring-btn-primary-neutral-stroke-default hover:ring-btn-primary-neutral-stroke-hover active:ring-btn-primary-neutral-stroke-pressed disabled:ring-btn-primary-neutral-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
44
44
  },
45
45
  {
46
- iconOnly: !1,
47
- size: "small",
48
- class: "p-1.5 gap-0.5"
46
+ variant: "filled",
47
+ shade: "danger",
48
+ class: "bg-btn-primary-danger-surface-default hover:bg-btn-primary-danger-surface-hover active:bg-btn-primary-danger-surface-pressed disabled:bg-btn-primary-danger-surface-disabled ring-[0.5px] ring-btn-primary-danger-stroke-default hover:ring-btn-primary-danger-stroke-hover active:ring-btn-primary-danger-stroke-pressed disabled:ring-btn-primary-danger-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
49
49
  },
50
50
  {
51
51
  variant: "stroke",
52
52
  shade: "neutral",
53
- class: "border-none shadow-button-default disabled:shadow-none dark:shadow-none bg-button-secondary-surface-default text-text-neutral-primary hover:bg-button-secondary-surface-hover hover:text-text-neutral-primary active:bg-button-secondary-surface-pressed active:text-text-neutral-primary disabled:bg-button-secondary-surface-disabled disabled:text-text-neutral-muted"
53
+ class: "text-text-neutral-primary disabled:text-text-neutral-muted"
54
54
  },
55
55
  {
56
56
  variant: "stroke",
57
- shade: "danger",
58
- class: "border-none shadow-button-default disabled:shadow-none dark:shadow-none bg-button-secondary-surface-default text-text-danger-secondary hover:bg-button-secondary-surface-hover hover:text-text-secondary active:bg-button-secondary-surface-pressed active:text-text-primary disabled:bg-button-secondary-surface-disabled disabled:text-text-neutral-muted"
57
+ shade: "brand",
58
+ class: "text-text-brand-secondary disabled:text-text-neutral-muted"
59
59
  },
60
60
  {
61
61
  variant: "stroke",
62
- shade: "brand",
63
- class: "border-none shadow-button-default disabled:shadow-none dark:shadow-none bg-button-secondary-surface-default text-text-brand-secondary hover:bg-button-secondary-surface-hover hover:text-text-secondary active:bg-button-secondary-surface-pressed active:text-text-primary disabled:bg-button-secondary-surface-disabled disabled:text-text-neutral-muted"
62
+ shade: "danger",
63
+ class: "text-text-danger-secondary disabled:text-text-neutral-muted"
64
64
  },
65
65
  {
66
66
  variant: "ghost",
67
67
  shade: "neutral",
68
- class: "bg-transparent text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted hover:bg-transparent active:bg-transparent"
68
+ class: "text-text-neutral-primary"
69
69
  },
70
70
  {
71
71
  variant: "ghost",
72
72
  shade: "brand",
73
- class: "bg-transparent text-text-brand-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted hover:bg-transparent active:bg-transparent"
73
+ class: "text-text-brand-secondary"
74
74
  },
75
75
  {
76
76
  variant: "ghost",
77
77
  shade: "danger",
78
- class: "bg-transparent text-text-danger-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted hover:bg-transparent active:bg-transparent"
78
+ class: "text-text-danger-secondary"
79
79
  }
80
80
  ],
81
81
  defaultVariants: {
82
82
  variant: "filled",
83
83
  shade: "neutral",
84
- size: "large",
84
+ size: "medium",
85
85
  iconOnly: !1
86
86
  }
87
87
  }
88
- ), N = w.forwardRef(
88
+ ), O = k.forwardRef(
89
89
  ({
90
- className: i,
91
- shade: b = "neutral",
90
+ className: b,
91
+ shade: u = "neutral",
92
92
  size: c,
93
- variant: x = "filled",
94
- asChild: o = !1,
95
- leftIcon: t,
96
- rightIcon: a,
97
- label: m,
98
- children: u,
99
- ...p
93
+ variant: m = "filled",
94
+ asChild: i = !1,
95
+ leftIcon: r,
96
+ rightIcon: t,
97
+ label: p,
98
+ children: l,
99
+ ...g
100
100
  }, y) => {
101
- const f = o ? k : "button", r = m || u, n = !r && !!(t || a), l = n ? t || a : null, g = d(
102
- z({ shade: b, size: c, variant: x, iconOnly: n }),
103
- i
101
+ const f = i ? w : "button", a = p || l, n = !a && !!(r || t), o = n ? r || t : null, v = d(
102
+ C({ shade: u, size: c, variant: m, iconOnly: n }),
103
+ b
104
104
  ), s = "w-3.5 h-3.5 min-w-max";
105
- return /* @__PURE__ */ e(f, { className: g, ref: y, ...p, children: o ? u : n ? l ? /* @__PURE__ */ e("span", { className: s, children: l }) : null : /* @__PURE__ */ v(h, { children: [
106
- t && /* @__PURE__ */ e("span", { className: d(s), children: t }),
107
- r && /* @__PURE__ */ e("span", { children: r }),
108
- a && /* @__PURE__ */ e("span", { className: d(s), children: a })
105
+ return /* @__PURE__ */ e(f, { className: v, ref: y, ...g, children: i ? l : n ? o ? /* @__PURE__ */ e("span", { className: s, children: o }) : null : /* @__PURE__ */ x(h, { children: [
106
+ r && /* @__PURE__ */ e("span", { className: d(s), children: r }),
107
+ a && /* @__PURE__ */ e("span", { children: a }),
108
+ t && /* @__PURE__ */ e("span", { className: d(s), children: t })
109
109
  ] }) });
110
110
  }
111
111
  );
112
- N.displayName = "Button";
112
+ O.displayName = "Button";
113
113
  export {
114
- N as Button,
115
- z as buttonVariants
114
+ O as Button,
115
+ C as buttonVariants
116
116
  };
@@ -1,26 +1,26 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import { cn as p } from "../../lib/utils.js";
3
+ import { cn as h } from "../../lib/utils.js";
4
4
  import { useZ2SideNavBar as C } from "./context.js";
5
5
  import x from "../assets/icons/window-left-copy.js";
6
6
  import { Button as v } from "../button/button.js";
7
7
  const w = n.forwardRef(
8
8
  ({
9
9
  className: o,
10
- children: s,
10
+ children: r,
11
11
  showCollapseButton: g = !0,
12
- icon: r,
12
+ icon: s,
13
13
  title: a,
14
14
  forceMultiLine: d = !1,
15
15
  ...c
16
16
  }, m) => {
17
- const { toggleCollapsed: f, isCollapsed: i } = C(), [y, u] = n.useState(d), h = n.useRef(null), b = y || !!s;
17
+ const { toggleCollapsed: f, isCollapsed: i } = C(), [y, u] = n.useState(d), p = n.useRef(null), b = y || !!r;
18
18
  return n.useEffect(() => {
19
19
  if (d) {
20
20
  u(!0);
21
21
  return;
22
22
  }
23
- if (h.current && !i && a) {
23
+ if (p.current && !i && a) {
24
24
  const t = document.createElement("span");
25
25
  t.style.visibility = "hidden", t.style.position = "absolute", t.style.whiteSpace = "nowrap", t.style.fontSize = "14px", t.style.fontWeight = "450", t.textContent = a, document.body.appendChild(t);
26
26
  const N = t.offsetWidth;
@@ -30,7 +30,7 @@ const w = n.forwardRef(
30
30
  "div",
31
31
  {
32
32
  ref: m,
33
- className: p(
33
+ className: h(
34
34
  "flex flex-col items-center gap-1.5 self-stretch border-b border-gray-200 p-2",
35
35
  o
36
36
  ),
@@ -39,7 +39,7 @@ const w = n.forwardRef(
39
39
  v,
40
40
  {
41
41
  variant: "ghost",
42
- shade: "neutralGhost",
42
+ shade: "neutral",
43
43
  size: "small",
44
44
  onClick: f,
45
45
  title: "Collapse sidebar",
@@ -51,19 +51,19 @@ const w = n.forwardRef(
51
51
  "div",
52
52
  {
53
53
  ref: m,
54
- className: p(
54
+ className: h(
55
55
  "flex flex-col items-start gap-5 self-stretch border-b border-gray-100 w-60 px-2.5 py-4 pl-4 relative",
56
56
  o
57
57
  ),
58
58
  ...c,
59
59
  children: [
60
60
  /* @__PURE__ */ l("div", { className: "header-icons-container flex justify-between items-center self-stretch relative", children: [
61
- r && /* @__PURE__ */ e("div", { className: "database-icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: r }) }),
61
+ s && /* @__PURE__ */ e("div", { className: "database-icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: s }) }),
62
62
  g && /* @__PURE__ */ e(
63
63
  v,
64
64
  {
65
65
  variant: "ghost",
66
- shade: "neutralGhost",
66
+ shade: "neutral",
67
67
  size: "small",
68
68
  onClick: f,
69
69
  title: "Collapse sidebar",
@@ -76,9 +76,9 @@ const w = n.forwardRef(
76
76
  /* @__PURE__ */ e(
77
77
  "div",
78
78
  {
79
- ref: h,
79
+ ref: p,
80
80
  className: "secondary-text line-clamp-1 self-stretch overflow-hidden text-gray-600 text-ellipsis text-sm font-normal leading-none tracking-tight relative",
81
- children: s
81
+ children: r
82
82
  }
83
83
  )
84
84
  ] })
@@ -88,21 +88,21 @@ const w = n.forwardRef(
88
88
  "div",
89
89
  {
90
90
  ref: m,
91
- className: p(
91
+ className: h(
92
92
  "flex items-center gap-2.5 border-b header-default-layout w-full pr-2.5 pl-3 py-2.5 stroke-solid-light relative",
93
93
  o
94
94
  ),
95
95
  ...c,
96
96
  children: [
97
- r && /* @__PURE__ */ e("div", { className: "icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: r }) }),
97
+ s && /* @__PURE__ */ e("div", { className: "icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: s }) }),
98
98
  /* @__PURE__ */ l(
99
99
  "div",
100
100
  {
101
- ref: h,
101
+ ref: p,
102
102
  className: "text-content flex flex-col items-start gap-2.5 flex-1 relative",
103
103
  children: [
104
104
  /* @__PURE__ */ e("div", { className: "leading-none-medium-sm text-neutral-primary", children: a }),
105
- s && /* @__PURE__ */ e("div", { className: "secondary-text line-clamp-1 self-stretch overflow-hidden text-(--color-neutral-600) text-ellipsis text-xs font-normal leading-none tracking-tight relative", children: s })
105
+ r && /* @__PURE__ */ e("div", { className: "secondary-text line-clamp-1 self-stretch overflow-hidden text-(--color-neutral-600) text-ellipsis text-xs font-normal leading-none tracking-tight relative", children: r })
106
106
  ]
107
107
  }
108
108
  ),
@@ -110,7 +110,7 @@ const w = n.forwardRef(
110
110
  v,
111
111
  {
112
112
  variant: "ghost",
113
- shade: "neutralGhost",
113
+ shade: "neutral",
114
114
  size: "small",
115
115
  onClick: f,
116
116
  title: "Collapse sidebar",
@@ -1,6 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { ButtonProps } from '../../button/button';
3
- export interface NavItemProps extends ButtonProps {
2
+ export interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
3
  isActive?: boolean;
4
+ leftIcon?: React.ReactNode;
5
+ rightIcon?: React.ReactNode;
6
+ label?: string;
5
7
  }
6
8
  export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,31 +1,32 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import v from "react";
3
- import { Button as f } from "../../button/button.js";
4
- import { cn as c } from "../../../lib/utils.js";
5
- const d = v.forwardRef(
6
- ({ leftIcon: r, label: t, rightIcon: a, onClick: o, className: m, isActive: l, asChild: e, children: n, ...i }, s) => /* @__PURE__ */ u(
7
- f,
8
- {
9
- variant: "ghost",
10
- shade: "neutralGhost",
11
- size: "large",
12
- leftIcon: r,
13
- rightIcon: a,
14
- label: t,
15
- onClick: o,
16
- className: c(
17
- "text-inverted-primary hover:text-inverted-primary hover:surface-neutral-elevated active:surface-neutral-elevated ",
18
- l && "surface-neutral-elevated",
19
- m
20
- ),
21
- asChild: e,
22
- ...i,
23
- ref: s,
24
- children: e ? n : null
25
- }
26
- )
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { cn as f } from "../../../lib/utils.js";
4
+ const p = u.forwardRef(
5
+ ({ leftIcon: n, label: o, rightIcon: r, className: t, isActive: a, children: l, ...c }, d) => {
6
+ const i = o ?? l, s = "w-3.5 h-3.5 min-w-max";
7
+ return /* @__PURE__ */ m(
8
+ "button",
9
+ {
10
+ ref: d,
11
+ className: f(
12
+ "h-7.5 inline-flex items-center justify-center p-2 gap-1 rounded-lg",
13
+ "hover:bg-background-inverted-elevated text-inverted-primary",
14
+ "leading-none-medium-sm",
15
+ "select-none hover:cursor-pointer disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring-default",
16
+ a && "bg-background-inverted-elevated",
17
+ t
18
+ ),
19
+ ...c,
20
+ children: [
21
+ n && /* @__PURE__ */ e("span", { className: s, children: n }),
22
+ i && /* @__PURE__ */ e("span", { children: i }),
23
+ r && /* @__PURE__ */ e("span", { className: s, children: r })
24
+ ]
25
+ }
26
+ );
27
+ }
27
28
  );
28
- d.displayName = "NavItem";
29
+ p.displayName = "NavItem";
29
30
  export {
30
- d as NavItem
31
+ p as NavItem
31
32
  };