docthub-core-components 3.0.0 → 3.1.0
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/components/overrides/ui/auto-complete.js +466 -0
- package/dist/components/overrides/ui/autocomplete-checkbox.js +480 -0
- package/dist/components/overrides/ui/chips/doct-chip.js +157 -0
- package/dist/components/overrides/ui/circular-progress.js +32 -0
- package/dist/components/overrides/ui/composed/address-form-section.js +67 -0
- package/dist/components/overrides/ui/composed/contact-form-section.js +56 -0
- package/dist/components/overrides/ui/composed/search-filter-section.js +132 -0
- package/dist/components/overrides/ui/composed/user-registration-section.js +77 -0
- package/dist/components/overrides/ui/currencyInput/currency-input.js +69 -0
- package/dist/components/overrides/ui/doct-animation-loader.js +13 -0
- package/dist/components/overrides/ui/expandable-card.js +115 -0
- package/dist/components/overrides/ui/footer/doct-footer.js +35 -0
- package/dist/components/overrides/ui/footer/footer-desktop.js +92 -0
- package/dist/components/overrides/ui/footer/footer-mobile.js +123 -0
- package/dist/components/overrides/ui/footer/footer-routes.js +87 -0
- package/dist/components/overrides/ui/footer/footer-shared.js +137 -0
- package/dist/components/overrides/ui/footer/presets.js +269 -0
- package/dist/components/overrides/ui/inputs/labeled-input.js +92 -0
- package/dist/components/overrides/ui/inputs/otp-input.js +101 -0
- package/dist/components/overrides/ui/inputs/password-input.js +77 -0
- package/dist/components/overrides/ui/inputs/phone-input.js +336 -0
- package/dist/components/overrides/ui/navigation-menu/doct-navigation-menu.js +22 -0
- package/dist/components/overrides/ui/navigation-menu/individual-nav-routes.js +46 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/nav-env.js +64 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-adapter.js +55 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-internal.js +36 -0
- package/dist/components/overrides/ui/navigation-menu/organization-nav-routes.js +34 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/presets.js +238 -0
- package/dist/components/overrides/ui/navigation-menu/types.js +6 -0
- package/dist/components/overrides/ui/pickers/date-picker-field.js +361 -0
- package/dist/components/overrides/ui/pickers/date-range-picker-field.js +288 -0
- package/dist/components/overrides/ui/pickers/day-picker-bounds.js +38 -0
- package/dist/components/overrides/ui/pickers/select-field.js +158 -0
- package/dist/components/overrides/ui/search/auto-complete.js +64 -0
- package/dist/components/overrides/ui/search/search-input.js +65 -0
- package/dist/components/overrides/ui/showcase/component-section.js +45 -0
- package/dist/components/ui/alert.js +94 -0
- package/dist/components/ui/avatar.js +69 -0
- package/dist/components/ui/badge.js +37 -0
- package/dist/components/ui/breadcrumb.js +117 -0
- package/dist/components/ui/button.js +223 -0
- package/dist/components/ui/calendar.js +100 -0
- package/dist/components/ui/checkbox.js +57 -0
- package/dist/components/ui/collapsible.js +25 -0
- package/dist/components/ui/command.js +132 -0
- package/dist/components/ui/dialog.js +230 -0
- package/dist/components/ui/drawer.js +119 -0
- package/dist/components/ui/dropdown-menu.js +216 -0
- package/dist/components/ui/input.js +48 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/popover.js +181 -0
- package/dist/components/ui/progress.js +91 -0
- package/dist/components/ui/radio-group.js +49 -0
- package/dist/components/ui/select.js +169 -0
- package/dist/components/ui/skeleton.js +91 -0
- package/dist/components/ui/spinner.js +32 -0
- package/dist/components/ui/tabs.js +68 -0
- package/dist/components/ui/textarea.js +73 -0
- package/dist/components/ui/timeline.js +177 -0
- package/dist/components/ui/toast.js +82 -0
- package/dist/components/ui/tooltip.js +91 -0
- package/dist/components/ui/typography.js +213 -0
- package/dist/hooks/use-exclusive-dropdown.js +53 -0
- package/dist/hooks/use-mobile.js +19 -0
- package/dist/hooks/useAutocompleteCheckbox.js +204 -0
- package/dist/index.js +187 -0
- package/dist/lib/dropdown-manager.js +17 -0
- package/dist/lib/get-floating-dropdown-position.js +32 -0
- package/dist/lib/get-scroll-parents.js +20 -0
- package/dist/lib/slot.js +40 -0
- package/dist/lib/utils.js +9 -0
- package/dist/util/getInputClasses.js +19 -0
- package/package.json +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c as D } from "react-compiler-runtime";
|
|
3
|
+
import { useState as b, useEffect as d } from "react";
|
|
4
|
+
import { openDropdown as p, releaseDropdown as u } from "../lib/dropdown-manager.js";
|
|
5
|
+
function x() {
|
|
6
|
+
const e = D(9), [f, _] = b(0);
|
|
7
|
+
let n;
|
|
8
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
|
|
9
|
+
_(C);
|
|
10
|
+
}, e[0] = n) : n = e[0];
|
|
11
|
+
const t = n;
|
|
12
|
+
let r, c;
|
|
13
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (r = () => () => {
|
|
14
|
+
u(t);
|
|
15
|
+
}, c = [t], e[1] = r, e[2] = c) : (r = e[1], c = e[2]), d(r, c);
|
|
16
|
+
let l;
|
|
17
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
|
|
18
|
+
p(t);
|
|
19
|
+
}, e[3] = l) : l = e[3];
|
|
20
|
+
const y = l;
|
|
21
|
+
let s;
|
|
22
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (s = (o) => {
|
|
23
|
+
o ? p(t) : u(t);
|
|
24
|
+
}, e[4] = s) : s = e[4];
|
|
25
|
+
const h = s;
|
|
26
|
+
let i;
|
|
27
|
+
e[5] === Symbol.for("react.memo_cache_sentinel") ? (i = (o) => {
|
|
28
|
+
(o.key === "Enter" || o.key === " " || o.key === "ArrowDown" || o.key === "ArrowUp") && p(t);
|
|
29
|
+
}, e[5] = i) : i = e[5];
|
|
30
|
+
const w = i;
|
|
31
|
+
let a;
|
|
32
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
33
|
+
style: {
|
|
34
|
+
display: "contents"
|
|
35
|
+
},
|
|
36
|
+
onPointerDownCapture: y,
|
|
37
|
+
onFocusCapture: y,
|
|
38
|
+
onKeyDownCapture: w
|
|
39
|
+
}, e[6] = a) : a = e[6];
|
|
40
|
+
const S = a;
|
|
41
|
+
let m;
|
|
42
|
+
return e[7] !== f ? (m = {
|
|
43
|
+
instanceKey: f,
|
|
44
|
+
containerProps: S,
|
|
45
|
+
onOpenChange: h
|
|
46
|
+
}, e[7] = f, e[8] = m) : m = e[8], m;
|
|
47
|
+
}
|
|
48
|
+
function C(e) {
|
|
49
|
+
return e + 1;
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
x as useExclusiveDropdown
|
|
53
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
const n = 1024;
|
|
5
|
+
function h() {
|
|
6
|
+
const e = c(2), [a, o] = r.useState(void 0);
|
|
7
|
+
let t, i;
|
|
8
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = () => {
|
|
9
|
+
if (globalThis.window === void 0)
|
|
10
|
+
return;
|
|
11
|
+
const s = globalThis.window.matchMedia(`(max-width: ${n - 1}px)`), l = () => {
|
|
12
|
+
o(globalThis.window.innerWidth < n);
|
|
13
|
+
};
|
|
14
|
+
return s.addEventListener("change", l), o(globalThis.window.innerWidth < n), () => s.removeEventListener("change", l);
|
|
15
|
+
}, i = [], e[0] = t, e[1] = i) : (t = e[0], i = e[1]), r.useEffect(t, i), !!a;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
h as useIsMobile
|
|
19
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as A, useRef as O, useMemo as U, useCallback as a, useEffect as V } from "react";
|
|
3
|
+
import { getFloatingDropdownPosition as C } from "../lib/get-floating-dropdown-position.js";
|
|
4
|
+
import { getScrollParentClipRects as ee, getScrollParents as te } from "../lib/get-scroll-parents.js";
|
|
5
|
+
const re = (r, u) => u && typeof r == "object" && r !== null ? r[u.text] : typeof r == "string" ? r : (r == null ? void 0 : r.label) || "", se = (r, u) => u && typeof r == "object" && r !== null ? r[u.value] : typeof r == "string" ? r : (r == null ? void 0 : r.value) || r, ce = (r, u, o, s) => o(r, s) === o(u, s), K = (r) => {
|
|
6
|
+
if (r == null) return "";
|
|
7
|
+
try {
|
|
8
|
+
return String(r).toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
9
|
+
} catch {
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
}, oe = (r, u, o, s) => {
|
|
13
|
+
if (!u) return r;
|
|
14
|
+
const w = K(u);
|
|
15
|
+
return r.filter((P) => {
|
|
16
|
+
const R = o(P, s);
|
|
17
|
+
return K(R).includes(w);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
function ue({
|
|
21
|
+
// Core props
|
|
22
|
+
options: r = [],
|
|
23
|
+
value: u = [],
|
|
24
|
+
onChange: o,
|
|
25
|
+
onInputChange: s,
|
|
26
|
+
// Behavior props
|
|
27
|
+
disabled: w = !1,
|
|
28
|
+
disableCloseOnSelect: P = !0,
|
|
29
|
+
freeSolo: R,
|
|
30
|
+
// Advanced props
|
|
31
|
+
fields: p,
|
|
32
|
+
getOptionLabel: z = (c) => re(c, p),
|
|
33
|
+
getOptionValue: q = (c) => se(c, p),
|
|
34
|
+
isOptionEqualToValue: G,
|
|
35
|
+
filterOptions: g
|
|
36
|
+
}) {
|
|
37
|
+
const [c, d] = A(!1), [i, b] = A(""), [x, S] = A(-1), [, k] = A(!1), [M, J] = A({
|
|
38
|
+
top: 0,
|
|
39
|
+
left: 0,
|
|
40
|
+
width: 0,
|
|
41
|
+
maxHeight: 0,
|
|
42
|
+
placement: "bottom"
|
|
43
|
+
}), T = O(null), j = O(null), L = O(null), H = O(null), B = O(!1), y = U(() => G || ((e, t) => ce(e, t, q, p)), [G, q, p]), N = a((e) => {
|
|
44
|
+
try {
|
|
45
|
+
return z(e);
|
|
46
|
+
} catch {
|
|
47
|
+
return String(e);
|
|
48
|
+
}
|
|
49
|
+
}, [z]), E = U(() => u ?? [], [u]), v = r ?? [], D = U(() => {
|
|
50
|
+
const e = v;
|
|
51
|
+
if (g)
|
|
52
|
+
return g(e, {
|
|
53
|
+
inputValue: i
|
|
54
|
+
});
|
|
55
|
+
const t = oe(e, i, z, p);
|
|
56
|
+
if (R && i && i.trim() !== "")
|
|
57
|
+
if (v.length === 0 || v.every((l) => typeof l == "string")) {
|
|
58
|
+
if (!t.some((n) => N(n).toLowerCase() === i.toLowerCase()))
|
|
59
|
+
return [...t, i];
|
|
60
|
+
} else
|
|
61
|
+
process.env.NODE_ENV !== "production" && console.warn("[useAutocompleteCheckbox] freeSolo is only supported for string types. For object types, consider using a different approach or constraining your generic to string.");
|
|
62
|
+
return t;
|
|
63
|
+
}, [v, i, g, z, p, R, N]), Q = a((e) => E.some((t) => y(e, t)), [E, y]), m = a(() => {
|
|
64
|
+
const e = H.current || L.current;
|
|
65
|
+
if (e) {
|
|
66
|
+
const t = ee(e);
|
|
67
|
+
J(C({
|
|
68
|
+
anchorRect: e.getBoundingClientRect(),
|
|
69
|
+
placement: "auto",
|
|
70
|
+
strategy: "fixed",
|
|
71
|
+
clipRects: t
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
}, []), W = a((e) => {
|
|
75
|
+
const t = e.target.value;
|
|
76
|
+
k(!0), b(t), s == null || s(e, t), !c && t && d(!0);
|
|
77
|
+
}, [c, s]), F = a((e) => {
|
|
78
|
+
if (w) return;
|
|
79
|
+
const t = E, f = t.some((n) => y(e, n));
|
|
80
|
+
let l;
|
|
81
|
+
f ? l = t.filter((n) => !y(e, n)) : l = [...t, e], o == null || o(null, l), k(!1), P || d(!1), setTimeout(() => {
|
|
82
|
+
var n;
|
|
83
|
+
(n = T.current) == null || n.focus();
|
|
84
|
+
}, 0), S(-1);
|
|
85
|
+
}, [w, E, y, o, P]), X = a((e) => {
|
|
86
|
+
if (w) return;
|
|
87
|
+
const t = E.filter((f) => !y(e, f));
|
|
88
|
+
o == null || o(null, t);
|
|
89
|
+
}, [w, E, y, o]), Y = a((e) => {
|
|
90
|
+
e.stopPropagation(), b(""), k(!1), s == null || s({
|
|
91
|
+
target: {
|
|
92
|
+
value: ""
|
|
93
|
+
}
|
|
94
|
+
}, ""), setTimeout(() => {
|
|
95
|
+
T.current && (T.current.value = "", T.current.focus());
|
|
96
|
+
}, 0), d(!1);
|
|
97
|
+
}, [s]), Z = a(() => {
|
|
98
|
+
w || (o == null || o(null, []), b(""));
|
|
99
|
+
}, [w, o]), $ = a((e) => {
|
|
100
|
+
if (!c && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
101
|
+
d(!0);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (c)
|
|
105
|
+
switch (e.key) {
|
|
106
|
+
case "ArrowDown":
|
|
107
|
+
e.preventDefault(), S((t) => t < D.length - 1 ? t + 1 : 0);
|
|
108
|
+
break;
|
|
109
|
+
case "ArrowUp":
|
|
110
|
+
e.preventDefault(), S((t) => t > 0 ? t - 1 : D.length - 1);
|
|
111
|
+
break;
|
|
112
|
+
case "Enter":
|
|
113
|
+
e.preventDefault(), x >= 0 && D[x] ? F(D[x]) : R && i && (v.length === 0 || v.every((f) => typeof f == "string") ? F(i) : process.env.NODE_ENV !== "production" && console.warn("[useAutocompleteCheckbox] freeSolo Enter key is only supported for string types. For object types, consider using a different approach or constraining your generic to string."));
|
|
114
|
+
break;
|
|
115
|
+
case "Escape":
|
|
116
|
+
d(!1), S(-1);
|
|
117
|
+
break;
|
|
118
|
+
case "Tab":
|
|
119
|
+
d(!1);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}, [c, D, x, F, R, i, v]), _ = a(() => {
|
|
123
|
+
c || i === "" && (s == null || s({
|
|
124
|
+
target: {
|
|
125
|
+
value: ""
|
|
126
|
+
}
|
|
127
|
+
}, "")), d(!c);
|
|
128
|
+
}, [c, i, s]), h = a(() => {
|
|
129
|
+
m(), d(!0), k(!1);
|
|
130
|
+
}, [m]);
|
|
131
|
+
return V(() => {
|
|
132
|
+
B.current && !c && (b(""), k(!1), s == null || s({
|
|
133
|
+
target: {
|
|
134
|
+
value: ""
|
|
135
|
+
}
|
|
136
|
+
}, "")), B.current = c;
|
|
137
|
+
}, [c, s]), V(() => {
|
|
138
|
+
if (!(c || i !== "")) return;
|
|
139
|
+
const t = (f) => {
|
|
140
|
+
const l = f.target, n = L.current ? !L.current.contains(l) : !0, I = j.current ? !j.current.contains(l) : !0;
|
|
141
|
+
n && I && (d(!1), b(""), k(!1), s == null || s({
|
|
142
|
+
target: {
|
|
143
|
+
value: ""
|
|
144
|
+
}
|
|
145
|
+
}, ""));
|
|
146
|
+
};
|
|
147
|
+
return typeof window < "u" && document.addEventListener("pointerdown", t, !0), () => {
|
|
148
|
+
typeof window < "u" && document.removeEventListener("pointerdown", t, !0);
|
|
149
|
+
};
|
|
150
|
+
}, [c, i, s]), V(() => {
|
|
151
|
+
c && (m(), requestAnimationFrame(() => {
|
|
152
|
+
m();
|
|
153
|
+
}));
|
|
154
|
+
}, [c, m]), V(() => {
|
|
155
|
+
if (!c || typeof window > "u") return;
|
|
156
|
+
const e = () => {
|
|
157
|
+
m();
|
|
158
|
+
}, t = H.current ?? L.current, f = te(t), l = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
|
|
159
|
+
m();
|
|
160
|
+
});
|
|
161
|
+
return l == null || l.observe(t ?? document.body), f.forEach((n) => {
|
|
162
|
+
n.addEventListener("scroll", e, {
|
|
163
|
+
passive: !0
|
|
164
|
+
});
|
|
165
|
+
}), window.addEventListener("resize", e), () => {
|
|
166
|
+
l == null || l.disconnect(), f.forEach((n) => {
|
|
167
|
+
n.removeEventListener("scroll", e);
|
|
168
|
+
}), window.removeEventListener("resize", e);
|
|
169
|
+
};
|
|
170
|
+
}, [c, m]), {
|
|
171
|
+
// State
|
|
172
|
+
open: c,
|
|
173
|
+
inputValue: i,
|
|
174
|
+
highlightedIndex: x,
|
|
175
|
+
filteredOptions: D,
|
|
176
|
+
selectedOptions: E,
|
|
177
|
+
dropdownPosition: M,
|
|
178
|
+
// Refs
|
|
179
|
+
inputRef: T,
|
|
180
|
+
listRef: j,
|
|
181
|
+
containerRef: L,
|
|
182
|
+
triggerRef: H,
|
|
183
|
+
// Actions
|
|
184
|
+
setOpen: d,
|
|
185
|
+
setInputValue: b,
|
|
186
|
+
setHighlightedIndex: S,
|
|
187
|
+
handleInputChange: W,
|
|
188
|
+
handleOptionSelect: F,
|
|
189
|
+
handleTagRemove: X,
|
|
190
|
+
handleClear: Y,
|
|
191
|
+
handleClearAll: Z,
|
|
192
|
+
handleKeyDown: $,
|
|
193
|
+
handleToggle: _,
|
|
194
|
+
handleFocus: h,
|
|
195
|
+
updateDropdownPosition: m,
|
|
196
|
+
// Utilities
|
|
197
|
+
isOptionSelected: Q,
|
|
198
|
+
getOptionLabelSafe: N,
|
|
199
|
+
memoizedIsOptionEqualToValue: y
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export {
|
|
203
|
+
ue as useAutocompleteCheckbox
|
|
204
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { DoctAutocomplete as t } from "./components/overrides/ui/auto-complete.js";
|
|
4
|
+
import { AutocompleteCheckbox as D } from "./components/overrides/ui/autocomplete-checkbox.js";
|
|
5
|
+
import { Chip as c } from "./components/overrides/ui/chips/doct-chip.js";
|
|
6
|
+
import { CircularProgress as s } from "./components/overrides/ui/circular-progress.js";
|
|
7
|
+
import { AddressFormSection as m } from "./components/overrides/ui/composed/address-form-section.js";
|
|
8
|
+
import { ContactFormSection as d } from "./components/overrides/ui/composed/contact-form-section.js";
|
|
9
|
+
import { SearchFilterSection as g } from "./components/overrides/ui/composed/search-filter-section.js";
|
|
10
|
+
import { UserRegistrationSection as x } from "./components/overrides/ui/composed/user-registration-section.js";
|
|
11
|
+
import { CurrencyInput as T } from "./components/overrides/ui/currencyInput/currency-input.js";
|
|
12
|
+
import { DoctAnimationLoader as w } from "./components/overrides/ui/doct-animation-loader.js";
|
|
13
|
+
import { ExpandableCard as S } from "./components/overrides/ui/expandable-card.js";
|
|
14
|
+
import { LabeledInput as A } from "./components/overrides/ui/inputs/labeled-input.js";
|
|
15
|
+
import { OtpInput as M } from "./components/overrides/ui/inputs/otp-input.js";
|
|
16
|
+
import { PasswordInput as R } from "./components/overrides/ui/inputs/password-input.js";
|
|
17
|
+
import { DoctPhoneInput as h } from "./components/overrides/ui/inputs/phone-input.js";
|
|
18
|
+
import { DatePickerField as k } from "./components/overrides/ui/pickers/date-picker-field.js";
|
|
19
|
+
import { DateRangePickerField as O } from "./components/overrides/ui/pickers/date-range-picker-field.js";
|
|
20
|
+
import { SelectField as V } from "./components/overrides/ui/pickers/select-field.js";
|
|
21
|
+
import { AutoComplete as G } from "./components/overrides/ui/search/auto-complete.js";
|
|
22
|
+
import { SearchInput as y } from "./components/overrides/ui/search/search-input.js";
|
|
23
|
+
import { ComponentVariant as Q, ComponentSection as Z } from "./components/overrides/ui/showcase/component-section.js";
|
|
24
|
+
import { Alert as j, AlertDescription as q, AlertTitle as J } from "./components/ui/alert.js";
|
|
25
|
+
import { Avatar as W, AvatarFallback as X, AvatarImage as Y } from "./components/ui/avatar.js";
|
|
26
|
+
import { Badge as oo, badgeVariants as ro } from "./components/ui/badge.js";
|
|
27
|
+
import { Breadcrumb as to, BreadcrumbEllipsis as ao, BreadcrumbItem as Do, BreadcrumbLink as no, BreadcrumbList as co, BreadcrumbPage as po, BreadcrumbSeparator as so } from "./components/ui/breadcrumb.js";
|
|
28
|
+
import { DoctButton as mo } from "./components/ui/button.js";
|
|
29
|
+
import { CalendarDayButton as uo, Calendar as go } from "./components/ui/calendar.js";
|
|
30
|
+
import { Checkbox as xo } from "./components/ui/checkbox.js";
|
|
31
|
+
import { Collapsible as To, CollapsibleContent as fo, CollapsibleTrigger as wo } from "./components/ui/collapsible.js";
|
|
32
|
+
import { Command as So, CommandDialog as Po, CommandEmpty as Ao, CommandGroup as vo, CommandInput as Mo, CommandItem as No, CommandList as Ro, CommandSeparator as Bo, CommandShortcut as ho } from "./components/ui/command.js";
|
|
33
|
+
import { Dialog as ko, DialogClose as Lo, DialogContent as Oo, DialogDescription as _o, DialogFooter as Vo, DialogHeader as Eo, DialogScrollableBody as Go, DialogTitle as Uo, DialogTrigger as yo } from "./components/ui/dialog.js";
|
|
34
|
+
import { Drawer as Qo, DrawerClose as Zo, DrawerContent as zo, DrawerDescription as jo, DrawerFooter as qo, DrawerHeader as Jo, DrawerTitle as Ko, DrawerTrigger as Wo } from "./components/ui/drawer.js";
|
|
35
|
+
import { DropdownMenu as Yo, DropdownMenuCheckboxItem as $o, DropdownMenuContent as or, DropdownMenuGroup as rr, DropdownMenuItem as er, DropdownMenuLabel as tr, DropdownMenuRadioGroup as ar, DropdownMenuRadioItem as Dr, DropdownMenuSeparator as nr, DropdownMenuShortcut as cr, DropdownMenuSub as pr, DropdownMenuSubContent as sr, DropdownMenuSubTrigger as ir, DropdownMenuTrigger as mr } from "./components/ui/dropdown-menu.js";
|
|
36
|
+
import { Input as dr } from "./components/ui/input.js";
|
|
37
|
+
import { Label as gr } from "./components/ui/label.js";
|
|
38
|
+
import { Popover as xr, PopoverArrow as br, PopoverBackdrop as Tr, PopoverClose as fr, PopoverContent as wr, PopoverDescription as Ir, PopoverHeader as Sr, PopoverTitle as Pr, PopoverTrigger as Ar, PopoverViewport as vr } from "./components/ui/popover.js";
|
|
39
|
+
import { Progress as Nr } from "./components/ui/progress.js";
|
|
40
|
+
import { RadioGroup as Br, RadioGroupItem as hr } from "./components/ui/radio-group.js";
|
|
41
|
+
import { Skeleton as kr } from "./components/ui/skeleton.js";
|
|
42
|
+
import { Tabs as Or, TabsContent as _r, TabsList as Vr, TabsTrigger as Er } from "./components/ui/tabs.js";
|
|
43
|
+
import { Textarea as Ur } from "./components/ui/textarea.js";
|
|
44
|
+
import { Timeline as Hr } from "./components/ui/timeline.js";
|
|
45
|
+
import { toast as Zr, Toaster as zr } from "./components/ui/toast.js";
|
|
46
|
+
import { Tooltip as qr, TooltipContent as Jr, TooltipProvider as Kr, TooltipTrigger as Wr } from "./components/ui/tooltip.js";
|
|
47
|
+
import { DoctTypography as Yr } from "./components/ui/typography.js";
|
|
48
|
+
import { useAutocompleteCheckbox as oe } from "./hooks/useAutocompleteCheckbox.js";
|
|
49
|
+
import { DoctFooter as ee } from "./components/overrides/ui/footer/doct-footer.js";
|
|
50
|
+
import { DoctNavigationMenu as ae } from "./components/overrides/ui/navigation-menu/doct-navigation-menu.js";
|
|
51
|
+
import { INDIVIDUAL_NAV_ROUTES as ne, INDIVIDUAL_NAV_ROUTES_PROD as ce, INDIVIDUAL_NAV_ROUTES_QA as pe } from "./components/overrides/ui/navigation-menu/individual-nav-routes.js";
|
|
52
|
+
import { IndividualNavigationMenu as ie } from "./components/overrides/ui/navigation-menu/individual-navigation-menu.js";
|
|
53
|
+
import { ORGANIZATION_NAV_ROUTES as le, ORGANIZATION_NAV_ROUTES_PROD as de, ORGANIZATION_NAV_ROUTES_QA as ue } from "./components/overrides/ui/navigation-menu/organization-nav-routes.js";
|
|
54
|
+
import { OrganizationNavigationMenu as Ce } from "./components/overrides/ui/navigation-menu/organization-navigation-menu.js";
|
|
55
|
+
import { isPossiblePhoneNumber as be, isValidPhoneNumber as Te } from "react-phone-number-input";
|
|
56
|
+
import { isProdNav as we, isQaNav as Ie, resolveNavEnv as Se } from "./components/overrides/ui/navigation-menu/nav-env.js";
|
|
57
|
+
export {
|
|
58
|
+
uo as CalendarDayButton,
|
|
59
|
+
Q as ComponentVariant,
|
|
60
|
+
m as DoctAddressFormSection,
|
|
61
|
+
j as DoctAlert,
|
|
62
|
+
q as DoctAlertDescription,
|
|
63
|
+
J as DoctAlertTitle,
|
|
64
|
+
w as DoctAnimationLoader,
|
|
65
|
+
G as DoctAutoComplete,
|
|
66
|
+
t as DoctAutocomplete,
|
|
67
|
+
D as DoctAutocompleteCheckbox,
|
|
68
|
+
W as DoctAvatar,
|
|
69
|
+
X as DoctAvatarFallback,
|
|
70
|
+
Y as DoctAvatarImage,
|
|
71
|
+
oo as DoctBadge,
|
|
72
|
+
to as DoctBreadcrumb,
|
|
73
|
+
ao as DoctBreadcrumbEllipsis,
|
|
74
|
+
Do as DoctBreadcrumbItem,
|
|
75
|
+
no as DoctBreadcrumbLink,
|
|
76
|
+
co as DoctBreadcrumbList,
|
|
77
|
+
po as DoctBreadcrumbPage,
|
|
78
|
+
so as DoctBreadcrumbSeparator,
|
|
79
|
+
mo as DoctButton,
|
|
80
|
+
go as DoctCalendar,
|
|
81
|
+
xo as DoctCheckbox,
|
|
82
|
+
c as DoctChip,
|
|
83
|
+
s as DoctCircularProgress,
|
|
84
|
+
To as DoctCollapsible,
|
|
85
|
+
fo as DoctCollapsibleContent,
|
|
86
|
+
wo as DoctCollapsibleTrigger,
|
|
87
|
+
So as DoctCommand,
|
|
88
|
+
Po as DoctCommandDialog,
|
|
89
|
+
Ao as DoctCommandEmpty,
|
|
90
|
+
vo as DoctCommandGroup,
|
|
91
|
+
Mo as DoctCommandInput,
|
|
92
|
+
No as DoctCommandItem,
|
|
93
|
+
Ro as DoctCommandList,
|
|
94
|
+
Bo as DoctCommandSeparator,
|
|
95
|
+
ho as DoctCommandShortcut,
|
|
96
|
+
Z as DoctComponentSection,
|
|
97
|
+
d as DoctContactFormSection,
|
|
98
|
+
T as DoctCurrencyInput,
|
|
99
|
+
k as DoctDatePickerField,
|
|
100
|
+
O as DoctDateRangePickerField,
|
|
101
|
+
ko as DoctDialog,
|
|
102
|
+
Lo as DoctDialogClose,
|
|
103
|
+
Oo as DoctDialogContent,
|
|
104
|
+
_o as DoctDialogDescription,
|
|
105
|
+
Vo as DoctDialogFooter,
|
|
106
|
+
Eo as DoctDialogHeader,
|
|
107
|
+
Go as DoctDialogScrollableBody,
|
|
108
|
+
Uo as DoctDialogTitle,
|
|
109
|
+
yo as DoctDialogTrigger,
|
|
110
|
+
Qo as DoctDrawer,
|
|
111
|
+
Zo as DoctDrawerClose,
|
|
112
|
+
zo as DoctDrawerContent,
|
|
113
|
+
jo as DoctDrawerDescription,
|
|
114
|
+
qo as DoctDrawerFooter,
|
|
115
|
+
Jo as DoctDrawerHeader,
|
|
116
|
+
Ko as DoctDrawerTitle,
|
|
117
|
+
Wo as DoctDrawerTrigger,
|
|
118
|
+
Yo as DoctDropdownMenu,
|
|
119
|
+
$o as DoctDropdownMenuCheckboxItem,
|
|
120
|
+
or as DoctDropdownMenuContent,
|
|
121
|
+
rr as DoctDropdownMenuGroup,
|
|
122
|
+
er as DoctDropdownMenuItem,
|
|
123
|
+
tr as DoctDropdownMenuLabel,
|
|
124
|
+
ar as DoctDropdownMenuRadioGroup,
|
|
125
|
+
Dr as DoctDropdownMenuRadioItem,
|
|
126
|
+
nr as DoctDropdownMenuSeparator,
|
|
127
|
+
cr as DoctDropdownMenuShortcut,
|
|
128
|
+
pr as DoctDropdownMenuSub,
|
|
129
|
+
sr as DoctDropdownMenuSubContent,
|
|
130
|
+
ir as DoctDropdownMenuSubTrigger,
|
|
131
|
+
mr as DoctDropdownMenuTrigger,
|
|
132
|
+
S as DoctExpandableCard,
|
|
133
|
+
ee as DoctFooter,
|
|
134
|
+
dr as DoctInput,
|
|
135
|
+
gr as DoctLabel,
|
|
136
|
+
A as DoctLabeledInput,
|
|
137
|
+
ae as DoctNavigationMenu,
|
|
138
|
+
M as DoctOtpInput,
|
|
139
|
+
R as DoctPasswordInput,
|
|
140
|
+
h as DoctPhoneInput,
|
|
141
|
+
xr as DoctPopover,
|
|
142
|
+
br as DoctPopoverArrow,
|
|
143
|
+
Tr as DoctPopoverBackdrop,
|
|
144
|
+
fr as DoctPopoverClose,
|
|
145
|
+
wr as DoctPopoverContent,
|
|
146
|
+
Ir as DoctPopoverDescription,
|
|
147
|
+
Sr as DoctPopoverHeader,
|
|
148
|
+
Pr as DoctPopoverTitle,
|
|
149
|
+
Ar as DoctPopoverTrigger,
|
|
150
|
+
vr as DoctPopoverViewport,
|
|
151
|
+
Nr as DoctProgress,
|
|
152
|
+
Br as DoctRadioGroup,
|
|
153
|
+
hr as DoctRadioGroupItem,
|
|
154
|
+
g as DoctSearchFilterSection,
|
|
155
|
+
y as DoctSearchInput,
|
|
156
|
+
V as DoctSelectField,
|
|
157
|
+
kr as DoctSkeleton,
|
|
158
|
+
Or as DoctTabs,
|
|
159
|
+
_r as DoctTabsContent,
|
|
160
|
+
Vr as DoctTabsList,
|
|
161
|
+
Er as DoctTabsTrigger,
|
|
162
|
+
Ur as DoctTextareaField,
|
|
163
|
+
Hr as DoctTimeline,
|
|
164
|
+
Zr as DoctToast,
|
|
165
|
+
zr as DoctToaster,
|
|
166
|
+
qr as DoctTooltip,
|
|
167
|
+
Jr as DoctTooltipContent,
|
|
168
|
+
Kr as DoctTooltipProvider,
|
|
169
|
+
Wr as DoctTooltipTrigger,
|
|
170
|
+
Yr as DoctTypography,
|
|
171
|
+
x as DoctUserRegistrationSection,
|
|
172
|
+
ne as INDIVIDUAL_NAV_ROUTES,
|
|
173
|
+
ce as INDIVIDUAL_NAV_ROUTES_PROD,
|
|
174
|
+
pe as INDIVIDUAL_NAV_ROUTES_QA,
|
|
175
|
+
ie as IndividualNavigationMenu,
|
|
176
|
+
le as ORGANIZATION_NAV_ROUTES,
|
|
177
|
+
de as ORGANIZATION_NAV_ROUTES_PROD,
|
|
178
|
+
ue as ORGANIZATION_NAV_ROUTES_QA,
|
|
179
|
+
Ce as OrganizationNavigationMenu,
|
|
180
|
+
ro as badgeVariants,
|
|
181
|
+
be as isPossiblePhoneNumber,
|
|
182
|
+
we as isProdNav,
|
|
183
|
+
Ie as isQaNav,
|
|
184
|
+
Te as isValidPhoneNumber,
|
|
185
|
+
Se as resolveNavEnv,
|
|
186
|
+
oe as useAutocompleteCheckbox
|
|
187
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const I = ({
|
|
3
|
+
anchorRect: t,
|
|
4
|
+
strategy: M = "fixed",
|
|
5
|
+
placement: x = "auto",
|
|
6
|
+
preferredMaxHeight: f = 240,
|
|
7
|
+
gap: m = 4,
|
|
8
|
+
viewportPadding: l = 8,
|
|
9
|
+
clipRects: e = []
|
|
10
|
+
}) => {
|
|
11
|
+
const w = window.innerHeight, H = window.innerWidth, S = M === "absolute" ? window.scrollX : 0, p = M === "absolute" ? window.scrollY : 0, u = e.reduce((i, o) => Math.max(i, o.top), 0), d = e.reduce((i, o) => Math.min(i, o.bottom), w), s = e.reduce((i, o) => Math.max(i, o.left), 0), n = e.reduce((i, o) => Math.min(i, o.right), H), c = t.bottom < u || t.top > d || t.left + t.width < s || t.left > n, A = Math.max(0, d - t.bottom - l - m), B = Math.max(0, t.top - u - l - m), C = Math.max(0, w - t.bottom - l - m), L = Math.max(0, t.top - l - m), W = Math.min(f, 160), a = x === "auto" ? A >= W || A >= B ? "bottom" : "top" : x, F = Math.max(0, Math.min(f, a === "bottom" ? C : L)), v = c ? 0 : F, X = t.left >= s && t.left + t.width <= n;
|
|
12
|
+
let h, b;
|
|
13
|
+
if (X)
|
|
14
|
+
h = t.width, b = t.left;
|
|
15
|
+
else {
|
|
16
|
+
const i = Math.max(n - s - l * 2, 0);
|
|
17
|
+
h = Math.min(t.width, i);
|
|
18
|
+
const o = s + l, Y = Math.max(o, n - l - h);
|
|
19
|
+
b = Math.min(Math.max(t.left, o), Y);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
top: a === "bottom" ? t.bottom + m + p : t.top - m - v + p,
|
|
23
|
+
left: b + S,
|
|
24
|
+
width: h,
|
|
25
|
+
maxHeight: v,
|
|
26
|
+
placement: a,
|
|
27
|
+
isAnchorClipped: c
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
I as getFloatingDropdownPosition
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const w = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), i = (o) => {
|
|
3
|
+
if (typeof window > "u")
|
|
4
|
+
return [];
|
|
5
|
+
const e = [];
|
|
6
|
+
let t = (o == null ? void 0 : o.parentElement) ?? null;
|
|
7
|
+
for (; t; ) {
|
|
8
|
+
const {
|
|
9
|
+
overflow: n,
|
|
10
|
+
overflowX: r,
|
|
11
|
+
overflowY: l
|
|
12
|
+
} = window.getComputedStyle(t);
|
|
13
|
+
[n, r, l].some((s) => w.has(s)) && e.push(t), t = t.parentElement;
|
|
14
|
+
}
|
|
15
|
+
return e.push(window), Array.from(new Set(e));
|
|
16
|
+
}, c = (o) => typeof window > "u" ? [] : i(o).filter((e) => e !== window).map((e) => e.getBoundingClientRect());
|
|
17
|
+
export {
|
|
18
|
+
c as getScrollParentClipRects,
|
|
19
|
+
i as getScrollParents
|
|
20
|
+
};
|
package/dist/lib/slot.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
const r = s.forwardRef(({
|
|
4
|
+
children: o,
|
|
5
|
+
...f
|
|
6
|
+
}, e) => {
|
|
7
|
+
if (!s.isValidElement(o))
|
|
8
|
+
return null;
|
|
9
|
+
const t = o.props, n = t.ref ?? o.ref;
|
|
10
|
+
return s.cloneElement(o, {
|
|
11
|
+
...u(f, t),
|
|
12
|
+
ref: e ? a(e, n) : n
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
r.displayName = "Slot";
|
|
16
|
+
function u(o, f) {
|
|
17
|
+
const e = {
|
|
18
|
+
...f
|
|
19
|
+
};
|
|
20
|
+
for (const t of Object.keys(o)) {
|
|
21
|
+
const n = o[t], c = f[t];
|
|
22
|
+
t === "style" ? e[t] = {
|
|
23
|
+
...c,
|
|
24
|
+
...n
|
|
25
|
+
} : t === "className" ? e[t] = [c, n].filter(Boolean).join(" ") : typeof n == "function" && typeof c == "function" ? e[t] = (...i) => {
|
|
26
|
+
const l = i[0];
|
|
27
|
+
c(...i), (!(typeof l == "object" && l !== null && "preventDefault" in l && typeof l.preventDefault == "function" && "defaultPrevented" in l && typeof l.defaultPrevented == "boolean") || !l.defaultPrevented) && n(...i);
|
|
28
|
+
} : n !== void 0 && (e[t] = n);
|
|
29
|
+
}
|
|
30
|
+
return e;
|
|
31
|
+
}
|
|
32
|
+
function a(...o) {
|
|
33
|
+
return (f) => {
|
|
34
|
+
for (const e of o)
|
|
35
|
+
typeof e == "function" ? e(f) : e && typeof e == "object" && (e.current = f);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
r as Slot
|
|
40
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function o(e = "medium", t = "white") {
|
|
3
|
+
const s = {
|
|
4
|
+
small: "text-sm py-1 px-2 h-8",
|
|
5
|
+
medium: "text-base py-2 px-3 h-10",
|
|
6
|
+
large: "text-lg py-3 px-4 h-12"
|
|
7
|
+
}, r = {
|
|
8
|
+
white: "bg-background text-foreground border-border",
|
|
9
|
+
grey: "bg-muted text-muted-foreground border-border"
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
sizeClasses: s[e],
|
|
13
|
+
variantClasses: r[t],
|
|
14
|
+
combined: `${s[e]} ${r[t]}`
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
o as getInputClasses
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docthub-core-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
7
|
"style": "dist/style.css",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./docthub-core-components.css": "./dist/style.css",
|
|
18
18
|
"./style.css": "./dist/style.css",
|