ag-common 0.0.797 → 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.
Files changed (171) hide show
  1. package/dist/ui/components/DarkMode/Base.js +6 -36
  2. package/dist/ui/components/Markdown/index.js +4 -29
  3. package/dist/ui/components/index.d.ts +0 -33
  4. package/dist/ui/components/index.js +0 -33
  5. package/dist/ui/components/shadcn/button.d.ts +1 -1
  6. package/dist/ui/components/shadcn/dropdown-list.d.ts +13 -0
  7. package/dist/ui/components/shadcn/dropdown-list.js +57 -0
  8. package/dist/ui/components/shadcn/sheet.d.ts +1 -1
  9. package/dist/ui/icons/index.d.ts +1 -6
  10. package/dist/ui/icons/index.js +1 -4
  11. package/dist/ui/styles/common.d.ts +21 -14
  12. package/dist/ui/styles/common.js +44 -45
  13. package/dist/ui/styles/index.d.ts +0 -1
  14. package/dist/ui/styles/index.js +0 -1
  15. package/package.json +8 -13
  16. package/dist/ui/components/BarChart/Base.d.ts +0 -8
  17. package/dist/ui/components/BarChart/Base.js +0 -49
  18. package/dist/ui/components/BarChart/Item.d.ts +0 -12
  19. package/dist/ui/components/BarChart/Item.js +0 -38
  20. package/dist/ui/components/BarChart/Legend.d.ts +0 -8
  21. package/dist/ui/components/BarChart/Legend.js +0 -83
  22. package/dist/ui/components/BarChart/TooltipContent.d.ts +0 -8
  23. package/dist/ui/components/BarChart/TooltipContent.js +0 -51
  24. package/dist/ui/components/BarChart/getLegendItems.d.ts +0 -17
  25. package/dist/ui/components/BarChart/getLegendItems.js +0 -24
  26. package/dist/ui/components/BarChart/index.d.ts +0 -2
  27. package/dist/ui/components/BarChart/index.js +0 -17
  28. package/dist/ui/components/BarChart/types.d.ts +0 -9
  29. package/dist/ui/components/BarChart/types.js +0 -2
  30. package/dist/ui/components/BorderGradient/index.d.ts +0 -21
  31. package/dist/ui/components/BorderGradient/index.js +0 -77
  32. package/dist/ui/components/Chevron/index.d.ts +0 -12
  33. package/dist/ui/components/Chevron/index.js +0 -45
  34. package/dist/ui/components/Close/index.d.ts +0 -6
  35. package/dist/ui/components/Close/index.js +0 -41
  36. package/dist/ui/components/Confirm/Dialog.d.ts +0 -7
  37. package/dist/ui/components/Confirm/Dialog.js +0 -54
  38. package/dist/ui/components/Confirm/Modal.d.ts +0 -3
  39. package/dist/ui/components/Confirm/Modal.js +0 -53
  40. package/dist/ui/components/Confirm/index.d.ts +0 -3
  41. package/dist/ui/components/Confirm/index.js +0 -18
  42. package/dist/ui/components/Confirm/types.d.ts +0 -18
  43. package/dist/ui/components/Confirm/types.js +0 -2
  44. package/dist/ui/components/DropdownList/Base.d.ts +0 -3
  45. package/dist/ui/components/DropdownList/Base.js +0 -178
  46. package/dist/ui/components/DropdownList/Dialog.d.ts +0 -7
  47. package/dist/ui/components/DropdownList/Dialog.js +0 -54
  48. package/dist/ui/components/DropdownList/index.d.ts +0 -2
  49. package/dist/ui/components/DropdownList/index.js +0 -18
  50. package/dist/ui/components/DropdownList/types.d.ts +0 -37
  51. package/dist/ui/components/DropdownList/types.js +0 -2
  52. package/dist/ui/components/FlexColumn/index.d.ts +0 -3
  53. package/dist/ui/components/FlexColumn/index.js +0 -31
  54. package/dist/ui/components/FlexRow/index.d.ts +0 -3
  55. package/dist/ui/components/FlexRow/index.js +0 -37
  56. package/dist/ui/components/HorizontalScrollBar/index.d.ts +0 -5
  57. package/dist/ui/components/HorizontalScrollBar/index.js +0 -66
  58. package/dist/ui/components/Icon/index.d.ts +0 -31
  59. package/dist/ui/components/Icon/index.js +0 -69
  60. package/dist/ui/components/Image/index.d.ts +0 -13
  61. package/dist/ui/components/Image/index.js +0 -104
  62. package/dist/ui/components/InfiniteScroll/index.d.ts +0 -17
  63. package/dist/ui/components/InfiniteScroll/index.js +0 -99
  64. package/dist/ui/components/KebabDots/index.d.ts +0 -5
  65. package/dist/ui/components/KebabDots/index.js +0 -16
  66. package/dist/ui/components/LineChart/Base.d.ts +0 -3
  67. package/dist/ui/components/LineChart/Base.js +0 -121
  68. package/dist/ui/components/LineChart/LegendX.d.ts +0 -11
  69. package/dist/ui/components/LineChart/LegendX.js +0 -107
  70. package/dist/ui/components/LineChart/LegendY.d.ts +0 -7
  71. package/dist/ui/components/LineChart/LegendY.js +0 -44
  72. package/dist/ui/components/LineChart/TooltipContent.d.ts +0 -8
  73. package/dist/ui/components/LineChart/TooltipContent.js +0 -52
  74. package/dist/ui/components/LineChart/dateHelpers.d.ts +0 -3
  75. package/dist/ui/components/LineChart/dateHelpers.js +0 -36
  76. package/dist/ui/components/LineChart/getLegendItems.d.ts +0 -18
  77. package/dist/ui/components/LineChart/getLegendItems.js +0 -75
  78. package/dist/ui/components/LineChart/index.d.ts +0 -2
  79. package/dist/ui/components/LineChart/index.js +0 -17
  80. package/dist/ui/components/LineChart/interpolate.d.ts +0 -17
  81. package/dist/ui/components/LineChart/interpolate.js +0 -58
  82. package/dist/ui/components/LineChart/types.d.ts +0 -32
  83. package/dist/ui/components/LineChart/types.js +0 -2
  84. package/dist/ui/components/Loader/index.d.ts +0 -15
  85. package/dist/ui/components/Loader/index.js +0 -93
  86. package/dist/ui/components/MinSidebar/index.d.ts +0 -13
  87. package/dist/ui/components/MinSidebar/index.js +0 -93
  88. package/dist/ui/components/Modal/Dialog.d.ts +0 -8
  89. package/dist/ui/components/Modal/Dialog.js +0 -47
  90. package/dist/ui/components/Modal/Modal.d.ts +0 -7
  91. package/dist/ui/components/Modal/Modal.js +0 -178
  92. package/dist/ui/components/Modal/index.d.ts +0 -3
  93. package/dist/ui/components/Modal/index.js +0 -18
  94. package/dist/ui/components/Modal/types.d.ts +0 -16
  95. package/dist/ui/components/Modal/types.js +0 -2
  96. package/dist/ui/components/PieChart/index.d.ts +0 -11
  97. package/dist/ui/components/PieChart/index.js +0 -43
  98. package/dist/ui/components/ProgressBar/index.d.ts +0 -15
  99. package/dist/ui/components/ProgressBar/index.js +0 -96
  100. package/dist/ui/components/Prompt/Dialog.d.ts +0 -2
  101. package/dist/ui/components/Prompt/Dialog.js +0 -26
  102. package/dist/ui/components/Prompt/Modal.d.ts +0 -3
  103. package/dist/ui/components/Prompt/Modal.js +0 -111
  104. package/dist/ui/components/Prompt/index.d.ts +0 -3
  105. package/dist/ui/components/Prompt/index.js +0 -18
  106. package/dist/ui/components/Prompt/types.d.ts +0 -23
  107. package/dist/ui/components/Prompt/types.js +0 -2
  108. package/dist/ui/components/PulseRing/index.d.ts +0 -19
  109. package/dist/ui/components/PulseRing/index.js +0 -75
  110. package/dist/ui/components/RowOrColumn/index.d.ts +0 -15
  111. package/dist/ui/components/RowOrColumn/index.js +0 -46
  112. package/dist/ui/components/Search/AutoHideSearchBox.d.ts +0 -8
  113. package/dist/ui/components/Search/AutoHideSearchBox.js +0 -114
  114. package/dist/ui/components/Search/Dialog.d.ts +0 -7
  115. package/dist/ui/components/Search/Dialog.js +0 -60
  116. package/dist/ui/components/Search/Inline.d.ts +0 -3
  117. package/dist/ui/components/Search/Inline.js +0 -137
  118. package/dist/ui/components/Search/Modal.d.ts +0 -3
  119. package/dist/ui/components/Search/Modal.js +0 -28
  120. package/dist/ui/components/Search/SearchBox.d.ts +0 -16
  121. package/dist/ui/components/Search/SearchBox.js +0 -107
  122. package/dist/ui/components/Search/index.d.ts +0 -6
  123. package/dist/ui/components/Search/index.js +0 -21
  124. package/dist/ui/components/Search/types.d.ts +0 -49
  125. package/dist/ui/components/Search/types.js +0 -2
  126. package/dist/ui/components/Sidebar/index.d.ts +0 -11
  127. package/dist/ui/components/Sidebar/index.js +0 -194
  128. package/dist/ui/components/SparkLine/index.d.ts +0 -16
  129. package/dist/ui/components/SparkLine/index.js +0 -64
  130. package/dist/ui/components/TabBar/index.d.ts +0 -27
  131. package/dist/ui/components/TabBar/index.js +0 -100
  132. package/dist/ui/components/Table/index.d.ts +0 -11
  133. package/dist/ui/components/Table/index.js +0 -49
  134. package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +0 -14
  135. package/dist/ui/components/TextEdit/CheckboxEdit.js +0 -104
  136. package/dist/ui/components/TextEdit/ColourEdit.d.ts +0 -5
  137. package/dist/ui/components/TextEdit/ColourEdit.js +0 -63
  138. package/dist/ui/components/TextEdit/LengthBox.d.ts +0 -5
  139. package/dist/ui/components/TextEdit/LengthBox.js +0 -28
  140. package/dist/ui/components/TextEdit/ListboxEdit.d.ts +0 -14
  141. package/dist/ui/components/TextEdit/ListboxEdit.js +0 -61
  142. package/dist/ui/components/TextEdit/TextEdit.d.ts +0 -3
  143. package/dist/ui/components/TextEdit/TextEdit.js +0 -145
  144. package/dist/ui/components/TextEdit/common.d.ts +0 -19
  145. package/dist/ui/components/TextEdit/common.js +0 -61
  146. package/dist/ui/components/TextEdit/index.d.ts +0 -5
  147. package/dist/ui/components/TextEdit/index.js +0 -20
  148. package/dist/ui/components/TextEdit/types.d.ts +0 -65
  149. package/dist/ui/components/TextEdit/types.js +0 -2
  150. package/dist/ui/components/TextWithButton/index.d.ts +0 -10
  151. package/dist/ui/components/TextWithButton/index.js +0 -89
  152. package/dist/ui/components/Timeline/index.d.ts +0 -22
  153. package/dist/ui/components/Timeline/index.js +0 -72
  154. package/dist/ui/components/TimelineChart/index.d.ts +0 -21
  155. package/dist/ui/components/TimelineChart/index.js +0 -63
  156. package/dist/ui/components/TreeChart/TooltipContent.d.ts +0 -7
  157. package/dist/ui/components/TreeChart/TooltipContent.js +0 -34
  158. package/dist/ui/components/TreeChart/base.d.ts +0 -3
  159. package/dist/ui/components/TreeChart/base.js +0 -144
  160. package/dist/ui/components/TreeChart/helpers.d.ts +0 -4
  161. package/dist/ui/components/TreeChart/helpers.js +0 -41
  162. package/dist/ui/components/TreeChart/index.d.ts +0 -2
  163. package/dist/ui/components/TreeChart/index.js +0 -17
  164. package/dist/ui/components/TreeChart/types.d.ts +0 -27
  165. package/dist/ui/components/TreeChart/types.js +0 -2
  166. package/dist/ui/components/UserImage/index.d.ts +0 -26
  167. package/dist/ui/components/UserImage/index.js +0 -109
  168. package/dist/ui/icons/CrossIcon.d.ts +0 -5
  169. package/dist/ui/icons/CrossIcon.js +0 -24
  170. package/dist/ui/styles/standaloneStyles.d.ts +0 -24
  171. package/dist/ui/styles/standaloneStyles.js +0 -69
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Dialog"), exports);
18
- __exportStar(require("./Modal"), exports);
@@ -1,16 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- export interface IModal {
3
- open: boolean;
4
- setOpen: (b: boolean, e: Event) => void;
5
- children: React.ReactNode;
6
- position?: 'left' | 'right' | 'center';
7
- topPosition?: 'bottom' | 'top' | 'center';
8
- showCloseButton?: boolean;
9
- closeOnMoveMouseOutside?: boolean;
10
- className?: string;
11
- closeOnClickOutside?: boolean;
12
- /** if provided, will create inside this #id. default "ag-modal-portal". if null, wont use global id */
13
- portalId?: string | null;
14
- /**applied to modal inside fixed */
15
- style?: CSSProperties;
16
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- export interface IPieChartData {
3
- label: string;
4
- value: number;
5
- color: string;
6
- }
7
- export interface IPieChart {
8
- data: IPieChartData[];
9
- className?: string;
10
- }
11
- export declare const PieChart: React.FC<IPieChart>;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PieChart = void 0;
8
- const styled_1 = __importDefault(require("@emotion/styled"));
9
- const react_1 = __importDefault(require("react"));
10
- const Base = styled_1.default.div `
11
- width: 100%;
12
- height: 100%;
13
- `;
14
- const PieChart = ({ data, className }) => {
15
- const total = data.reduce((sum, { value }) => sum + value, 0);
16
- const width = 500;
17
- const height = 500;
18
- const centerX = width / 2;
19
- const centerY = height / 2;
20
- const radius = Math.min(width, height) / 2;
21
- let cumulativeAngle = 0;
22
- return (react_1.default.createElement(Base, { className: className },
23
- react_1.default.createElement("svg", { viewBox: `0 0 ${width} ${height}` }, data.map(({ label, value, color }) => {
24
- const angle = (value / total) * 360;
25
- const startX = centerX + radius * Math.cos((cumulativeAngle * Math.PI) / 180);
26
- const startY = centerY + radius * Math.sin((cumulativeAngle * Math.PI) / 180);
27
- const endX = centerX +
28
- radius * Math.cos(((cumulativeAngle + angle) * Math.PI) / 180);
29
- const endY = centerY +
30
- radius * Math.sin(((cumulativeAngle + angle) * Math.PI) / 180);
31
- const largeArcFlag = angle > 180 ? 1 : 0;
32
- const midAngle = cumulativeAngle + angle / 2;
33
- const midX = centerX + radius * 0.75 * Math.cos((midAngle * Math.PI) / 180);
34
- const midY = centerY + radius * 0.75 * Math.sin((midAngle * Math.PI) / 180);
35
- cumulativeAngle += angle;
36
- return (react_1.default.createElement("g", { key: label },
37
- react_1.default.createElement("title", null, `${label}: ${value}`),
38
- react_1.default.createElement("path", { d: `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endX} ${endY} L ${centerX} ${centerY} Z`, fill: color }),
39
- react_1.default.createElement("text", { x: midX, y: midY, textAnchor: "middle", alignmentBaseline: "middle", stroke: "white", strokeWidth: "6px" }, label),
40
- react_1.default.createElement("text", { x: midX, y: midY, textAnchor: "middle", alignmentBaseline: "middle", fill: "black" }, label)));
41
- }))));
42
- };
43
- exports.PieChart = PieChart;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- export interface IProgressBar {
3
- min: number;
4
- max: number;
5
- /** default #4d76ff */
6
- frontColour?: string;
7
- /** default #eee */
8
- backColour?: string;
9
- /** default 25,50,75 */
10
- dotPercentages?: number[] | null;
11
- className?: string;
12
- /** if true, will transition to the end in X ms */
13
- transitionToMs?: number;
14
- }
15
- export declare const ProgressBar: (p: IProgressBar) => React.JSX.Element;
@@ -1,96 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.ProgressBar = void 0;
41
- const styled_1 = __importDefault(require("@emotion/styled"));
42
- const react_1 = __importStar(require("react"));
43
- const styles_1 = require("../../styles");
44
- const Base = styled_1.default.div `
45
- position: relative;
46
- min-width: 5rem;
47
- width: 100%;
48
- height: 2rem;
49
- border-radius: 1rem;
50
- overflow: hidden;
51
- `;
52
- const Bar = styled_1.default.div `
53
- position: absolute;
54
- top: 0;
55
- bottom: 0;
56
- left: 0;
57
- `;
58
- const Dot = styled_1.default.div `
59
- position: absolute;
60
- top: calc(50% - 0.25rem);
61
- width: 0.5rem;
62
- height: 0.5rem;
63
- background-color: #aaa;
64
- z-index: 1;
65
- border-radius: 50%;
66
- &[data-invert='true'] {
67
- background-color: #333;
68
- }
69
- `;
70
- const ProgressBar = (p) => {
71
- const { transitionToMs = 200, frontColour = styles_1.colours.notificationBlue, backColour = '#eee', dotPercentages = [25, 50, 75], } = p;
72
- const [barWidth, setBarWidth] = (0, react_1.useState)((p.min / p.max) * 100);
73
- (0, react_1.useEffect)(() => {
74
- const newbw = (p.min / p.max) * 100;
75
- if (barWidth !== newbw) {
76
- setBarWidth(newbw);
77
- }
78
- // eslint-disable-next-line react-hooks/exhaustive-deps
79
- }, [p.min, p.max]);
80
- (0, react_1.useEffect)(() => {
81
- if (transitionToMs) {
82
- setBarWidth(p.max);
83
- }
84
- // eslint-disable-next-line react-hooks/exhaustive-deps
85
- }, []);
86
- return (react_1.default.createElement(Base, { style: {
87
- backgroundColor: backColour,
88
- }, className: p.className },
89
- react_1.default.createElement(Bar, { style: {
90
- width: `${barWidth}%`,
91
- backgroundColor: frontColour,
92
- transition: `width ${transitionToMs}ms linear`,
93
- } }), dotPercentages === null || dotPercentages === void 0 ? void 0 :
94
- dotPercentages.map((v) => (react_1.default.createElement(Dot, { key: v, style: { left: `calc(${v}% - 0.25rem)` }, "data-invert": v > barWidth })))));
95
- };
96
- exports.ProgressBar = ProgressBar;
@@ -1,2 +0,0 @@
1
- import type { IPromptDialog } from './types';
2
- export declare const PromptDialog: (p: IPromptDialog) => Promise<string | undefined>;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.PromptDialog = void 0;
16
- const react_1 = __importDefault(require("react"));
17
- const client_1 = require("react-dom/client");
18
- const Modal_1 = require("./Modal");
19
- const PromptDialog = (p) => __awaiter(void 0, void 0, void 0, function* () {
20
- return new Promise((res) => {
21
- const wrapper = document.body.appendChild(document.createElement('div'));
22
- const root = (0, client_1.createRoot)(wrapper);
23
- root.render(react_1.default.createElement(Modal_1.PromptModal, Object.assign({}, p, { res: res, root: root, wrapper: wrapper })));
24
- });
25
- });
26
- exports.PromptDialog = PromptDialog;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { IPromptModal } from './types';
3
- export declare const PromptModal: ({ root, wrapper, res, bottomText, topText, okText, cancelText, defaultValue, placeholder, style, }: IPromptModal) => React.JSX.Element;
@@ -1,111 +0,0 @@
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.PromptModal = void 0;
41
- const styled_1 = __importDefault(require("@emotion/styled"));
42
- const react_1 = __importStar(require("react"));
43
- const FlexColumn_1 = require("../FlexColumn");
44
- const FlexRow_1 = require("../FlexRow");
45
- const Modal_1 = require("../Modal/Modal");
46
- const button_1 = require("../shadcn/button");
47
- const TextEdit_1 = require("../TextEdit");
48
- const Base = styled_1.default.div `
49
- width: 95vw;
50
- max-width: 30rem;
51
- height: 50vh;
52
- max-height: 15rem;
53
- `;
54
- const Content = (0, styled_1.default)(FlexColumn_1.FlexColumn) `
55
- padding: 1rem;
56
- height: calc(100% - 2rem);
57
- width: calc(100% - 2rem);
58
- `;
59
- const TopText = styled_1.default.div `
60
- font-weight: bold;
61
- border-bottom: solid 1px #ccc;
62
- padding-bottom: 0.25rem;
63
- font-size: 1.5rem;
64
- margin-bottom: 1rem;
65
- `;
66
- const BottomText = styled_1.default.div `
67
- padding-bottom: 0.25rem;
68
- font-size: 1.1rem;
69
- `;
70
- const Bottom = (0, styled_1.default)(FlexRow_1.FlexRow) `
71
- margin-top: auto;
72
- justify-content: flex-end;
73
- > button:first-of-type {
74
- margin-right: 1rem;
75
- }
76
- `;
77
- const PromptModal = ({ root, wrapper, res, bottomText, topText, okText = 'OK', cancelText = 'Cancel', defaultValue, placeholder, style, }) => {
78
- const [text, setText] = (0, react_1.useState)(defaultValue || '');
79
- const ret = (v) => {
80
- try {
81
- res(v);
82
- }
83
- finally {
84
- try {
85
- root === null || root === void 0 ? void 0 : root.unmount();
86
- wrapper === null || wrapper === void 0 ? void 0 : wrapper.remove();
87
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
88
- }
89
- catch (e) {
90
- //
91
- }
92
- }
93
- };
94
- return (react_1.default.createElement(Modal_1.Modal, { position: "center", topPosition: "center", open: true, setOpen: () => ret(undefined), showCloseButton: false, closeOnClickOutside: false },
95
- react_1.default.createElement(Base, null,
96
- react_1.default.createElement(Content, { style: style },
97
- topText && react_1.default.createElement(TopText, null, topText),
98
- react_1.default.createElement(BottomText, null, bottomText),
99
- react_1.default.createElement(TextEdit_1.TextEdit, { defaultValue: text, onSubmit: (c, enter) => {
100
- if (enter) {
101
- ret(c);
102
- }
103
- else {
104
- setText(c);
105
- }
106
- }, placeholder: placeholder, defaultEditing: { focus: true }, singleLine: true, noGrow: true, allowUndo: false }),
107
- react_1.default.createElement(Bottom, { noGrow: true },
108
- react_1.default.createElement(button_1.Button, { onClick: () => ret(text) }, okText),
109
- react_1.default.createElement(button_1.Button, { variant: "outline", onClick: () => ret(undefined) }, cancelText))))));
110
- };
111
- exports.PromptModal = PromptModal;
@@ -1,3 +0,0 @@
1
- export * from './Dialog';
2
- export * from './Modal';
3
- export type * from './types';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Dialog"), exports);
18
- __exportStar(require("./Modal"), exports);
@@ -1,23 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- import type { Root } from 'react-dom/client';
3
- export interface IPromptModal {
4
- defaultValue?: string;
5
- placeholder?: string;
6
- res: (v: string | undefined) => void;
7
- root?: Root;
8
- wrapper?: HTMLDivElement;
9
- topText?: string;
10
- bottomText: string;
11
- /** default 'OK' */
12
- okText?: string;
13
- /** default "cancel" */
14
- cancelText?: string;
15
- style?: CSSProperties;
16
- }
17
- export interface IPromptDialog {
18
- topText?: string;
19
- bottomText: string;
20
- defaultValue?: string;
21
- placeholder?: string;
22
- style?: CSSProperties;
23
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- import React from 'react';
3
- export declare const PulseRing: ({ style, className, text, title, }: {
4
- /** tooltip text */
5
- title?: string;
6
- /** bubble text */
7
- text?: string;
8
- className?: string;
9
- style?: CSSProperties & {
10
- /** default 2.5rem */
11
- width?: string;
12
- /** default 2.5rem */
13
- height?: string;
14
- /** colour of pulse. default #01a4e9 */
15
- backgroundColor?: string;
16
- /** colour of tex. default #000 */
17
- color?: string;
18
- };
19
- }) => React.JSX.Element;
@@ -1,75 +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.PulseRing = void 0;
7
- const styled_1 = __importDefault(require("@emotion/styled"));
8
- const react_1 = __importDefault(require("react"));
9
- const CP = styled_1.default.div `
10
- position: relative;
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- background-color: transparent;
15
-
16
- &:before {
17
- content: '';
18
- position: relative;
19
- display: block;
20
- width: 150%;
21
- height: 150%;
22
- aspect-ratio: 4/3;
23
- box-sizing: border-box;
24
- border-radius: 45px;
25
- background-color: var(--var-bg-col);
26
- animation: pulse-ring 1s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
27
- }
28
-
29
- @keyframes pulse-ring {
30
- 0% {
31
- transform: scale(0.33);
32
- }
33
- 80%,
34
- 100% {
35
- opacity: 0;
36
- }
37
- }
38
-
39
- @keyframes pulse-dot {
40
- 0% {
41
- transform: scale(0.8);
42
- }
43
- 50% {
44
- transform: scale(1);
45
- }
46
- 100% {
47
- transform: scale(0.8);
48
- }
49
- }
50
- `;
51
- const Text = styled_1.default.div `
52
- position: absolute;
53
- z-index: 1;
54
- background-color: var(--var-bg-col);
55
- border-radius: 15px;
56
- box-shadow: 0 0 8px var(--var-bg-col);
57
- min-width: 1rem;
58
- min-height: 1rem;
59
- display: flex;
60
- justify-content: center;
61
- align-items: center;
62
- padding: 2px;
63
- `;
64
- const PulseRing = ({ style, className, text, title, }) => {
65
- var _a, _b, _c, _d;
66
- const st = Object.assign(Object.assign({}, style), { width: (_a = style === null || style === void 0 ? void 0 : style.width) !== null && _a !== void 0 ? _a : '2rem', height: (_b = style === null || style === void 0 ? void 0 : style.height) !== null && _b !== void 0 ? _b : '2rem', color: 'transparent', backgroundColor: 'transparent', '--var-bg-col': (_c = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _c !== void 0 ? _c : '#01a4e9' });
67
- return (react_1.default.createElement(CP, { style: st, className: className, title: title },
68
- react_1.default.createElement(Text, { style: {
69
- color: (_d = style === null || style === void 0 ? void 0 : style.color) !== null && _d !== void 0 ? _d : 'black',
70
- aspectRatio: '1/1',
71
- minWidth: '1.5ch',
72
- minHeight: '1.5ch',
73
- } }, text)));
74
- };
75
- exports.PulseRing = PulseRing;
@@ -1,15 +0,0 @@
1
- import type { CSSProperties, ReactNode } from 'react';
2
- import React from 'react';
3
- export interface IRowOrColumn {
4
- noGrow?: boolean;
5
- center?: boolean;
6
- noWrap?: boolean;
7
- children: ReactNode;
8
- className?: string;
9
- break?: 'small' | 'vsmall';
10
- style?: CSSProperties;
11
- onClick?: () => void;
12
- }
13
- export type IFlexColumn = IRowOrColumn;
14
- export type IFlexRow = IRowOrColumn;
15
- export declare const RowOrColumn: (props: IRowOrColumn) => React.JSX.Element;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RowOrColumn = void 0;
8
- const styled_1 = __importDefault(require("@emotion/styled"));
9
- const react_1 = __importDefault(require("react"));
10
- const media_1 = require("../../styles/media");
11
- const Base = styled_1.default.div `
12
- display: flex;
13
- flex-flow: row;
14
- flex-grow: 1;
15
- width: 100%;
16
- @media ${media_1.bigScreen} {
17
- &[data-nowrap='true'] {
18
- flex-flow: row;
19
- }
20
- }
21
- &[data-break='small'] {
22
- @media ${media_1.smallScreen} {
23
- flex-flow: column;
24
- }
25
- }
26
-
27
- &[data-break='vsmall'] {
28
- @media ${media_1.vSmallScreen} {
29
- flex-flow: column;
30
- }
31
- }
32
-
33
- &[data-center='true'] {
34
- justify-content: center;
35
- align-items: center;
36
- }
37
- &[data-nogrow='true'] {
38
- flex-grow: 0;
39
- width: auto;
40
- }
41
- `;
42
- const RowOrColumn = (props) => {
43
- var _a, _b, _c, _d;
44
- return (react_1.default.createElement(Base, Object.assign({ "data-nogrow": (_a = props.noGrow) !== null && _a !== void 0 ? _a : false, "data-center": (_b = props.center) !== null && _b !== void 0 ? _b : false, "data-nowrap": (_c = props.noWrap) !== null && _c !== void 0 ? _c : false }, props, { "data-break": (_d = props.break) !== null && _d !== void 0 ? _d : 'small' }), props.children));
45
- };
46
- exports.RowOrColumn = RowOrColumn;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export interface IAutoHideSearchBox {
3
- searchText: string;
4
- setSearchText: (val: string, enterPressed: boolean) => void;
5
- onOpenToggle?: (open: boolean) => void;
6
- className?: string;
7
- }
8
- export declare const AutoHideSearchBox: (p: IAutoHideSearchBox) => React.JSX.Element;