ag-common 0.0.798 → 0.0.800

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 (170) hide show
  1. package/dist/ui/components/DarkMode/Base.js +6 -36
  2. package/dist/ui/components/index.d.ts +0 -33
  3. package/dist/ui/components/index.js +0 -33
  4. package/dist/ui/components/shadcn/button.d.ts +1 -1
  5. package/dist/ui/components/shadcn/dropdown-list.d.ts +13 -0
  6. package/dist/ui/components/shadcn/dropdown-list.js +57 -0
  7. package/dist/ui/components/shadcn/sheet.d.ts +1 -1
  8. package/dist/ui/icons/index.d.ts +1 -6
  9. package/dist/ui/icons/index.js +1 -4
  10. package/dist/ui/styles/common.d.ts +21 -14
  11. package/dist/ui/styles/common.js +44 -45
  12. package/dist/ui/styles/index.d.ts +0 -1
  13. package/dist/ui/styles/index.js +0 -1
  14. package/package.json +9 -14
  15. package/dist/ui/components/BarChart/Base.d.ts +0 -8
  16. package/dist/ui/components/BarChart/Base.js +0 -49
  17. package/dist/ui/components/BarChart/Item.d.ts +0 -12
  18. package/dist/ui/components/BarChart/Item.js +0 -38
  19. package/dist/ui/components/BarChart/Legend.d.ts +0 -8
  20. package/dist/ui/components/BarChart/Legend.js +0 -83
  21. package/dist/ui/components/BarChart/TooltipContent.d.ts +0 -8
  22. package/dist/ui/components/BarChart/TooltipContent.js +0 -51
  23. package/dist/ui/components/BarChart/getLegendItems.d.ts +0 -17
  24. package/dist/ui/components/BarChart/getLegendItems.js +0 -24
  25. package/dist/ui/components/BarChart/index.d.ts +0 -2
  26. package/dist/ui/components/BarChart/index.js +0 -17
  27. package/dist/ui/components/BarChart/types.d.ts +0 -9
  28. package/dist/ui/components/BarChart/types.js +0 -2
  29. package/dist/ui/components/BorderGradient/index.d.ts +0 -21
  30. package/dist/ui/components/BorderGradient/index.js +0 -77
  31. package/dist/ui/components/Chevron/index.d.ts +0 -12
  32. package/dist/ui/components/Chevron/index.js +0 -45
  33. package/dist/ui/components/Close/index.d.ts +0 -6
  34. package/dist/ui/components/Close/index.js +0 -41
  35. package/dist/ui/components/Confirm/Dialog.d.ts +0 -7
  36. package/dist/ui/components/Confirm/Dialog.js +0 -54
  37. package/dist/ui/components/Confirm/Modal.d.ts +0 -3
  38. package/dist/ui/components/Confirm/Modal.js +0 -53
  39. package/dist/ui/components/Confirm/index.d.ts +0 -3
  40. package/dist/ui/components/Confirm/index.js +0 -18
  41. package/dist/ui/components/Confirm/types.d.ts +0 -18
  42. package/dist/ui/components/Confirm/types.js +0 -2
  43. package/dist/ui/components/DropdownList/Base.d.ts +0 -3
  44. package/dist/ui/components/DropdownList/Base.js +0 -178
  45. package/dist/ui/components/DropdownList/Dialog.d.ts +0 -7
  46. package/dist/ui/components/DropdownList/Dialog.js +0 -54
  47. package/dist/ui/components/DropdownList/index.d.ts +0 -2
  48. package/dist/ui/components/DropdownList/index.js +0 -18
  49. package/dist/ui/components/DropdownList/types.d.ts +0 -37
  50. package/dist/ui/components/DropdownList/types.js +0 -2
  51. package/dist/ui/components/FlexColumn/index.d.ts +0 -3
  52. package/dist/ui/components/FlexColumn/index.js +0 -31
  53. package/dist/ui/components/FlexRow/index.d.ts +0 -3
  54. package/dist/ui/components/FlexRow/index.js +0 -37
  55. package/dist/ui/components/HorizontalScrollBar/index.d.ts +0 -5
  56. package/dist/ui/components/HorizontalScrollBar/index.js +0 -66
  57. package/dist/ui/components/Icon/index.d.ts +0 -31
  58. package/dist/ui/components/Icon/index.js +0 -69
  59. package/dist/ui/components/Image/index.d.ts +0 -13
  60. package/dist/ui/components/Image/index.js +0 -104
  61. package/dist/ui/components/InfiniteScroll/index.d.ts +0 -17
  62. package/dist/ui/components/InfiniteScroll/index.js +0 -99
  63. package/dist/ui/components/KebabDots/index.d.ts +0 -5
  64. package/dist/ui/components/KebabDots/index.js +0 -16
  65. package/dist/ui/components/LineChart/Base.d.ts +0 -3
  66. package/dist/ui/components/LineChart/Base.js +0 -121
  67. package/dist/ui/components/LineChart/LegendX.d.ts +0 -11
  68. package/dist/ui/components/LineChart/LegendX.js +0 -107
  69. package/dist/ui/components/LineChart/LegendY.d.ts +0 -7
  70. package/dist/ui/components/LineChart/LegendY.js +0 -44
  71. package/dist/ui/components/LineChart/TooltipContent.d.ts +0 -8
  72. package/dist/ui/components/LineChart/TooltipContent.js +0 -52
  73. package/dist/ui/components/LineChart/dateHelpers.d.ts +0 -3
  74. package/dist/ui/components/LineChart/dateHelpers.js +0 -36
  75. package/dist/ui/components/LineChart/getLegendItems.d.ts +0 -18
  76. package/dist/ui/components/LineChart/getLegendItems.js +0 -75
  77. package/dist/ui/components/LineChart/index.d.ts +0 -2
  78. package/dist/ui/components/LineChart/index.js +0 -17
  79. package/dist/ui/components/LineChart/interpolate.d.ts +0 -17
  80. package/dist/ui/components/LineChart/interpolate.js +0 -58
  81. package/dist/ui/components/LineChart/types.d.ts +0 -32
  82. package/dist/ui/components/LineChart/types.js +0 -2
  83. package/dist/ui/components/Loader/index.d.ts +0 -15
  84. package/dist/ui/components/Loader/index.js +0 -93
  85. package/dist/ui/components/MinSidebar/index.d.ts +0 -13
  86. package/dist/ui/components/MinSidebar/index.js +0 -93
  87. package/dist/ui/components/Modal/Dialog.d.ts +0 -8
  88. package/dist/ui/components/Modal/Dialog.js +0 -47
  89. package/dist/ui/components/Modal/Modal.d.ts +0 -7
  90. package/dist/ui/components/Modal/Modal.js +0 -178
  91. package/dist/ui/components/Modal/index.d.ts +0 -3
  92. package/dist/ui/components/Modal/index.js +0 -18
  93. package/dist/ui/components/Modal/types.d.ts +0 -16
  94. package/dist/ui/components/Modal/types.js +0 -2
  95. package/dist/ui/components/PieChart/index.d.ts +0 -11
  96. package/dist/ui/components/PieChart/index.js +0 -43
  97. package/dist/ui/components/ProgressBar/index.d.ts +0 -15
  98. package/dist/ui/components/ProgressBar/index.js +0 -96
  99. package/dist/ui/components/Prompt/Dialog.d.ts +0 -2
  100. package/dist/ui/components/Prompt/Dialog.js +0 -26
  101. package/dist/ui/components/Prompt/Modal.d.ts +0 -3
  102. package/dist/ui/components/Prompt/Modal.js +0 -111
  103. package/dist/ui/components/Prompt/index.d.ts +0 -3
  104. package/dist/ui/components/Prompt/index.js +0 -18
  105. package/dist/ui/components/Prompt/types.d.ts +0 -23
  106. package/dist/ui/components/Prompt/types.js +0 -2
  107. package/dist/ui/components/PulseRing/index.d.ts +0 -19
  108. package/dist/ui/components/PulseRing/index.js +0 -75
  109. package/dist/ui/components/RowOrColumn/index.d.ts +0 -15
  110. package/dist/ui/components/RowOrColumn/index.js +0 -46
  111. package/dist/ui/components/Search/AutoHideSearchBox.d.ts +0 -8
  112. package/dist/ui/components/Search/AutoHideSearchBox.js +0 -114
  113. package/dist/ui/components/Search/Dialog.d.ts +0 -7
  114. package/dist/ui/components/Search/Dialog.js +0 -60
  115. package/dist/ui/components/Search/Inline.d.ts +0 -3
  116. package/dist/ui/components/Search/Inline.js +0 -137
  117. package/dist/ui/components/Search/Modal.d.ts +0 -3
  118. package/dist/ui/components/Search/Modal.js +0 -28
  119. package/dist/ui/components/Search/SearchBox.d.ts +0 -16
  120. package/dist/ui/components/Search/SearchBox.js +0 -107
  121. package/dist/ui/components/Search/index.d.ts +0 -6
  122. package/dist/ui/components/Search/index.js +0 -21
  123. package/dist/ui/components/Search/types.d.ts +0 -49
  124. package/dist/ui/components/Search/types.js +0 -2
  125. package/dist/ui/components/Sidebar/index.d.ts +0 -11
  126. package/dist/ui/components/Sidebar/index.js +0 -194
  127. package/dist/ui/components/SparkLine/index.d.ts +0 -16
  128. package/dist/ui/components/SparkLine/index.js +0 -64
  129. package/dist/ui/components/TabBar/index.d.ts +0 -27
  130. package/dist/ui/components/TabBar/index.js +0 -100
  131. package/dist/ui/components/Table/index.d.ts +0 -11
  132. package/dist/ui/components/Table/index.js +0 -49
  133. package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +0 -14
  134. package/dist/ui/components/TextEdit/CheckboxEdit.js +0 -104
  135. package/dist/ui/components/TextEdit/ColourEdit.d.ts +0 -5
  136. package/dist/ui/components/TextEdit/ColourEdit.js +0 -63
  137. package/dist/ui/components/TextEdit/LengthBox.d.ts +0 -5
  138. package/dist/ui/components/TextEdit/LengthBox.js +0 -28
  139. package/dist/ui/components/TextEdit/ListboxEdit.d.ts +0 -14
  140. package/dist/ui/components/TextEdit/ListboxEdit.js +0 -61
  141. package/dist/ui/components/TextEdit/TextEdit.d.ts +0 -3
  142. package/dist/ui/components/TextEdit/TextEdit.js +0 -145
  143. package/dist/ui/components/TextEdit/common.d.ts +0 -19
  144. package/dist/ui/components/TextEdit/common.js +0 -61
  145. package/dist/ui/components/TextEdit/index.d.ts +0 -5
  146. package/dist/ui/components/TextEdit/index.js +0 -20
  147. package/dist/ui/components/TextEdit/types.d.ts +0 -65
  148. package/dist/ui/components/TextEdit/types.js +0 -2
  149. package/dist/ui/components/TextWithButton/index.d.ts +0 -10
  150. package/dist/ui/components/TextWithButton/index.js +0 -89
  151. package/dist/ui/components/Timeline/index.d.ts +0 -22
  152. package/dist/ui/components/Timeline/index.js +0 -72
  153. package/dist/ui/components/TimelineChart/index.d.ts +0 -21
  154. package/dist/ui/components/TimelineChart/index.js +0 -63
  155. package/dist/ui/components/TreeChart/TooltipContent.d.ts +0 -7
  156. package/dist/ui/components/TreeChart/TooltipContent.js +0 -34
  157. package/dist/ui/components/TreeChart/base.d.ts +0 -3
  158. package/dist/ui/components/TreeChart/base.js +0 -144
  159. package/dist/ui/components/TreeChart/helpers.d.ts +0 -4
  160. package/dist/ui/components/TreeChart/helpers.js +0 -41
  161. package/dist/ui/components/TreeChart/index.d.ts +0 -2
  162. package/dist/ui/components/TreeChart/index.js +0 -17
  163. package/dist/ui/components/TreeChart/types.d.ts +0 -27
  164. package/dist/ui/components/TreeChart/types.js +0 -2
  165. package/dist/ui/components/UserImage/index.d.ts +0 -26
  166. package/dist/ui/components/UserImage/index.js +0 -109
  167. package/dist/ui/icons/CrossIcon.d.ts +0 -5
  168. package/dist/ui/icons/CrossIcon.js +0 -24
  169. package/dist/ui/styles/standaloneStyles.d.ts +0 -24
  170. package/dist/ui/styles/standaloneStyles.js +0 -69
@@ -1,178 +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.DropdownList = DropdownList;
41
- const styled_1 = __importDefault(require("@emotion/styled"));
42
- const react_1 = __importStar(require("react"));
43
- const dom_1 = require("../../helpers/dom");
44
- const useOnClickOutside_1 = require("../../helpers/useOnClickOutside");
45
- const colours_1 = require("../../styles/colours");
46
- const common_1 = require("../../styles/common");
47
- const KebabDots_1 = require("../KebabDots");
48
- const Base = styled_1.default.div `
49
- display: flex;
50
- flex-flow: row;
51
- position: relative;
52
- align-items: center;
53
- justify-content: space-between;
54
- cursor: pointer;
55
- flex-grow: 0;
56
- max-height: 100%;
57
- `;
58
- const DropItems = styled_1.default.div `
59
- flex-flow: column;
60
- z-index: 1;
61
- display: none;
62
- background-color: white;
63
- cursor: default;
64
- width: 100%;
65
- position: absolute;
66
-
67
- overflow-y: auto;
68
- &[data-open='true'] {
69
- display: flex;
70
- }
71
- ${(0, common_1.bounce)('data-bounced')}
72
- `;
73
- const ListItemStyle = styled_1.default.div `
74
- font-weight: 500;
75
- padding-left: 0.5rem;
76
- flex-grow: 1;
77
- padding: 1rem;
78
- cursor: pointer;
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
- &[data-default='false'] {
83
- &[data-selected='true'] {
84
- opacity: 1 !important;
85
- background-color: ${colours_1.colours.orangeRed} !important;
86
- cursor: default;
87
- }
88
- &[data-selected='false'] {
89
- &:hover {
90
- opacity: 0.9 !important;
91
- background-color: ${colours_1.colours.orange} !important;
92
- }
93
- }
94
- }
95
-
96
- &:nth-of-type(even) {
97
- background-color: rgba(0, 0, 0, 0.1);
98
- }
99
- &:nth-of-type(odd) {
100
- background-color: rgba(0, 0, 0, 0.2);
101
- }
102
- `;
103
- const ListItem = ({ render, onChange, selected, defaultV = false, }) => (react_1.default.createElement(ListItemStyle, { "data-type": "ddl-item", "data-selected": selected, "data-default": defaultV, onClick: (e) => {
104
- if (!selected) {
105
- onChange === null || onChange === void 0 ? void 0 : onChange();
106
- }
107
- e.preventDefault();
108
- } }, render));
109
- function DropdownList(p) {
110
- var _a;
111
- const { shadow = '#555', maxHeight = '50vh' } = p;
112
- const ref = (0, react_1.useRef)(null);
113
- const [state, setState] = (0, react_1.useState)(p.value);
114
- const [open, setOpen] = (0, react_1.useState)(p.open);
115
- const [bounced, setBounced] = (0, react_1.useState)(false);
116
- (0, useOnClickOutside_1.useOnClickOutside)({ disabled: !open, ref: ref, moveMouseOutside: false }, () => {
117
- var _a;
118
- setOpen(false);
119
- setBounced(false);
120
- (_a = p.onClose) === null || _a === void 0 ? void 0 : _a.call(p);
121
- });
122
- (0, react_1.useEffect)(() => {
123
- const newv = p.value;
124
- if (JSON.stringify(newv) !== JSON.stringify(state)) {
125
- setState(newv);
126
- }
127
- }, [p.value, state]);
128
- const [style, setStyle] = (0, react_1.useState)({});
129
- (0, react_1.useEffect)(() => {
130
- var _a, _b, _c, _d;
131
- const maxLen = 20;
132
- const newStyle = {
133
- minWidth: `calc(${maxLen}ch + 2rem)`,
134
- filter: `drop-shadow(1px 1px 0.5rem ${shadow})`,
135
- maxHeight,
136
- width: 'fit-content',
137
- };
138
- const minPx = (0, dom_1.convertRemToPixels)(2 + maxLen / 2);
139
- const offsetLeft = (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.offsetLeft) !== null && _b !== void 0 ? _b : 0;
140
- if (offsetLeft < minPx) {
141
- newStyle.left = '0';
142
- }
143
- else {
144
- newStyle.right = '0';
145
- }
146
- const b = (_d = (_c = ref.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) !== null && _d !== void 0 ? _d : { bottom: 0 };
147
- const ih = typeof window !== 'undefined' ? window.innerHeight : 0;
148
- //below screen
149
- if (b.bottom + 50 > ih) {
150
- newStyle.bottom = '1rem';
151
- }
152
- else {
153
- newStyle.top = '0';
154
- }
155
- if (JSON.stringify(style) !== JSON.stringify(newStyle)) {
156
- setStyle(newStyle);
157
- }
158
- }, [maxHeight, open, p.options, p.renderF, shadow, style]);
159
- const defaultRender = !p.value ? react_1.default.createElement(KebabDots_1.KebabDots, null) : react_1.default.createElement(react_1.default.Fragment, null, p.renderF(p.value, 0));
160
- const openDisplay = (_a = p.children) !== null && _a !== void 0 ? _a : (react_1.default.createElement(ListItem, { selected: true, render: defaultRender, key: defaultRender.key, defaultV: !p.value }));
161
- (0, react_1.useEffect)(() => {
162
- if (!bounced && open) {
163
- setBounced(true);
164
- }
165
- }, [bounced, open]);
166
- return (react_1.default.createElement(Base, { className: p.className, ref: ref, title: p.placeholder, onClick: (e) => {
167
- var _a;
168
- e.stopPropagation();
169
- e.preventDefault();
170
- setOpen(!open);
171
- if (open) {
172
- (_a = p.onClose) === null || _a === void 0 ? void 0 : _a.call(p);
173
- }
174
- } },
175
- react_1.default.createElement(DropItems, { "data-open": open, style: style, "data-bounced": bounced }, open &&
176
- p.options.map((s, i) => (react_1.default.createElement(ListItem, { key: typeof s === 'string' ? s : p.renderF(s, i).key, render: p.renderF(s, i), onChange: () => p.onChange(s, i), selected: s === state })))),
177
- openDisplay));
178
- }
@@ -1,7 +0,0 @@
1
- import type { IDropdownList } from './types';
2
- export declare const DropdownListDialog: <T>(p: {
3
- position: {
4
- x: number;
5
- y: number;
6
- };
7
- } & Omit<IDropdownList<T>, "onChange">) => Promise<undefined | [v: T, index: number]>;
@@ -1,54 +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.DropdownListDialog = void 0;
16
- const react_1 = __importDefault(require("react"));
17
- const client_1 = require("react-dom/client");
18
- const index_1 = require("./index");
19
- const DropdownListDialog = (p) => __awaiter(void 0, void 0, void 0, function* () {
20
- return new Promise((res) => {
21
- const id = 'ag-common-ddld';
22
- //already open
23
- if (document.querySelectorAll('#' + id).length) {
24
- return;
25
- }
26
- const wrapper = document.body.appendChild(document.createElement('div'));
27
- wrapper.id = id;
28
- wrapper.style.position = 'absolute';
29
- wrapper.style.top = `${p.position.y}px`;
30
- wrapper.style.left = `${p.position.x}px`;
31
- const root = (0, client_1.createRoot)(wrapper);
32
- root.render(react_1.default.createElement(index_1.DropdownList, Object.assign({}, p, { open: true, onClose: () => {
33
- try {
34
- root.unmount();
35
- wrapper.remove();
36
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
- }
38
- catch (e) {
39
- //
40
- }
41
- }, onChange: (v, i) => {
42
- try {
43
- root.unmount();
44
- wrapper.remove();
45
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
46
- }
47
- catch (e) {
48
- //
49
- }
50
- res(!v ? undefined : [v, i]);
51
- } }), "\u00A0"));
52
- });
53
- });
54
- exports.DropdownListDialog = DropdownListDialog;
@@ -1,2 +0,0 @@
1
- export * from './Base';
2
- export * from './Dialog';
@@ -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("./Base"), exports);
18
- __exportStar(require("./Dialog"), exports);
@@ -1,37 +0,0 @@
1
- import type { JSX } from 'react';
2
- export interface IDropdownList<T> {
3
- /**
4
- * all items that can be in dropdown
5
- */
6
- options: T[];
7
- /**
8
- * selected item from options. closing will return undefined
9
- */
10
- value?: T;
11
- onChange: (v: T | undefined, index: number) => void;
12
- /** will call on close/click outside */
13
- onClose?: () => void;
14
- /**
15
- * placeholder title for list
16
- */
17
- placeholder?: string;
18
- className?: string;
19
- /**
20
- * function to render value
21
- */
22
- renderF: (v: T, index: number) => JSX.Element;
23
- /**
24
- * colour of dropdown shadow. default #555
25
- */
26
- shadow?: string;
27
- /**
28
- * max height of items list. default 50vh
29
- */
30
- maxHeight?: string;
31
- /**
32
- * if not provided, will default display value, then kebab dots
33
- */
34
- children?: React.ReactNode;
35
- /** default false */
36
- open?: boolean;
37
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { IFlexColumn } from '../RowOrColumn';
3
- export declare const FlexColumn: (props: IFlexColumn) => React.JSX.Element;
@@ -1,31 +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.FlexColumn = 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
- position: relative;
12
- display: flex;
13
- flex-flow: column;
14
- flex-grow: 1;
15
- width: 100%;
16
- height: 100%;
17
- &[data-center='true'] {
18
- justify-content: center;
19
- align-items: center;
20
- }
21
- &[data-nogrow='true'] {
22
- flex-grow: 0;
23
- width: unset;
24
- height: unset;
25
- }
26
- `;
27
- const FlexColumn = (props) => {
28
- var _a, _b;
29
- 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 }, props), props.children));
30
- };
31
- exports.FlexColumn = FlexColumn;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { IFlexRow } from '../RowOrColumn';
3
- export declare const FlexRow: (props: IFlexRow) => React.JSX.Element;
@@ -1,37 +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.FlexRow = 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
- position: relative;
12
- display: flex;
13
- flex-flow: row wrap;
14
-
15
- &[data-nowrap='true'] {
16
- flex-flow: row;
17
- }
18
-
19
- &[data-nogrow='true'] {
20
- flex-grow: 0;
21
- }
22
- &[data-nogrow='false'] {
23
- width: 100%;
24
- height: 100%;
25
- flex-grow: 1;
26
- }
27
-
28
- &[data-center='true'] {
29
- justify-content: center;
30
- align-items: center;
31
- }
32
- `;
33
- const FlexRow = (props) => {
34
- var _a, _b, _c;
35
- return (react_1.default.createElement(Base, Object.assign({ "data-nowrap": (_a = props.noWrap) !== null && _a !== void 0 ? _a : false, "data-nogrow": (_b = props.noGrow) !== null && _b !== void 0 ? _b : false, "data-center": (_c = props.center) !== null && _c !== void 0 ? _c : false }, props), props.children));
36
- };
37
- exports.FlexRow = FlexRow;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const HorizontalScrollBar: ({ children, className, }: {
3
- children: React.ReactNode;
4
- className?: string;
5
- }) => React.JSX.Element;
@@ -1,66 +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
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.HorizontalScrollBar = void 0;
38
- const react_1 = __importStar(require("react"));
39
- const HorizontalScrollBar = ({ children, className, }) => {
40
- const scrollRef = (0, react_1.useRef)(null);
41
- (0, react_1.useEffect)(() => {
42
- if (!scrollRef.current)
43
- return;
44
- const handleScroll = (e) => {
45
- const { current } = scrollRef;
46
- if (!current)
47
- return;
48
- e.preventDefault();
49
- current.scrollLeft += e.deltaY;
50
- };
51
- scrollRef.current.addEventListener('wheel', handleScroll);
52
- return () => {
53
- var _a;
54
- try {
55
- // eslint-disable-next-line react-hooks/exhaustive-deps
56
- (_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', handleScroll);
57
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
58
- }
59
- catch (e) {
60
- //
61
- }
62
- };
63
- }, [scrollRef]);
64
- return (react_1.default.createElement("div", { ref: scrollRef, style: { overflowX: 'auto' }, className: className }, children));
65
- };
66
- exports.HorizontalScrollBar = HorizontalScrollBar;
@@ -1,31 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- import React from 'react';
3
- export declare const IconF: import("@emotion/styled").StyledComponent<{
4
- theme?: import("@emotion/react").Theme;
5
- as?: React.ElementType;
6
- }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
7
- export interface IIcon {
8
- disabled?: boolean;
9
- outline?: string;
10
- rotate?: number;
11
- canHover?: boolean;
12
- onClick?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
13
- children?: React.ReactNode;
14
- role?: string;
15
- title?: string;
16
- tabIndex?: number;
17
- className?: string;
18
- style?: {
19
- /** default 100% */
20
- width?: string;
21
- /** default 100% */
22
- height?: string;
23
- /** default 0 */
24
- padding?: string;
25
- /** default unset */
26
- margin?: string;
27
- /** pass fill down to svg */
28
- fill?: string;
29
- } & CSSProperties;
30
- }
31
- export declare const Icon: (pr: IIcon) => React.JSX.Element;
@@ -1,69 +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.Icon = exports.IconF = void 0;
8
- const styled_1 = __importDefault(require("@emotion/styled"));
9
- const react_1 = __importDefault(require("react"));
10
- const object_1 = require("../../../common/helpers/object");
11
- const common_1 = require("../../styles/common");
12
- exports.IconF = styled_1.default.span `
13
- transition: all 200ms;
14
- display: flex;
15
- justify-content: center;
16
- align-items: center;
17
- font-size: 2rem;
18
- cursor: inherit;
19
- width: 100%;
20
- height: 100%;
21
- padding: 0;
22
- margin: unset;
23
- &[data-chnd='true'] {
24
- cursor: pointer;
25
- &:hover {
26
- filter: saturate(3);
27
- }
28
- }
29
-
30
- > svg {
31
- flex-grow: 1;
32
- }
33
-
34
- &[data-hasfill='true'] {
35
- fill: var(--fill);
36
-
37
- svg {
38
- fill: var(--fill);
39
- }
40
-
41
- linearGradient > *,
42
- radialGradient > * {
43
- stop-color: var(--fill) !important;
44
- }
45
- }
46
-
47
- &[data-hasoutline='true'] {
48
- ${(0, common_1.HardOutline)('var(--outlinecolour)')}
49
- }
50
-
51
- svg {
52
- width: 100%;
53
- height: 100%;
54
- object-fit: contain;
55
- aspect-ratio: 1/1;
56
- }
57
-
58
- img {
59
- object-fit: contain;
60
- }
61
- `;
62
- const Icon = (pr) => {
63
- var _a, _b, _c, _d, _e, _f, _g, _h;
64
- const { className, children, disabled, onClick } = pr;
65
- const CHND = pr.canHover && !pr.disabled;
66
- const style = (0, object_1.removeUndefValuesFromObject)(Object.assign(Object.assign({}, ((_a = pr.style) !== null && _a !== void 0 ? _a : {})), { '--fill': (_c = (_b = pr.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : null, width: (_d = pr.style) === null || _d === void 0 ? void 0 : _d.width, height: (_e = pr.style) === null || _e === void 0 ? void 0 : _e.height, padding: (_f = pr.style) === null || _f === void 0 ? void 0 : _f.padding, margin: (_g = pr.style) === null || _g === void 0 ? void 0 : _g.margin, transform: !pr.rotate ? null : `rotate(${pr.rotate || 0}deg)`, filter: !pr.disabled ? null : 'grayscale(1)', '--outlinecolour': pr.outline || null }));
67
- return (react_1.default.createElement(exports.IconF, Object.assign({}, pr, { className: className, onClick: (e) => !disabled && (onClick === null || onClick === void 0 ? void 0 : onClick(e)), style: style, "data-chnd": CHND, "data-hasoutline": pr.outline, "data-hasfill": !!((_h = pr.style) === null || _h === void 0 ? void 0 : _h.fill), "data-type": "iconbox" }), children));
68
- };
69
- exports.Icon = Icon;
@@ -1,13 +0,0 @@
1
- import type { ImgHTMLAttributes } from 'react';
2
- import React from 'react';
3
- export interface IImage {
4
- /** if true, will set order to -1 for mobile. default false */
5
- smalltop?: boolean;
6
- /** if true, will hide on mobile. default false */
7
- bigonly?: boolean;
8
- /** if true, will hide on desktop. default false */
9
- smallonly?: boolean;
10
- /** if true is counted as a small image, and will be sized accordingly. default false */
11
- small?: boolean;
12
- }
13
- export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => React.JSX.Element | null;
@@ -1,104 +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 __rest = (this && this.__rest) || function (s, e) {
37
- var t = {};
38
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
39
- t[p] = s[p];
40
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
41
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
43
- t[p[i]] = s[p[i]];
44
- }
45
- return t;
46
- };
47
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.Image = void 0;
52
- const styled_1 = __importDefault(require("@emotion/styled"));
53
- const react_1 = __importStar(require("react"));
54
- const media_1 = require("../../styles/media");
55
- const Base = styled_1.default.img `
56
- object-fit: contain;
57
- width: 100%;
58
- height: 100%;
59
-
60
- min-width: 5rem;
61
- min-height: 5rem;
62
-
63
- max-width: 100%;
64
- max-height: 100%;
65
-
66
- &[data-smalltop='true'] {
67
- @media ${media_1.smallScreen} {
68
- order: -1;
69
- }
70
- }
71
- @media ${media_1.smallScreen} {
72
- max-width: 50vw;
73
- max-height: 50vh;
74
-
75
- &[data-bigonly='true'] {
76
- display: none;
77
- }
78
- &[data-small='true'] {
79
- max-width: 25vw;
80
- max-height: 25vh;
81
- }
82
- }
83
-
84
- @media ${media_1.bigScreen} {
85
- max-width: 50vw;
86
- max-height: 50vh;
87
- &[data-smallonly='true'] {
88
- display: none;
89
- }
90
- &[data-small='true'] {
91
- max-width: 30vw;
92
- max-height: 30vh;
93
- }
94
- }
95
- `;
96
- const Image = (p) => {
97
- const { smalltop, bigonly, smallonly, small } = p, p1 = __rest(p, ["smalltop", "bigonly", "smallonly", "small"]);
98
- const [display, setDisplay] = (0, react_1.useState)(true);
99
- if (!display) {
100
- return null;
101
- }
102
- return (react_1.default.createElement(Base, Object.assign({}, p1, { "data-smalltop": smalltop, "data-bigonly": bigonly, "data-smallonly": smallonly, "data-small": small, onError: () => setDisplay(false) })));
103
- };
104
- exports.Image = Image;