@ztwoint/z-ui 0.1.103 → 0.1.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,14 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | null | undefined;
5
- size?: "default" | "sm" | "xs" | "lg" | null | undefined;
6
- color?: "default" | "success" | "warning" | "destructive" | "primary" | null | undefined;
4
+ variant?: "success" | "warning" | "danger" | "neutral" | "brand" | "gray" | null | undefined;
5
+ rounded?: "none" | "sm" | "md" | "full" | "lg" | null | undefined;
6
+ size?: "sm" | "md" | "lg" | null | undefined;
7
7
  } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
8
- declare function Badge({ className, variant, size, color, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
8
+ declare function Badge({ className, variant, size, rounded, leftIcon, rightIcon, label, asChild, }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
9
9
  asChild?: boolean;
10
+ leftIcon?: React.ReactNode;
11
+ rightIcon?: React.ReactNode;
12
+ label?: string;
10
13
  }): import("react/jsx-runtime").JSX.Element;
11
14
  export { Badge, badgeVariants };
@@ -1,121 +1,54 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Slot as c } from "@radix-ui/react-slot";
3
- import { cva as i } from "class-variance-authority";
1
+ import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { Slot as m } from "@radix-ui/react-slot";
3
+ import { cva as o } from "class-variance-authority";
4
4
  import "react";
5
- import { cn as u } from "../../lib/utils.js";
6
- const l = i(
7
- "inline-flex rounded-lg items-center justify-center border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
8
- {
9
- variants: {
10
- variant: {
11
- default: "border-transparent",
12
- destructive: "border-transparent",
13
- outline: ""
14
- },
15
- size: {
16
- default: "px-[8px] py-[3px] text-sm",
17
- xs: "px-[4px] py-[1px] text-[10px]",
18
- sm: "px-[6px] py-[2px] text-xs",
19
- lg: "px-[10px] py-[4px] text-base"
20
- },
21
- color: {
22
- default: "",
23
- primary: "bg-surface-neutral-default text-default-brand [a&]:hover:bg-surface-neutral-hover",
24
- destructive: "bg-surface-danger-default text-inverted-primary [a&]:hover:bg-surface-danger-hover",
25
- success: "bg-surface-success-default text-inverted-primary [a&]:hover:bg-surface-success-hover",
26
- warning: "bg-surface-warning-default text-inverted-primary [a&]:hover:bg-surface-warning-hover"
27
- }
5
+ import { cn as c } from "../../lib/utils.js";
6
+ const g = o("inline-flex items-center justify-center py-1 px-1.5", {
7
+ variants: {
8
+ variant: {
9
+ neutral: "bg-surface-neutral-default text-neutral-primary border border-stroke-solid-light",
10
+ brand: "bg-surface-accent-default text-inverted-primary",
11
+ gray: "bg-surface-gray-default text-inverted-primary",
12
+ danger: "bg-surface-danger-default text-inverted-primary",
13
+ success: "bg-surface-success-default text-inverted-primary",
14
+ warning: "bg-surface-warning-default text-inverted-primary"
28
15
  },
29
- compoundVariants: [
30
- // Default variant with different colors
31
- {
32
- variant: "default",
33
- color: "default",
34
- class: "bg-surface-neutral-hover [a&]:hover:bg-surface-neutral-hover"
35
- },
36
- {
37
- variant: "default",
38
- color: "primary",
39
- class: "bg-[var(--surface-accent-light)] text-default-brand [a&]:hover:bg-surface-neutral-hover"
40
- },
41
- {
42
- variant: "default",
43
- color: "destructive",
44
- class: "bg-[var(--surface-danger-light)] text-danger-secondary [a&]:hover:bg-surface-danger-hover"
45
- },
46
- {
47
- variant: "default",
48
- color: "success",
49
- class: "bg-[var(--surface-success-light)] text-success-secondary [a&]:hover:bg-surface-success-hover"
50
- },
51
- {
52
- variant: "default",
53
- color: "warning",
54
- class: "bg-[var(--surface-warning-light)] text-warning-secondary [a&]:hover:bg-surface-warning-hover"
55
- },
56
- // Destructive variant with different colors
57
- {
58
- variant: "destructive",
59
- color: "default",
60
- class: "bg-neutral-950 text-inverted-primary [a&]:hover:bg-neutral-800"
61
- },
62
- {
63
- variant: "destructive",
64
- color: "primary",
65
- class: "bg-[var(--surface-accent-default)] text-inverted-primary [a&]:hover:bg-surface-primary-hover"
66
- },
67
- // Outline variant with different colors
68
- {
69
- variant: "outline",
70
- color: "default",
71
- class: "bg-[var(--surface-neutral-hover)] text-neutral-primary border border-neutral-300 [a&]:hover:bg-surface-neutral-hover"
72
- },
73
- {
74
- variant: "outline",
75
- color: "primary",
76
- class: "bg-[var(--surface-accent-light)] text-brand-secondary border border-blue-300 [a&]:hover:bg-surface-neutral-hover"
77
- },
78
- {
79
- variant: "outline",
80
- color: "destructive",
81
- class: "bg-[var(--surface-danger-light)] text-danger-secondary border border-red-300 [a&]:hover:bg-surface-danger-light-hover"
82
- },
83
- {
84
- variant: "outline",
85
- color: "success",
86
- class: "bg-[var(--surface-success-light)] text-success-secondary border border-green-300 [a&]:hover:bg-surface-success-light-hover"
87
- },
88
- {
89
- variant: "outline",
90
- color: "warning",
91
- class: "bg-[var(--surface-warning-light)] text-warning-secondary border border-amber-300 [a&]:hover:bg-surface-warning-light-hover"
92
- }
93
- ],
94
- defaultVariants: {
95
- variant: "default",
96
- size: "default",
97
- color: "default"
16
+ rounded: {
17
+ full: "rounded-full",
18
+ lg: "rounded-lg",
19
+ md: "rounded-md",
20
+ sm: "rounded-sm",
21
+ none: "rounded-none"
22
+ },
23
+ size: {
24
+ sm: "leading-none-regular-xs",
25
+ md: "leading-none-regular-sm",
26
+ lg: "leading-none-regular"
98
27
  }
28
+ },
29
+ defaultVariants: {
30
+ variant: "neutral",
31
+ rounded: "lg",
32
+ size: "md"
99
33
  }
100
- );
101
- function p({
102
- className: r,
103
- variant: e,
104
- size: a,
105
- color: t,
106
- asChild: s = !1,
107
- ...o
34
+ });
35
+ function h({
36
+ className: t,
37
+ variant: s,
38
+ size: d,
39
+ rounded: i,
40
+ leftIcon: r,
41
+ rightIcon: a,
42
+ label: n,
43
+ asChild: l = !1
108
44
  }) {
109
- return /* @__PURE__ */ n(
110
- s ? c : "span",
111
- {
112
- "data-slot": "badge",
113
- className: u(l({ variant: e, size: a, color: t }), r),
114
- ...o
115
- }
116
- );
45
+ return /* @__PURE__ */ u(l ? m : "span", { "data-slot": "badge", className: c(g({ variant: s, size: d, rounded: i }), t), children: [
46
+ r && /* @__PURE__ */ e("span", { className: "size-3.5", children: r }),
47
+ n && /* @__PURE__ */ e("span", { className: "flex items-center justify-center px-0.5 py-px", children: n }),
48
+ a && /* @__PURE__ */ e("span", { className: "size-3.5", children: a })
49
+ ] });
117
50
  }
118
51
  export {
119
- p as Badge,
120
- l as badgeVariants
52
+ h as Badge,
53
+ g as badgeVariants
121
54
  };
@@ -3,11 +3,11 @@ import { useRef as x, useState as h, useEffect as b } from "react";
3
3
  import { createPortal as N } from "react-dom";
4
4
  import { cn as u } from "../../../../lib/utils.js";
5
5
  import { useColumnItemDragAndDrop as v } from "./column-item.hook.js";
6
- import { Button as w } from "../../../button/button.js";
7
- import { Minus as y } from "../../../assets/icons/minus.js";
6
+ import { Button as y } from "../../../button/button.js";
7
+ import k from "../../../assets/icons/x.js";
8
8
  import { parseColumnLabel as p } from "./column-item.util.js";
9
9
  import g from "../../../assets/icons/drag-handle.js";
10
- import { Z2Tooltip as k } from "../../../tooltip/tooltip.js";
10
+ import { Z2Tooltip as w } from "../../../tooltip/tooltip.js";
11
11
  const L = {
12
12
  "is-dragging": "opacity-40",
13
13
  "is-dragging-over": "bg-background-neutral-medium"
@@ -23,7 +23,7 @@ const L = {
23
23
  return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
24
24
  }, [t]);
25
25
  const a = /* @__PURE__ */ e("span", { ref: i, className: u("truncate min-w-0", s), children: t });
26
- return o && r ? /* @__PURE__ */ e(k, { message: r, side: "top", children: a }) : a;
26
+ return o && r ? /* @__PURE__ */ e(w, { message: r, side: "top", children: a }) : a;
27
27
  }, T = ({
28
28
  edge: t,
29
29
  isFirstElement: s = !1
@@ -105,13 +105,13 @@ const S = ({
105
105
  )
106
106
  ] }),
107
107
  /* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-3", children: i ? i(t, r) : /* @__PURE__ */ e(
108
- w,
108
+ y,
109
109
  {
110
110
  onClick: () => r == null ? void 0 : r(t.id),
111
111
  variant: "ghost",
112
112
  shade: "neutral",
113
113
  size: "medium",
114
- leftIcon: /* @__PURE__ */ e(y, { className: "w-4 h-4" })
114
+ leftIcon: /* @__PURE__ */ e(k, { className: "w-4 h-4" })
115
115
  }
116
116
  ) })
117
117
  ]
@@ -46,6 +46,8 @@
46
46
  --surface-inverted-hover: var(--alpha-two-300);
47
47
  --surface-inverted-pressed: var(--neutral-00);
48
48
  --surface-inverted-disabled: var(--neutral-100);
49
+
50
+ --surface-gray-default: var(--neutral-600);
49
51
  }
50
52
 
51
53
  .dark {
@@ -136,4 +138,7 @@
136
138
  --color-surface-inverted-hover: var(--surface-inverted-hover);
137
139
  --color-surface-inverted-pressed: var(--surface-inverted-pressed);
138
140
  --color-surface-inverted-disabled: var(--surface-inverted-disabled);
141
+
142
+ /* Surface Colors - Gray */
143
+ --color-surface-gray-default: var(--surface-gray-default);
139
144
  }