ag-common 0.0.798 → 0.0.799
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/ui/components/DarkMode/Base.js +6 -36
- package/dist/ui/components/index.d.ts +0 -33
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/shadcn/button.d.ts +1 -1
- package/dist/ui/components/shadcn/dropdown-list.d.ts +13 -0
- package/dist/ui/components/shadcn/dropdown-list.js +57 -0
- package/dist/ui/components/shadcn/sheet.d.ts +1 -1
- package/dist/ui/icons/index.d.ts +1 -6
- package/dist/ui/icons/index.js +1 -4
- package/dist/ui/styles/common.d.ts +21 -14
- package/dist/ui/styles/common.js +44 -45
- package/dist/ui/styles/index.d.ts +0 -1
- package/dist/ui/styles/index.js +0 -1
- package/package.json +8 -13
- package/dist/ui/components/BarChart/Base.d.ts +0 -8
- package/dist/ui/components/BarChart/Base.js +0 -49
- package/dist/ui/components/BarChart/Item.d.ts +0 -12
- package/dist/ui/components/BarChart/Item.js +0 -38
- package/dist/ui/components/BarChart/Legend.d.ts +0 -8
- package/dist/ui/components/BarChart/Legend.js +0 -83
- package/dist/ui/components/BarChart/TooltipContent.d.ts +0 -8
- package/dist/ui/components/BarChart/TooltipContent.js +0 -51
- package/dist/ui/components/BarChart/getLegendItems.d.ts +0 -17
- package/dist/ui/components/BarChart/getLegendItems.js +0 -24
- package/dist/ui/components/BarChart/index.d.ts +0 -2
- package/dist/ui/components/BarChart/index.js +0 -17
- package/dist/ui/components/BarChart/types.d.ts +0 -9
- package/dist/ui/components/BarChart/types.js +0 -2
- package/dist/ui/components/BorderGradient/index.d.ts +0 -21
- package/dist/ui/components/BorderGradient/index.js +0 -77
- package/dist/ui/components/Chevron/index.d.ts +0 -12
- package/dist/ui/components/Chevron/index.js +0 -45
- package/dist/ui/components/Close/index.d.ts +0 -6
- package/dist/ui/components/Close/index.js +0 -41
- package/dist/ui/components/Confirm/Dialog.d.ts +0 -7
- package/dist/ui/components/Confirm/Dialog.js +0 -54
- package/dist/ui/components/Confirm/Modal.d.ts +0 -3
- package/dist/ui/components/Confirm/Modal.js +0 -53
- package/dist/ui/components/Confirm/index.d.ts +0 -3
- package/dist/ui/components/Confirm/index.js +0 -18
- package/dist/ui/components/Confirm/types.d.ts +0 -18
- package/dist/ui/components/Confirm/types.js +0 -2
- package/dist/ui/components/DropdownList/Base.d.ts +0 -3
- package/dist/ui/components/DropdownList/Base.js +0 -178
- package/dist/ui/components/DropdownList/Dialog.d.ts +0 -7
- package/dist/ui/components/DropdownList/Dialog.js +0 -54
- package/dist/ui/components/DropdownList/index.d.ts +0 -2
- package/dist/ui/components/DropdownList/index.js +0 -18
- package/dist/ui/components/DropdownList/types.d.ts +0 -37
- package/dist/ui/components/DropdownList/types.js +0 -2
- package/dist/ui/components/FlexColumn/index.d.ts +0 -3
- package/dist/ui/components/FlexColumn/index.js +0 -31
- package/dist/ui/components/FlexRow/index.d.ts +0 -3
- package/dist/ui/components/FlexRow/index.js +0 -37
- package/dist/ui/components/HorizontalScrollBar/index.d.ts +0 -5
- package/dist/ui/components/HorizontalScrollBar/index.js +0 -66
- package/dist/ui/components/Icon/index.d.ts +0 -31
- package/dist/ui/components/Icon/index.js +0 -69
- package/dist/ui/components/Image/index.d.ts +0 -13
- package/dist/ui/components/Image/index.js +0 -104
- package/dist/ui/components/InfiniteScroll/index.d.ts +0 -17
- package/dist/ui/components/InfiniteScroll/index.js +0 -99
- package/dist/ui/components/KebabDots/index.d.ts +0 -5
- package/dist/ui/components/KebabDots/index.js +0 -16
- package/dist/ui/components/LineChart/Base.d.ts +0 -3
- package/dist/ui/components/LineChart/Base.js +0 -121
- package/dist/ui/components/LineChart/LegendX.d.ts +0 -11
- package/dist/ui/components/LineChart/LegendX.js +0 -107
- package/dist/ui/components/LineChart/LegendY.d.ts +0 -7
- package/dist/ui/components/LineChart/LegendY.js +0 -44
- package/dist/ui/components/LineChart/TooltipContent.d.ts +0 -8
- package/dist/ui/components/LineChart/TooltipContent.js +0 -52
- package/dist/ui/components/LineChart/dateHelpers.d.ts +0 -3
- package/dist/ui/components/LineChart/dateHelpers.js +0 -36
- package/dist/ui/components/LineChart/getLegendItems.d.ts +0 -18
- package/dist/ui/components/LineChart/getLegendItems.js +0 -75
- package/dist/ui/components/LineChart/index.d.ts +0 -2
- package/dist/ui/components/LineChart/index.js +0 -17
- package/dist/ui/components/LineChart/interpolate.d.ts +0 -17
- package/dist/ui/components/LineChart/interpolate.js +0 -58
- package/dist/ui/components/LineChart/types.d.ts +0 -32
- package/dist/ui/components/LineChart/types.js +0 -2
- package/dist/ui/components/Loader/index.d.ts +0 -15
- package/dist/ui/components/Loader/index.js +0 -93
- package/dist/ui/components/MinSidebar/index.d.ts +0 -13
- package/dist/ui/components/MinSidebar/index.js +0 -93
- package/dist/ui/components/Modal/Dialog.d.ts +0 -8
- package/dist/ui/components/Modal/Dialog.js +0 -47
- package/dist/ui/components/Modal/Modal.d.ts +0 -7
- package/dist/ui/components/Modal/Modal.js +0 -178
- package/dist/ui/components/Modal/index.d.ts +0 -3
- package/dist/ui/components/Modal/index.js +0 -18
- package/dist/ui/components/Modal/types.d.ts +0 -16
- package/dist/ui/components/Modal/types.js +0 -2
- package/dist/ui/components/PieChart/index.d.ts +0 -11
- package/dist/ui/components/PieChart/index.js +0 -43
- package/dist/ui/components/ProgressBar/index.d.ts +0 -15
- package/dist/ui/components/ProgressBar/index.js +0 -96
- package/dist/ui/components/Prompt/Dialog.d.ts +0 -2
- package/dist/ui/components/Prompt/Dialog.js +0 -26
- package/dist/ui/components/Prompt/Modal.d.ts +0 -3
- package/dist/ui/components/Prompt/Modal.js +0 -111
- package/dist/ui/components/Prompt/index.d.ts +0 -3
- package/dist/ui/components/Prompt/index.js +0 -18
- package/dist/ui/components/Prompt/types.d.ts +0 -23
- package/dist/ui/components/Prompt/types.js +0 -2
- package/dist/ui/components/PulseRing/index.d.ts +0 -19
- package/dist/ui/components/PulseRing/index.js +0 -75
- package/dist/ui/components/RowOrColumn/index.d.ts +0 -15
- package/dist/ui/components/RowOrColumn/index.js +0 -46
- package/dist/ui/components/Search/AutoHideSearchBox.d.ts +0 -8
- package/dist/ui/components/Search/AutoHideSearchBox.js +0 -114
- package/dist/ui/components/Search/Dialog.d.ts +0 -7
- package/dist/ui/components/Search/Dialog.js +0 -60
- package/dist/ui/components/Search/Inline.d.ts +0 -3
- package/dist/ui/components/Search/Inline.js +0 -137
- package/dist/ui/components/Search/Modal.d.ts +0 -3
- package/dist/ui/components/Search/Modal.js +0 -28
- package/dist/ui/components/Search/SearchBox.d.ts +0 -16
- package/dist/ui/components/Search/SearchBox.js +0 -107
- package/dist/ui/components/Search/index.d.ts +0 -6
- package/dist/ui/components/Search/index.js +0 -21
- package/dist/ui/components/Search/types.d.ts +0 -49
- package/dist/ui/components/Search/types.js +0 -2
- package/dist/ui/components/Sidebar/index.d.ts +0 -11
- package/dist/ui/components/Sidebar/index.js +0 -194
- package/dist/ui/components/SparkLine/index.d.ts +0 -16
- package/dist/ui/components/SparkLine/index.js +0 -64
- package/dist/ui/components/TabBar/index.d.ts +0 -27
- package/dist/ui/components/TabBar/index.js +0 -100
- package/dist/ui/components/Table/index.d.ts +0 -11
- package/dist/ui/components/Table/index.js +0 -49
- package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +0 -14
- package/dist/ui/components/TextEdit/CheckboxEdit.js +0 -104
- package/dist/ui/components/TextEdit/ColourEdit.d.ts +0 -5
- package/dist/ui/components/TextEdit/ColourEdit.js +0 -63
- package/dist/ui/components/TextEdit/LengthBox.d.ts +0 -5
- package/dist/ui/components/TextEdit/LengthBox.js +0 -28
- package/dist/ui/components/TextEdit/ListboxEdit.d.ts +0 -14
- package/dist/ui/components/TextEdit/ListboxEdit.js +0 -61
- package/dist/ui/components/TextEdit/TextEdit.d.ts +0 -3
- package/dist/ui/components/TextEdit/TextEdit.js +0 -145
- package/dist/ui/components/TextEdit/common.d.ts +0 -19
- package/dist/ui/components/TextEdit/common.js +0 -61
- package/dist/ui/components/TextEdit/index.d.ts +0 -5
- package/dist/ui/components/TextEdit/index.js +0 -20
- package/dist/ui/components/TextEdit/types.d.ts +0 -65
- package/dist/ui/components/TextEdit/types.js +0 -2
- package/dist/ui/components/TextWithButton/index.d.ts +0 -10
- package/dist/ui/components/TextWithButton/index.js +0 -89
- package/dist/ui/components/Timeline/index.d.ts +0 -22
- package/dist/ui/components/Timeline/index.js +0 -72
- package/dist/ui/components/TimelineChart/index.d.ts +0 -21
- package/dist/ui/components/TimelineChart/index.js +0 -63
- package/dist/ui/components/TreeChart/TooltipContent.d.ts +0 -7
- package/dist/ui/components/TreeChart/TooltipContent.js +0 -34
- package/dist/ui/components/TreeChart/base.d.ts +0 -3
- package/dist/ui/components/TreeChart/base.js +0 -144
- package/dist/ui/components/TreeChart/helpers.d.ts +0 -4
- package/dist/ui/components/TreeChart/helpers.js +0 -41
- package/dist/ui/components/TreeChart/index.d.ts +0 -2
- package/dist/ui/components/TreeChart/index.js +0 -17
- package/dist/ui/components/TreeChart/types.d.ts +0 -27
- package/dist/ui/components/TreeChart/types.js +0 -2
- package/dist/ui/components/UserImage/index.d.ts +0 -26
- package/dist/ui/components/UserImage/index.js +0 -109
- package/dist/ui/icons/CrossIcon.d.ts +0 -5
- package/dist/ui/icons/CrossIcon.js +0 -24
- package/dist/ui/styles/standaloneStyles.d.ts +0 -24
- package/dist/ui/styles/standaloneStyles.js +0 -69
|
@@ -33,43 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
37
|
exports.DarkMode = exports.DarkModeAux = exports.UseDarkMode = void 0;
|
|
41
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
38
|
const react_1 = __importStar(require("react"));
|
|
43
39
|
const use_1 = require("../../helpers/cookie/use");
|
|
40
|
+
const utils_1 = require("../../helpers/utils");
|
|
44
41
|
const icons_1 = require("../../icons");
|
|
45
|
-
const FlexColumn_1 = require("../FlexColumn");
|
|
46
|
-
const Icon_1 = require("../Icon");
|
|
47
42
|
const types_1 = require("./types");
|
|
48
|
-
const Base = styled_1.default.div `
|
|
49
|
-
display: flex;
|
|
50
|
-
flex-flow: row;
|
|
51
|
-
&[data-mode='vert'] {
|
|
52
|
-
flex-flow: column;
|
|
53
|
-
}
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
border-radius: 2rem;
|
|
57
|
-
`;
|
|
58
|
-
const IconStyled = (0, styled_1.default)(Icon_1.Icon) `
|
|
59
|
-
> svg {
|
|
60
|
-
height: 60%;
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
const Label = (0, styled_1.default)(FlexColumn_1.FlexColumn) `
|
|
64
|
-
border-radius: 50%;
|
|
65
|
-
overflow: hidden;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
|
|
68
|
-
&[data-selected='true'] {
|
|
69
|
-
background-color: white;
|
|
70
|
-
cursor: default;
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
43
|
const getColours = (p, vert) => {
|
|
74
44
|
const deg = vert ? '180deg' : '90deg';
|
|
75
45
|
switch (p) {
|
|
@@ -123,7 +93,7 @@ exports.UseDarkMode = UseDarkMode;
|
|
|
123
93
|
const DarkModeAux = ({ iconSize = '2.5rem', className, mode, onSubmit, style, dm, }) => {
|
|
124
94
|
const [index, setIndex] = (0, react_1.useState)(modes.findIndex((d) => d.mode === dm.darkmode));
|
|
125
95
|
const [fill, background] = getColours(modes[index].mode, mode === 'vert');
|
|
126
|
-
const twCalc = `calc(${iconSize} + ${iconSize} + ${iconSize} )`;
|
|
96
|
+
const twCalc = `calc(${iconSize} + ${iconSize} + ${iconSize} + 8px)`;
|
|
127
97
|
const setDarkmode = (newDarkMode) => {
|
|
128
98
|
let className = '';
|
|
129
99
|
if (newDarkMode === types_1.TDarkMode.dark) {
|
|
@@ -149,12 +119,12 @@ const DarkModeAux = ({ iconSize = '2.5rem', className, mode, onSubmit, style, dm
|
|
|
149
119
|
dm.setDarkmode(newDarkMode);
|
|
150
120
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(newDarkMode);
|
|
151
121
|
};
|
|
152
|
-
return (react_1.default.createElement(
|
|
153
|
-
width: iconSize
|
|
122
|
+
return (react_1.default.createElement("div", { className: (0, utils_1.cn)('flex flex-row overflow-hidden justify-between items-center rounded-4xl', 'data-[mode=vert]:flex-col', className), "data-mode": mode !== null && mode !== void 0 ? mode : 'horiz', style: Object.assign(Object.assign(Object.assign({}, style), { background, border: `solid 2px ${fill}`, width: twCalc, height: `calc(${iconSize} + 8px)`, padding: '2px', boxSizing: 'border-box' }), (mode === 'vert' && {
|
|
123
|
+
width: `calc(${iconSize} + 8px)`,
|
|
154
124
|
height: twCalc,
|
|
155
125
|
})) }, modes.map((v, i) => {
|
|
156
126
|
const selected = index === i;
|
|
157
|
-
return (react_1.default.createElement(
|
|
127
|
+
return (react_1.default.createElement("div", { className: (0, utils_1.cn)('flex flex-col items-center justify-center rounded-full overflow-hidden cursor-pointer', 'data-[selected=true]:bg-white data-[selected=true]:cursor-default'), "data-selected": selected, style: { width: iconSize, height: iconSize },
|
|
158
128
|
// eslint-disable-next-line react/no-array-index-key
|
|
159
129
|
key: i.toString(), onClick: () => {
|
|
160
130
|
if (index === i) {
|
|
@@ -163,7 +133,7 @@ const DarkModeAux = ({ iconSize = '2.5rem', className, mode, onSubmit, style, dm
|
|
|
163
133
|
setIndex(i);
|
|
164
134
|
setDarkmode(v.mode);
|
|
165
135
|
} },
|
|
166
|
-
react_1.default.createElement(
|
|
136
|
+
react_1.default.createElement("div", { className: "[&>svg]:h-[70%] flex justify-center items-center w-full h-full" }, v.icon({ style: { fill: selected ? fill : 'white' } }))));
|
|
167
137
|
})));
|
|
168
138
|
};
|
|
169
139
|
exports.DarkModeAux = DarkModeAux;
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
export * from './BarChart';
|
|
2
|
-
export * from './BorderGradient';
|
|
3
|
-
export * from './Chevron';
|
|
4
|
-
export * from './Close';
|
|
5
|
-
export * from './Confirm';
|
|
6
1
|
export * from './DarkMode';
|
|
7
|
-
export * from './DropdownList';
|
|
8
|
-
export * from './FlexColumn';
|
|
9
|
-
export * from './FlexRow';
|
|
10
2
|
export * from './HeadersRaw';
|
|
11
|
-
export * from './HorizontalScrollBar';
|
|
12
|
-
export * from './Icon';
|
|
13
|
-
export * from './Image';
|
|
14
|
-
export * from './InfiniteScroll';
|
|
15
|
-
export * from './KebabDots';
|
|
16
|
-
export * from './LineChart';
|
|
17
|
-
export * from './Loader';
|
|
18
3
|
export * from './Markdown';
|
|
19
|
-
export * from './MinSidebar';
|
|
20
|
-
export * from './Modal';
|
|
21
|
-
export * from './PieChart';
|
|
22
|
-
export * from './ProgressBar';
|
|
23
|
-
export * from './Prompt';
|
|
24
|
-
export * from './PulseRing';
|
|
25
|
-
export * from './RowOrColumn';
|
|
26
|
-
export * from './Search';
|
|
27
|
-
export * from './shadcn';
|
|
28
|
-
export * from './Sidebar';
|
|
29
|
-
export * from './SparkLine';
|
|
30
|
-
export * from './TabBar';
|
|
31
|
-
export * from './Table';
|
|
32
|
-
export * from './TextEdit';
|
|
33
|
-
export * from './TextWithButton';
|
|
34
|
-
export * from './TimelineChart';
|
|
35
|
-
export * from './TreeChart';
|
|
36
|
-
export * from './UserImage';
|
|
@@ -14,39 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./BarChart"), exports);
|
|
18
|
-
__exportStar(require("./BorderGradient"), exports);
|
|
19
|
-
__exportStar(require("./Chevron"), exports);
|
|
20
|
-
__exportStar(require("./Close"), exports);
|
|
21
|
-
__exportStar(require("./Confirm"), exports);
|
|
22
17
|
__exportStar(require("./DarkMode"), exports);
|
|
23
|
-
__exportStar(require("./DropdownList"), exports);
|
|
24
|
-
__exportStar(require("./FlexColumn"), exports);
|
|
25
|
-
__exportStar(require("./FlexRow"), exports);
|
|
26
18
|
__exportStar(require("./HeadersRaw"), exports);
|
|
27
|
-
__exportStar(require("./HorizontalScrollBar"), exports);
|
|
28
|
-
__exportStar(require("./Icon"), exports);
|
|
29
|
-
__exportStar(require("./Image"), exports);
|
|
30
|
-
__exportStar(require("./InfiniteScroll"), exports);
|
|
31
|
-
__exportStar(require("./KebabDots"), exports);
|
|
32
|
-
__exportStar(require("./LineChart"), exports);
|
|
33
|
-
__exportStar(require("./Loader"), exports);
|
|
34
19
|
__exportStar(require("./Markdown"), exports);
|
|
35
|
-
__exportStar(require("./MinSidebar"), exports);
|
|
36
|
-
__exportStar(require("./Modal"), exports);
|
|
37
|
-
__exportStar(require("./PieChart"), exports);
|
|
38
|
-
__exportStar(require("./ProgressBar"), exports);
|
|
39
|
-
__exportStar(require("./Prompt"), exports);
|
|
40
|
-
__exportStar(require("./PulseRing"), exports);
|
|
41
|
-
__exportStar(require("./RowOrColumn"), exports);
|
|
42
|
-
__exportStar(require("./Search"), exports);
|
|
43
|
-
__exportStar(require("./shadcn"), exports);
|
|
44
|
-
__exportStar(require("./Sidebar"), exports);
|
|
45
|
-
__exportStar(require("./SparkLine"), exports);
|
|
46
|
-
__exportStar(require("./TabBar"), exports);
|
|
47
|
-
__exportStar(require("./Table"), exports);
|
|
48
|
-
__exportStar(require("./TextEdit"), exports);
|
|
49
|
-
__exportStar(require("./TextWithButton"), exports);
|
|
50
|
-
__exportStar(require("./TimelineChart"), exports);
|
|
51
|
-
__exportStar(require("./TreeChart"), exports);
|
|
52
|
-
__exportStar(require("./UserImage"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "link" | "
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface DropdownListOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DropdownListProps {
|
|
7
|
+
options: string[] | DropdownListOption[];
|
|
8
|
+
renderF?: (value: string) => React.ReactNode;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DropdownList: ({ options, renderF, onChange, children, className, }: DropdownListProps) => React.JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.DropdownList = void 0;
|
|
38
|
+
const DropdownMenuPrimitive = __importStar(require("@radix-ui/react-dropdown-menu"));
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const utils_1 = require("../../helpers/utils");
|
|
41
|
+
const DropdownList = ({ options, renderF, onChange, children, className, }) => {
|
|
42
|
+
const [open, setOpen] = React.useState(false);
|
|
43
|
+
const handleSelect = (value) => {
|
|
44
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
45
|
+
setOpen(false);
|
|
46
|
+
};
|
|
47
|
+
return (React.createElement(DropdownMenuPrimitive.Root, { open: open, onOpenChange: setOpen },
|
|
48
|
+
React.createElement(DropdownMenuPrimitive.Trigger, { asChild: true, className: className }, children),
|
|
49
|
+
React.createElement(DropdownMenuPrimitive.Portal, null,
|
|
50
|
+
React.createElement(DropdownMenuPrimitive.Content, { className: (0, utils_1.cn)('z-[1200] min-w-[8rem] overflow-hidden rounded-md border border-main-fg-mid bg-main-bg text-main-fg shadow-md', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2'), align: "end" }, options.map((option, index) => {
|
|
51
|
+
const value = typeof option === 'string' ? option : option.value;
|
|
52
|
+
const label = typeof option === 'string' ? option : option.label;
|
|
53
|
+
const isLast = index === options.length - 1;
|
|
54
|
+
return (React.createElement(DropdownMenuPrimitive.Item, { key: value, className: (0, utils_1.cn)('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-main-bg-mid focus:text-main-fg data-[disabled]:pointer-events-none data-[disabled]:opacity-50', !isLast && 'border-b border-main-bg-mid'), onSelect: () => handleSelect(value) }, renderF ? renderF(value) : label));
|
|
55
|
+
})))));
|
|
56
|
+
};
|
|
57
|
+
exports.DropdownList = DropdownList;
|
|
@@ -7,7 +7,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogC
|
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>) => React.JSX.Element;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "left" | "right" | "
|
|
10
|
+
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|
package/dist/ui/icons/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Circle } from './Circle';
|
|
|
4
4
|
import { CircleDot } from './CircleDot';
|
|
5
5
|
import { Cog } from './Cog';
|
|
6
6
|
import { Computer } from './Computer';
|
|
7
|
-
import { CrossIcon } from './CrossIcon';
|
|
8
7
|
import { Door } from './Door';
|
|
9
8
|
import { Hamburger } from './Hamburger';
|
|
10
9
|
import { HorizontalDots } from './HorizontalDots';
|
|
@@ -43,10 +42,6 @@ declare const icons: {
|
|
|
43
42
|
fill?: string;
|
|
44
43
|
} & import("react").CSSProperties;
|
|
45
44
|
}) => import("react").JSX.Element;
|
|
46
|
-
CrossIcon: ({ className, onClick, }: {
|
|
47
|
-
className?: string;
|
|
48
|
-
onClick?: () => void;
|
|
49
|
-
}) => import("react").JSX.Element;
|
|
50
45
|
Door: import("react").JSX.Element;
|
|
51
46
|
Hamburger: ({ className }: {
|
|
52
47
|
className?: string;
|
|
@@ -83,4 +78,4 @@ declare const icons: {
|
|
|
83
78
|
} & import("react").CSSProperties;
|
|
84
79
|
}) => import("react").JSX.Element;
|
|
85
80
|
};
|
|
86
|
-
export { Checkmark, ChevronRight, Circle, CircleDot, Cog, Computer,
|
|
81
|
+
export { Checkmark, ChevronRight, Circle, CircleDot, Cog, Computer, Door, Hamburger, HorizontalDots, House, icons, Magnify, Moon, Pencil, Save, Sun, Undo, UserOutline, Warning, };
|
package/dist/ui/icons/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Warning = exports.UserOutline = exports.Undo = exports.Sun = exports.Save = exports.Pencil = exports.Moon = exports.Magnify = exports.icons = exports.House = exports.HorizontalDots = exports.Hamburger = exports.Door = exports.
|
|
3
|
+
exports.Warning = exports.UserOutline = exports.Undo = exports.Sun = exports.Save = exports.Pencil = exports.Moon = exports.Magnify = exports.icons = exports.House = exports.HorizontalDots = exports.Hamburger = exports.Door = exports.Computer = exports.Cog = exports.CircleDot = exports.Circle = exports.ChevronRight = exports.Checkmark = void 0;
|
|
4
4
|
const Checkmark_1 = require("./Checkmark");
|
|
5
5
|
Object.defineProperty(exports, "Checkmark", { enumerable: true, get: function () { return Checkmark_1.Checkmark; } });
|
|
6
6
|
const ChevronRight_1 = require("./ChevronRight");
|
|
@@ -13,8 +13,6 @@ const Cog_1 = require("./Cog");
|
|
|
13
13
|
Object.defineProperty(exports, "Cog", { enumerable: true, get: function () { return Cog_1.Cog; } });
|
|
14
14
|
const Computer_1 = require("./Computer");
|
|
15
15
|
Object.defineProperty(exports, "Computer", { enumerable: true, get: function () { return Computer_1.Computer; } });
|
|
16
|
-
const CrossIcon_1 = require("./CrossIcon");
|
|
17
|
-
Object.defineProperty(exports, "CrossIcon", { enumerable: true, get: function () { return CrossIcon_1.CrossIcon; } });
|
|
18
16
|
const Door_1 = require("./Door");
|
|
19
17
|
Object.defineProperty(exports, "Door", { enumerable: true, get: function () { return Door_1.Door; } });
|
|
20
18
|
const Hamburger_1 = require("./Hamburger");
|
|
@@ -46,7 +44,6 @@ const icons = {
|
|
|
46
44
|
Circle: Circle_1.Circle,
|
|
47
45
|
CircleDot: CircleDot_1.CircleDot,
|
|
48
46
|
Computer: Computer_1.Computer,
|
|
49
|
-
CrossIcon: CrossIcon_1.CrossIcon,
|
|
50
47
|
Door: Door_1.Door,
|
|
51
48
|
Hamburger: Hamburger_1.Hamburger,
|
|
52
49
|
House: House_1.House,
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
/** function that returns
|
|
1
|
+
import React, { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
/** function that returns a style object for text outline drop shadow.
|
|
3
3
|
* @param outlineColour default='white'
|
|
4
4
|
* @param sizePx default = 1px
|
|
5
5
|
*/
|
|
6
|
-
export declare const HardOutline: (outlineColour?: string, sizePx?: number) =>
|
|
6
|
+
export declare const HardOutline: (outlineColour?: string, sizePx?: number) => React.CSSProperties;
|
|
7
7
|
export declare const HardOutlineFilter: (outlineColour?: string, sizePx?: number) => string;
|
|
8
|
-
/** disable user text selection */
|
|
9
|
-
export declare const NoTextSelect
|
|
10
|
-
/** enable text overflow
|
|
11
|
-
* @param lines number of lines before overflow
|
|
8
|
+
/** disable user text selection - returns Tailwind className */
|
|
9
|
+
export declare const NoTextSelect = "select-none";
|
|
10
|
+
/** enable text overflow - returns Tailwind className
|
|
11
|
+
* @param lines number of lines before overflow (1-10 supported by Tailwind, or use arbitrary value)
|
|
12
12
|
*/
|
|
13
|
-
export declare const TextOverflowEllipsis: (lines: number) =>
|
|
13
|
+
export declare const TextOverflowEllipsis: (lines: number) => string;
|
|
14
14
|
/** stop dragging of element */
|
|
15
15
|
export declare const noDrag: {
|
|
16
16
|
draggable: boolean;
|
|
17
17
|
onDragStart: React.DragEventHandler<HTMLDivElement>;
|
|
18
18
|
onTouchStart: React.TouchEventHandler<HTMLDivElement>;
|
|
19
19
|
};
|
|
20
|
-
/** apply bounce effect given a condition
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
/** apply bounce effect given a condition
|
|
21
|
+
* Returns className and style for bounce animation
|
|
22
|
+
* @param isActive whether the bounce is active (transform translateY to 0)
|
|
23
|
+
* @returns object with className and style for the bounce effect
|
|
24
|
+
*/
|
|
25
|
+
export declare const bounce: (isActive?: boolean) => {
|
|
26
|
+
className: string;
|
|
27
|
+
style: React.CSSProperties;
|
|
28
|
+
};
|
|
29
|
+
export declare const Card: ({ children, className, ...props }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
} & React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
26
33
|
export interface IVarStyles {
|
|
27
34
|
/** default var(--main-fg) */
|
|
28
35
|
color: string;
|
package/dist/ui/styles/common.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
10
|
+
t[p[i]] = s[p[i]];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
3
14
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
16
|
};
|
|
6
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
18
|
exports.getVarStyles = exports.Card = exports.bounce = exports.noDrag = exports.TextOverflowEllipsis = exports.NoTextSelect = exports.HardOutlineFilter = exports.HardOutline = void 0;
|
|
8
|
-
const react_1 = require("
|
|
9
|
-
|
|
10
|
-
const colours_1 = require("./colours");
|
|
11
|
-
/** function that returns css that gives a text outline drop shadow.
|
|
19
|
+
const react_1 = __importDefault(require("react"));
|
|
20
|
+
/** function that returns a style object for text outline drop shadow.
|
|
12
21
|
* @param outlineColour default='white'
|
|
13
22
|
* @param sizePx default = 1px
|
|
14
23
|
*/
|
|
15
|
-
const HardOutline = (outlineColour = 'white', sizePx = 1) => (
|
|
16
|
-
filter:
|
|
17
|
-
|
|
24
|
+
const HardOutline = (outlineColour = 'white', sizePx = 1) => ({
|
|
25
|
+
filter: (0, exports.HardOutlineFilter)(outlineColour, sizePx),
|
|
26
|
+
});
|
|
18
27
|
exports.HardOutline = HardOutline;
|
|
19
28
|
const HardOutlineFilter = (outlineColour = 'white', sizePx = 1) => {
|
|
20
29
|
const px = `${sizePx}px`;
|
|
@@ -24,24 +33,19 @@ const HardOutlineFilter = (outlineColour = 'white', sizePx = 1) => {
|
|
|
24
33
|
drop-shadow(-${px} -${px} 0px ${outlineColour})`;
|
|
25
34
|
};
|
|
26
35
|
exports.HardOutlineFilter = HardOutlineFilter;
|
|
27
|
-
/** disable user text selection */
|
|
28
|
-
exports.NoTextSelect =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-khtml-user-select: none; /* Konqueror HTML */
|
|
32
|
-
-moz-user-select: none; /* Firefox */
|
|
33
|
-
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
34
|
-
`;
|
|
35
|
-
/** enable text overflow
|
|
36
|
-
* @param lines number of lines before overflow
|
|
36
|
+
/** disable user text selection - returns Tailwind className */
|
|
37
|
+
exports.NoTextSelect = 'select-none';
|
|
38
|
+
/** enable text overflow - returns Tailwind className
|
|
39
|
+
* @param lines number of lines before overflow (1-10 supported by Tailwind, or use arbitrary value)
|
|
37
40
|
*/
|
|
38
|
-
const TextOverflowEllipsis = (lines) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`;
|
|
41
|
+
const TextOverflowEllipsis = (lines) => {
|
|
42
|
+
// Tailwind supports line-clamp-1 through line-clamp-10
|
|
43
|
+
if (lines >= 1 && lines <= 10) {
|
|
44
|
+
return `line-clamp-${lines}`;
|
|
45
|
+
}
|
|
46
|
+
// For values outside 1-10, use arbitrary value
|
|
47
|
+
return `line-clamp-[${lines}]`;
|
|
48
|
+
};
|
|
45
49
|
exports.TextOverflowEllipsis = TextOverflowEllipsis;
|
|
46
50
|
/** stop dragging of element */
|
|
47
51
|
exports.noDrag = {
|
|
@@ -55,28 +59,23 @@ exports.noDrag = {
|
|
|
55
59
|
e.stopPropagation();
|
|
56
60
|
},
|
|
57
61
|
};
|
|
58
|
-
/** apply bounce effect given a condition
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
/** apply bounce effect given a condition
|
|
63
|
+
* Returns className and style for bounce animation
|
|
64
|
+
* @param isActive whether the bounce is active (transform translateY to 0)
|
|
65
|
+
* @returns object with className and style for the bounce effect
|
|
66
|
+
*/
|
|
67
|
+
const bounce = (isActive = false) => ({
|
|
68
|
+
className: `transition-opacity transition-transform duration-200 origin-center ${isActive ? 'translate-y-0' : '-translate-y-[5px]'}`,
|
|
69
|
+
style: {
|
|
70
|
+
transitionTimingFunction: 'cubic-bezier(0.02, 1.5, 0.74, 1.23)',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
69
73
|
exports.bounce = bounce;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
border-radius: 0.5rem;
|
|
76
|
-
max-width: 40rem;
|
|
77
|
-
padding: 1rem;
|
|
78
|
-
border: solid 2px ${colours_1.colours.lighter};
|
|
79
|
-
`;
|
|
74
|
+
const Card = (_a) => {
|
|
75
|
+
var { children, className = '' } = _a, props = __rest(_a, ["children", "className"]);
|
|
76
|
+
return (react_1.default.createElement("div", Object.assign({ className: `bg-white m-2 relative rounded-lg max-w-[40rem] p-4 border-2 border-lighter ${className}` }, props), children));
|
|
77
|
+
};
|
|
78
|
+
exports.Card = Card;
|
|
80
79
|
const getVarStyles = (raw) => {
|
|
81
80
|
var _a, _b, _c;
|
|
82
81
|
return (Object.assign(Object.assign({}, raw), { color: (_a = raw === null || raw === void 0 ? void 0 : raw.color) !== null && _a !== void 0 ? _a : 'var(--main-fg)', backgroundColor: (_b = raw === null || raw === void 0 ? void 0 : raw.backgroundColor) !== null && _b !== void 0 ? _b : 'var(--main-bg)', borderColor: (_c = raw === null || raw === void 0 ? void 0 : raw.borderColor) !== null && _c !== void 0 ? _c : 'var(--main-bg-mid)' }));
|
package/dist/ui/styles/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.799",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -43,8 +43,6 @@
|
|
|
43
43
|
"@aws-sdk/lib-dynamodb": "^3.902.0",
|
|
44
44
|
"@aws-sdk/s3-presigned-post": "^3.901.0",
|
|
45
45
|
"@azure/cosmos": "^4.5.1",
|
|
46
|
-
"@emotion/react": "^11.14.0",
|
|
47
|
-
"@emotion/styled": "^11.14.1",
|
|
48
46
|
"@google/genai": "^1.22.0",
|
|
49
47
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
50
48
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
@@ -61,15 +59,12 @@
|
|
|
61
59
|
"@radix-ui/react-switch": "^1.2.6",
|
|
62
60
|
"@radix-ui/react-toast": "^1.2.15",
|
|
63
61
|
"@smithy/types": "^4.6.0",
|
|
64
|
-
"@storybook/addon-docs": "^
|
|
65
|
-
"@storybook/addon-links": "^
|
|
66
|
-
"@storybook/addon-styling-webpack": "^
|
|
62
|
+
"@storybook/addon-docs": "^10.0.8",
|
|
63
|
+
"@storybook/addon-links": "^10.0.8",
|
|
64
|
+
"@storybook/addon-styling-webpack": "^3.0.0",
|
|
67
65
|
"@storybook/addons": "^7.6.17",
|
|
68
|
-
"@storybook/
|
|
69
|
-
"@storybook/react": "^
|
|
70
|
-
"@storybook/react-vite": "^9.1.10",
|
|
71
|
-
"@storybook/react-webpack5": "^9.1.10",
|
|
72
|
-
"@storybook/theming": "^8.6.14",
|
|
66
|
+
"@storybook/react-vite": "^10.0.8",
|
|
67
|
+
"@storybook/react-webpack5": "^10.0.8",
|
|
73
68
|
"@types/jsonwebtoken": "^9.0.10",
|
|
74
69
|
"@types/node": "^24.7.0",
|
|
75
70
|
"@types/react": "^19.2.2",
|
|
@@ -78,13 +73,13 @@
|
|
|
78
73
|
"@typescript-eslint/parser": "^8.46.0",
|
|
79
74
|
"aws-cdk-lib": "^2.219.0",
|
|
80
75
|
"buffer": "^6.0.3",
|
|
81
|
-
"eslint-plugin-storybook": "^
|
|
76
|
+
"eslint-plugin-storybook": "^10.0.8",
|
|
82
77
|
"globstar": "^1.0.0",
|
|
83
78
|
"jsonwebtoken": "^9.0.2",
|
|
84
79
|
"jwks-rsa": "^3.2.0",
|
|
85
80
|
"node-cache": "^5.1.2",
|
|
86
81
|
"rimraf": "^6.0.1",
|
|
87
|
-
"storybook": "^
|
|
82
|
+
"storybook": "^10.0.8"
|
|
88
83
|
},
|
|
89
84
|
"files": [
|
|
90
85
|
"dist/**/*",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type IVarStyles } from '../../styles/common';
|
|
3
|
-
import type { IBarChartData } from './types';
|
|
4
|
-
export declare const BarChart: ({ data: dataRaw, style: sRaw, className, }: {
|
|
5
|
-
data: IBarChartData[];
|
|
6
|
-
style?: Partial<IVarStyles>;
|
|
7
|
-
className?: string;
|
|
8
|
-
}) => React.JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BarChart = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const useTooltip_1 = require("../../helpers/useTooltip");
|
|
10
|
-
const common_1 = require("../../styles/common");
|
|
11
|
-
const Item_1 = require("./Item");
|
|
12
|
-
const Legend_1 = require("./Legend");
|
|
13
|
-
const TooltipContent_1 = require("./TooltipContent");
|
|
14
|
-
const BarChartBase = styled_1.default.div `
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-flow: column;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
margin-top: 0.5rem;
|
|
20
|
-
position: relative;
|
|
21
|
-
`;
|
|
22
|
-
const ItemStyled = (0, styled_1.default)(Item_1.Item) `
|
|
23
|
-
margin-bottom: 0.75rem;
|
|
24
|
-
height: auto;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
|
|
27
|
-
&:last-of-type {
|
|
28
|
-
margin-bottom: 0;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
const BarChart = ({ data: dataRaw, style: sRaw, className, }) => {
|
|
32
|
-
const style = (0, common_1.getVarStyles)(sRaw);
|
|
33
|
-
const UT = (0, useTooltip_1.useTooltip)();
|
|
34
|
-
const maxWidth = Math.max(...dataRaw.map((a) => a.total));
|
|
35
|
-
return (react_1.default.createElement(BarChartBase, { "data-type": "bcb", style: style, className: className },
|
|
36
|
-
react_1.default.createElement(UT.Comp, { pos: UT.pos }, ({ data }) => react_1.default.createElement(TooltipContent_1.TooltipContent, Object.assign({}, data, { style: style }))),
|
|
37
|
-
dataRaw.map((data) => (react_1.default.createElement(ItemStyled, { style: style, key: data.name, data: data, maxWidth: maxWidth, onMouseLeave: () => UT.setPos(undefined), onMouseMove: (element) => {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
const selectedKey = (_b = (_a = document
|
|
40
|
-
.elementFromPoint(element.pageX, element.pageY)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-barchartitem-key')) !== null && _b !== void 0 ? _b : '';
|
|
41
|
-
UT.setPos({
|
|
42
|
-
element,
|
|
43
|
-
parent: element.currentTarget.closest("[data-type='bcb']"),
|
|
44
|
-
data: { selectedKey, data },
|
|
45
|
-
});
|
|
46
|
-
} }))),
|
|
47
|
-
react_1.default.createElement(Legend_1.Legend, { data: dataRaw, maxWidth: maxWidth, style: style })));
|
|
48
|
-
};
|
|
49
|
-
exports.BarChart = BarChart;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MouseEventHandler } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { IVarStyles } from '../../styles';
|
|
4
|
-
import type { IBarChartData } from './types';
|
|
5
|
-
export declare const Item: ({ data, className, onMouseMove, onMouseLeave, maxWidth, style, }: {
|
|
6
|
-
data: IBarChartData;
|
|
7
|
-
className?: string;
|
|
8
|
-
onMouseMove?: MouseEventHandler<HTMLDivElement>;
|
|
9
|
-
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
10
|
-
maxWidth: number;
|
|
11
|
-
style: IVarStyles;
|
|
12
|
-
}) => React.JSX.Element;
|