@gen3/frontend 0.11.18 → 0.11.20

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.
Files changed (53) hide show
  1. package/dist/cjs/index.js +197 -90
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.d.ts +4 -0
  4. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.d.ts.map +1 -0
  5. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.js +192 -0
  6. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.js.map +1 -0
  7. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.stories.d.ts +13 -0
  8. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.stories.d.ts.map +1 -0
  9. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.stories.js +53 -0
  10. package/dist/dts/components/AddtoDataLibrary/AddToDataLibrary.stories.js.map +1 -0
  11. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.d.ts +15 -0
  12. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.d.ts.map +1 -0
  13. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.js +37 -0
  14. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.js.map +1 -0
  15. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.stories.d.ts +13 -0
  16. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.stories.d.ts.map +1 -0
  17. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.stories.js +15 -0
  18. package/dist/dts/components/AddtoDataLibrary/DataLibraryActionButton.stories.js.map +1 -0
  19. package/dist/dts/components/AddtoDataLibrary/types.d.ts +21 -0
  20. package/dist/dts/components/AddtoDataLibrary/types.d.ts.map +1 -0
  21. package/dist/dts/components/AddtoDataLibrary/types.js +2 -0
  22. package/dist/dts/components/AddtoDataLibrary/types.js.map +1 -0
  23. package/dist/dts/components/Details/DetailsDrawer.d.ts +2 -2
  24. package/dist/dts/components/Details/DetailsDrawer.d.ts.map +1 -1
  25. package/dist/dts/components/Details/DetailsDrawer.js +2 -2
  26. package/dist/dts/components/Details/DetailsDrawer.js.map +1 -1
  27. package/dist/dts/components/Providers/Gen3Provider.d.ts +22 -22
  28. package/dist/dts/components/charts/Charts.d.ts.map +1 -1
  29. package/dist/dts/components/charts/Charts.js +14 -12
  30. package/dist/dts/components/charts/Charts.js.map +1 -1
  31. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +6 -6
  32. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/types.d.ts +2 -1
  33. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/types.d.ts.map +1 -1
  34. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.d.ts.map +1 -1
  35. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.js +30 -4
  36. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.js.map +1 -1
  37. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js +1 -1
  38. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortManager.js.map +1 -1
  39. package/dist/dts/features/Navigation/Footer/FooterColumn.d.ts.map +1 -1
  40. package/dist/dts/features/Navigation/Footer/FooterColumn.js +3 -0
  41. package/dist/dts/features/Navigation/Footer/FooterColumn.js.map +1 -1
  42. package/dist/dts/features/Navigation/Footer/types.d.ts +1 -0
  43. package/dist/dts/features/Navigation/Footer/types.d.ts.map +1 -1
  44. package/dist/dts/features/Study/StudyDetails/SinglePageStudyDetailsPanel.js +4 -4
  45. package/dist/dts/features/Study/StudyDetails/SinglePageStudyDetailsPanel.js.map +1 -1
  46. package/dist/dts/features/Study/StudyDetails/StudyItems.d.ts.map +1 -1
  47. package/dist/dts/features/Study/StudyDetails/StudyItems.js +9 -5
  48. package/dist/dts/features/Study/StudyDetails/StudyItems.js.map +1 -1
  49. package/dist/esm/index.js +197 -90
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/index.d.ts +25 -23
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +3 -3
@@ -0,0 +1,4 @@
1
+ import { ExportActionButtonProps } from './types';
2
+ declare const AddToDataLibrary: ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode, classNames, }: ExportActionButtonProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default AddToDataLibrary;
4
+ //# sourceMappingURL=AddToDataLibrary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddToDataLibrary.d.ts","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/AddToDataLibrary.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAsClD,QAAA,MAAM,gBAAgB,GAAI,0FAMvB,uBAAuB,4CA+NzB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,192 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useEffect, useMemo, useState } from 'react';
14
+ import { Button, Group, ScrollArea, Combobox, TextInput, useCombobox, Tooltip, } from '@mantine/core';
15
+ import { notifications } from '@mantine/notifications';
16
+ import { extractFileDatasetsInRecords, useDataLibrary, buildListItemsGroupedByDataset, useCoreSelector, selectUserAuthStatus, isAuthenticated, DataLibraryStoreMode, } from '@gen3/core';
17
+ import { useDeepCompareEffect } from 'use-deep-compare';
18
+ import { mergeDefaultTailwindClassnames } from '../../utils/mergeDefaultTailwindClassnames';
19
+ var extractIdToLabel = function (data) {
20
+ return !data
21
+ ? {}
22
+ : Object.keys(data).reduce(function (acc, id) {
23
+ acc[id] = data[id].name;
24
+ return acc;
25
+ }, {});
26
+ };
27
+ var buildErrorMessage = function (error) {
28
+ if (error.status === 401) {
29
+ return 'Please log in to save to data library';
30
+ }
31
+ if (error.status === 404) {
32
+ return 'Cannot query data library. Please try again later.';
33
+ }
34
+ return 'Error saving to data library. Please try again later.';
35
+ };
36
+ var createTooltipLabel = function (error, isLoggedIn, requiresLogin, numSelected, currentListName) {
37
+ if (!isLoggedIn && requiresLogin)
38
+ return 'Please log in to save to data library';
39
+ if (numSelected === 0)
40
+ return 'Please select at least one study to save to data library';
41
+ if (!currentListName)
42
+ return 'Please select or create a list';
43
+ if (error)
44
+ return buildErrorMessage(error);
45
+ return 'Add selections to list';
46
+ };
47
+ var AddToDataLibrary = function (_a) {
48
+ var _b;
49
+ var buttonConfig = _a.buttonConfig, selectedResources = _a.selectedResources, exportDataFields = _a.exportDataFields, _c = _a.dataLibraryStoreMode, dataLibraryStoreMode = _c === void 0 ? DataLibraryStoreMode.ApiOnly : _c, _d = _a.classNames, classNames = _d === void 0 ? {} : _d;
50
+ var _e = useState({}), selectItems = _e[0], setSelectItems = _e[1];
51
+ var _f = useState(null), currentList = _f[0], setCurrentList = _f[1];
52
+ var _g = useState(null), error = _g[0], setError = _g[1];
53
+ var _h = useState(''), currentListName = _h[0], setCurrentListName = _h[1];
54
+ var combobox = useCombobox({
55
+ onDropdownClose: function () { return combobox.resetSelectedOption(); },
56
+ });
57
+ var userStatus = useCoreSelector(function (state) {
58
+ return selectUserAuthStatus(state);
59
+ });
60
+ var isLoggedIn = isAuthenticated(userStatus);
61
+ var isDisabled = error !== null ||
62
+ selectedResources.length === 0 ||
63
+ !currentListName ||
64
+ ((buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.requiresLogin) && !isLoggedIn);
65
+ var tooltipLabel = createTooltipLabel(error, isLoggedIn, buttonConfig.requiresLogin, selectedResources.length, currentListName);
66
+ var classNamesDefaults = {
67
+ root: 'w-1/2',
68
+ };
69
+ var mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
70
+ var _j = useDataLibrary({ storageMode: dataLibraryStoreMode }), dataLibrary = _j.dataLibrary, updateListInDataLibrary = _j.updateListInDataLibrary, addListToDataLibrary = _j.addListToDataLibrary, isLoading = _j.isLoading, isUpdating = _j.isUpdating, dataLibraryError = _j.error;
71
+ var saveToList = function (listname, listId) {
72
+ if (listId === void 0) { listId = undefined; }
73
+ if (selectedResources.length === 0)
74
+ return;
75
+ var items = buildListItemsGroupedByDataset(extractFileDatasetsInRecords(selectedResources, exportDataFields));
76
+ if (Object.keys(items).length === 0) {
77
+ notifications.show({
78
+ id: 'update-datalibrary-no-items-to-update-notification',
79
+ position: 'top-center',
80
+ withCloseButton: true,
81
+ autoClose: 5000,
82
+ title: 'Save to list',
83
+ message: "No data objects selected to save to list ".concat(listname, "."),
84
+ loading: false,
85
+ });
86
+ return;
87
+ }
88
+ if (listId) {
89
+ // updating list
90
+ updateListInDataLibrary({
91
+ id: listId,
92
+ name: listname,
93
+ items: __assign(__assign({}, dataLibrary[listId].items), items),
94
+ }).then(function (results) {
95
+ if (results.isError)
96
+ notifications.show({
97
+ id: 'update-datalibrary-list-error-notification',
98
+ position: 'top-center',
99
+ withCloseButton: true,
100
+ autoClose: 5000,
101
+ title: 'Save to list',
102
+ message: "Error saving to list ".concat(listname, "."),
103
+ loading: isUpdating !== null,
104
+ });
105
+ else
106
+ notifications.show({
107
+ id: 'update-datalibrary-list-notification',
108
+ position: 'top-center',
109
+ withCloseButton: true,
110
+ autoClose: 5000,
111
+ title: 'Save to list',
112
+ message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
113
+ loading: isUpdating !== null,
114
+ });
115
+ });
116
+ }
117
+ else {
118
+ addListToDataLibrary(items, listname).then(function (results) {
119
+ if (results.isError)
120
+ notifications.show({
121
+ id: 'update-datalibrary-list-error-notification',
122
+ position: 'top-center',
123
+ withCloseButton: true,
124
+ autoClose: 5000,
125
+ title: 'Save to list',
126
+ message: "Error saving to list ".concat(listname, "."),
127
+ loading: isUpdating !== null,
128
+ });
129
+ else
130
+ notifications.show({
131
+ id: 'update-datalibrary-list-notification',
132
+ position: 'top-center',
133
+ withCloseButton: true,
134
+ autoClose: 5000,
135
+ title: 'Save to list',
136
+ message: "".concat(Object.values(items).length, " datasets saved to list ").concat(listname, "."),
137
+ loading: isLoading,
138
+ });
139
+ });
140
+ }
141
+ };
142
+ var exactOptionMatch = Object.values(selectItems).some(function (listName) { return listName === currentListName; });
143
+ var filteredOptions = exactOptionMatch
144
+ ? selectItems
145
+ : Object.entries(selectItems).reduce(function (acc, _a) {
146
+ var listId = _a[0], listName = _a[1];
147
+ if (listName.toLowerCase().includes(currentListName.toLowerCase().trim())) {
148
+ acc[listId] = listName;
149
+ }
150
+ return acc;
151
+ }, {});
152
+ var options = useMemo(function () {
153
+ return Object.entries(filteredOptions).map(function (_a) {
154
+ var listId = _a[0], listName = _a[1];
155
+ return (_jsx(Combobox.Option, { value: listId, children: listName }, listId));
156
+ });
157
+ }, [filteredOptions]);
158
+ useEffect(function () {
159
+ if (options.length === 0)
160
+ setCurrentList(null);
161
+ }, [options]);
162
+ useDeepCompareEffect(function () {
163
+ if (dataLibrary)
164
+ if (!dataLibraryError) {
165
+ var listItems = extractIdToLabel(dataLibrary);
166
+ setSelectItems(listItems);
167
+ }
168
+ else {
169
+ setError(dataLibraryError);
170
+ }
171
+ }, [dataLibrary, dataLibraryError]);
172
+ return (_jsxs(Group, { "data-testid": "add-to-data-library", wrap: "nowrap", classNames: { root: mergedClassnames.root }, children: [_jsxs(Combobox, { onOptionSubmit: function (selectedValue) {
173
+ setCurrentList(selectedValue);
174
+ setCurrentListName(selectItems[selectedValue]);
175
+ combobox.closeDropdown();
176
+ }, store: combobox, withinPortal: false, children: [_jsx(Combobox.Target, { children: _jsx(TextInput, { placeholder: "Select/Search/Create List", value: currentListName !== null && currentListName !== void 0 ? currentListName : '', className: 'w-full', onChange: function (event) {
177
+ setCurrentListName(event.currentTarget.value);
178
+ combobox.openDropdown();
179
+ combobox.updateSelectedOptionIndex();
180
+ }, onClick: function () { return combobox.openDropdown(); }, onFocus: function () { return combobox.openDropdown(); }, onBlur: function () { return combobox.closeDropdown(); } }) }), _jsx(Combobox.Dropdown, { children: _jsx(Combobox.Options, { children: _jsx(ScrollArea.Autosize, { mah: 200, type: "scroll", children: options.length === 0 ? (_jsx(Combobox.Empty, { children: "Click button to create new list" })) : (options) }) }) })] }), _jsx(Tooltip, { label: tooltipLabel, children: _jsx(Button, { classNames: { root: 'w-1/3' }, loading: isLoading, disabled: isDisabled, onClick: function () {
181
+ if (currentList) {
182
+ saveToList(selectItems[currentList], currentList);
183
+ }
184
+ else {
185
+ saveToList(currentListName, undefined);
186
+ }
187
+ }, children: options.length === 0 && currentListName.length > 0
188
+ ? 'Save to New List'
189
+ : ((_b = buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.label) !== null && _b !== void 0 ? _b : 'Save to List') }) })] }));
190
+ };
191
+ export default AddToDataLibrary;
192
+ //# sourceMappingURL=AddToDataLibrary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddToDataLibrary.js","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/AddToDataLibrary.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,8BAA8B,EAE9B,eAAe,EAEf,oBAAoB,EACpB,eAAe,EACf,oBAAoB,GAErB,MAAM,YAAY,CAAC;AACpB,OA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AEX,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,YAC1B,KAAC,MAAM,IACL,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAC7B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE;wBACP,IAAI,WAAW,EAAE,CAAC;4BAChB,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;wBACpD,CAAC;6BAAM,CAAC;4BACN,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;wBACzC,CAAC;oBACH,CAAC,YAEA,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC;wBACjD,CAAC,CAAC,kBAAkB;wBACpB,CAAC,CAAC,CAAC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,mCAAI,cAAc,CAAC,GACpC,GACD,IACJ,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ component: ({ buttonConfig, selectedResources, exportDataFields, dataLibraryStoreMode, classNames, }: import("./types").ExportActionButtonProps) => import("react/jsx-runtime").JSX.Element;
4
+ parameters: {
5
+ deepControls: {
6
+ enabled: boolean;
7
+ };
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ //# sourceMappingURL=AddToDataLibrary.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddToDataLibrary.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/AddToDataLibrary.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,QAAA,MAAM,IAAI;;;;;;;CAK+B,CAAC;AAE1C,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA2CrB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import AddToDataLibrary from './AddToDataLibrary';
2
+ var meta = {
3
+ component: AddToDataLibrary,
4
+ parameters: {
5
+ deepControls: { enabled: true },
6
+ },
7
+ };
8
+ export default meta;
9
+ export var Default = {
10
+ args: {
11
+ buttonConfig: {
12
+ label: 'Add to List',
13
+ tooltip: 'Add selections to list',
14
+ },
15
+ selectedResources: [
16
+ {
17
+ __manifest: [
18
+ {
19
+ md5sum: 'a1890eb3da180416a3a1e2c4e4527356', // pragma: allowlist secret
20
+ file_name: 'teach.sav',
21
+ file_size: 1291786,
22
+ object_id: 'dg.5555/8d84511c',
23
+ },
24
+ {
25
+ md5sum: '32d8152b09a2ed05a0fde2f21ff46479', // pragma: allowlist secret
26
+ file_name: 'Teaching.zip',
27
+ file_size: 2565265,
28
+ object_id: 'dg.5555/3ca7d38-',
29
+ },
30
+ {
31
+ md5sum: 'dde1b1d86b3b4ed88fa5b42974ecfd79', // pragma: allowlist secret
32
+ file_name: 'tutorial.zip',
33
+ file_size: 94535,
34
+ object_id: 'dg.5555/0c8df5e3',
35
+ },
36
+ {
37
+ md5sum: '8f5b9b28004210865a0c1d7fc9834b1a', // pragma: allowlist secret
38
+ file_name: 'teach.csv',
39
+ file_size: 932272,
40
+ object_id: 'dg.5555/03ed62aa',
41
+ },
42
+ ],
43
+ dataset_id: '1010',
44
+ },
45
+ ],
46
+ exportDataFields: {
47
+ dataObjectField: '__manifest',
48
+ datasetIdField: 'dataset_id',
49
+ dataObjectIdField: 'object_id',
50
+ },
51
+ },
52
+ };
53
+ //# sourceMappingURL=AddToDataLibrary.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddToDataLibrary.stories.js","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/AddToDataLibrary.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,IAAM,IAAI,GAAG;IACX,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAChC;CACsC,CAAC;AAE1C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,wBAAwB;SAClC;QACD,iBAAiB,EAAE;YACjB;gBACE,UAAU,EAAE;oBACV;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,WAAW;wBACtB,SAAS,EAAE,OAAO;wBAClB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,cAAc;wBACzB,SAAS,EAAE,OAAO;wBAClB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,cAAc;wBACzB,SAAS,EAAE,KAAK;wBAChB,SAAS,EAAE,kBAAkB;qBAC9B;oBACD;wBACE,MAAM,EAAE,kCAAkC,EAAE,2BAA2B;wBACvE,SAAS,EAAE,WAAW;wBACtB,SAAS,EAAE,MAAM;wBACjB,SAAS,EAAE,kBAAkB;qBAC9B;iBACF;gBACD,UAAU,EAAE,MAAM;aACnB;SACF;QACD,gBAAgB,EAAE;YAChB,eAAe,EAAE,YAAY;YAC7B,cAAc,EAAE,YAAY;YAC5B,iBAAiB,EAAE,WAAW;SAC/B;KACF;CACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ButtonProps } from '@mantine/core';
3
+ export interface ExportActionButtonProps {
4
+ label?: string;
5
+ icon?: ReactNode;
6
+ disabled?: boolean;
7
+ tooltip?: string;
8
+ active?: boolean;
9
+ showIcon?: boolean;
10
+ loginRequired?: boolean;
11
+ onClick?: (items: Record<string, any> | Array<any>) => void;
12
+ }
13
+ declare const DataLibraryActionButton: React.ForwardRefExoticComponent<ExportActionButtonProps & ButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
+ export default DataLibraryActionButton;
15
+ //# sourceMappingURL=DataLibraryActionButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataLibraryActionButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/DataLibraryActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AACrD,OAAO,EAAU,WAAW,EAAmB,MAAM,eAAe,CAAC;AAIrE,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED,QAAA,MAAM,uBAAuB,iHAyC5B,CAAC;AAIF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,37 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { forwardRef } from 'react';
25
+ import { Button, Tooltip, Loader } from '@mantine/core';
26
+ import { FiDownload as DownloadIcon } from 'react-icons/fi';
27
+ import { useIsUserLoggedIn } from '@gen3/core';
28
+ var DataLibraryActionButton = forwardRef(function (_a, ref) {
29
+ var _b = _a.label, label = _b === void 0 ? undefined : _b, _c = _a.icon, icon = _c === void 0 ? undefined : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.tooltip, tooltip = _e === void 0 ? undefined : _e, _f = _a.onClick, onClick = _f === void 0 ? function () { return null; } : _f, _g = _a.active, active = _g === void 0 ? false : _g, _h = _a.showIcon, showIcon = _h === void 0 ? true : _h, _j = _a.loginRequired, loginRequired = _j === void 0 ? false : _j, buttonProps = __rest(_a, ["label", "icon", "disabled", "tooltip", "onClick", "active", "showIcon", "loginRequired"]);
30
+ // TODO Test what idp was used to login and restrict actions to that idp or all or none
31
+ var requiresLogin = !useIsUserLoggedIn() && loginRequired;
32
+ var buttonIcon = active ? (_jsx(Loader, { size: "sm", className: "p-1" })) : (_jsx(DownloadIcon, { title: "download", size: 16 }));
33
+ return (_jsx(Tooltip, { disabled: !tooltip, label: tooltip, children: _jsx(Button, __assign({ ref: ref, onClick: onClick, disabled: disabled || requiresLogin, leftSection: showIcon ? buttonIcon : undefined }, buttonProps, { children: label })) }));
34
+ });
35
+ DataLibraryActionButton.displayName = 'DataLibraryActionButton';
36
+ export default DataLibraryActionButton;
37
+ //# sourceMappingURL=DataLibraryActionButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataLibraryActionButton.js","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/DataLibraryActionButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,MAAM,EAAe,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAa/C,IAAM,uBAAuB,GAAG,UAAU,CAIxC,UACE,EAUwC,EACxC,GAAG;IAVD,IAAA,aAAiB,EAAjB,KAAK,mBAAG,SAAS,KAAA,EACjB,YAAgB,EAAhB,IAAI,mBAAG,SAAS,KAAA,EAChB,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,eAAmB,EAAnB,OAAO,mBAAG,SAAS,KAAA,EACnB,eAAoB,EAApB,OAAO,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA,EACpB,cAAc,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,gBAAe,EAAf,QAAQ,mBAAG,IAAI,KAAA,EACf,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EAClB,WAAW,cAThB,0FAUC,CADe;IAIhB,uFAAuF;IACvF,IAAM,aAAa,GAAG,CAAC,iBAAiB,EAAE,IAAI,aAAa,CAAC;IAE5D,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAC1B,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,KAAK,GAAG,CACrC,CAAC,CAAC,CAAC,CACF,KAAC,YAAY,IAAC,KAAK,EAAC,UAAU,EAAC,IAAI,EAAE,EAAE,GAAI,CAC5C,CAAC;IAEF,OAAO,CACL,KAAC,OAAO,IAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,YACzC,KAAC,MAAM,aACL,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,aAAa,EACnC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IAC1C,WAAW,cAEd,KAAK,IACC,GACD,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,uBAAuB,CAAC,WAAW,GAAG,yBAAyB,CAAC;AAEhE,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ component: import("react").ForwardRefExoticComponent<import("./DataLibraryActionButton").ExportActionButtonProps & import("@mantine/core").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ parameters: {
5
+ deepControls: {
6
+ enabled: boolean;
7
+ };
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ //# sourceMappingURL=DataLibraryActionButton.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataLibraryActionButton.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/DataLibraryActionButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,QAAA,MAAM,IAAI;;;;;;;CAKsC,CAAC;AAEjD,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import DataLibraryActionButton from './DataLibraryActionButton';
2
+ var meta = {
3
+ component: DataLibraryActionButton,
4
+ parameters: {
5
+ deepControls: { enabled: true },
6
+ },
7
+ };
8
+ export default meta;
9
+ export var Default = {
10
+ args: {
11
+ label: 'Download Action',
12
+ tooltip: 'Download action tooltip',
13
+ },
14
+ };
15
+ //# sourceMappingURL=DataLibraryActionButton.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataLibraryActionButton.stories.js","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/DataLibraryActionButton.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,IAAM,IAAI,GAAG;IACX,SAAS,EAAE,uBAAuB;IAClC,UAAU,EAAE;QACV,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAChC;CAC6C,CAAC;AAEjD,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,yBAAyB;KACnC;CACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { DataLibraryStoreMode, ExportDatasetFields } from '@gen3/core';
2
+ import { StylingOverride } from '../../types';
3
+ export interface ExportActionProps<T extends Record<string, any> = Record<string, any>> {
4
+ selectedResources: Array<T>;
5
+ exportDataFields: ExportDatasetFields;
6
+ verifyExternalLogins?: boolean;
7
+ dataLibraryStoreMode?: DataLibraryStoreMode;
8
+ }
9
+ export interface ButtonConfiguration {
10
+ label?: string;
11
+ icon?: string;
12
+ requiresLogin?: boolean;
13
+ tooltip?: string;
14
+ disabled?: boolean;
15
+ }
16
+ export interface ExportActionButtonProps<T extends Record<string, any> = Record<string, any>> extends ExportActionProps<T> {
17
+ buttonConfig: ButtonConfiguration;
18
+ classNames?: StylingOverride;
19
+ }
20
+ export type ActionButtonFunction<T extends Record<string, any> = Record<string, any>> = (props: ExportActionProps<T>) => void;
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEnD,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB,CACtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACnD,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAC5B,YAAY,EAAE,mBAAmB,CAAC;IAClC,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACjD,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/AddtoDataLibrary/types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { DetailsComponentProps } from './types';
2
- declare const DetailsDrawer: ({ id, panel, panelProps }: DetailsComponentProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { DetailsComponentProps, DetailsPanelComponentProps } from './types';
2
+ declare const DetailsDrawer: <T extends DetailsPanelComponentProps = DetailsPanelComponentProps>({ id, title, panel, panelProps, }: DetailsComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
3
3
  export default DetailsDrawer;
4
4
  //# sourceMappingURL=DetailsDrawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Details/DetailsDrawer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,QAAA,MAAM,aAAa,GAAI,2BAA2B,qBAAqB,4CAsBtE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"DetailsDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Details/DetailsDrawer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE5E,QAAA,MAAM,aAAa,GACjB,CAAC,SAAS,0BAA0B,GAAG,0BAA0B,EACjE,mCAKC,qBAAqB,CAAC,CAAC,CAAC,4CAqB1B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -15,7 +15,7 @@ import { Button, Drawer } from '@mantine/core';
15
15
  import { useDisclosure } from '@mantine/hooks';
16
16
  import { MdKeyboardDoubleArrowLeft as BackIcon } from 'react-icons/md';
17
17
  var DetailsDrawer = function (_a) {
18
- var id = _a.id, panel = _a.panel, panelProps = _a.panelProps;
18
+ var id = _a.id, title = _a.title, panel = _a.panel, panelProps = _a.panelProps;
19
19
  var _b = useDisclosure(id !== undefined), opened = _b[0], _c = _b[1], open = _c.open, close = _c.close;
20
20
  useEffect(function () {
21
21
  if (id !== undefined)
@@ -23,7 +23,7 @@ var DetailsDrawer = function (_a) {
23
23
  else
24
24
  close();
25
25
  }, [close, id, open]);
26
- return (_jsxs(Drawer.Root, { opened: opened, onClose: close, size: "50%", position: "right", children: [_jsx(Drawer.Overlay, { opacity: 0.5, blur: 4 }), _jsxs(Drawer.Content, { children: [_jsx(Drawer.Header, { children: _jsxs(Button, { leftSection: _jsx(BackIcon, {}), onClick: close, variant: "outline", children: [' ', "Back", ' '] }) }), _jsx(Drawer.Body, { children: panel(__assign({ id: id }, panelProps)) })] })] }));
26
+ return (_jsxs(Drawer.Root, { opened: opened, onClose: close, size: "50%", position: "right", children: [_jsx(Drawer.Overlay, { opacity: 0.5, blur: 4 }), _jsxs(Drawer.Content, { children: [_jsx(Drawer.Header, { children: _jsx(Button, { leftSection: _jsx(BackIcon, {}), onClick: close, variant: "outline", children: "Back" }) }), _jsx(Drawer.Body, { children: panel(__assign({ id: id }, panelProps)) })] })] }));
27
27
  };
28
28
  export default DetailsDrawer;
29
29
  //# sourceMappingURL=DetailsDrawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsDrawer.js","sourceRoot":"","sources":["../../../../src/components/Details/DetailsDrawer.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGvE,IAAM,aAAa,GAAG,UAAC,EAAgD;QAA9C,EAAE,QAAA,EAAE,KAAK,WAAA,EAAE,UAAU,gBAAA;IACtC,IAAA,KAA4B,aAAa,CAAC,EAAE,KAAK,SAAS,CAAC,EAA1D,MAAM,QAAA,EAAE,UAAe,EAAb,IAAI,UAAA,EAAE,KAAK,WAAqC,CAAC;IAElE,SAAS,CAAC;QACR,IAAI,EAAE,KAAK,SAAS;YAAE,IAA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,EAAE,KAAK,WAAqC,CAAC;IAElE,SAAS,CAAC;QACR,IAAI,EAAE,KAAK,SAAS;YAAE,IAAI,EAAE,CAAC;;YACxB,KAAK,EAAE,CAAC;IACf,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,MAAC,MAAM,CAAC,IAAI,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,aACtE,KAAC,MAAM,CAAC,OAAO,IAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAI,EACzC,MAAC,MAAM,CAAC,OAAO,eACb,KAAC,MAAM,CAAC,MAAM,cACZ,KAAC,MAAM,IAAC,WAAW,EAAE,KAAC,QAAQ,KAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAC,SAAS,qBAE3D,GACK,EAChB,KAAC,MAAM,CAAC,IAAI,cAAE,KAAK,YAAG,EAAE,EAAE,EAAE,IAAK,UAAU,EAAG,GAAe,IAC9C,IACL,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -17,20 +17,20 @@ export declare const createMantineTheme: (fonts: Fonts, colors: Record<string, T
17
17
  black?: string | undefined;
18
18
  colors?: {
19
19
  [x: string & {}]: import("@mantine/core").MantineColorsTuple | undefined;
20
- blue?: import("@mantine/core").MantineColorsTuple | undefined;
21
- cyan?: import("@mantine/core").MantineColorsTuple | undefined;
22
- gray?: import("@mantine/core").MantineColorsTuple | undefined;
23
20
  green?: import("@mantine/core").MantineColorsTuple | undefined;
21
+ dark?: import("@mantine/core").MantineColorsTuple | undefined;
22
+ gray?: import("@mantine/core").MantineColorsTuple | undefined;
23
+ red?: import("@mantine/core").MantineColorsTuple | undefined;
24
+ pink?: import("@mantine/core").MantineColorsTuple | undefined;
25
+ grape?: import("@mantine/core").MantineColorsTuple | undefined;
26
+ violet?: import("@mantine/core").MantineColorsTuple | undefined;
24
27
  indigo?: import("@mantine/core").MantineColorsTuple | undefined;
28
+ blue?: import("@mantine/core").MantineColorsTuple | undefined;
29
+ cyan?: import("@mantine/core").MantineColorsTuple | undefined;
25
30
  lime?: import("@mantine/core").MantineColorsTuple | undefined;
31
+ yellow?: import("@mantine/core").MantineColorsTuple | undefined;
26
32
  orange?: import("@mantine/core").MantineColorsTuple | undefined;
27
- pink?: import("@mantine/core").MantineColorsTuple | undefined;
28
- red?: import("@mantine/core").MantineColorsTuple | undefined;
29
33
  teal?: import("@mantine/core").MantineColorsTuple | undefined;
30
- violet?: import("@mantine/core").MantineColorsTuple | undefined;
31
- yellow?: import("@mantine/core").MantineColorsTuple | undefined;
32
- dark?: import("@mantine/core").MantineColorsTuple | undefined;
33
- grape?: import("@mantine/core").MantineColorsTuple | undefined;
34
34
  } | undefined;
35
35
  primaryShade?: import("@mantine/core").MantineColorShade | {
36
36
  light?: import("@mantine/core").MantineColorShade | undefined;
@@ -45,7 +45,7 @@ export declare const createMantineTheme: (fonts: Fonts, colors: Record<string, T
45
45
  headings?: {
46
46
  fontFamily?: string | undefined;
47
47
  fontWeight?: string | undefined;
48
- textWrap?: "wrap" | "nowrap" | "balance" | "pretty" | "stable" | undefined;
48
+ textWrap?: "wrap" | "balance" | "nowrap" | "pretty" | "stable" | undefined;
49
49
  sizes?: {
50
50
  h1?: {
51
51
  fontSize?: string | undefined;
@@ -81,53 +81,53 @@ export declare const createMantineTheme: (fonts: Fonts, colors: Record<string, T
81
81
  } | undefined;
82
82
  radius?: {
83
83
  [x: string & {}]: string | undefined;
84
+ xs?: string | undefined;
84
85
  sm?: string | undefined;
85
86
  md?: string | undefined;
86
- xl?: string | undefined;
87
- xs?: string | undefined;
88
87
  lg?: string | undefined;
88
+ xl?: string | undefined;
89
89
  } | undefined;
90
90
  defaultRadius?: import("@mantine/core").MantineRadius | undefined;
91
91
  spacing?: {
92
92
  [x: number]: string | undefined;
93
93
  [x: string & {}]: string | undefined;
94
+ xs?: string | undefined;
94
95
  sm?: string | undefined;
95
96
  md?: string | undefined;
96
- xl?: string | undefined;
97
- xs?: string | undefined;
98
97
  lg?: string | undefined;
98
+ xl?: string | undefined;
99
99
  } | undefined;
100
100
  fontSizes?: {
101
101
  [x: string & {}]: string | undefined;
102
+ xs?: string | undefined;
102
103
  sm?: string | undefined;
103
104
  md?: string | undefined;
104
- xl?: string | undefined;
105
- xs?: string | undefined;
106
105
  lg?: string | undefined;
106
+ xl?: string | undefined;
107
107
  } | undefined;
108
108
  lineHeights?: {
109
109
  [x: string & {}]: string | undefined;
110
+ xs?: string | undefined;
110
111
  sm?: string | undefined;
111
112
  md?: string | undefined;
112
- xl?: string | undefined;
113
- xs?: string | undefined;
114
113
  lg?: string | undefined;
114
+ xl?: string | undefined;
115
115
  } | undefined;
116
116
  breakpoints?: {
117
117
  [x: string & {}]: string | undefined;
118
+ xs?: string | undefined;
118
119
  sm?: string | undefined;
119
120
  md?: string | undefined;
120
- xl?: string | undefined;
121
- xs?: string | undefined;
122
121
  lg?: string | undefined;
122
+ xl?: string | undefined;
123
123
  } | undefined;
124
124
  shadows?: {
125
125
  [x: string & {}]: string | undefined;
126
+ xs?: string | undefined;
126
127
  sm?: string | undefined;
127
128
  md?: string | undefined;
128
- xl?: string | undefined;
129
- xs?: string | undefined;
130
129
  lg?: string | undefined;
130
+ xl?: string | undefined;
131
131
  } | undefined;
132
132
  respectReducedMotion?: boolean | undefined;
133
133
  cursorType?: "default" | "pointer" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Charts.d.ts","sourceRoot":"","sources":["../../../../src/components/charts/Charts.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AAoBpB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAwHD,QAAA,MAAM,MAAM,GAAI,mEAQb,WAAW,4CAkGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Charts.d.ts","sourceRoot":"","sources":["../../../../src/components/charts/Charts.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AAqBpB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAyID,QAAA,MAAM,MAAM,GAAI,mEAQb,WAAW,4CA4Gb,CAAC;AAEF,eAAe,MAAM,CAAC"}