@pibit.ai/cure-design-system 0.6.51 → 0.6.52
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.
- package/dist/_virtual/index.js +3 -2
- package/dist/_virtual/index2.js +5 -3
- package/dist/_virtual/index3.js +2 -5
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/patterns/filters/status-filter-dropdown.d.ts.map +1 -1
- package/dist/patterns/filters/status-filter-dropdown.js +73 -65
- package/package.json +1 -1
package/dist/_virtual/index.js
CHANGED
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as t } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as e } from "../node_modules/eventemitter3/index2.js";
|
|
3
|
+
var r = e();
|
|
4
|
+
const i = /* @__PURE__ */ t(r);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
i as default
|
|
5
7
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as e } from "../node_modules/eventemitter3/index2.js";
|
|
3
|
-
var r = e();
|
|
4
|
-
const i = /* @__PURE__ */ t(r);
|
|
1
|
+
var e = { exports: {} };
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
e as __module
|
|
7
4
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Children as p } from "react";
|
|
2
|
-
import { r as y } from "../../../../_virtual/
|
|
2
|
+
import { r as y } from "../../../../_virtual/index.js";
|
|
3
3
|
import { isNullish as m } from "./DataUtils.js";
|
|
4
4
|
import { get as f } from "../../../es-toolkit/dist/compat/object/get.js";
|
|
5
5
|
var u = (r) => typeof r == "string" ? r : r ? r.displayName || r.name || "Component" : "", l = null, n = null, o = (r) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../_virtual/
|
|
1
|
+
import { __module as r } from "../../../_virtual/index4.js";
|
|
2
2
|
import { __require as o } from "../cjs/use-sync-external-store-shim.production.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.development.js";
|
|
4
4
|
var e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-filter-dropdown.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/status-filter-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"status-filter-dropdown.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/status-filter-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAiBnE,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yFAAyF;IACzF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yFAAyF;IACzF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,KAAK,iCAAiC,GAAG,uBAAuB,GAAG;IACjE,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,oBAAoB,EAAE,aAAa,CAAC;IACpC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,2GAA2G;IAC3G,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,KAAK,+BAA+B,GAAG,uBAAuB,GAAG;IAC/D,aAAa,EAAE,QAAQ,CAAC;IACxB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GACjC,iCAAiC,GACjC,+BAA+B,CAAC;AAqBpC,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA0Q9D,CAAC"}
|
|
@@ -1,72 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { cx as
|
|
1
|
+
import { jsx as n, jsxs as s, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as S, useState as I, useLayoutEffect as D } from "react";
|
|
3
|
+
import { ChevronDown as P, MinusSquare as $ } from "@untitledui/icons";
|
|
4
|
+
import { cx as U } from "../../utils/cn.js";
|
|
5
5
|
import { Dropdown as p } from "../../primitives/dropdown/dropdown.js";
|
|
6
6
|
import { Button as y } from "../../primitives/button/button.js";
|
|
7
|
-
import { RadioButtonBase as
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { RadioButtonBase as W } from "../../primitives/radio/radio.js";
|
|
8
|
+
import { EllipsisContentWithTooltip as G } from "../../primitives/tooltip/ellipsis-content.js";
|
|
9
|
+
import { CheckboxBase as J } from "../../primitives/checkbox/checkbox.js";
|
|
10
|
+
const N = ({ isSelected: t }) => /* @__PURE__ */ n("div", { className: "pointer-events-none", "aria-hidden": !0, children: /* @__PURE__ */ n(J, { isSelected: t }) }), A = ({ label: t }) => /* @__PURE__ */ n(
|
|
11
|
+
G,
|
|
12
|
+
{
|
|
13
|
+
content: t,
|
|
14
|
+
className: "min-w-0 flex-1",
|
|
15
|
+
tooltipClassName: "z-[100001]"
|
|
16
|
+
}
|
|
17
|
+
), oe = (t) => {
|
|
10
18
|
const {
|
|
11
19
|
isOpen: u,
|
|
12
|
-
onOpenChange:
|
|
13
|
-
onApply:
|
|
14
|
-
onReset:
|
|
15
|
-
className:
|
|
20
|
+
onOpenChange: F,
|
|
21
|
+
onApply: R,
|
|
22
|
+
onReset: V,
|
|
23
|
+
className: z,
|
|
16
24
|
buttonLabel: d = "Status",
|
|
17
25
|
isDisabled: M = !1,
|
|
18
|
-
isApplyDisabled:
|
|
19
|
-
isResetDisabled:
|
|
26
|
+
isApplyDisabled: T,
|
|
27
|
+
isResetDisabled: E
|
|
20
28
|
} = t, i = t.selectionMode === "single", o = i ? t.options : t.statusOptions, a = (o == null ? void 0 : o.length) ?? 0, f = i ? 0 : Object.entries(t.appliedStatusFilters).filter(
|
|
21
|
-
([e,
|
|
22
|
-
).length,
|
|
29
|
+
([e, l]) => e !== "all" && l
|
|
30
|
+
).length, L = !i && t.defaultSelectAll === !0, H = (() => {
|
|
23
31
|
if (i) {
|
|
24
32
|
const e = t.defaultValue ?? "all";
|
|
25
33
|
return t.value !== e;
|
|
26
34
|
}
|
|
27
|
-
return a === 0 ? !1 :
|
|
35
|
+
return a === 0 ? !1 : L ? f < a : f > 0;
|
|
28
36
|
})(), m = i ? 0 : Object.entries(t.statusFilters).filter(
|
|
29
|
-
([e,
|
|
30
|
-
).length,
|
|
31
|
-
var
|
|
37
|
+
([e, l]) => e !== "all" && l
|
|
38
|
+
).length, b = m === a && a > 0, g = m > 0 && m < a, O = (() => {
|
|
39
|
+
var l;
|
|
32
40
|
if (!i)
|
|
33
41
|
return !(f === a && a > 0) && f > 0 ? `${d} ${f} selected` : d;
|
|
34
42
|
const e = t.defaultValue ?? "all";
|
|
35
|
-
return t.value === e ? d : ((
|
|
36
|
-
})(), h =
|
|
43
|
+
return t.value === e ? d : ((l = o.find((c) => c.key === t.value)) == null ? void 0 : l.label) ?? d;
|
|
44
|
+
})(), h = S(null), v = S(0), [j, B] = I(
|
|
37
45
|
() => typeof window > "u" ? 400 : Math.round(window.innerHeight * 0.5)
|
|
38
|
-
),
|
|
46
|
+
), K = i ? t.pendingValue : t.statusFilters;
|
|
39
47
|
return D(() => {
|
|
40
48
|
if (!u) return;
|
|
41
49
|
const e = () => {
|
|
42
|
-
|
|
50
|
+
B(Math.round(window.innerHeight * 0.5));
|
|
43
51
|
};
|
|
44
52
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
45
53
|
}, [u]), D(() => {
|
|
46
54
|
const e = () => {
|
|
47
|
-
h.current && (h.current.scrollTop =
|
|
55
|
+
h.current && (h.current.scrollTop = v.current);
|
|
48
56
|
};
|
|
49
57
|
e();
|
|
50
|
-
const
|
|
51
|
-
return () => cancelAnimationFrame(
|
|
52
|
-
}, [
|
|
53
|
-
/* @__PURE__ */
|
|
58
|
+
const l = requestAnimationFrame(e);
|
|
59
|
+
return () => cancelAnimationFrame(l);
|
|
60
|
+
}, [K]), /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ s(p.Root, { isOpen: u, onOpenChange: F, children: [
|
|
61
|
+
/* @__PURE__ */ n(
|
|
54
62
|
y,
|
|
55
63
|
{
|
|
56
64
|
size: "xs",
|
|
57
65
|
color: "secondary",
|
|
58
|
-
iconTrailing: /* @__PURE__ */
|
|
59
|
-
className:
|
|
66
|
+
iconTrailing: /* @__PURE__ */ n(P, { size: 12 }),
|
|
67
|
+
className: U(
|
|
60
68
|
"relative",
|
|
61
69
|
H && !u && "ring-1 ring-brand-600 bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600",
|
|
62
|
-
|
|
70
|
+
z,
|
|
63
71
|
u && "shadow-[0_0_0_4px_rgba(102,112,133,0.14)]"
|
|
64
72
|
),
|
|
65
73
|
isDisabled: M,
|
|
66
|
-
children:
|
|
74
|
+
children: O
|
|
67
75
|
}
|
|
68
76
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ n(
|
|
70
78
|
p.Popover,
|
|
71
79
|
{
|
|
72
80
|
className: "overflow-hidden",
|
|
@@ -74,59 +82,59 @@ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
|
|
|
74
82
|
maxHeight: j,
|
|
75
83
|
scrollRef: h,
|
|
76
84
|
children: /* @__PURE__ */ s("div", { className: "flex max-h-[50vh] flex-col overflow-hidden text-secondary text-xs", children: [
|
|
77
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ n(
|
|
78
86
|
"div",
|
|
79
87
|
{
|
|
80
88
|
ref: h,
|
|
81
|
-
className: "min-h-0 flex-1 space-y-3 overflow-y-auto p-3",
|
|
89
|
+
className: "min-h-0 flex-1 space-y-3 overflow-x-hidden overflow-y-auto p-3",
|
|
82
90
|
role: i ? "radiogroup" : void 0,
|
|
83
91
|
"aria-label": i ? d : void 0,
|
|
84
92
|
onScroll: (e) => {
|
|
85
|
-
|
|
93
|
+
v.current = e.currentTarget.scrollTop;
|
|
86
94
|
},
|
|
87
|
-
children: i ? o.map((e,
|
|
88
|
-
const c = t.pendingValue === e.key,
|
|
95
|
+
children: i ? o.map((e, l) => {
|
|
96
|
+
const c = t.pendingValue === e.key, _ = o.some((r) => r.key === t.pendingValue);
|
|
89
97
|
return /* @__PURE__ */ s(
|
|
90
98
|
"div",
|
|
91
99
|
{
|
|
92
100
|
role: "radio",
|
|
93
101
|
"aria-checked": c,
|
|
94
|
-
tabIndex: c || !
|
|
102
|
+
tabIndex: c || !_ && l === 0 ? 0 : -1,
|
|
95
103
|
className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
|
|
96
104
|
onMouseDownCapture: (r) => r.preventDefault(),
|
|
97
105
|
onClick: () => t.onValueChange(e.key),
|
|
98
106
|
onKeyDown: (r) => {
|
|
99
|
-
var w,
|
|
107
|
+
var w, C;
|
|
100
108
|
if (r.key === "Enter" || r.key === " ") {
|
|
101
109
|
r.preventDefault(), t.onValueChange(e.key);
|
|
102
110
|
return;
|
|
103
111
|
}
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
112
|
+
const k = r.key === "ArrowDown" || r.key === "ArrowRight" ? 1 : r.key === "ArrowUp" || r.key === "ArrowLeft" ? -1 : 0;
|
|
113
|
+
if (!k) return;
|
|
106
114
|
r.preventDefault();
|
|
107
|
-
const x = (
|
|
108
|
-
t.onValueChange(o[x].key), (
|
|
115
|
+
const x = (l + k + o.length) % o.length;
|
|
116
|
+
t.onValueChange(o[x].key), (C = (w = h.current) == null ? void 0 : w.querySelectorAll('[role="radio"]')[x]) == null || C.focus();
|
|
109
117
|
},
|
|
110
118
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
|
|
119
|
+
/* @__PURE__ */ n("div", { className: "pointer-events-none", children: /* @__PURE__ */ n(
|
|
120
|
+
W,
|
|
113
121
|
{
|
|
114
122
|
size: "sm",
|
|
115
123
|
isSelected: c,
|
|
116
124
|
"aria-hidden": !0
|
|
117
125
|
}
|
|
118
126
|
) }),
|
|
119
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ n(A, { label: e.label })
|
|
120
128
|
]
|
|
121
129
|
},
|
|
122
130
|
e.key
|
|
123
131
|
);
|
|
124
|
-
}) : /* @__PURE__ */ s(
|
|
132
|
+
}) : /* @__PURE__ */ s(q, { children: [
|
|
125
133
|
/* @__PURE__ */ s(
|
|
126
134
|
"div",
|
|
127
135
|
{
|
|
128
136
|
role: "checkbox",
|
|
129
|
-
"aria-checked":
|
|
137
|
+
"aria-checked": g ? "mixed" : b,
|
|
130
138
|
tabIndex: 0,
|
|
131
139
|
className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
|
|
132
140
|
onMouseDownCapture: (e) => e.preventDefault(),
|
|
@@ -135,15 +143,15 @@ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
|
|
|
135
143
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t.onStatusChange("all"));
|
|
136
144
|
},
|
|
137
145
|
children: [
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
g ? /* @__PURE__ */ n(
|
|
147
|
+
$,
|
|
140
148
|
{
|
|
141
149
|
size: 18,
|
|
142
150
|
className: "text-utility-brand-600",
|
|
143
151
|
"aria-hidden": !0
|
|
144
152
|
}
|
|
145
|
-
) : /* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
153
|
+
) : /* @__PURE__ */ n(N, { isSelected: b }),
|
|
154
|
+
/* @__PURE__ */ n("span", { children: "All" })
|
|
147
155
|
]
|
|
148
156
|
}
|
|
149
157
|
),
|
|
@@ -154,19 +162,19 @@ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
|
|
|
154
162
|
"aria-checked": t.statusFilters[e.key],
|
|
155
163
|
tabIndex: 0,
|
|
156
164
|
className: "flex cursor-pointer items-center gap-3 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
|
|
157
|
-
onMouseDownCapture: (
|
|
165
|
+
onMouseDownCapture: (l) => l.preventDefault(),
|
|
158
166
|
onClick: () => t.onStatusChange(e.key),
|
|
159
|
-
onKeyDown: (
|
|
160
|
-
(
|
|
167
|
+
onKeyDown: (l) => {
|
|
168
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), t.onStatusChange(e.key));
|
|
161
169
|
},
|
|
162
170
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ n(
|
|
164
172
|
N,
|
|
165
173
|
{
|
|
166
174
|
isSelected: t.statusFilters[e.key]
|
|
167
175
|
}
|
|
168
176
|
),
|
|
169
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ n(A, { label: e.label })
|
|
170
178
|
]
|
|
171
179
|
},
|
|
172
180
|
e.key
|
|
@@ -175,25 +183,25 @@ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
|
|
|
175
183
|
}
|
|
176
184
|
),
|
|
177
185
|
/* @__PURE__ */ s("div", { className: "flex shrink-0 justify-end gap-2 bg-primary p-3", children: [
|
|
178
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ n(
|
|
179
187
|
y,
|
|
180
188
|
{
|
|
181
189
|
size: "xs",
|
|
182
190
|
color: "secondary",
|
|
183
191
|
className: "flex-1 p-2",
|
|
184
|
-
onClick:
|
|
185
|
-
isDisabled:
|
|
192
|
+
onClick: V,
|
|
193
|
+
isDisabled: E,
|
|
186
194
|
children: "Reset"
|
|
187
195
|
}
|
|
188
196
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ n(
|
|
190
198
|
y,
|
|
191
199
|
{
|
|
192
200
|
size: "xs",
|
|
193
201
|
color: "primary",
|
|
194
202
|
className: "flex-1 p-2",
|
|
195
|
-
onClick:
|
|
196
|
-
isDisabled:
|
|
203
|
+
onClick: R,
|
|
204
|
+
isDisabled: T,
|
|
197
205
|
children: "Apply"
|
|
198
206
|
}
|
|
199
207
|
)
|
|
@@ -204,5 +212,5 @@ const N = ({ isSelected: t }) => /* @__PURE__ */ l("div", { className: "pointer-
|
|
|
204
212
|
] }) });
|
|
205
213
|
};
|
|
206
214
|
export {
|
|
207
|
-
|
|
215
|
+
oe as StatusFilterDropdown
|
|
208
216
|
};
|