@pibit.ai/cure-design-system 0.3.50 → 0.3.54

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 +1 @@
1
- {"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/TableToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAG3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kJAAkJ;IAClJ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAC;AACjD,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CA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AuG;IACvG,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0GAA0G;IAC1G,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAyHD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAsJ9C,CAAC;AAiJF,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,GAAG;IACF,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAMA"}
@@ -67,7 +67,9 @@ const se = ({ config: e }) => (Z({
67
67
  {
68
68
  isOpen: e.isOpen,
69
69
  onOpenChange: (s) => {
70
- s && e.onSortsChange(e.sorts.map((c) => ({ ...c }))), e.onOpenChange(s);
70
+ s && e.onSortsChange(
71
+ e.sorts.length > 0 ? e.sorts.map((c) => ({ ...c })) : [{ field: "", direction: "" }]
72
+ ), e.onOpenChange(s);
71
73
  },
72
74
  children: [
73
75
  /* @__PURE__ */ p(
@@ -1 +1 @@
1
- {"version":3,"file":"TableViewsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/TableViewsDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;AAe/C,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAwIxG,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CA+DA,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAEzE"}
1
+ {"version":3,"file":"TableViewsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/TableViewsDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;AAe/C,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AA8J1B,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAkEA,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAEzE"}
@@ -1,44 +1,47 @@
1
- import { jsx as t, jsxs as l, Fragment as f } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as s, Fragment as f } from "react/jsx-runtime";
2
2
  import { useState as x } from "react";
3
- import { ChevronDown as y, Check as b, DotsVertical as k, Edit03 as v, Share07 as D, Eye as N, Trash01 as S } from "@untitledui/icons";
4
- import V from "../../../assets/icons/filtered-view.svg.js";
3
+ import { ChevronDown as b, Check as k, DotsVertical as D, Edit03 as N, Share07 as v, Eye as S, Trash01 as V } from "@untitledui/icons";
4
+ import O from "../../../assets/icons/filtered-view.svg.js";
5
5
  import { cx as p } from "../../../utils/cn.js";
6
6
  import { DEFAULT_TABLE_VIEW_ID as C } from "./tableViewTypes.js";
7
- import { Dropdown as h } from "../../../primitives/dropdown/dropdown.js";
7
+ import { Dropdown as u } from "../../../primitives/dropdown/dropdown.js";
8
8
  import { Button as w } from "../../../primitives/button/button.js";
9
- const m = ({ icon: e, label: r, danger: o, onClick: n }) => /* @__PURE__ */ l(
9
+ const m = ({ icon: e, label: r, danger: a, onClick: n }) => /* @__PURE__ */ s(
10
10
  "button",
11
11
  {
12
12
  type: "button",
13
13
  onClick: n,
14
14
  className: p(
15
15
  "flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-xs font-medium outline-none",
16
- o ? "cursor-pointer text-error-primary hover:bg-error-primary" : "cursor-pointer text-secondary hover:bg-primary_hover"
16
+ a ? "cursor-pointer text-error-primary hover:bg-error-primary" : "cursor-pointer text-secondary hover:bg-primary_hover"
17
17
  ),
18
18
  children: [
19
19
  /* @__PURE__ */ t(
20
20
  e,
21
21
  {
22
22
  size: 16,
23
- className: p("shrink-0", o ? "text-error-primary" : "text-fg-quaternary")
23
+ className: p(
24
+ "shrink-0",
25
+ a ? "text-error-primary" : "text-fg-quaternary"
26
+ )
24
27
  }
25
28
  ),
26
29
  /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: r })
27
30
  ]
28
31
  }
29
32
  );
30
- function O({
33
+ function I({
31
34
  view: e,
32
35
  config: r,
33
- onCloseParent: o,
36
+ onCloseParent: a,
34
37
  onOpenChange: n
35
38
  }) {
36
- const [s, i] = x(!1), a = (c) => {
37
- i(c), n == null || n(c);
38
- }, d = (c) => () => {
39
- c == null || c(e.id), a(!1), o();
39
+ const [i, d] = x(!1), o = (l) => {
40
+ d(l), n == null || n(l);
41
+ }, c = (l) => () => {
42
+ l == null || l(e.id), o(!1), a();
40
43
  };
41
- return /* @__PURE__ */ l(h.Root, { isOpen: s, onOpenChange: a, children: [
44
+ return /* @__PURE__ */ s(u.Root, { isOpen: i, onOpenChange: o, children: [
42
45
  /* @__PURE__ */ t(
43
46
  w,
44
47
  {
@@ -47,68 +50,97 @@ function O({
47
50
  "aria-label": `Actions for ${e.name}`,
48
51
  className: p(
49
52
  "opacity-0 group-hover:opacity-100 data-pressed:opacity-100",
50
- s && "bg-primary_hover opacity-100"
53
+ i && "bg-primary_hover opacity-100"
51
54
  ),
52
- iconLeading: /* @__PURE__ */ t(k, { size: 16 })
55
+ iconLeading: /* @__PURE__ */ t(D, { size: 16 })
53
56
  }
54
57
  ),
55
- /* @__PURE__ */ l(h.Popover, { placement: "right top", className: "w-52 p-1", children: [
56
- r.onRename && /* @__PURE__ */ t(m, { icon: v, label: "Rename", onClick: d(r.onRename) }),
57
- r.onShare && /* @__PURE__ */ t(m, { icon: D, label: "Share View", onClick: d(r.onShare) }),
58
- r.onMakeDefault && !e.isDefault && /* @__PURE__ */ t(m, { icon: N, label: "Make Default View", onClick: d(r.onMakeDefault) }),
59
- r.onDelete && /* @__PURE__ */ l(f, { children: [
58
+ /* @__PURE__ */ s(u.Popover, { placement: "right top", className: "w-52 p-1", children: [
59
+ e.kind === "owned" && r.onRename && /* @__PURE__ */ t(
60
+ m,
61
+ {
62
+ icon: N,
63
+ label: "Rename",
64
+ onClick: c(r.onRename)
65
+ }
66
+ ),
67
+ e.kind === "owned" && r.onShare && /* @__PURE__ */ t(
68
+ m,
69
+ {
70
+ icon: v,
71
+ label: "Share View",
72
+ onClick: c(r.onShare)
73
+ }
74
+ ),
75
+ r.onMakeDefault && !e.isDefault && /* @__PURE__ */ t(
76
+ m,
77
+ {
78
+ icon: S,
79
+ label: "Make Default View",
80
+ onClick: c(r.onMakeDefault)
81
+ }
82
+ ),
83
+ e.kind === "owned" && r.onDelete && /* @__PURE__ */ s(f, { children: [
60
84
  /* @__PURE__ */ t("div", { className: "my-1 h-px w-full bg-border-secondary" }),
61
- /* @__PURE__ */ t(m, { icon: S, label: "Delete View", danger: !0, onClick: d(r.onDelete) })
85
+ /* @__PURE__ */ t(
86
+ m,
87
+ {
88
+ icon: V,
89
+ label: "Delete View",
90
+ danger: !0,
91
+ onClick: c(r.onDelete)
92
+ }
93
+ )
62
94
  ] })
63
95
  ] })
64
96
  ] });
65
97
  }
66
- function u({
98
+ function h({
67
99
  view: e,
68
100
  selected: r,
69
- config: o,
101
+ config: a,
70
102
  onClose: n,
71
- onSelect: s
103
+ onSelect: i
72
104
  }) {
73
- const [i, a] = x(!1), d = e.kind === "owned" && !!(o.onRename || o.onShare || o.onMakeDefault || o.onDelete);
74
- return /* @__PURE__ */ l(
105
+ const [d, o] = x(!1), c = e.kind === "owned" && !!(a.onRename || a.onShare || a.onDelete), l = !!(a.onMakeDefault && !e.isDefault), y = c || l;
106
+ return /* @__PURE__ */ s(
75
107
  "div",
76
108
  {
77
109
  className: p(
78
110
  "group flex items-center gap-1 rounded-md px-1",
79
- r ? "bg-utility-brand-25" : i ? "bg-primary_hover" : "hover:bg-primary_hover"
111
+ r ? "bg-utility-brand-25" : d ? "bg-primary_hover" : "hover:bg-primary_hover"
80
112
  ),
81
113
  children: [
82
- /* @__PURE__ */ l(
114
+ /* @__PURE__ */ s(
83
115
  "button",
84
116
  {
85
117
  type: "button",
86
118
  className: "flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-2 text-left text-xs font-medium text-secondary outline-none",
87
119
  onClick: () => {
88
- s ? s() : o.onSelect(e.id), n();
120
+ i ? i() : a.onSelect(e.id), n();
89
121
  },
90
122
  children: [
91
123
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: e.name }),
92
- r && /* @__PURE__ */ t(b, { size: 16, className: "shrink-0 text-brand-600" })
124
+ r && /* @__PURE__ */ t(k, { size: 16, className: "shrink-0 text-brand-600" })
93
125
  ]
94
126
  }
95
127
  ),
96
- d && /* @__PURE__ */ t(
97
- O,
128
+ y && /* @__PURE__ */ t(
129
+ I,
98
130
  {
99
131
  view: e,
100
- config: o,
132
+ config: a,
101
133
  onCloseParent: n,
102
- onOpenChange: a
134
+ onOpenChange: o
103
135
  }
104
136
  )
105
137
  ]
106
138
  }
107
139
  );
108
140
  }
109
- const A = ({ config: e, isDisabled: r }) => {
110
- const [o, n] = x(!1), s = e.items.filter((a) => a.kind === "owned"), i = e.items.filter((a) => a.kind === "shared");
111
- return /* @__PURE__ */ t("div", { className: "relative z-50 shrink-0", children: /* @__PURE__ */ l(h.Root, { isOpen: o, onOpenChange: n, children: [
141
+ const L = ({ config: e, isDisabled: r }) => {
142
+ const [a, n] = x(!1), i = e.items.filter((o) => o.kind === "owned"), d = e.items.filter((o) => o.kind === "shared");
143
+ return /* @__PURE__ */ t("div", { className: "relative z-50 shrink-0", children: /* @__PURE__ */ s(u.Root, { isOpen: a, onOpenChange: n, children: [
112
144
  /* @__PURE__ */ t(
113
145
  w,
114
146
  {
@@ -117,18 +149,19 @@ const A = ({ config: e, isDisabled: r }) => {
117
149
  "aria-label": "Table views",
118
150
  title: "Table views",
119
151
  isDisabled: r,
120
- iconLeading: /* @__PURE__ */ t("img", { src: V, alt: "", className: "h-4 w-4" }),
121
- iconTrailing: /* @__PURE__ */ t(y, { size: 16 })
152
+ iconLeading: /* @__PURE__ */ t("img", { src: O, alt: "", className: "h-4 w-4" }),
153
+ iconTrailing: /* @__PURE__ */ t(b, { size: 16 })
122
154
  }
123
155
  ),
124
- /* @__PURE__ */ t(h.Popover, { className: "z-50 w-56 p-1.5", children: /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
156
+ /* @__PURE__ */ t(u.Popover, { className: "z-50 w-56 p-1.5", children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
125
157
  e.onSelectInitial && /* @__PURE__ */ t(
126
- u,
158
+ h,
127
159
  {
128
160
  view: {
129
161
  id: C,
130
162
  name: "System View",
131
- kind: "default"
163
+ kind: "default",
164
+ isDefault: e.initialViewIsDefault
132
165
  },
133
166
  selected: e.selectedId === void 0,
134
167
  config: e,
@@ -136,36 +169,36 @@ const A = ({ config: e, isDisabled: r }) => {
136
169
  onSelect: e.onSelectInitial
137
170
  }
138
171
  ),
139
- s.map((a) => /* @__PURE__ */ t(
140
- u,
172
+ i.map((o) => /* @__PURE__ */ t(
173
+ h,
141
174
  {
142
- view: a,
143
- selected: e.selectedId === a.id,
175
+ view: o,
176
+ selected: e.selectedId === o.id,
144
177
  config: e,
145
178
  onClose: () => n(!1)
146
179
  },
147
- a.id
180
+ o.id
148
181
  )),
149
- i.length > 0 && /* @__PURE__ */ l(f, { children: [
182
+ d.length > 0 && /* @__PURE__ */ s(f, { children: [
150
183
  /* @__PURE__ */ t("div", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold tracking-wide text-tertiary uppercase", children: "Shared with me" }),
151
- i.map((a) => /* @__PURE__ */ t(
152
- u,
184
+ d.map((o) => /* @__PURE__ */ t(
185
+ h,
153
186
  {
154
- view: a,
155
- selected: e.selectedId === a.id,
187
+ view: o,
188
+ selected: e.selectedId === o.id,
156
189
  config: e,
157
190
  onClose: () => n(!1)
158
191
  },
159
- a.id
192
+ o.id
160
193
  ))
161
194
  ] })
162
195
  ] }) })
163
196
  ] }) });
164
197
  };
165
- function B(e) {
198
+ function P(e) {
166
199
  return e.some((r) => r.kind === "owned" || r.kind === "shared");
167
200
  }
168
201
  export {
169
- A as TableViewsDropdown,
170
- B as hasSavedOrSharedViews
202
+ L as TableViewsDropdown,
203
+ P as hasSavedOrSharedViews
171
204
  };
@@ -54,6 +54,8 @@ export type TableViewsConfig = {
54
54
  onSelect: (id: string) => void;
55
55
  /** Restores the consumer-managed, unsaved initial table state. It is never persisted. */
56
56
  onSelectInitial?: () => void;
57
+ /** Whether the consumer has made the virtual System View its default. */
58
+ initialViewIsDefault?: boolean;
57
59
  initialViewLabel?: string;
58
60
  onSaveClick: () => void;
59
61
  onRevertClick?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"tableViewTypes.d.ts","sourceRoot":"","sources":["../../../../src/patterns/table/toolbar/tableViewTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,E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AAK,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
@@ -13,18 +13,27 @@ interface DropdownItemProps extends AriaMenuItemProps {
13
13
  }>;
14
14
  /** If true, the item will be selected. */
15
15
  isSelected?: boolean;
16
+ /** The size of the item. */
17
+ size?: "sm" | "md";
16
18
  }
17
19
  interface DropdownMenuProps<T extends object> extends AriaMenuProps<T> {
18
20
  }
19
21
  interface DropdownPopoverProps extends AriaPopoverProps {
20
22
  }
23
+ /**
24
+ * Exported for its test only — not re-exported from index.ts, so the package's
25
+ * public surface is unchanged. This predicate is the whole point of the
26
+ * DropdownPopover wrapper, so it is worth asserting directly rather than
27
+ * through react-aria's outside-click plumbing.
28
+ */
29
+ export declare const isNestedOverlayElement: (element: Element) => boolean;
21
30
  export declare const Dropdown: {
22
31
  Root: typeof AriaMenuTrigger;
23
- Popover: (props: DropdownPopoverProps) => import("react/jsx-runtime").JSX.Element;
32
+ Popover: ({ shouldCloseOnInteractOutside, ...props }: DropdownPopoverProps) => import("react/jsx-runtime").JSX.Element;
24
33
  Menu: <T extends object>(props: DropdownMenuProps<T>) => import("react/jsx-runtime").JSX.Element;
25
34
  Section: <T extends object>(props: import('react-aria-components').MenuSectionProps<T> & React.RefAttributes<HTMLElement>) => import('react').ReactElement | null;
26
35
  SectionHeader: (props: React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
27
- Item: ({ label, children, addon, icon: Icon, unstyled, isSelected, ...props }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
36
+ Item: ({ label, children, addon, icon: Icon, unstyled, isSelected, size, ...props }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
28
37
  Separator: (props: AriaSeparatorProps) => import("react/jsx-runtime").JSX.Element;
29
38
  DotsButton: (props: AriaButtonProps & RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
30
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/primitives/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,aAAa,IAAI,iBAAiB,EAClC,SAAS,IAAI,aAAa,EAC1B,YAAY,IAAI,gBAAgB,EAChC,cAAc,IAAI,kBAAkB,EACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAML,WAAW,IAAI,eAAe,EAG/B,MAAM,uBAAuB,CAAC;AAG/B,UAAU,iBAAkB,SAAQ,iBAAiB;IACnD,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAyED,UAAU,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;CAAG;AAkBzE,UAAU,oBAAqB,SAAQ,gBAAgB;CAAG;AA8C1D,eAAO,MAAM,QAAQ;;qBA5CW,oBAAoB;WAlB9B,CAAC,SAAS,MAAM,SAAS,iBAAiB,CAAC,CAAC,CAAC;;;mFAjEhE,iBAAiB;uBAwGc,kBAAkB;wBAIjB,eAAe,GAAG,aAAa,CAAC,iBAAiB,CAAC;CA4BpF,C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AAkB;wBAU3C,eAAe,GAAG,aAAa,CAAC,iBAAiB,CAAC;CAgC1D,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,63 +1,66 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import { DotsVertical as u, Check as f } from "@untitledui/icons";
3
- import { Header as g, MenuSection as x, MenuTrigger as p, Button as h, Separator as y, MenuItem as m, Menu as N, Popover as b } from "react-aria-components";
4
- import { cn as i } from "../../utils/cn.js";
5
- const w = ({
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
+ import { useCallback as f } from "react";
3
+ import { DotsVertical as x, Check as g } from "@untitledui/icons";
4
+ import { Header as p, MenuSection as y, MenuTrigger as N, Button as b, Separator as h, MenuItem as c, Menu as v, Popover as w } from "react-aria-components";
5
+ import { cx as r } from "../../utils/cn.js";
6
+ const D = ({
6
7
  label: e,
7
- children: o,
8
+ children: t,
8
9
  addon: s,
9
- icon: l,
10
- unstyled: c,
11
- isSelected: a = !1,
12
- ...r
13
- }) => c ? /* @__PURE__ */ t(m, { id: e, textValue: e, ...r }) : /* @__PURE__ */ t(
14
- m,
10
+ icon: a,
11
+ unstyled: m,
12
+ isSelected: l = !1,
13
+ size: u = "sm",
14
+ ...i
15
+ }) => m ? /* @__PURE__ */ n(c, { id: e, textValue: e, ...i }) : /* @__PURE__ */ n(
16
+ c,
15
17
  {
16
- ...r,
17
- className: (n) => i(
18
+ ...i,
19
+ className: (o) => r(
18
20
  "group block cursor-pointer px-1.5 py-px outline-hidden",
19
- n.isDisabled && "cursor-not-allowed",
20
- typeof r.className == "function" ? r.className(n) : r.className
21
+ o.isDisabled && "cursor-not-allowed",
22
+ typeof i.className == "function" ? i.className(o) : i.className
21
23
  ),
22
- children: (n) => /* @__PURE__ */ d(
24
+ children: (o) => /* @__PURE__ */ d(
23
25
  "div",
24
26
  {
25
- className: i(
27
+ className: r(
26
28
  "relative flex items-center rounded-md px-2.5 py-2 outline-focus-ring transition duration-100 ease-linear",
27
- !n.isDisabled && !a && "group-hover:bg-primary_hover",
28
- n.isFocused && "bg-primary_hover",
29
- n.isFocusVisible && !a && "outline-2 -outline-offset-2",
30
- a && "bg-utility-brand-25"
29
+ !o.isDisabled && !l && "group-hover:bg-primary_hover",
30
+ o.isFocused && "bg-primary_hover",
31
+ o.isFocusVisible && !l && "outline-2 -outline-offset-2",
32
+ l && "bg-utility-brand-25"
31
33
  ),
32
34
  children: [
33
- l && /* @__PURE__ */ t(
34
- l,
35
+ a && /* @__PURE__ */ n(
36
+ a,
35
37
  {
36
38
  "aria-hidden": "true",
37
- className: i(
39
+ className: r(
38
40
  "mr-2 size-4 shrink-0 stroke-[2.25px]",
39
- n.isDisabled ? "text-fg-disabled" : "text-fg-quaternary"
41
+ o.isDisabled ? "text-fg-disabled" : "text-fg-quaternary"
40
42
  )
41
43
  }
42
44
  ),
43
- /* @__PURE__ */ t(
45
+ /* @__PURE__ */ n(
44
46
  "span",
45
47
  {
46
- className: i(
48
+ className: r(
47
49
  "grow truncate text-sm font-medium",
48
- n.isDisabled ? "text-disabled" : "text-secondary",
49
- n.isFocused && "text-secondary_hover"
50
+ o.isDisabled ? "text-disabled" : "text-secondary",
51
+ o.isFocused && "text-secondary_hover",
52
+ u === "sm" ? "text-xs" : "text-sm"
50
53
  ),
51
- children: e || (typeof o == "function" ? o(n) : o)
54
+ children: e || (typeof t == "function" ? t(o) : t)
52
55
  }
53
56
  ),
54
- a && /* @__PURE__ */ t(f, { size: 16, className: "text-brand-600" }),
55
- s && /* @__PURE__ */ t(
57
+ l && /* @__PURE__ */ n(g, { size: 16, className: "text-brand-600" }),
58
+ s && /* @__PURE__ */ n(
56
59
  "span",
57
60
  {
58
- className: i(
61
+ className: r(
59
62
  "ml-3 shrink-0 rounded px-1 py-px text-xs font-medium ring-1 ring-secondary ring-inset",
60
- n.isDisabled ? "text-disabled" : "text-quaternary"
63
+ o.isDisabled ? "text-disabled" : "text-quaternary"
61
64
  ),
62
65
  children: s
63
66
  }
@@ -66,53 +69,79 @@ const w = ({
66
69
  }
67
70
  )
68
71
  }
69
- ), D = (e) => /* @__PURE__ */ t(
70
- N,
72
+ ), E = (e) => /* @__PURE__ */ n(
73
+ v,
71
74
  {
72
75
  disallowEmptySelection: !0,
73
76
  selectionMode: "single",
74
77
  ...e,
75
- className: (o) => i(
78
+ className: (t) => r(
76
79
  "h-min overflow-y-auto py-1 outline-hidden select-none",
77
- typeof e.className == "function" ? e.className(o) : e.className
80
+ typeof e.className == "function" ? e.className(t) : e.className
78
81
  )
79
82
  }
80
- ), v = (e) => /* @__PURE__ */ t(
81
- b,
83
+ ), M = [
84
+ '[class*="react-aria-Popover"]',
85
+ '[class*="react-aria-ListBox"]',
86
+ '[class*="react-aria-Menu"]',
87
+ '[role="listbox"]',
88
+ '[role="option"]',
89
+ "[data-nested-select-overlay]"
90
+ ], S = (e) => M.some(
91
+ (t) => e.closest(t) != null
92
+ ), _ = ({
93
+ shouldCloseOnInteractOutside: e,
94
+ ...t
95
+ }) => {
96
+ const s = f(
97
+ (a) => S(a) ? !1 : (e == null ? void 0 : e(a)) ?? !0,
98
+ [e]
99
+ );
100
+ return /* @__PURE__ */ n(
101
+ w,
102
+ {
103
+ placement: "bottom left",
104
+ ...t,
105
+ shouldCloseOnInteractOutside: s,
106
+ className: (a) => r(
107
+ "max-h-max! w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
108
+ a.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
109
+ a.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
110
+ typeof t.className == "function" ? t.className(a) : t.className
111
+ ),
112
+ children: t.children
113
+ }
114
+ );
115
+ }, k = (e) => /* @__PURE__ */ n(
116
+ h,
82
117
  {
83
- placement: "bottom left",
84
118
  ...e,
85
- className: (o) => i(
86
- "max-h-max! w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
87
- o.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
88
- o.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
89
- typeof e.className == "function" ? e.className(o) : e.className
90
- ),
91
- children: e.children
119
+ className: r("my-1 h-px w-full bg-secondary", e.className)
92
120
  }
93
- ), M = (e) => /* @__PURE__ */ t(y, { ...e, className: i("my-1 h-px w-full bg-secondary", e.className) }), k = (e) => /* @__PURE__ */ t(
94
- h,
121
+ ), P = (e) => /* @__PURE__ */ n(
122
+ b,
95
123
  {
96
124
  ...e,
97
125
  "aria-label": "Open menu",
98
- className: (o) => i(
126
+ className: (t) => r(
99
127
  "cursor-pointer rounded-md text-fg-quaternary transition duration-100 ease-linear",
100
- (o.isPressed || o.isHovered) && "text-fg-quaternary_hover",
101
- (o.isPressed || o.isFocusVisible) && "outline-2 outline-offset-2",
102
- typeof e.className == "function" ? e.className(o) : e.className
128
+ (t.isPressed || t.isHovered) && "text-fg-quaternary_hover",
129
+ (t.isPressed || t.isFocusVisible) && "outline-2 outline-offset-2",
130
+ typeof e.className == "function" ? e.className(t) : e.className
103
131
  ),
104
- children: /* @__PURE__ */ t(u, { className: "size-5 transition-inherit-all" })
132
+ children: /* @__PURE__ */ n(x, { className: "size-5 transition-inherit-all" })
105
133
  }
106
- ), S = {
107
- Root: p,
108
- Popover: v,
109
- Menu: D,
110
- Section: x,
111
- SectionHeader: g,
112
- Item: w,
113
- Separator: M,
114
- DotsButton: k
134
+ ), H = {
135
+ Root: N,
136
+ Popover: _,
137
+ Menu: E,
138
+ Section: y,
139
+ SectionHeader: p,
140
+ Item: D,
141
+ Separator: k,
142
+ DotsButton: P
115
143
  };
116
144
  export {
117
- S as Dropdown
145
+ H as Dropdown,
146
+ S as isNestedOverlayElement
118
147
  };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown.nestedOverlay.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.nestedOverlay.test.d.ts","sourceRoot":"","sources":["../../../src/primitives/dropdown/dropdown.nestedOverlay.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { cx as m } from "class-variance-authority";
2
+ import { cx as m } from "../../utils/cn.js";
3
3
  import { Text as s } from "react-aria-components";
4
4
  const i = {
5
5
  sm: "text-[11px]",
@@ -27,8 +27,12 @@ export interface TooltipProps extends AriaTooltipTriggerComponentProps, Omit<Ari
27
27
  * @default true
28
28
  */
29
29
  isHoverable?: boolean;
30
+ /**
31
+ * Optional class names for the inner tooltip content container.
32
+ */
33
+ contentClassName?: string;
30
34
  }
31
- export declare const Tooltip: ({ title, description, children, arrow, isHoverable, delay, closeDelay, trigger, isDisabled, isOpen, defaultOpen, offset, crossOffset, placement, onOpenChange, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const Tooltip: ({ title, description, children, arrow, delay, closeDelay, trigger, isDisabled, isHoverable, contentClassName, isOpen, defaultOpen, offset, crossOffset, placement, onOpenChange, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
32
36
  export interface TooltipTriggerProps extends AriaButtonProps {
33
37
  }
34
38
  export declare const TooltipTrigger: ({ children, className, ...buttonProps }: TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,OAAO,GAAI,oMAkBrB,YAAY,4CAoFd,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,eAAe;CAAG;AAE/D,eAAO,MAAM,cAAc,GAAI,yCAI5B,mBAAmB,4CAcrB,CAAC"}
@@ -1,59 +1,60 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { TooltipTrigger as v, Tooltip as z, OverlayArrow as B, Button as N } from "react-aria-components";
2
+ import { TooltipTrigger as z, Tooltip as B, OverlayArrow as N, Button as L } from "react-aria-components";
3
3
  import { cx as s } from "../../utils/cn.js";
4
- const A = ({
4
+ const M = ({
5
5
  title: e,
6
6
  description: t,
7
7
  children: i,
8
8
  arrow: n = !1,
9
- isHoverable: p = !0,
10
- delay: c = 300,
11
- closeDelay: d = 0,
12
- trigger: f,
13
- isDisabled: g,
14
- isOpen: h,
15
- defaultOpen: u,
16
- offset: x = 6,
17
- crossOffset: b,
9
+ delay: p = 300,
10
+ closeDelay: c = 0,
11
+ trigger: d,
12
+ isDisabled: f,
13
+ isHoverable: g = !0,
14
+ contentClassName: h,
15
+ isOpen: u,
16
+ defaultOpen: x,
17
+ offset: b = 6,
18
+ crossOffset: T,
18
19
  placement: l = "top",
19
- onOpenChange: T,
20
- ...w
20
+ onOpenChange: w,
21
+ ...y
21
22
  }) => {
22
- const y = [
23
+ const O = [
23
24
  "top left",
24
25
  "top end",
25
26
  "bottom left",
26
27
  "bottom end"
27
- ].includes(l), O = [
28
+ ].includes(l), v = [
28
29
  "top right",
29
30
  "top start",
30
31
  "bottom right",
31
32
  "bottom start"
32
33
  ].includes(l);
33
34
  return /* @__PURE__ */ m(
34
- v,
35
+ z,
35
36
  {
36
- trigger: f,
37
- delay: c,
38
- closeDelay: d,
39
- isDisabled: g,
40
- isOpen: h,
41
- defaultOpen: u,
42
- onOpenChange: T,
37
+ trigger: d,
38
+ delay: p,
39
+ closeDelay: c,
40
+ isDisabled: f,
41
+ isOpen: u,
42
+ defaultOpen: x,
43
+ onOpenChange: w,
43
44
  children: [
44
45
  i,
45
46
  /* @__PURE__ */ o(
46
- z,
47
+ B,
47
48
  {
48
- ...w,
49
- offset: x,
49
+ ...y,
50
+ offset: b,
50
51
  placement: l,
51
- crossOffset: b ?? (y ? -12 : O ? 12 : 0),
52
+ crossOffset: T ?? (O ? -12 : v ? 12 : 0),
52
53
  className: ({ isEntering: r, isExiting: a }) => s(
53
54
  r && "ease-out animate-in",
54
55
  a && "ease-in animate-out",
55
56
  !e && "hidden",
56
- !p && "pointer-events-none"
57
+ !g && "pointer-events-none"
57
58
  ),
58
59
  children: ({ isEntering: r, isExiting: a }) => /* @__PURE__ */ m(
59
60
  "div",
@@ -61,13 +62,14 @@ const A = ({
61
62
  className: s(
62
63
  "z-50 flex max-w-xs origin-(--trigger-anchor-point) flex-col items-start gap-1 rounded-lg bg-primary-solid px-3 shadow-lg will-change-transform",
63
64
  t ? "py-3" : "py-2",
65
+ h,
64
66
  r && "ease-out animate-in fade-in zoom-in-95 in-placement-left:slide-in-from-right-0.5 in-placement-right:slide-in-from-left-0.5 in-placement-top:slide-in-from-bottom-0.5 in-placement-bottom:slide-in-from-top-0.5",
65
67
  a && "ease-in animate-out fade-out zoom-out-95 in-placement-left:slide-out-to-right-0.5 in-placement-right:slide-out-to-left-0.5 in-placement-top:slide-out-to-bottom-0.5 in-placement-bottom:slide-out-to-top-0.5"
66
68
  ),
67
69
  children: [
68
70
  /* @__PURE__ */ o("span", { className: "text-xs font-semibold text-white", children: e }),
69
71
  t && /* @__PURE__ */ o("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: t }),
70
- n && /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
72
+ n && /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(
71
73
  "svg",
72
74
  {
73
75
  viewBox: "0 0 100 100",
@@ -83,12 +85,12 @@ const A = ({
83
85
  ]
84
86
  }
85
87
  );
86
- }, M = ({
88
+ }, Q = ({
87
89
  children: e,
88
90
  className: t,
89
91
  ...i
90
92
  }) => /* @__PURE__ */ o(
91
- N,
93
+ L,
92
94
  {
93
95
  ...i,
94
96
  className: (n) => s(
@@ -99,6 +101,6 @@ const A = ({
99
101
  }
100
102
  );
101
103
  export {
102
- A as Tooltip,
103
- M as TooltipTrigger
104
+ M as Tooltip,
105
+ Q as TooltipTrigger
104
106
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pibit.ai/cure-design-system",
3
- "version": "0.3.50",
3
+ "version": "0.3.54",
4
4
  "description": "CURE Design System - React component library",
5
5
  "author": "Pibit",
6
6
  "license": "MIT",
@@ -47,10 +47,6 @@
47
47
  "import": "./dist/patterns/*/index.js",
48
48
  "types": "./dist/patterns/*/index.d.ts"
49
49
  },
50
- "./applications/*": {
51
- "import": "./dist/applications/*/index.js",
52
- "types": "./dist/applications/*/index.d.ts"
53
- },
54
50
  "./complex/*": {
55
51
  "import": "./dist/complex/*/index.js",
56
52
  "types": "./dist/complex/*/index.d.ts"
@@ -76,7 +72,8 @@
76
72
  "lint": "eslint . --ext ts,tsx",
77
73
  "storybook": "storybook dev -p 6006",
78
74
  "build-storybook": "storybook build",
79
- "test": "vitest"
75
+ "test": "vitest",
76
+ "check:exports": "node scripts/check-exports.mjs"
80
77
  },
81
78
  "peerDependencies": {
82
79
  "react": "^18.0.0 || ^19.0.0",