@tedi-design-system/react 19.1.0-rc.2 → 19.1.0-rc.3
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/DESIGN.md +308 -0
- package/README.md +28 -0
- package/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/component.manifest.json +1191 -0
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.d.ts +5 -0
- package/src/tedi/components/filter/filter/filter.es.js +154 -144
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +2 -1
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +82 -74
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.es.js +1 -0
|
@@ -1,121 +1,129 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloatingNodeId as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as A, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as U, useFloating as q, useInteractions as z, useClick as G, useRole as J, useDismiss as K, useListNavigation as Q, FloatingPortal as V, FloatingFocusManager as X } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import Y from "../../../../../external/classnames/index.es.js";
|
|
4
4
|
import e from "react";
|
|
5
|
-
import
|
|
6
|
-
import { DropdownContent as
|
|
7
|
-
import { DropdownContext as
|
|
8
|
-
import { resolveDropdownWidth as
|
|
9
|
-
import { DropdownItem as
|
|
10
|
-
import { DropdownSeparator as
|
|
11
|
-
import { DropdownTrigger as
|
|
12
|
-
import { useBreakpointProps as
|
|
13
|
-
import { useLabels as
|
|
14
|
-
import { autoUpdate as
|
|
15
|
-
import { offset as
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
const { getCurrentBreakpointProps:
|
|
19
|
-
children:
|
|
20
|
-
modal:
|
|
5
|
+
import v from "./dropdown.module.scss.es.js";
|
|
6
|
+
import { DropdownContent as Z } from "./dropdown-content/dropdown-content.es.js";
|
|
7
|
+
import { DropdownContext as ee } from "./dropdown-context.es.js";
|
|
8
|
+
import { resolveDropdownWidth as te } from "./dropdown-helpers.es.js";
|
|
9
|
+
import { DropdownItem as oe } from "./dropdown-item/dropdown-item.es.js";
|
|
10
|
+
import { DropdownSeparator as ne } from "./dropdown-separator/dropdown-separator.es.js";
|
|
11
|
+
import { DropdownTrigger as re } from "./dropdown-trigger/dropdown-trigger.es.js";
|
|
12
|
+
import { useBreakpointProps as ie } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
+
import { useLabels as se } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
import { autoUpdate as ae } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
15
|
+
import { offset as le, flip as de, shift as ce } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
16
|
+
const me = 4, c = (h) => {
|
|
17
|
+
var O;
|
|
18
|
+
const { getCurrentBreakpointProps: F } = ie(h.defaultServerBreakpoint), {
|
|
19
|
+
children: N,
|
|
20
|
+
modal: w = !1,
|
|
21
21
|
divided: R = !1,
|
|
22
|
-
width:
|
|
23
|
-
variant:
|
|
24
|
-
open:
|
|
22
|
+
width: y = "auto",
|
|
23
|
+
variant: m = "default",
|
|
24
|
+
open: p,
|
|
25
25
|
defaultOpen: P = !1,
|
|
26
26
|
onOpenChange: s,
|
|
27
27
|
defaultActiveIndex: o,
|
|
28
28
|
placement: u = "bottom-start",
|
|
29
|
+
maxHeight: a,
|
|
29
30
|
className: S
|
|
30
|
-
} =
|
|
31
|
+
} = F(h), { getLabel: b } = se(), k = U(), x = e.useRef([]), [l, f] = e.useState(o ?? null), [g, B] = e.useState(null), [_, W] = e.useState(P), t = p ?? _;
|
|
31
32
|
e.useEffect(() => {
|
|
32
|
-
t ||
|
|
33
|
+
t || f(o ?? null);
|
|
33
34
|
}, [t, o]);
|
|
34
|
-
const
|
|
35
|
+
const D = e.useCallback(
|
|
35
36
|
(i) => {
|
|
36
|
-
|
|
37
|
+
p === void 0 && W(i), s == null || s(i);
|
|
37
38
|
},
|
|
38
|
-
[
|
|
39
|
-
), E =
|
|
40
|
-
nodeId:
|
|
39
|
+
[p, s]
|
|
40
|
+
), E = q({
|
|
41
|
+
nodeId: k,
|
|
41
42
|
open: t,
|
|
42
43
|
placement: u,
|
|
43
|
-
onOpenChange:
|
|
44
|
-
middleware: [
|
|
45
|
-
whileElementsMounted:
|
|
46
|
-
}), { context: n, refs: r, x:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
listRef:
|
|
52
|
-
activeIndex:
|
|
53
|
-
onNavigate:
|
|
44
|
+
onOpenChange: D,
|
|
45
|
+
middleware: [le(me), de(), ce()],
|
|
46
|
+
whileElementsMounted: ae
|
|
47
|
+
}), { context: n, refs: r, x: H, y: L, strategy: M } = E, I = z([
|
|
48
|
+
G(n),
|
|
49
|
+
J(n, { role: "menu" }),
|
|
50
|
+
K(n),
|
|
51
|
+
Q(n, {
|
|
52
|
+
listRef: x,
|
|
53
|
+
activeIndex: l,
|
|
54
|
+
onNavigate: f,
|
|
54
55
|
loop: !0,
|
|
55
56
|
selectedIndex: o ?? null,
|
|
56
57
|
focusItemOnOpen: o !== null ? !0 : "auto"
|
|
57
58
|
})
|
|
58
|
-
]),
|
|
59
|
+
]), T = {
|
|
59
60
|
open: t,
|
|
60
|
-
setOpen:
|
|
61
|
+
setOpen: D,
|
|
61
62
|
refs: r,
|
|
62
|
-
listItemsRef:
|
|
63
|
-
activeIndex:
|
|
64
|
-
setActiveIndex:
|
|
63
|
+
listItemsRef: x,
|
|
64
|
+
activeIndex: l,
|
|
65
|
+
setActiveIndex: f,
|
|
65
66
|
placement: u,
|
|
66
|
-
content:
|
|
67
|
+
content: g,
|
|
67
68
|
setContent: B,
|
|
68
69
|
divided: R,
|
|
69
|
-
variant:
|
|
70
|
-
...
|
|
71
|
-
},
|
|
70
|
+
variant: m,
|
|
71
|
+
...I
|
|
72
|
+
}, $ = (O = r.reference.current) == null ? void 0 : O.getBoundingClientRect().width, j = e.useMemo(() => {
|
|
72
73
|
const i = r.reference.current;
|
|
73
74
|
if (!i) return;
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
75
|
+
const C = i.offsetParent;
|
|
76
|
+
if (C)
|
|
77
|
+
return C.getBoundingClientRect().width;
|
|
77
78
|
}, [r.reference.current]);
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
79
|
+
return /* @__PURE__ */ A(ee.Provider, { value: T, children: [
|
|
80
|
+
N,
|
|
81
|
+
/* @__PURE__ */ d(V, { children: t && /* @__PURE__ */ d(
|
|
82
|
+
X,
|
|
82
83
|
{
|
|
83
84
|
context: n,
|
|
84
|
-
modal:
|
|
85
|
-
visuallyHiddenDismiss:
|
|
86
|
-
children: /* @__PURE__ */
|
|
85
|
+
modal: w,
|
|
86
|
+
visuallyHiddenDismiss: w ? b("close") : !1,
|
|
87
|
+
children: /* @__PURE__ */ d(
|
|
87
88
|
"div",
|
|
88
89
|
{
|
|
89
|
-
...
|
|
90
|
+
...I.getFloatingProps({
|
|
90
91
|
ref: r.setFloating,
|
|
91
|
-
className:
|
|
92
|
-
|
|
93
|
-
{ [
|
|
92
|
+
className: Y(
|
|
93
|
+
v["tedi-dropdown"],
|
|
94
|
+
{ [v[`tedi-dropdown--${m}`]]: m === "tree" },
|
|
94
95
|
S
|
|
95
96
|
),
|
|
96
97
|
style: {
|
|
97
|
-
position:
|
|
98
|
-
left:
|
|
99
|
-
top:
|
|
100
|
-
width:
|
|
98
|
+
position: M,
|
|
99
|
+
left: H ?? 0,
|
|
100
|
+
top: L ?? 0,
|
|
101
|
+
width: te(y, $, j)
|
|
101
102
|
},
|
|
102
103
|
role: "menu",
|
|
103
104
|
"aria-orientation": "vertical",
|
|
104
|
-
"aria-activedescendant":
|
|
105
|
+
"aria-activedescendant": l !== null ? `dropdown-item-${l}` : void 0
|
|
105
106
|
}),
|
|
106
107
|
"data-placement": u,
|
|
107
108
|
"data-state": t ? "open" : "closed",
|
|
108
|
-
children:
|
|
109
|
+
children: a !== void 0 ? /* @__PURE__ */ d(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: v["tedi-dropdown__scroll"],
|
|
113
|
+
style: { maxHeight: typeof a == "number" ? `${a}px` : a },
|
|
114
|
+
children: g
|
|
115
|
+
}
|
|
116
|
+
) : g
|
|
109
117
|
}
|
|
110
118
|
)
|
|
111
119
|
}
|
|
112
120
|
) })
|
|
113
121
|
] });
|
|
114
122
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
c.Trigger = re;
|
|
124
|
+
c.Content = Z;
|
|
125
|
+
c.Item = oe;
|
|
126
|
+
c.Separator = ne;
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
c as Dropdown
|
|
121
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-dropdown":"tedi-dropdown-0246d37c","tedi-dropdown--tree":"tedi-dropdown--tree-c13f70ee","tedi-dropdown__item":"tedi-dropdown__item-fa7ee478"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-dropdown":"tedi-dropdown-0246d37c","tedi-dropdown__scroll":"tedi-dropdown__scroll-c7d1c849","tedi-dropdown--tree":"tedi-dropdown--tree-c13f70ee","tedi-dropdown__item":"tedi-dropdown__item-fa7ee478"};exports.default=e;
|