@aivenio/aquarium 1.77.0 → 1.78.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 +19 -2
- package/dist/atoms.cjs +40 -1
- package/dist/atoms.mjs +40 -1
- package/dist/src/molecules/DropdownMenu/DropdownMenu.js +76 -18
- package/dist/src/molecules/Popover/Popover.d.ts +1 -0
- package/dist/src/molecules/Popover/Popover.js +1 -1
- package/dist/src/molecules/PopoverDialog/PopoverDialog.d.ts +1 -1
- package/dist/src/molecules/Spacing/Spacing.d.ts +1 -1
- package/dist/src/molecules/Spacing/Spacing.js +1 -1
- package/dist/src/molecules/Tooltip/Tooltip.js +2 -2
- package/dist/src/molecules/Typography/Typography.d.ts +1 -1
- package/dist/src/molecules/Typography/Typography.js +11 -1
- package/dist/src/tokens/tokens.json +20 -0
- package/dist/src/utils/mocks/mockDynamicIds.js +1 -2
- package/dist/styles.css +9 -0
- package/dist/system.cjs +90 -9
- package/dist/system.mjs +91 -10
- package/dist/tokens.json +20 -0
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/designTokens.d.ts +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.cjs
CHANGED
@@ -6325,6 +6325,26 @@ var tokens_default = {
|
|
6325
6325
|
lineHeight: 1.5,
|
6326
6326
|
textTransform: "none"
|
6327
6327
|
},
|
6328
|
+
"code-small": {
|
6329
|
+
fontFamily: [
|
6330
|
+
"Source Code Pro"
|
6331
|
+
],
|
6332
|
+
fontSize: "14px",
|
6333
|
+
fontWeight: 400,
|
6334
|
+
fontStyle: "normal",
|
6335
|
+
lineHeight: 1.42,
|
6336
|
+
textTransform: "none"
|
6337
|
+
},
|
6338
|
+
"code-small-strong": {
|
6339
|
+
fontFamily: [
|
6340
|
+
"Source Code Pro"
|
6341
|
+
],
|
6342
|
+
fontSize: "14px",
|
6343
|
+
fontWeight: 600,
|
6344
|
+
fontStyle: "normal",
|
6345
|
+
lineHeight: 1.42,
|
6346
|
+
textTransform: "none"
|
6347
|
+
},
|
6328
6348
|
"caption-small": {
|
6329
6349
|
fontFamily: [
|
6330
6350
|
"Inter"
|
@@ -6977,7 +6997,10 @@ var TooltipWrapper = import_react11.default.forwardRef(
|
|
6977
6997
|
const arrowStyle = getArrowStyle(ref.current, placement, (_a2 = arrowProps.style) != null ? _a2 : {});
|
6978
6998
|
return /* @__PURE__ */ import_react11.default.createElement(import_overlays2.OverlayContainer, null, /* @__PURE__ */ import_react11.default.createElement("div", __spreadValues({
|
6979
6999
|
ref,
|
6980
|
-
className: classNames(
|
7000
|
+
className: classNames(
|
7001
|
+
"Aquarium-Tooltip",
|
7002
|
+
tw("p-3 rounded-sm typography-caption max-w-[320px] bg-body-intense text-opposite-default")
|
7003
|
+
)
|
6981
7004
|
}, (0, import_utils.mergeProps)(props, tooltipProps)), props.children, /* @__PURE__ */ import_react11.default.createElement(Arrow, __spreadProps(__spreadValues({}, arrowProps), {
|
6982
7005
|
style: arrowStyle
|
6983
7006
|
}))));
|
@@ -7864,6 +7887,22 @@ Typography2.CodeStrong = (_a) => {
|
|
7864
7887
|
}));
|
7865
7888
|
};
|
7866
7889
|
Typography2.CodeStrong.displayName = "Typography.CodeStrong";
|
7890
|
+
Typography2.CodeSmall = (_a) => {
|
7891
|
+
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7892
|
+
return /* @__PURE__ */ import_react23.default.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
7893
|
+
htmlTag,
|
7894
|
+
variant: "code-small"
|
7895
|
+
}));
|
7896
|
+
};
|
7897
|
+
Typography2.CodeSmall.displayName = "Typography.Code";
|
7898
|
+
Typography2.CodeSmallStrong = (_a) => {
|
7899
|
+
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7900
|
+
return /* @__PURE__ */ import_react23.default.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
7901
|
+
htmlTag,
|
7902
|
+
variant: "code-small-strong"
|
7903
|
+
}));
|
7904
|
+
};
|
7905
|
+
Typography2.CodeSmallStrong.displayName = "Typography.CodeSmallStrong";
|
7867
7906
|
Typography2.LargeText = (_a) => {
|
7868
7907
|
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7869
7908
|
return /* @__PURE__ */ import_react23.default.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
@@ -11821,13 +11860,13 @@ var MenuWrapper = (_a) => {
|
|
11821
11860
|
"header",
|
11822
11861
|
"footer"
|
11823
11862
|
]);
|
11824
|
-
const
|
11863
|
+
const baseListRef = import_react74.default.useRef(null);
|
11825
11864
|
const disabledKeys = getDisabledItemKeys(props.children);
|
11826
11865
|
const state = (0, import_tree.useTreeState)(__spreadValues({
|
11827
11866
|
disabledKeys,
|
11828
11867
|
selectedKeys
|
11829
11868
|
}, props));
|
11830
|
-
const { menuProps } = (0, import_menu2.useMenu)(props, state,
|
11869
|
+
const { menuProps } = (0, import_menu2.useMenu)(props, state, baseListRef);
|
11831
11870
|
const { contains } = (0, import_i18n.useFilter)({ sensitivity: "base" });
|
11832
11871
|
const [search, setSearch] = import_react74.default.useState("");
|
11833
11872
|
const searchInputRef = import_react74.default.useRef(null);
|
@@ -11835,12 +11874,51 @@ var MenuWrapper = (_a) => {
|
|
11835
11874
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
11836
11875
|
[searchable, state.collection, search, contains]
|
11837
11876
|
);
|
11838
|
-
import_react74.
|
11877
|
+
const focusOnSearchInput = (0, import_react74.useCallback)(() => {
|
11839
11878
|
var _a2;
|
11879
|
+
(_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
11880
|
+
}, []);
|
11881
|
+
const focusOnBaseList = (0, import_react74.useCallback)(() => {
|
11882
|
+
var _a2;
|
11883
|
+
(_a2 = baseListRef.current) == null ? void 0 : _a2.focus();
|
11884
|
+
}, []);
|
11885
|
+
import_react74.default.useEffect(() => {
|
11840
11886
|
if (searchable) {
|
11841
|
-
(
|
11887
|
+
requestAnimationFrame(focusOnSearchInput);
|
11842
11888
|
}
|
11843
|
-
}, [searchable]);
|
11889
|
+
}, [searchable, focusOnSearchInput]);
|
11890
|
+
const onSearchInputKeyDown = (0, import_react74.useCallback)(
|
11891
|
+
(event) => {
|
11892
|
+
if (event.code === "ArrowDown") {
|
11893
|
+
focusOnBaseList();
|
11894
|
+
}
|
11895
|
+
},
|
11896
|
+
[focusOnBaseList]
|
11897
|
+
);
|
11898
|
+
const onMenuItemsKeyDown = (0, import_react74.useCallback)(
|
11899
|
+
(event) => {
|
11900
|
+
if (!searchable) {
|
11901
|
+
return;
|
11902
|
+
}
|
11903
|
+
if (event.shiftKey && event.code.startsWith("Shift") || event.altKey && event.code.startsWith("Alt") || event.ctrlKey || event.metaKey || [
|
11904
|
+
"ArrowUp",
|
11905
|
+
"ArrowDown",
|
11906
|
+
"ArrowLeft",
|
11907
|
+
"ArrowRight",
|
11908
|
+
"PageUp",
|
11909
|
+
"PageDown",
|
11910
|
+
"Home",
|
11911
|
+
"End",
|
11912
|
+
"Tab",
|
11913
|
+
"Enter",
|
11914
|
+
"Space"
|
11915
|
+
].includes(event.code)) {
|
11916
|
+
return;
|
11917
|
+
}
|
11918
|
+
focusOnSearchInput();
|
11919
|
+
},
|
11920
|
+
[searchable, focusOnSearchInput]
|
11921
|
+
);
|
11844
11922
|
return /* @__PURE__ */ import_react74.default.createElement(DropdownMenu, {
|
11845
11923
|
minWidth,
|
11846
11924
|
maxWidth,
|
@@ -11850,10 +11928,13 @@ var MenuWrapper = (_a) => {
|
|
11850
11928
|
"aria-label": "search",
|
11851
11929
|
value: search,
|
11852
11930
|
onChange: (e) => setSearch(e.target.value),
|
11931
|
+
onKeyDown: onSearchInputKeyDown,
|
11853
11932
|
className: tw("mb-5"),
|
11854
11933
|
ref: searchInputRef
|
11855
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ import_react74.default.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ import_react74.default.createElement(
|
11856
|
-
|
11934
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ import_react74.default.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ import_react74.default.createElement("div", {
|
11935
|
+
onKeyDown: onMenuItemsKeyDown
|
11936
|
+
}, /* @__PURE__ */ import_react74.default.createElement(DropdownMenu.List, __spreadValues({
|
11937
|
+
ref: baseListRef
|
11857
11938
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
11858
11939
|
if (isSectionNode(item)) {
|
11859
11940
|
return /* @__PURE__ */ import_react74.default.createElement(SectionWrapper, {
|
@@ -11868,7 +11949,7 @@ var MenuWrapper = (_a) => {
|
|
11868
11949
|
state
|
11869
11950
|
});
|
11870
11951
|
}
|
11871
|
-
}))), footer);
|
11952
|
+
})))), footer);
|
11872
11953
|
};
|
11873
11954
|
var ItemWrapper = ({ item, state }) => {
|
11874
11955
|
const ref = import_react74.default.useRef(null);
|
package/dist/system.mjs
CHANGED
@@ -6174,6 +6174,26 @@ var tokens_default = {
|
|
6174
6174
|
lineHeight: 1.5,
|
6175
6175
|
textTransform: "none"
|
6176
6176
|
},
|
6177
|
+
"code-small": {
|
6178
|
+
fontFamily: [
|
6179
|
+
"Source Code Pro"
|
6180
|
+
],
|
6181
|
+
fontSize: "14px",
|
6182
|
+
fontWeight: 400,
|
6183
|
+
fontStyle: "normal",
|
6184
|
+
lineHeight: 1.42,
|
6185
|
+
textTransform: "none"
|
6186
|
+
},
|
6187
|
+
"code-small-strong": {
|
6188
|
+
fontFamily: [
|
6189
|
+
"Source Code Pro"
|
6190
|
+
],
|
6191
|
+
fontSize: "14px",
|
6192
|
+
fontWeight: 600,
|
6193
|
+
fontStyle: "normal",
|
6194
|
+
lineHeight: 1.42,
|
6195
|
+
textTransform: "none"
|
6196
|
+
},
|
6177
6197
|
"caption-small": {
|
6178
6198
|
fontFamily: [
|
6179
6199
|
"Inter"
|
@@ -6826,7 +6846,10 @@ var TooltipWrapper = React8.forwardRef(
|
|
6826
6846
|
const arrowStyle = getArrowStyle(ref.current, placement, (_a2 = arrowProps.style) != null ? _a2 : {});
|
6827
6847
|
return /* @__PURE__ */ React8.createElement(OverlayContainer, null, /* @__PURE__ */ React8.createElement("div", __spreadValues({
|
6828
6848
|
ref,
|
6829
|
-
className: classNames(
|
6849
|
+
className: classNames(
|
6850
|
+
"Aquarium-Tooltip",
|
6851
|
+
tw("p-3 rounded-sm typography-caption max-w-[320px] bg-body-intense text-opposite-default")
|
6852
|
+
)
|
6830
6853
|
}, mergeProps(props, tooltipProps)), props.children, /* @__PURE__ */ React8.createElement(Arrow, __spreadProps(__spreadValues({}, arrowProps), {
|
6831
6854
|
style: arrowStyle
|
6832
6855
|
}))));
|
@@ -7713,6 +7736,22 @@ Typography2.CodeStrong = (_a) => {
|
|
7713
7736
|
}));
|
7714
7737
|
};
|
7715
7738
|
Typography2.CodeStrong.displayName = "Typography.CodeStrong";
|
7739
|
+
Typography2.CodeSmall = (_a) => {
|
7740
|
+
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7741
|
+
return /* @__PURE__ */ React19.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
7742
|
+
htmlTag,
|
7743
|
+
variant: "code-small"
|
7744
|
+
}));
|
7745
|
+
};
|
7746
|
+
Typography2.CodeSmall.displayName = "Typography.Code";
|
7747
|
+
Typography2.CodeSmallStrong = (_a) => {
|
7748
|
+
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7749
|
+
return /* @__PURE__ */ React19.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
7750
|
+
htmlTag,
|
7751
|
+
variant: "code-small-strong"
|
7752
|
+
}));
|
7753
|
+
};
|
7754
|
+
Typography2.CodeSmallStrong.displayName = "Typography.CodeSmallStrong";
|
7716
7755
|
Typography2.LargeText = (_a) => {
|
7717
7756
|
var _b = _a, { htmlTag = "div" } = _b, props = __objRest(_b, ["htmlTag"]);
|
7718
7757
|
return /* @__PURE__ */ React19.createElement(Typography, __spreadProps(__spreadValues({}, props), {
|
@@ -11440,7 +11479,7 @@ import React68 from "react";
|
|
11440
11479
|
import isFunction from "lodash/isFunction";
|
11441
11480
|
|
11442
11481
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
11443
|
-
import React67 from "react";
|
11482
|
+
import React67, { useCallback as useCallback2 } from "react";
|
11444
11483
|
import { useFilter } from "@react-aria/i18n";
|
11445
11484
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
11446
11485
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -11670,13 +11709,13 @@ var MenuWrapper = (_a) => {
|
|
11670
11709
|
"header",
|
11671
11710
|
"footer"
|
11672
11711
|
]);
|
11673
|
-
const
|
11712
|
+
const baseListRef = React67.useRef(null);
|
11674
11713
|
const disabledKeys = getDisabledItemKeys(props.children);
|
11675
11714
|
const state = useTreeState(__spreadValues({
|
11676
11715
|
disabledKeys,
|
11677
11716
|
selectedKeys
|
11678
11717
|
}, props));
|
11679
|
-
const { menuProps } = useMenu(props, state,
|
11718
|
+
const { menuProps } = useMenu(props, state, baseListRef);
|
11680
11719
|
const { contains } = useFilter({ sensitivity: "base" });
|
11681
11720
|
const [search, setSearch] = React67.useState("");
|
11682
11721
|
const searchInputRef = React67.useRef(null);
|
@@ -11684,12 +11723,51 @@ var MenuWrapper = (_a) => {
|
|
11684
11723
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
11685
11724
|
[searchable, state.collection, search, contains]
|
11686
11725
|
);
|
11687
|
-
|
11726
|
+
const focusOnSearchInput = useCallback2(() => {
|
11688
11727
|
var _a2;
|
11728
|
+
(_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
11729
|
+
}, []);
|
11730
|
+
const focusOnBaseList = useCallback2(() => {
|
11731
|
+
var _a2;
|
11732
|
+
(_a2 = baseListRef.current) == null ? void 0 : _a2.focus();
|
11733
|
+
}, []);
|
11734
|
+
React67.useEffect(() => {
|
11689
11735
|
if (searchable) {
|
11690
|
-
(
|
11736
|
+
requestAnimationFrame(focusOnSearchInput);
|
11691
11737
|
}
|
11692
|
-
}, [searchable]);
|
11738
|
+
}, [searchable, focusOnSearchInput]);
|
11739
|
+
const onSearchInputKeyDown = useCallback2(
|
11740
|
+
(event) => {
|
11741
|
+
if (event.code === "ArrowDown") {
|
11742
|
+
focusOnBaseList();
|
11743
|
+
}
|
11744
|
+
},
|
11745
|
+
[focusOnBaseList]
|
11746
|
+
);
|
11747
|
+
const onMenuItemsKeyDown = useCallback2(
|
11748
|
+
(event) => {
|
11749
|
+
if (!searchable) {
|
11750
|
+
return;
|
11751
|
+
}
|
11752
|
+
if (event.shiftKey && event.code.startsWith("Shift") || event.altKey && event.code.startsWith("Alt") || event.ctrlKey || event.metaKey || [
|
11753
|
+
"ArrowUp",
|
11754
|
+
"ArrowDown",
|
11755
|
+
"ArrowLeft",
|
11756
|
+
"ArrowRight",
|
11757
|
+
"PageUp",
|
11758
|
+
"PageDown",
|
11759
|
+
"Home",
|
11760
|
+
"End",
|
11761
|
+
"Tab",
|
11762
|
+
"Enter",
|
11763
|
+
"Space"
|
11764
|
+
].includes(event.code)) {
|
11765
|
+
return;
|
11766
|
+
}
|
11767
|
+
focusOnSearchInput();
|
11768
|
+
},
|
11769
|
+
[searchable, focusOnSearchInput]
|
11770
|
+
);
|
11693
11771
|
return /* @__PURE__ */ React67.createElement(DropdownMenu, {
|
11694
11772
|
minWidth,
|
11695
11773
|
maxWidth,
|
@@ -11699,10 +11777,13 @@ var MenuWrapper = (_a) => {
|
|
11699
11777
|
"aria-label": "search",
|
11700
11778
|
value: search,
|
11701
11779
|
onChange: (e) => setSearch(e.target.value),
|
11780
|
+
onKeyDown: onSearchInputKeyDown,
|
11702
11781
|
className: tw("mb-5"),
|
11703
11782
|
ref: searchInputRef
|
11704
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React67.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React67.createElement(
|
11705
|
-
|
11783
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React67.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React67.createElement("div", {
|
11784
|
+
onKeyDown: onMenuItemsKeyDown
|
11785
|
+
}, /* @__PURE__ */ React67.createElement(DropdownMenu.List, __spreadValues({
|
11786
|
+
ref: baseListRef
|
11706
11787
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
11707
11788
|
if (isSectionNode(item)) {
|
11708
11789
|
return /* @__PURE__ */ React67.createElement(SectionWrapper, {
|
@@ -11717,7 +11798,7 @@ var MenuWrapper = (_a) => {
|
|
11717
11798
|
state
|
11718
11799
|
});
|
11719
11800
|
}
|
11720
|
-
}))), footer);
|
11801
|
+
})))), footer);
|
11721
11802
|
};
|
11722
11803
|
var ItemWrapper = ({ item, state }) => {
|
11723
11804
|
const ref = React67.useRef(null);
|
package/dist/tokens.json
CHANGED
@@ -460,6 +460,26 @@
|
|
460
460
|
"lineHeight": 1.5,
|
461
461
|
"textTransform": "none"
|
462
462
|
},
|
463
|
+
"code-small": {
|
464
|
+
"fontFamily": [
|
465
|
+
"Source Code Pro"
|
466
|
+
],
|
467
|
+
"fontSize": "14px",
|
468
|
+
"fontWeight": 400,
|
469
|
+
"fontStyle": "normal",
|
470
|
+
"lineHeight": 1.42,
|
471
|
+
"textTransform": "none"
|
472
|
+
},
|
473
|
+
"code-small-strong": {
|
474
|
+
"fontFamily": [
|
475
|
+
"Source Code Pro"
|
476
|
+
],
|
477
|
+
"fontSize": "14px",
|
478
|
+
"fontWeight": 600,
|
479
|
+
"fontStyle": "normal",
|
480
|
+
"lineHeight": 1.42,
|
481
|
+
"textTransform": "none"
|
482
|
+
},
|
463
483
|
"caption-small": {
|
464
484
|
"fontFamily": [
|
465
485
|
"Inter"
|