@ztwoint/z-ui 0.1.108 → 0.1.110

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.
@@ -9,17 +9,16 @@ import "clsx";
9
9
  import "tailwind-merge";
10
10
  import { isColumnData as s } from "./components/column-item/column-item.util.js";
11
11
  import "../button/button.js";
12
- import "../tooltip/tooltip.js";
13
- const b = ({ columns: o, onReorder: r }) => {
14
- const [t, a] = I(o);
12
+ const $ = ({ columns: e, onReorder: r }) => {
13
+ const [t, a] = I(e);
15
14
  return p(() => {
16
- a(o);
17
- }, [o]), p(() => C({
18
- canMonitor({ source: e }) {
19
- return s(e.data);
15
+ a(e);
16
+ }, [e]), p(() => C({
17
+ canMonitor({ source: o }) {
18
+ return s(o.data);
20
19
  },
21
- onDrop({ location: e, source: g }) {
22
- const c = e.current.dropTargets[0];
20
+ onDrop({ location: o, source: g }) {
21
+ const c = o.current.dropTargets[0];
23
22
  if (!c)
24
23
  return;
25
24
  const n = g.data, i = c.data;
@@ -44,5 +43,5 @@ const b = ({ columns: o, onReorder: r }) => {
44
43
  }), [t, r]), { internalColumns: t };
45
44
  };
46
45
  export {
47
- b as useColumnReorder
46
+ $ as useColumnReorder
48
47
  };
@@ -1,128 +1,87 @@
1
1
  import { jsxs as l, Fragment as f, jsx as e } from "react/jsx-runtime";
2
- import { useRef as x, useState as h, useEffect as b } from "react";
3
- import { createPortal as N } from "react-dom";
4
- import { cn as u } from "../../../../lib/utils.js";
5
- import { useColumnItemDragAndDrop as v } from "./column-item.hook.js";
6
- import { Button as y } from "../../../button/button.js";
7
- import k from "../../../assets/icons/x.js";
8
- import { parseColumnLabel as p } from "./column-item.util.js";
9
- import g from "../../../assets/icons/drag-handle.js";
10
- import { Z2Tooltip as w } from "../../../tooltip/tooltip.js";
11
- const L = {
2
+ import { createPortal as x } from "react-dom";
3
+ import "react";
4
+ import { cn as c } from "../../../../lib/utils.js";
5
+ import { useColumnItemDragAndDrop as h } from "./column-item.hook.js";
6
+ import { Button as b } from "../../../button/button.js";
7
+ import N from "../../../assets/icons/x.js";
8
+ import { parseColumnLabel as g } from "./column-item.util.js";
9
+ import u from "../../../assets/icons/drag-handle.js";
10
+ const y = {
12
11
  "is-dragging": "opacity-40",
13
12
  "is-dragging-over": "bg-background-neutral-medium"
14
- }, d = ({ text: t, className: s, tooltipMessage: r }) => {
15
- const i = x(null), [o, m] = h(!1);
16
- b(() => {
17
- const n = () => {
18
- if (i.current) {
19
- const c = i.current;
20
- m(c.scrollWidth > c.clientWidth);
21
- }
22
- };
23
- return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
24
- }, [t]);
25
- const a = /* @__PURE__ */ e("span", { ref: i, className: u("truncate min-w-0", s), children: t });
26
- return o && r ? /* @__PURE__ */ e(w, { message: r, side: "top", children: a }) : a;
27
- }, T = ({
13
+ }, i = ({ text: t, className: r }) => /* @__PURE__ */ e("span", { className: c("truncate min-w-0", r), children: t }), k = ({
28
14
  edge: t,
29
- isFirstElement: s = !1
15
+ isFirstElement: r = !1
30
16
  }) => /* @__PURE__ */ e(
31
17
  "div",
32
18
  {
33
- className: u(
19
+ className: c(
34
20
  "absolute left-0 right-0 h-0.5 bg-blue-500",
35
- t === "top" ? s ? "top-0" : "top-[-3px]" : "bottom-0"
21
+ t === "top" ? r ? "top-0" : "top-[-3px]" : "bottom-0"
36
22
  )
37
23
  }
38
24
  );
39
- function E({ column: t }) {
40
- const { groupLabel: s, fieldLabel: r } = p(t);
25
+ function v({ column: t }) {
26
+ const { groupLabel: r, fieldLabel: a } = g(t);
41
27
  return /* @__PURE__ */ l("div", { className: "flex items-center gap-3 p-1 bg-background-neutral-default border border-stroke-solid-light rounded-xl ", children: [
42
- /* @__PURE__ */ e(g, {}),
28
+ /* @__PURE__ */ e(u, {}),
43
29
  /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-center w-3.5 h-3.5 ", children: t.icon }),
44
30
  /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5 min-w-0 flex-1 leading-none-regular-sm", children: [
45
- /* @__PURE__ */ e(
46
- d,
47
- {
48
- text: s,
49
- className: "text-text-neutral-secondary",
50
- tooltipMessage: `Group: ${s}`
51
- }
52
- ),
31
+ /* @__PURE__ */ e(i, { text: r, className: "text-text-neutral-secondary" }),
53
32
  /* @__PURE__ */ e("span", { className: "text-text-neutral-muted flex-shrink-0", children: "/" }),
54
- /* @__PURE__ */ e(
55
- d,
56
- {
57
- text: r,
58
- className: "text-text-neutral-primary",
59
- tooltipMessage: `Field: ${r}`
60
- }
61
- )
33
+ /* @__PURE__ */ e(i, { text: a, className: "text-text-neutral-primary" })
62
34
  ] })
63
35
  ] });
64
36
  }
65
- const S = ({
37
+ const T = ({
66
38
  column: t,
67
- index: s,
68
- onRemove: r,
69
- renderAction: i,
70
- disabled: o = !1
39
+ index: r,
40
+ onRemove: a,
41
+ renderAction: o,
42
+ disabled: n = !1
71
43
  }) => {
72
- const { ref: m, state: a } = v(t, s, o), { groupLabel: n, fieldLabel: c } = p(t);
44
+ const { ref: p, state: s } = h(t, r, n), { groupLabel: d, fieldLabel: m } = g(t);
73
45
  return /* @__PURE__ */ l(f, { children: [
74
46
  /* @__PURE__ */ l("div", { className: "relative border-b-0.5", children: [
75
47
  /* @__PURE__ */ l(
76
48
  "div",
77
49
  {
78
50
  "data-column-id": t.id,
79
- ref: m,
80
- className: u(
51
+ ref: p,
52
+ title: `${d} / ${m}`,
53
+ className: c(
81
54
  "flex items-center gap-2 p-1 pl-3 bg-background-neutral-default transition-colors",
82
- o ? "cursor-default" : "cursor-grab hover:bg-background-neutral-medium",
83
- L[a.type] ?? ""
55
+ n ? "cursor-default" : "cursor-grab hover:bg-background-neutral-medium",
56
+ y[s.type] ?? ""
84
57
  ),
85
58
  children: [
86
- !o && /* @__PURE__ */ e(g, {}),
59
+ !n && /* @__PURE__ */ e(u, {}),
87
60
  /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-center w-3.5 h-3.5", children: t.icon }),
88
61
  /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5 min-w-0 flex-1 leading-none-regular-sm", children: [
89
- /* @__PURE__ */ e(
90
- d,
91
- {
92
- text: n,
93
- className: "text-text-neutral-secondary",
94
- tooltipMessage: `Group: ${n}`
95
- }
96
- ),
62
+ /* @__PURE__ */ e(i, { text: d, className: "text-text-neutral-secondary" }),
97
63
  /* @__PURE__ */ e("span", { className: "text-text-neutral-muted flex-shrink-0", children: "/" }),
98
- /* @__PURE__ */ e(
99
- d,
100
- {
101
- text: c,
102
- className: "text-text-neutral-primary",
103
- tooltipMessage: `Field: ${c}`
104
- }
105
- )
64
+ /* @__PURE__ */ e(i, { text: m, className: "text-text-neutral-primary" })
106
65
  ] }),
107
- /* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-3", children: i ? i(t, r) : /* @__PURE__ */ e(
108
- y,
66
+ /* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-3", children: o ? o(t, a) : /* @__PURE__ */ e(
67
+ b,
109
68
  {
110
- onClick: () => r == null ? void 0 : r(t.id),
69
+ onClick: () => a == null ? void 0 : a(t.id),
111
70
  variant: "ghost",
112
71
  shade: "neutral",
113
72
  size: "medium",
114
- leftIcon: /* @__PURE__ */ e(k, { className: "w-4 h-4" })
73
+ leftIcon: /* @__PURE__ */ e(N, { className: "w-4 h-4" })
115
74
  }
116
75
  ) })
117
76
  ]
118
77
  }
119
78
  ),
120
- a.type === "is-dragging-over" && a.closestEdge && /* @__PURE__ */ e(T, { edge: a.closestEdge, isFirstElement: s === 0 })
79
+ s.type === "is-dragging-over" && s.closestEdge && /* @__PURE__ */ e(k, { edge: s.closestEdge, isFirstElement: r === 0 })
121
80
  ] }),
122
- a.type === "preview" && N(/* @__PURE__ */ e(E, { column: t }), a.container)
81
+ s.type === "preview" && x(/* @__PURE__ */ e(v, { column: t }), s.container)
123
82
  ] });
124
83
  };
125
84
  export {
126
- S as ColumnItem,
127
- S as default
85
+ T as ColumnItem,
86
+ T as default
128
87
  };
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
3
  declare function Z2RadioGroup({ ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function Z2RadioGroupItem({ className, children, size, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item> & {
5
- size?: 'sm' | 'default' | 'lg';
6
- }): import("react/jsx-runtime").JSX.Element;
4
+ declare const Z2RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
5
+ size?: "sm" | "default" | "lg";
6
+ } & React.RefAttributes<HTMLButtonElement>>;
7
7
  declare function Z2RadioGroupIndicator({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Indicator>): import("react/jsx-runtime").JSX.Element;
8
8
  export { Z2RadioGroup, Z2RadioGroupItem, Z2RadioGroupIndicator };
@@ -1,55 +1,51 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
+ import * as l from "react";
2
3
  import * as o from "@radix-ui/react-radio-group";
3
4
  import { cn as d } from "../../lib/utils.js";
4
- function c({ ...e }) {
5
+ function b({ ...e }) {
5
6
  return /* @__PURE__ */ t(o.Root, { "data-slot": "radio-group", ...e });
6
7
  }
7
- function n({
8
- className: e,
9
- children: r,
10
- size: a = "default",
11
- ...s
12
- }) {
13
- return /* @__PURE__ */ t(
14
- o.Item,
15
- {
16
- "data-slot": "radio-group-item",
17
- "data-size": a,
18
- className: d(
19
- // Base styles
20
- "aspect-square rounded-full border-2 border-stroke-solid-high bg-surface-neutral-default",
21
- "transition-all duration-200 ease-in-out relative",
22
- "focus:outline-none",
23
- // Size variants
24
- "data-[size=sm]:size-3 data-[size=default]:size-4 data-[size=lg]:size-5",
25
- // State styles
26
- "hover:border-stroke-solid-hover hover:bg-surface-neutral-hover",
27
- "data-[state=checked]:border-surface-accent-default data-[state=checked]:bg-surface-accent-default",
28
- "data-[state=checked]:hover:border-surface-accent-hover data-[state=checked]:hover:bg-surface-accent-hover",
29
- // Disabled state
30
- "disabled:cursor-not-allowed disabled:opacity-50",
31
- "disabled:border-stroke-solid-light disabled:bg-surface-neutral-disabled",
32
- "disabled:hover:border-stroke-solid-light disabled:hover:bg-surface-neutral-disabled",
33
- "disabled:data-[state=checked]:border-stroke-solid-light disabled:data-[state=checked]:bg-surface-neutral-disabled",
34
- e
35
- ),
36
- ...s,
37
- children: r ?? /* @__PURE__ */ t(
38
- i,
39
- {
40
- className: d(
41
- "rounded-full bg-surface-neutral-default",
42
- "transition-all duration-200 ease-in-out",
43
- a === "sm" && "size-1.5",
44
- a === "default" && "size-2",
45
- a === "lg" && "size-2.5"
46
- )
47
- }
48
- )
49
- }
50
- );
51
- }
52
- function i({
8
+ const u = l.forwardRef(({ className: e, children: r, size: a = "default", ...s }, i) => /* @__PURE__ */ t(
9
+ o.Item,
10
+ {
11
+ ref: i,
12
+ "data-slot": "radio-group-item",
13
+ "data-size": a,
14
+ className: d(
15
+ // Base styles
16
+ "aspect-square rounded-full border-2 border-stroke-solid-high bg-surface-neutral-default",
17
+ "transition-all duration-200 ease-in-out relative",
18
+ "focus:outline-none",
19
+ // Size variants
20
+ "data-[size=sm]:size-3 data-[size=default]:size-4 data-[size=lg]:size-5",
21
+ // State styles
22
+ "hover:border-stroke-solid-hover hover:bg-surface-neutral-hover",
23
+ "data-[state=checked]:border-surface-accent-default data-[state=checked]:bg-surface-accent-default",
24
+ "data-[state=checked]:hover:border-surface-accent-hover data-[state=checked]:hover:bg-surface-accent-hover",
25
+ // Disabled state
26
+ "disabled:cursor-not-allowed disabled:opacity-50",
27
+ "disabled:border-stroke-solid-light disabled:bg-surface-neutral-disabled",
28
+ "disabled:hover:border-stroke-solid-light disabled:hover:bg-surface-neutral-disabled",
29
+ "disabled:data-[state=checked]:border-stroke-solid-light disabled:data-[state=checked]:bg-surface-neutral-disabled",
30
+ e
31
+ ),
32
+ ...s,
33
+ children: r ?? /* @__PURE__ */ t(
34
+ c,
35
+ {
36
+ className: d(
37
+ "rounded-full bg-surface-neutral-default",
38
+ "transition-all duration-200 ease-in-out",
39
+ a === "sm" && "size-1.5",
40
+ a === "default" && "size-2",
41
+ a === "lg" && "size-2.5"
42
+ )
43
+ }
44
+ )
45
+ }
46
+ ));
47
+ u.displayName = "Z2RadioGroupItem";
48
+ function c({
53
49
  className: e,
54
50
  ...r
55
51
  }) {
@@ -66,7 +62,7 @@ function i({
66
62
  );
67
63
  }
68
64
  export {
69
- c as Z2RadioGroup,
70
- i as Z2RadioGroupIndicator,
71
- n as Z2RadioGroupItem
65
+ b as Z2RadioGroup,
66
+ c as Z2RadioGroupIndicator,
67
+ u as Z2RadioGroupItem
72
68
  };
@@ -0,0 +1,10 @@
1
+ declare function Z2RadioCard({ primaryText, supportText, value, id, disabled, className, itemClassName, }: {
2
+ primaryText: string;
3
+ supportText: string;
4
+ value: string;
5
+ id?: string;
6
+ disabled?: boolean;
7
+ className?: string;
8
+ itemClassName?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export default Z2RadioCard;
@@ -39,7 +39,7 @@ import "react-dom";
39
39
  import "../../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
40
40
  import "../../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
41
41
  import "@radix-ui/react-slot";
42
- import "@radix-ui/react-radio-group";
42
+ import "../../../radio/z2-radio.js";
43
43
  import "../../../segmented-control/item.js";
44
44
  import "@radix-ui/react-popover";
45
45
  import "../../../dynamic-table/z2-table.js";
@@ -44,7 +44,7 @@ import "react-dom";
44
44
  import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
45
45
  import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
46
46
  import "@radix-ui/react-slot";
47
- import "@radix-ui/react-radio-group";
47
+ import "../radio/z2-radio.js";
48
48
  import "../segmented-control/item.js";
49
49
  import "@radix-ui/react-popover";
50
50
  import "../dynamic-table/z2-table.js";
@@ -39,7 +39,7 @@ import "react-dom";
39
39
  import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js";
40
40
  import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js";
41
41
  import "@radix-ui/react-slot";
42
- import "@radix-ui/react-radio-group";
42
+ import "../radio/z2-radio.js";
43
43
  import "../segmented-control/item.js";
44
44
  import "@radix-ui/react-popover";
45
45
  import "../dynamic-table/z2-table.js";
@@ -4,6 +4,7 @@
4
4
  --text-neutral-primary: var(--neutral-950);
5
5
  --text-neutral-secondary: var(--neutral-600);
6
6
  --text-neutral-muted: var(--neutral-400);
7
+ --text-neutral-pale: var(--neutral-200);
7
8
 
8
9
  /* Text Colors - Inverted */
9
10
  --text-inverted-primary: var(--neutral-00);
@@ -41,6 +42,7 @@
41
42
  --text-neutral-primary: var(--neutral-950);
42
43
  --text-neutral-secondary: var(--neutral-500);
43
44
  --text-neutral-muted: var(--neutral-400);
45
+ --text-neutral-pale: var(--neutral-200);
44
46
 
45
47
  /* Text Colors - Inverted - Dark Mode */
46
48
  --text-inverted-primary: var(--neutral-00);
@@ -80,7 +82,7 @@
80
82
  --color-text-neutral-primary: var(--text-neutral-primary);
81
83
  --color-text-neutral-secondary: var(--text-neutral-secondary);
82
84
  --color-text-neutral-muted: var(--text-neutral-muted);
83
-
85
+ --color-text-neutral-pale: var(--text-neutral-pale);
84
86
  /* Text Colors - Inverted */
85
87
  --color-text-inverted-primary: var(--text-inverted-primary);
86
88
  --color-text-inverted-secondary: var(--text-inverted-secondary);