@alixpartners/ui-components 2.4.3 → 2.5.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/README.md +97 -97
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Illustration.css +1 -0
- package/dist/assets/NavBar.css +1 -1
- package/dist/assets/illustrations-map.d.ts +18 -0
- package/dist/components/Button/Button.d.ts +3 -1
- package/dist/components/Button/Button.js +23 -20
- package/dist/components/Button/Button.test.js +60 -54
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +3 -2
- package/dist/components/DragAndDrop/DragAndDrop.js +76 -78
- package/dist/components/DragAndDrop/DragAndDrop.test.js +16 -12
- package/dist/components/FilePicker/FilePicker.d.ts +2 -2
- package/dist/components/FilePicker/FilePicker.js +110 -112
- package/dist/components/FilePicker/FilePicker.test.js +90 -86
- package/dist/components/Illustration/Illustration.d.ts +3 -0
- package/dist/components/Illustration/Illustration.js +206 -0
- package/dist/components/Illustration/Illustration.test.d.ts +1 -0
- package/dist/components/Illustration/Illustration.test.js +40 -0
- package/dist/components/Illustration/constants.d.ts +34 -0
- package/dist/components/Illustration/types.d.ts +22 -0
- package/dist/components/Illustration/utils.d.ts +11 -0
- package/dist/components/NavBar/NavBar.js +123 -121
- package/dist/components/TabNavigation/TabNavigation.d.ts +2 -1
- package/dist/components/TabNavigation/TabNavigation.js +4 -3
- package/dist/main.d.ts +1 -0
- package/dist/main.js +18 -16
- package/dist/web.config +8 -8
- package/package.json +88 -87
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { d as s, i as r, r as l, s as t, g as e } from "../../vi.bdSIJ99Y-017e_Pkz.js";
|
|
3
|
+
import a from "./Illustration.js";
|
|
4
|
+
s("Illustration", () => {
|
|
5
|
+
s("Levels 1 and 2", () => {
|
|
6
|
+
s("Rendering", () => {
|
|
7
|
+
r("should render an image for a valid level 2 illustration", () => {
|
|
8
|
+
l(/* @__PURE__ */ o(a, { level: 2, category: "empty", name: "folder" }));
|
|
9
|
+
const n = t.getByTestId("illustration-image");
|
|
10
|
+
e(n).toBeInTheDocument(), e(n).toHaveAttribute("src"), e(n.getAttribute("src")).toBeTruthy();
|
|
11
|
+
}), r("should apply clamped square dimensions from size prop", () => {
|
|
12
|
+
l(/* @__PURE__ */ o(a, { level: 2, category: "empty", name: "folder", size: 100 }));
|
|
13
|
+
const n = t.getByTestId("illustration-image");
|
|
14
|
+
e(n).toHaveAttribute("width", "100"), e(n).toHaveAttribute("height", "100");
|
|
15
|
+
}), r("should use custom alt when provided", () => {
|
|
16
|
+
l(/* @__PURE__ */ o(a, { level: 1, category: "empty", name: "folder", alt: "Custom alt" })), e(t.getByTestId("illustration-image")).toHaveAttribute("alt", "Custom alt");
|
|
17
|
+
}), r("should not render when name is not in the catalog", () => {
|
|
18
|
+
l(/* @__PURE__ */ o(a, { level: 2, category: "empty", name: "not-a-real-illustration" })), e(t.queryByTestId("illustration-image")).not.toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}), s("Level 3", () => {
|
|
22
|
+
s("Rendering", () => {
|
|
23
|
+
r("should render message and error tag for a mapped error code", () => {
|
|
24
|
+
l(/* @__PURE__ */ o(a, { level: 3, errorCode: 404 })), e(t.getByTestId("illustration")).toBeInTheDocument(), e(t.getByTestId("illustration-image")).toBeInTheDocument(), e(t.getByTestId("illustration-text")).toHaveTextContent("Page not found"), e(t.getByTestId("tag-label")).toHaveTextContent("Error 404");
|
|
25
|
+
}), r("should fall back to 500 content for unknown codes but keep the real code in the tag", () => {
|
|
26
|
+
l(/* @__PURE__ */ o(a, { level: 3, errorCode: 999 })), e(t.getByTestId("illustration-text")).toHaveTextContent("Something went wrong"), e(t.getByTestId("tag-label")).toHaveTextContent("Error 999");
|
|
27
|
+
}), r("should use mapped alt from message when alt is omitted", () => {
|
|
28
|
+
l(/* @__PURE__ */ o(a, { level: 3, errorCode: 500 })), e(t.getByTestId("illustration-image")).toHaveAttribute("alt", "Something went wrong");
|
|
29
|
+
}), r("should apply a custom text container offset for planets illustration", () => {
|
|
30
|
+
l(/* @__PURE__ */ o(a, { level: 3, errorCode: 404 })), e(t.getByTestId("illustration-text").parentElement).toHaveStyle({
|
|
31
|
+
bottom: "40px"
|
|
32
|
+
});
|
|
33
|
+
}), r("should apply a custom text container offset for overload illustration", () => {
|
|
34
|
+
l(/* @__PURE__ */ o(a, { level: 3, errorCode: 500 })), e(t.getByTestId("illustration-text").parentElement).toHaveStyle({
|
|
35
|
+
bottom: "24px"
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const LEVEL_3_CATEGORY: "error";
|
|
2
|
+
export declare const LEVEL_3_ERROR_MAP: Record<number, {
|
|
3
|
+
name: 'error-barrier' | 'error-overload' | 'error-planets' | 'error-plug' | 'error-time';
|
|
4
|
+
message: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const LEVEL_3_FALLBACK: {
|
|
7
|
+
name: "error-barrier" | "error-overload" | "error-planets" | "error-plug" | "error-time";
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const LEVEL_3_TEXT_BOTTOM_BY_NAME: Record<(typeof LEVEL_3_ERROR_MAP)[number]['name'], number>;
|
|
11
|
+
export declare const LEVEL_DIMENSIONS: {
|
|
12
|
+
readonly 1: {
|
|
13
|
+
readonly minSize: 54;
|
|
14
|
+
readonly maxSize: 72;
|
|
15
|
+
};
|
|
16
|
+
readonly 2: {
|
|
17
|
+
readonly minSize: 73;
|
|
18
|
+
readonly maxSize: 260;
|
|
19
|
+
};
|
|
20
|
+
readonly 3: {
|
|
21
|
+
readonly width: 600;
|
|
22
|
+
readonly height: 360;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const RANGE_DIMENSIONS: {
|
|
26
|
+
readonly 1: {
|
|
27
|
+
readonly minSize: 54;
|
|
28
|
+
readonly maxSize: 72;
|
|
29
|
+
};
|
|
30
|
+
readonly 2: {
|
|
31
|
+
readonly minSize: 73;
|
|
32
|
+
readonly maxSize: 260;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { ILLUSTRATIONS_BY_LEVEL } from '../../assets/illustrations-map';
|
|
3
|
+
import { DataAttributes } from '../../types/data-attributes';
|
|
4
|
+
export type IllustrationLevel = keyof typeof ILLUSTRATIONS_BY_LEVEL;
|
|
5
|
+
export type IllustrationCategory<L extends IllustrationLevel> = Extract<keyof (typeof ILLUSTRATIONS_BY_LEVEL)[L], string>;
|
|
6
|
+
export type IllustrationName<L extends IllustrationLevel, C extends IllustrationCategory<L>> = (typeof ILLUSTRATIONS_BY_LEVEL)[L][C] extends readonly (infer N)[] ? Extract<N, string> : never;
|
|
7
|
+
type ImgRest = Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'width' | 'height'> & DataAttributes;
|
|
8
|
+
export type IllustrationProps = ({
|
|
9
|
+
level: 1;
|
|
10
|
+
category: IllustrationCategory<1>;
|
|
11
|
+
name: IllustrationName<1, IllustrationCategory<1>>;
|
|
12
|
+
size?: number;
|
|
13
|
+
} & ImgRest) | ({
|
|
14
|
+
level: 2;
|
|
15
|
+
category: IllustrationCategory<2>;
|
|
16
|
+
name: IllustrationName<2, IllustrationCategory<2>>;
|
|
17
|
+
size?: number;
|
|
18
|
+
} & ImgRest) | ({
|
|
19
|
+
level: 3;
|
|
20
|
+
errorCode: number;
|
|
21
|
+
} & ImgRest);
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IllustrationLevel } from './types';
|
|
2
|
+
export declare function resolveLevel3Content(errorCode: number): {
|
|
3
|
+
name: "error-barrier" | "error-overload" | "error-planets" | "error-plug" | "error-time";
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function hasIllustration(level: IllustrationLevel, category: string, name: string): boolean;
|
|
7
|
+
export declare function toNumericDimension(value: number | string | undefined): number | undefined;
|
|
8
|
+
export declare function resolveDimensions(level: IllustrationLevel, requestedSize: number | undefined): {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
2
2
|
import ae from "../Tag/Tag.js";
|
|
3
|
-
import
|
|
4
|
-
import { c as
|
|
5
|
-
import
|
|
3
|
+
import G from "../Icon/Icon.js";
|
|
4
|
+
import { c as x } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import ne from "../Logo/Logo.js";
|
|
6
6
|
import * as s from "react";
|
|
7
|
-
import { useState as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as ue, P as z, d as se, c as R, b as
|
|
7
|
+
import { useState as y } from "react";
|
|
8
|
+
import { u as re, R as oe, I as te, c as H, a as ie } from "../../index-DEphED6n.js";
|
|
9
|
+
import { u as ue, P as z, d as se, c as R, b as le } from "../../index-DM51yNMI.js";
|
|
10
10
|
import { u as K } from "../../index-7CBv-Jx6.js";
|
|
11
|
-
import { R as
|
|
12
|
-
import '../../assets/NavBar.css';var
|
|
11
|
+
import { R as ce, A as de, P as me, C as be, I as ve, c as pe, G as _e, L as fe, a as ge, b as he, d as Me, e as Ne, S as Ce, f as Re, g as Pe, h as we } from "../../index-D_3jWVyV.js";
|
|
12
|
+
import '../../assets/NavBar.css';var S = "Menubar", [L, xe, Se] = ie(S), [Y] = le(S, [
|
|
13
13
|
Se,
|
|
14
14
|
H
|
|
15
|
-
]), p = pe(), Q = H(), [
|
|
15
|
+
]), p = pe(), Q = H(), [ye, V] = Y(S), X = s.forwardRef(
|
|
16
16
|
(a, o) => {
|
|
17
17
|
const {
|
|
18
|
-
__scopeMenubar:
|
|
19
|
-
value:
|
|
20
|
-
onValueChange:
|
|
18
|
+
__scopeMenubar: n,
|
|
19
|
+
value: r,
|
|
20
|
+
onValueChange: u,
|
|
21
21
|
defaultValue: M,
|
|
22
22
|
loop: v = !0,
|
|
23
23
|
dir: t,
|
|
24
24
|
...d
|
|
25
|
-
} = a, _ =
|
|
26
|
-
prop:
|
|
27
|
-
onChange:
|
|
25
|
+
} = a, _ = re(t), c = Q(n), [g, m] = ue({
|
|
26
|
+
prop: r,
|
|
27
|
+
onChange: u,
|
|
28
28
|
defaultProp: M ?? "",
|
|
29
|
-
caller:
|
|
30
|
-
}), [h,
|
|
29
|
+
caller: S
|
|
30
|
+
}), [h, l] = s.useState(null);
|
|
31
31
|
return /* @__PURE__ */ e(
|
|
32
|
-
|
|
32
|
+
ye,
|
|
33
33
|
{
|
|
34
|
-
scope:
|
|
34
|
+
scope: n,
|
|
35
35
|
value: g,
|
|
36
36
|
onMenuOpen: s.useCallback(
|
|
37
37
|
(f) => {
|
|
38
|
-
m(f),
|
|
38
|
+
m(f), l(f);
|
|
39
39
|
},
|
|
40
40
|
[m]
|
|
41
41
|
),
|
|
42
42
|
onMenuClose: s.useCallback(() => m(""), [m]),
|
|
43
43
|
onMenuToggle: s.useCallback(
|
|
44
44
|
(f) => {
|
|
45
|
-
m((w) => w ? "" : f),
|
|
45
|
+
m((w) => w ? "" : f), l(f);
|
|
46
46
|
},
|
|
47
47
|
[m]
|
|
48
48
|
),
|
|
49
49
|
dir: _,
|
|
50
50
|
loop: v,
|
|
51
|
-
children: /* @__PURE__ */ e(L.Provider, { scope:
|
|
51
|
+
children: /* @__PURE__ */ e(L.Provider, { scope: n, children: /* @__PURE__ */ e(L.Slot, { scope: n, children: /* @__PURE__ */ e(
|
|
52
52
|
oe,
|
|
53
53
|
{
|
|
54
54
|
asChild: !0,
|
|
55
|
-
...
|
|
55
|
+
...c,
|
|
56
56
|
orientation: "horizontal",
|
|
57
57
|
loop: v,
|
|
58
58
|
dir: _,
|
|
59
59
|
currentTabStopId: h,
|
|
60
|
-
onCurrentTabStopIdChange:
|
|
60
|
+
onCurrentTabStopIdChange: l,
|
|
61
61
|
children: /* @__PURE__ */ e(z.div, { role: "menubar", ...d, ref: o })
|
|
62
62
|
}
|
|
63
63
|
) }) })
|
|
@@ -65,13 +65,13 @@ import '../../assets/NavBar.css';var x = "Menubar", [L, xe, Se] = ie(x), [Y] = c
|
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
|
-
X.displayName =
|
|
69
|
-
var j = "MenubarMenu", [
|
|
70
|
-
const { __scopeMenubar: o, value:
|
|
68
|
+
X.displayName = S;
|
|
69
|
+
var j = "MenubarMenu", [Ae, J] = Y(j), W = (a) => {
|
|
70
|
+
const { __scopeMenubar: o, value: n, ...r } = a, u = K(), M = n || u || "LEGACY_REACT_AUTO_VALUE", v = V(j, o), t = p(o), d = s.useRef(null), _ = s.useRef(!1), c = v.value === M;
|
|
71
71
|
return s.useEffect(() => {
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
|
|
72
|
+
c || (_.current = !1);
|
|
73
|
+
}, [c]), /* @__PURE__ */ e(
|
|
74
|
+
Ae,
|
|
75
75
|
{
|
|
76
76
|
scope: o,
|
|
77
77
|
value: M,
|
|
@@ -80,16 +80,16 @@ var j = "MenubarMenu", [ye, J] = Y(j), W = (a) => {
|
|
|
80
80
|
contentId: K(),
|
|
81
81
|
wasKeyboardTriggerOpenRef: _,
|
|
82
82
|
children: /* @__PURE__ */ e(
|
|
83
|
-
|
|
83
|
+
ce,
|
|
84
84
|
{
|
|
85
85
|
...t,
|
|
86
|
-
open:
|
|
86
|
+
open: c,
|
|
87
87
|
onOpenChange: (g) => {
|
|
88
88
|
g || v.onMenuClose();
|
|
89
89
|
},
|
|
90
90
|
modal: !1,
|
|
91
91
|
dir: v.dir,
|
|
92
|
-
...
|
|
92
|
+
...r
|
|
93
93
|
}
|
|
94
94
|
)
|
|
95
95
|
}
|
|
@@ -98,13 +98,13 @@ var j = "MenubarMenu", [ye, J] = Y(j), W = (a) => {
|
|
|
98
98
|
W.displayName = j;
|
|
99
99
|
var F = "MenubarTrigger", Z = s.forwardRef(
|
|
100
100
|
(a, o) => {
|
|
101
|
-
const { __scopeMenubar:
|
|
102
|
-
return /* @__PURE__ */ e(L.ItemSlot, { scope:
|
|
101
|
+
const { __scopeMenubar: n, disabled: r = !1, ...u } = a, M = Q(n), v = p(n), t = V(F, n), d = J(F, n), _ = s.useRef(null), c = se(o, _, d.triggerRef), [g, m] = s.useState(!1), h = t.value === d.value;
|
|
102
|
+
return /* @__PURE__ */ e(L.ItemSlot, { scope: n, value: d.value, disabled: r, children: /* @__PURE__ */ e(
|
|
103
103
|
te,
|
|
104
104
|
{
|
|
105
105
|
asChild: !0,
|
|
106
106
|
...M,
|
|
107
|
-
focusable: !
|
|
107
|
+
focusable: !r,
|
|
108
108
|
tabStopId: d.value,
|
|
109
109
|
children: /* @__PURE__ */ e(de, { asChild: !0, ...v, children: /* @__PURE__ */ e(
|
|
110
110
|
z.button,
|
|
@@ -117,19 +117,19 @@ var F = "MenubarTrigger", Z = s.forwardRef(
|
|
|
117
117
|
"aria-controls": h ? d.contentId : void 0,
|
|
118
118
|
"data-highlighted": g ? "" : void 0,
|
|
119
119
|
"data-state": h ? "open" : "closed",
|
|
120
|
-
"data-disabled":
|
|
121
|
-
disabled:
|
|
122
|
-
...
|
|
123
|
-
ref:
|
|
124
|
-
onPointerDown: R(a.onPointerDown, (
|
|
125
|
-
!
|
|
120
|
+
"data-disabled": r ? "" : void 0,
|
|
121
|
+
disabled: r,
|
|
122
|
+
...u,
|
|
123
|
+
ref: c,
|
|
124
|
+
onPointerDown: R(a.onPointerDown, (l) => {
|
|
125
|
+
!r && l.button === 0 && l.ctrlKey === !1 && (t.onMenuOpen(d.value), h || l.preventDefault());
|
|
126
126
|
}),
|
|
127
127
|
onPointerEnter: R(a.onPointerEnter, () => {
|
|
128
128
|
var f;
|
|
129
129
|
!!t.value && !h && (t.onMenuOpen(d.value), (f = _.current) == null || f.focus());
|
|
130
130
|
}),
|
|
131
|
-
onKeyDown: R(a.onKeyDown, (
|
|
132
|
-
|
|
131
|
+
onKeyDown: R(a.onKeyDown, (l) => {
|
|
132
|
+
r || (["Enter", " "].includes(l.key) && t.onMenuToggle(d.value), l.key === "ArrowDown" && t.onMenuOpen(d.value), ["Enter", " ", "ArrowDown"].includes(l.key) && (d.wasKeyboardTriggerOpenRef.current = !0, l.preventDefault()));
|
|
133
133
|
}),
|
|
134
134
|
onFocus: R(a.onFocus, () => m(!0)),
|
|
135
135
|
onBlur: R(a.onBlur, () => m(!1))
|
|
@@ -141,13 +141,13 @@ var F = "MenubarTrigger", Z = s.forwardRef(
|
|
|
141
141
|
);
|
|
142
142
|
Z.displayName = F;
|
|
143
143
|
var Oe = "MenubarPortal", $ = (a) => {
|
|
144
|
-
const { __scopeMenubar: o, ...
|
|
145
|
-
return /* @__PURE__ */ e(me, { ...
|
|
144
|
+
const { __scopeMenubar: o, ...n } = a, r = p(o);
|
|
145
|
+
return /* @__PURE__ */ e(me, { ...r, ...n });
|
|
146
146
|
};
|
|
147
147
|
$.displayName = Oe;
|
|
148
148
|
var U = "MenubarContent", q = s.forwardRef(
|
|
149
149
|
(a, o) => {
|
|
150
|
-
const { __scopeMenubar:
|
|
150
|
+
const { __scopeMenubar: n, align: r = "start", ...u } = a, M = p(n), v = V(U, n), t = J(U, n), d = xe(n), _ = s.useRef(!1);
|
|
151
151
|
return /* @__PURE__ */ e(
|
|
152
152
|
be,
|
|
153
153
|
{
|
|
@@ -155,33 +155,33 @@ var U = "MenubarContent", q = s.forwardRef(
|
|
|
155
155
|
"aria-labelledby": t.triggerId,
|
|
156
156
|
"data-radix-menubar-content": "",
|
|
157
157
|
...M,
|
|
158
|
-
...
|
|
158
|
+
...u,
|
|
159
159
|
ref: o,
|
|
160
|
-
align:
|
|
161
|
-
onCloseAutoFocus: R(a.onCloseAutoFocus, (
|
|
160
|
+
align: r,
|
|
161
|
+
onCloseAutoFocus: R(a.onCloseAutoFocus, (c) => {
|
|
162
162
|
var m;
|
|
163
|
-
!!!v.value && !_.current && ((m = t.triggerRef.current) == null || m.focus()), _.current = !1,
|
|
163
|
+
!!!v.value && !_.current && ((m = t.triggerRef.current) == null || m.focus()), _.current = !1, c.preventDefault();
|
|
164
164
|
}),
|
|
165
|
-
onFocusOutside: R(a.onFocusOutside, (
|
|
166
|
-
const g =
|
|
165
|
+
onFocusOutside: R(a.onFocusOutside, (c) => {
|
|
166
|
+
const g = c.target;
|
|
167
167
|
d().some((h) => {
|
|
168
|
-
var
|
|
169
|
-
return (
|
|
170
|
-
}) &&
|
|
168
|
+
var l;
|
|
169
|
+
return (l = h.ref.current) == null ? void 0 : l.contains(g);
|
|
170
|
+
}) && c.preventDefault();
|
|
171
171
|
}),
|
|
172
172
|
onInteractOutside: R(a.onInteractOutside, () => {
|
|
173
173
|
_.current = !0;
|
|
174
174
|
}),
|
|
175
|
-
onEntryFocus: (
|
|
176
|
-
t.wasKeyboardTriggerOpenRef.current ||
|
|
175
|
+
onEntryFocus: (c) => {
|
|
176
|
+
t.wasKeyboardTriggerOpenRef.current || c.preventDefault();
|
|
177
177
|
},
|
|
178
178
|
onKeyDown: R(
|
|
179
179
|
a.onKeyDown,
|
|
180
|
-
(
|
|
181
|
-
if (["ArrowRight", "ArrowLeft"].includes(
|
|
182
|
-
const g =
|
|
180
|
+
(c) => {
|
|
181
|
+
if (["ArrowRight", "ArrowLeft"].includes(c.key)) {
|
|
182
|
+
const g = c.target, m = g.hasAttribute("data-radix-menubar-subtrigger"), h = g.closest("[data-radix-menubar-content]") !== c.currentTarget, f = (v.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === c.key;
|
|
183
183
|
if (!f && m || h && f) return;
|
|
184
|
-
let N = d().filter((
|
|
184
|
+
let N = d().filter((D) => !D.disabled).map((D) => D.value);
|
|
185
185
|
f && N.reverse();
|
|
186
186
|
const b = N.indexOf(t.value);
|
|
187
187
|
N = v.loop ? $e(N, b + 1) : N.slice(b + 1);
|
|
@@ -206,74 +206,74 @@ var U = "MenubarContent", q = s.forwardRef(
|
|
|
206
206
|
q.displayName = U;
|
|
207
207
|
var Ee = "MenubarGroup", Be = s.forwardRef(
|
|
208
208
|
(a, o) => {
|
|
209
|
-
const { __scopeMenubar:
|
|
210
|
-
return /* @__PURE__ */ e(_e, { ...
|
|
209
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
210
|
+
return /* @__PURE__ */ e(_e, { ...u, ...r, ref: o });
|
|
211
211
|
}
|
|
212
212
|
);
|
|
213
213
|
Be.displayName = Ee;
|
|
214
214
|
var Te = "MenubarLabel", Ie = s.forwardRef(
|
|
215
215
|
(a, o) => {
|
|
216
|
-
const { __scopeMenubar:
|
|
217
|
-
return /* @__PURE__ */ e(fe, { ...
|
|
216
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
217
|
+
return /* @__PURE__ */ e(fe, { ...u, ...r, ref: o });
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
Ie.displayName = Te;
|
|
221
221
|
var ke = "MenubarItem", ee = s.forwardRef(
|
|
222
222
|
(a, o) => {
|
|
223
|
-
const { __scopeMenubar:
|
|
224
|
-
return /* @__PURE__ */ e(ve, { ...
|
|
223
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
224
|
+
return /* @__PURE__ */ e(ve, { ...u, ...r, ref: o });
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
ee.displayName = ke;
|
|
228
228
|
var De = "MenubarCheckboxItem", Ge = s.forwardRef(
|
|
229
229
|
(a, o) => {
|
|
230
|
-
const { __scopeMenubar:
|
|
231
|
-
return /* @__PURE__ */ e(ge, { ...
|
|
230
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
231
|
+
return /* @__PURE__ */ e(ge, { ...u, ...r, ref: o });
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
234
|
Ge.displayName = De;
|
|
235
235
|
var Ke = "MenubarRadioGroup", Le = s.forwardRef(
|
|
236
236
|
(a, o) => {
|
|
237
|
-
const { __scopeMenubar:
|
|
238
|
-
return /* @__PURE__ */ e(he, { ...
|
|
237
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
238
|
+
return /* @__PURE__ */ e(he, { ...u, ...r, ref: o });
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
Le.displayName = Ke;
|
|
242
242
|
var Fe = "MenubarRadioItem", Ue = s.forwardRef(
|
|
243
243
|
(a, o) => {
|
|
244
|
-
const { __scopeMenubar:
|
|
245
|
-
return /* @__PURE__ */ e(Me, { ...
|
|
244
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
245
|
+
return /* @__PURE__ */ e(Me, { ...u, ...r, ref: o });
|
|
246
246
|
}
|
|
247
247
|
);
|
|
248
248
|
Ue.displayName = Fe;
|
|
249
249
|
var Ve = "MenubarItemIndicator", je = s.forwardRef((a, o) => {
|
|
250
|
-
const { __scopeMenubar:
|
|
251
|
-
return /* @__PURE__ */ e(Ne, { ...
|
|
250
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
251
|
+
return /* @__PURE__ */ e(Ne, { ...u, ...r, ref: o });
|
|
252
252
|
});
|
|
253
253
|
je.displayName = Ve;
|
|
254
254
|
var He = "MenubarSeparator", ze = s.forwardRef(
|
|
255
255
|
(a, o) => {
|
|
256
|
-
const { __scopeMenubar:
|
|
257
|
-
return /* @__PURE__ */ e(Ce, { ...
|
|
256
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
257
|
+
return /* @__PURE__ */ e(Ce, { ...u, ...r, ref: o });
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
ze.displayName = He;
|
|
261
261
|
var Ye = "MenubarArrow", Qe = s.forwardRef(
|
|
262
262
|
(a, o) => {
|
|
263
|
-
const { __scopeMenubar:
|
|
264
|
-
return /* @__PURE__ */ e(Re, { ...
|
|
263
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
264
|
+
return /* @__PURE__ */ e(Re, { ...u, ...r, ref: o });
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
Qe.displayName = Ye;
|
|
268
268
|
var Xe = "MenubarSubTrigger", Je = s.forwardRef(
|
|
269
269
|
(a, o) => {
|
|
270
|
-
const { __scopeMenubar:
|
|
270
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
271
271
|
return /* @__PURE__ */ e(
|
|
272
272
|
Pe,
|
|
273
273
|
{
|
|
274
274
|
"data-radix-menubar-subtrigger": "",
|
|
275
|
-
...
|
|
276
|
-
...
|
|
275
|
+
...u,
|
|
276
|
+
...r,
|
|
277
277
|
ref: o
|
|
278
278
|
}
|
|
279
279
|
);
|
|
@@ -282,13 +282,13 @@ var Xe = "MenubarSubTrigger", Je = s.forwardRef(
|
|
|
282
282
|
Je.displayName = Xe;
|
|
283
283
|
var We = "MenubarSubContent", Ze = s.forwardRef(
|
|
284
284
|
(a, o) => {
|
|
285
|
-
const { __scopeMenubar:
|
|
285
|
+
const { __scopeMenubar: n, ...r } = a, u = p(n);
|
|
286
286
|
return /* @__PURE__ */ e(
|
|
287
287
|
we,
|
|
288
288
|
{
|
|
289
|
-
...
|
|
289
|
+
...u,
|
|
290
290
|
"data-radix-menubar-content": "",
|
|
291
|
-
...
|
|
291
|
+
...r,
|
|
292
292
|
ref: o,
|
|
293
293
|
style: {
|
|
294
294
|
...a.style,
|
|
@@ -304,10 +304,10 @@ var We = "MenubarSubContent", Ze = s.forwardRef(
|
|
|
304
304
|
);
|
|
305
305
|
Ze.displayName = We;
|
|
306
306
|
function $e(a, o) {
|
|
307
|
-
return a.map((
|
|
307
|
+
return a.map((n, r) => a[(o + r) % a.length]);
|
|
308
308
|
}
|
|
309
|
-
var A = X,
|
|
310
|
-
const
|
|
309
|
+
var A = X, O = W, E = Z, B = $, T = q, I = ee;
|
|
310
|
+
const i = {
|
|
311
311
|
"navbar-wrapper": "NavBar-module__navbar-wrapper___e-f8y",
|
|
312
312
|
"navbar-container": "NavBar-module__navbar-container___KnbUz",
|
|
313
313
|
"navbar-logo-container": "NavBar-module__navbar-logo-container___VXWAo",
|
|
@@ -328,62 +328,64 @@ const u = {
|
|
|
328
328
|
"navbar-menu-additional": "NavBar-module__navbar-menu-additional___B8kH-",
|
|
329
329
|
"navbar-menu-additional-trigger": "NavBar-module__navbar-menu-additional-trigger___IpMHL",
|
|
330
330
|
"navbar-menu-additional-icon": "NavBar-module__navbar-menu-additional-icon___jhULk",
|
|
331
|
+
"navbar-menu-additional-icon-notification": "NavBar-module__navbar-menu-additional-icon-notification___RH-yL",
|
|
332
|
+
"navbar-menu-additional-icon-help": "NavBar-module__navbar-menu-additional-icon-help___5sqmP",
|
|
331
333
|
"navbar-menu-additional-user-profile": "NavBar-module__navbar-menu-additional-user-profile___ujsEv",
|
|
332
334
|
"navbar-notification-container": "NavBar-module__navbar-notification-container___K2YeD",
|
|
333
335
|
"navbar-notification-badge": "NavBar-module__navbar-notification-badge___vp5bK"
|
|
334
336
|
};
|
|
335
|
-
function
|
|
337
|
+
function la({
|
|
336
338
|
activeMenuItemHref: a,
|
|
337
339
|
projectName: o,
|
|
338
|
-
projectLogoIcon:
|
|
339
|
-
projectLogoOnClick:
|
|
340
|
-
projectTag:
|
|
340
|
+
projectLogoIcon: n,
|
|
341
|
+
projectLogoOnClick: r,
|
|
342
|
+
projectTag: u,
|
|
341
343
|
menuItems: M,
|
|
342
344
|
menuButton: v,
|
|
343
345
|
additionalItems: t,
|
|
344
346
|
className: d,
|
|
345
347
|
maxWidth: _
|
|
346
348
|
}) {
|
|
347
|
-
const
|
|
348
|
-
return /* @__PURE__ */ e("div", { className:
|
|
349
|
+
const c = (b) => b ? a === b : !1, [g, m] = y(!1), [h, l] = y(!1), [f, w] = y(!1), [k, N] = y(null);
|
|
350
|
+
return /* @__PURE__ */ e("div", { className: x(i["navbar-wrapper"], d), children: /* @__PURE__ */ C("div", { className: i["navbar-container"], style: {
|
|
349
351
|
maxWidth: _
|
|
350
352
|
}, children: [
|
|
351
|
-
/* @__PURE__ */ C("div", { className:
|
|
352
|
-
/* @__PURE__ */ e("a", { onClick:
|
|
353
|
-
/* @__PURE__ */ e("span", { className:
|
|
354
|
-
/* @__PURE__ */ e("span", { className:
|
|
355
|
-
|
|
353
|
+
/* @__PURE__ */ C("div", { className: i["navbar-logo-container"], children: [
|
|
354
|
+
/* @__PURE__ */ e("a", { onClick: r, className: i["navbar-logo-link"], children: /* @__PURE__ */ e(ne, { logo: n, color: "white" }) }),
|
|
355
|
+
/* @__PURE__ */ e("span", { className: i["navbar-project-name-separator"] }),
|
|
356
|
+
/* @__PURE__ */ e("span", { className: i["navbar-project-name"], children: o }),
|
|
357
|
+
u && /* @__PURE__ */ e(ae, { type: "basic", color: "green", size: "md", structure: "border", label: u })
|
|
356
358
|
] }),
|
|
357
|
-
/* @__PURE__ */ C("div", { className:
|
|
358
|
-
/* @__PURE__ */ e("div", { className:
|
|
359
|
-
/* @__PURE__ */ e(A, { className:
|
|
360
|
-
/* @__PURE__ */ e(
|
|
359
|
+
/* @__PURE__ */ C("div", { className: i["navbar-menu"], children: [
|
|
360
|
+
/* @__PURE__ */ e("div", { className: i["navbar-menu-button"], children: v }),
|
|
361
|
+
/* @__PURE__ */ e(A, { className: i["navbar-menu-list"], children: M == null ? void 0 : M.map((b) => /* @__PURE__ */ e("div", { onPointerLeave: () => N(null), children: /* @__PURE__ */ C(O, { open: k === b.label, onOpenChange: (P) => N(P ? b.label : null), children: [
|
|
362
|
+
/* @__PURE__ */ e(E, { "data-state": k === b.label ? "open" : "closed", onClick: () => N(b.label), onPointerMove: () => N(b.label), className: i["navbar-menu-list-item"], children: b.menuItems ? /* @__PURE__ */ C("span", { className: i["navbar-menu-list-item-trigger-container"], children: [
|
|
361
363
|
/* @__PURE__ */ e("span", { children: b.label }),
|
|
362
|
-
/* @__PURE__ */ e(
|
|
363
|
-
] }) : /* @__PURE__ */ e("a", { className:
|
|
364
|
-
b.menuItems && /* @__PURE__ */ e(
|
|
364
|
+
/* @__PURE__ */ e(G, { icon: "ap-icon-expand-more", className: x(i["navbar-menu-list-item-arrow"]) })
|
|
365
|
+
] }) : /* @__PURE__ */ e("a", { className: x(i["navbar-menu-list-item-action"], c(b.href) && i["navbar-menu-list-item-action-active"]), onClick: b.onClick, children: b.label }) }),
|
|
366
|
+
b.menuItems && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(T, { className: i["navbar-menu-list-item-submenu"], children: b.menuItems.map((P) => /* @__PURE__ */ e(I, { className: i["navbar-menu-list-item-submenu-item"], children: /* @__PURE__ */ e("a", { onClick: P.onClick, children: P.label }) }, P.label)) }) })
|
|
365
367
|
] }) }, b.label)) }),
|
|
366
|
-
t && /* @__PURE__ */ e("span", { className:
|
|
367
|
-
/* @__PURE__ */ C("div", { className:
|
|
368
|
-
(t == null ? void 0 : t.notifications) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () => m(!1), children: /* @__PURE__ */ C(
|
|
369
|
-
/* @__PURE__ */ e(
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
t.notifications.count > 0 && /* @__PURE__ */ e("span", { className:
|
|
368
|
+
t && /* @__PURE__ */ e("span", { className: i["navbar-menu-additional-separator"] }),
|
|
369
|
+
/* @__PURE__ */ C("div", { className: i["navbar-menu-additional"], children: [
|
|
370
|
+
(t == null ? void 0 : t.notifications) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () => m(!1), children: /* @__PURE__ */ C(O, { open: g, onOpenChange: m, children: [
|
|
371
|
+
/* @__PURE__ */ e(E, { onClick: () => m(!0), onPointerMove: () => m(!0), className: i["navbar-menu-additional-trigger"], children: /* @__PURE__ */ C("div", { className: i["navbar-notification-container"], children: [
|
|
372
|
+
/* @__PURE__ */ e(G, { icon: "ap-icon-notification-filled", className: x(i["navbar-menu-additional-icon"], i["navbar-menu-additional-icon-notification"]) }),
|
|
373
|
+
t.notifications.count > 0 && /* @__PURE__ */ e("span", { className: i["navbar-notification-badge"], children: t.notifications.count > 99 ? "99+" : t.notifications.count })
|
|
372
374
|
] }) }),
|
|
373
|
-
/* @__PURE__ */ e(
|
|
375
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(T, { align: "end", className: i["navbar-menu-list-item-submenu"], children: /* @__PURE__ */ e(I, { className: i["navbar-menu-list-item-submenu-item"], children: t.notifications.content }) }) })
|
|
374
376
|
] }) }) }),
|
|
375
|
-
(t == null ? void 0 : t.help) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () =>
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
/* @__PURE__ */ e(
|
|
377
|
+
(t == null ? void 0 : t.help) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () => l(!1), children: /* @__PURE__ */ C(O, { open: h, onOpenChange: l, children: [
|
|
378
|
+
/* @__PURE__ */ e(E, { onClick: () => l(!0), onPointerMove: () => l(!0), className: i["navbar-menu-additional-trigger"], children: /* @__PURE__ */ e(G, { icon: "ap-icon-help-filled", className: x(i["navbar-menu-additional-icon"], i["navbar-menu-additional-icon-help"]) }) }),
|
|
379
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(T, { align: "end", className: i["navbar-menu-list-item-submenu"], children: /* @__PURE__ */ e(I, { className: i["navbar-menu-list-item-submenu-item"], children: t.help }) }) })
|
|
378
380
|
] }) }) }),
|
|
379
|
-
(t == null ? void 0 : t.userProfile) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () => w(!1), children: /* @__PURE__ */ C(
|
|
380
|
-
/* @__PURE__ */ e(
|
|
381
|
-
/* @__PURE__ */ e(
|
|
381
|
+
(t == null ? void 0 : t.userProfile) && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { onPointerLeave: () => w(!1), children: /* @__PURE__ */ C(O, { open: f, onOpenChange: w, children: [
|
|
382
|
+
/* @__PURE__ */ e(E, { onClick: () => w(!0), onPointerMove: () => w(!0), className: i["navbar-menu-additional-trigger"], children: /* @__PURE__ */ e("span", { className: i["navbar-menu-additional-user-profile"], children: t.userProfile.initials }) }),
|
|
383
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(T, { align: "end", className: i["navbar-menu-list-item-submenu"], children: /* @__PURE__ */ e(I, { className: i["navbar-menu-list-item-submenu-item"], children: t.userProfile.content }) }) })
|
|
382
384
|
] }) }) })
|
|
383
385
|
] })
|
|
384
386
|
] })
|
|
385
387
|
] }) });
|
|
386
388
|
}
|
|
387
389
|
export {
|
|
388
|
-
|
|
390
|
+
la as default
|
|
389
391
|
};
|
|
@@ -4,6 +4,7 @@ type TabNavigationProps = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
align?: 'left' | 'center' | 'right';
|
|
7
|
+
noUnderline?: boolean;
|
|
7
8
|
} & DataAttributes;
|
|
8
|
-
export default function TabNavigation({ children, align, className, ...props }: TabNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function TabNavigation({ children, align, className, noUnderline, ...props }: TabNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -10,10 +10,11 @@ import '../../assets/TabNavigation.css';const a = {
|
|
|
10
10
|
function b({
|
|
11
11
|
children: _,
|
|
12
12
|
align: i = "center",
|
|
13
|
-
className:
|
|
14
|
-
|
|
13
|
+
className: e,
|
|
14
|
+
noUnderline: o = !1,
|
|
15
|
+
...g
|
|
15
16
|
}) {
|
|
16
|
-
return /* @__PURE__ */ t("div", { className: n(a["tab-navigation"]), ...
|
|
17
|
+
return /* @__PURE__ */ t("div", { className: o ? "" : n(a["tab-navigation"]), ...g, children: /* @__PURE__ */ t("div", { className: n(a["tab-navigation-items"], i && a[`align-${i}`], e), children: _ }) });
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
19
20
|
b as default
|
package/dist/main.d.ts
CHANGED
|
@@ -27,5 +27,6 @@ export { default as NavBar, type MenuItem, type Notifications, type UserProfile,
|
|
|
27
27
|
export { default as Tag, type TagColors } from './components/Tag/Tag.tsx';
|
|
28
28
|
export { default as Tooltip, type TooltipProps } from './components/Tooltip/Tooltip.tsx';
|
|
29
29
|
export { default as Spinner } from './components/Spinner/Spinner.tsx';
|
|
30
|
+
export { default as Illustration, type IllustrationCategory, type IllustrationLevel, type IllustrationName, type IllustrationProps, } from './components/Illustration/Illustration.tsx';
|
|
30
31
|
export { apLogos } from './assets/ap-logos';
|
|
31
32
|
export type { ApIcon } from './assets/ap-icons-types';
|