uibee 2.17.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +34 -0
  2. package/dist/icons-lZYQ6Vlr.js +125 -0
  3. package/dist/src/components/index.d.ts +706 -30
  4. package/dist/src/components/index.js +3243 -44
  5. package/dist/src/hooks/index.d.ts +15 -3
  6. package/dist/src/hooks/index.js +44 -3
  7. package/dist/src/icons/index.d.ts +420 -0
  8. package/dist/src/icons/index.js +3 -0
  9. package/dist/src/styles/index.d.ts +1 -1
  10. package/dist/src/styles/index.js +2 -1
  11. package/dist/src/utils/index.d.ts +38 -5
  12. package/dist/src/utils/index.js +125 -6
  13. package/dist/{src/globals.css → style.css} +1226 -607
  14. package/dist/useClickOutside-Cmp-RsP3.js +13 -0
  15. package/index.d.ts +0 -1
  16. package/package.json +22 -23
  17. package/src/components/alert/alert.tsx +20 -18
  18. package/src/components/buttons/button.tsx +28 -35
  19. package/src/components/confirm/confirmPopup.tsx +15 -17
  20. package/src/components/container/accordion.tsx +54 -0
  21. package/src/components/container/glassCard.tsx +14 -0
  22. package/src/components/container/iconBubble.tsx +30 -0
  23. package/src/components/container/leftBarPanel.tsx +15 -0
  24. package/src/components/container/pulseDot.tsx +31 -0
  25. package/src/components/container/statCard.tsx +24 -0
  26. package/src/components/container/tabs.tsx +64 -0
  27. package/src/components/footer/footer.tsx +124 -0
  28. package/src/components/footer/loginContent.tsx +70 -0
  29. package/src/components/index.ts +15 -0
  30. package/src/components/inputs/checkbox.tsx +4 -4
  31. package/src/components/inputs/input.tsx +11 -13
  32. package/src/components/inputs/multiSelect.tsx +144 -0
  33. package/src/components/inputs/radio.tsx +4 -4
  34. package/src/components/inputs/range.tsx +6 -5
  35. package/src/components/inputs/searchInput.tsx +1 -1
  36. package/src/components/inputs/select.tsx +19 -18
  37. package/src/components/inputs/shared/colorPickerPopup.tsx +5 -5
  38. package/src/components/inputs/shared/dateTimePickerPopup.tsx +9 -9
  39. package/src/components/inputs/shared/inputError.tsx +1 -1
  40. package/src/components/inputs/switch.tsx +7 -7
  41. package/src/components/inputs/tagInput.tsx +6 -7
  42. package/src/components/inputs/textarea.tsx +8 -10
  43. package/src/components/inputs/toggle.tsx +6 -6
  44. package/src/components/markdownrender/markdownRender.tsx +4 -2
  45. package/src/components/table/body.tsx +6 -6
  46. package/src/components/table/format.ts +1 -1
  47. package/src/components/table/header.tsx +1 -1
  48. package/src/components/table/pagination.tsx +17 -31
  49. package/src/components/table/table.tsx +2 -2
  50. package/src/components/version/version.tsx +1 -1
  51. package/src/components/vulnerability/constants.ts +6 -6
  52. package/src/components/vulnerability/severityPill.tsx +6 -7
  53. package/src/globals.css +12 -1
  54. package/src/hooks/index.ts +1 -0
  55. package/src/hooks/useClickOutside.ts +5 -22
  56. package/src/icons/icons.tsx +431 -0
  57. package/src/icons/index.ts +2 -0
  58. package/src/index.ts +0 -1
  59. package/src/types/hooks.d.ts +8 -2
  60. package/src/utils/index.ts +1 -1
  61. package/src/utils/logoConsoleOutput/logoConsoleOutput.ts +31 -0
  62. package/tsconfig.json +3 -2
  63. package/tsdown.config.ts +26 -0
  64. package/Readme.md +0 -29
  65. package/bun.lock +0 -662
  66. package/dist/src/components/alert/alert.d.ts +0 -8
  67. package/dist/src/components/alert/alert.js +0 -15
  68. package/dist/src/components/buttons/button.d.ts +0 -13
  69. package/dist/src/components/buttons/button.js +0 -30
  70. package/dist/src/components/confirm/confirmPopup.d.ts +0 -12
  71. package/dist/src/components/confirm/confirmPopup.js +0 -18
  72. package/dist/src/components/container/highlight.d.ts +0 -4
  73. package/dist/src/components/container/highlight.js +0 -4
  74. package/dist/src/components/container/page.d.ts +0 -8
  75. package/dist/src/components/container/page.js +0 -4
  76. package/dist/src/components/inputs/checkbox.d.ts +0 -17
  77. package/dist/src/components/inputs/checkbox.js +0 -37
  78. package/dist/src/components/inputs/input.d.ts +0 -12
  79. package/dist/src/components/inputs/input.js +0 -124
  80. package/dist/src/components/inputs/radio.d.ts +0 -17
  81. package/dist/src/components/inputs/radio.js +0 -27
  82. package/dist/src/components/inputs/range.d.ts +0 -11
  83. package/dist/src/components/inputs/range.js +0 -22
  84. package/dist/src/components/inputs/searchInput.d.ts +0 -6
  85. package/dist/src/components/inputs/searchInput.js +0 -42
  86. package/dist/src/components/inputs/select.d.ts +0 -23
  87. package/dist/src/components/inputs/select.js +0 -70
  88. package/dist/src/components/inputs/shared/colorPickerPopup.d.ts +0 -8
  89. package/dist/src/components/inputs/shared/colorPickerPopup.js +0 -191
  90. package/dist/src/components/inputs/shared/dateTimePickerPopup.d.ts +0 -9
  91. package/dist/src/components/inputs/shared/dateTimePickerPopup.js +0 -128
  92. package/dist/src/components/inputs/shared/fieldWrapper.d.ts +0 -14
  93. package/dist/src/components/inputs/shared/fieldWrapper.js +0 -8
  94. package/dist/src/components/inputs/shared/index.d.ts +0 -5
  95. package/dist/src/components/inputs/shared/index.js +0 -5
  96. package/dist/src/components/inputs/shared/inputError.d.ts +0 -6
  97. package/dist/src/components/inputs/shared/inputError.js +0 -6
  98. package/dist/src/components/inputs/shared/inputInfo.d.ts +0 -5
  99. package/dist/src/components/inputs/shared/inputInfo.js +0 -5
  100. package/dist/src/components/inputs/shared/inputLabel.d.ts +0 -9
  101. package/dist/src/components/inputs/shared/inputLabel.js +0 -4
  102. package/dist/src/components/inputs/switch.d.ts +0 -11
  103. package/dist/src/components/inputs/switch.js +0 -14
  104. package/dist/src/components/inputs/tagInput.d.ts +0 -15
  105. package/dist/src/components/inputs/tagInput.js +0 -40
  106. package/dist/src/components/inputs/textarea.d.ts +0 -11
  107. package/dist/src/components/inputs/textarea.js +0 -36
  108. package/dist/src/components/inputs/toggle.d.ts +0 -14
  109. package/dist/src/components/inputs/toggle.js +0 -12
  110. package/dist/src/components/login/loginPage.d.ts +0 -2
  111. package/dist/src/components/login/loginPage.js +0 -18
  112. package/dist/src/components/logo/logo.d.ts +0 -5
  113. package/dist/src/components/logo/logo.js +0 -6
  114. package/dist/src/components/logo/logoSmall.d.ts +0 -1
  115. package/dist/src/components/logo/logoSmall.js +0 -6
  116. package/dist/src/components/markdownrender/markdownRender.d.ts +0 -6
  117. package/dist/src/components/markdownrender/markdownRender.js +0 -25
  118. package/dist/src/components/navbar/bubble.d.ts +0 -14
  119. package/dist/src/components/navbar/bubble.js +0 -8
  120. package/dist/src/components/navbar/navbar.d.ts +0 -34
  121. package/dist/src/components/navbar/navbar.js +0 -36
  122. package/dist/src/components/navbar/navbarDropdown.d.ts +0 -7
  123. package/dist/src/components/navbar/navbarDropdown.js +0 -19
  124. package/dist/src/components/navbar/navbarItem.d.ts +0 -11
  125. package/dist/src/components/navbar/navbarItem.js +0 -12
  126. package/dist/src/components/table/body.d.ts +0 -15
  127. package/dist/src/components/table/body.js +0 -116
  128. package/dist/src/components/table/format.d.ts +0 -1
  129. package/dist/src/components/table/format.js +0 -27
  130. package/dist/src/components/table/header.d.ts +0 -8
  131. package/dist/src/components/table/header.js +0 -47
  132. package/dist/src/components/table/menu.d.ts +0 -17
  133. package/dist/src/components/table/menu.js +0 -30
  134. package/dist/src/components/table/pagination.d.ts +0 -6
  135. package/dist/src/components/table/pagination.js +0 -86
  136. package/dist/src/components/table/table.d.ts +0 -14
  137. package/dist/src/components/table/table.js +0 -14
  138. package/dist/src/components/toast/toastItem.d.ts +0 -2
  139. package/dist/src/components/toast/toastItem.js +0 -38
  140. package/dist/src/components/toast/toaster.d.ts +0 -9
  141. package/dist/src/components/toast/toaster.js +0 -86
  142. package/dist/src/components/toggle/language.d.ts +0 -4
  143. package/dist/src/components/toggle/language.js +0 -29
  144. package/dist/src/components/toggle/theme.d.ts +0 -3
  145. package/dist/src/components/toggle/theme.js +0 -30
  146. package/dist/src/components/version/version.d.ts +0 -7
  147. package/dist/src/components/version/version.js +0 -12
  148. package/dist/src/components/vulnerability/constants.d.ts +0 -4
  149. package/dist/src/components/vulnerability/constants.js +0 -14
  150. package/dist/src/components/vulnerability/severityPill.d.ts +0 -8
  151. package/dist/src/components/vulnerability/severityPill.js +0 -8
  152. package/dist/src/hooks/useClickOutside.d.ts +0 -2
  153. package/dist/src/hooks/useClickOutside.js +0 -27
  154. package/dist/src/hooks/useDarkMode.d.ts +0 -1
  155. package/dist/src/hooks/useDarkMode.js +0 -17
  156. package/dist/src/hooks/useVisibility.d.ts +0 -4
  157. package/dist/src/hooks/useVisibility.js +0 -23
  158. package/dist/src/index.d.ts +0 -5
  159. package/dist/src/index.js +0 -5
  160. package/dist/src/scripts/buildCss.d.ts +0 -1
  161. package/dist/src/scripts/buildCss.js +0 -22
  162. package/dist/src/scripts/index.d.ts +0 -1
  163. package/dist/src/scripts/index.js +0 -1
  164. package/dist/src/scripts/rewriteAlias.d.ts +0 -1
  165. package/dist/src/scripts/rewriteAlias.js +0 -31
  166. package/dist/src/utils/LogoConsoleOutput/LogoConsoleOutput.d.ts +0 -1
  167. package/dist/src/utils/LogoConsoleOutput/LogoConsoleOutput.js +0 -44
  168. package/dist/src/utils/auth/callback.d.ts +0 -2
  169. package/dist/src/utils/auth/callback.js +0 -63
  170. package/dist/src/utils/auth/getDomain.d.ts +0 -2
  171. package/dist/src/utils/auth/getDomain.js +0 -6
  172. package/dist/src/utils/auth/login.d.ts +0 -3
  173. package/dist/src/utils/auth/login.js +0 -14
  174. package/dist/src/utils/auth/logout.d.ts +0 -3
  175. package/dist/src/utils/auth/logout.js +0 -18
  176. package/dist/src/utils/auth/token.d.ts +0 -3
  177. package/dist/src/utils/auth/token.js +0 -33
  178. package/dist/tailwind.config.d.ts +0 -3
  179. package/dist/tailwind.config.js +0 -7
  180. package/src/scripts/buildCss.ts +0 -25
  181. package/src/scripts/index.ts +0 -1
  182. package/src/scripts/rewriteAlias.ts +0 -39
  183. package/src/utils/LogoConsoleOutput/LogoConsoleOutput.ts +0 -61
@@ -1,191 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef } from 'react';
3
- function hexToHsv(hex) {
4
- hex = hex.replace('#', '');
5
- let r = 0, g = 0, b = 0;
6
- if (hex.length === 3) {
7
- r = parseInt(hex[0] + hex[0], 16);
8
- g = parseInt(hex[1] + hex[1], 16);
9
- b = parseInt(hex[2] + hex[2], 16);
10
- }
11
- else if (hex.length === 6) {
12
- r = parseInt(hex.substring(0, 2), 16);
13
- g = parseInt(hex.substring(2, 4), 16);
14
- b = parseInt(hex.substring(4, 6), 16);
15
- }
16
- r /= 255;
17
- g /= 255;
18
- b /= 255;
19
- const max = Math.max(r, g, b);
20
- const min = Math.min(r, g, b);
21
- const d = max - min;
22
- let h = 0;
23
- const s = max === 0 ? 0 : d / max;
24
- const v = max;
25
- if (max !== min) {
26
- switch (max) {
27
- case r:
28
- h = (g - b) / d + (g < b ? 6 : 0);
29
- break;
30
- case g:
31
- h = (b - r) / d + 2;
32
- break;
33
- case b:
34
- h = (r - g) / d + 4;
35
- break;
36
- }
37
- h /= 6;
38
- }
39
- return { h: h * 360, s: s * 100, v: v * 100 };
40
- }
41
- function hsvToRgb(h, s, v) {
42
- let r = 0, g = 0, b = 0;
43
- const i = Math.floor(h * 6);
44
- const f = h * 6 - i;
45
- const p = v * (1 - s);
46
- const q = v * (1 - f * s);
47
- const t = v * (1 - (1 - f) * s);
48
- switch (i % 6) {
49
- case 0:
50
- r = v;
51
- g = t;
52
- b = p;
53
- break;
54
- case 1:
55
- r = q;
56
- g = v;
57
- b = p;
58
- break;
59
- case 2:
60
- r = p;
61
- g = v;
62
- b = t;
63
- break;
64
- case 3:
65
- r = p;
66
- g = q;
67
- b = v;
68
- break;
69
- case 4:
70
- r = t;
71
- g = p;
72
- b = v;
73
- break;
74
- case 5:
75
- r = v;
76
- g = p;
77
- b = q;
78
- break;
79
- }
80
- return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255) };
81
- }
82
- function hsvToHex(h, s, v) {
83
- const { r, g, b } = hsvToRgb(h / 360, s / 100, v / 100);
84
- function toHex(x) {
85
- const hex = x.toString(16);
86
- return hex.length === 1 ? '0' + hex : hex;
87
- }
88
- return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
89
- }
90
- const PRESET_COLORS = [
91
- '#f87171', '#fd8738', '#fbbf24', '#facc15', '#a3e635', '#4ade80', '#34d399', '#2dd4bf',
92
- '#38bdf8', '#60a5fa', '#818cf8', '#a78bfa', '#c084fc', '#e879f9', '#f472b6', '#fb7185'
93
- ];
94
- function SaturationPicker({ hsv, onChange }) {
95
- const containerRef = useRef(null);
96
- function handleMove(e) {
97
- if (!containerRef.current)
98
- return;
99
- const { left, top, width, height } = containerRef.current.getBoundingClientRect();
100
- const x = Math.min(Math.max((e.clientX - left) / width, 0), 1);
101
- const y = Math.min(Math.max((e.clientY - top) / height, 0), 1);
102
- onChange(x * 100, (1 - y) * 100);
103
- }
104
- function handleMouseDown(e) {
105
- handleMove(e);
106
- function moveHandler(e) { handleMove(e); }
107
- function upHandler() {
108
- window.removeEventListener('mousemove', moveHandler);
109
- window.removeEventListener('mouseup', upHandler);
110
- }
111
- window.addEventListener('mousemove', moveHandler);
112
- window.addEventListener('mouseup', upHandler);
113
- }
114
- const bgColor = hsvToHex(hsv.h, 100, 100);
115
- return (_jsxs("div", { ref: containerRef, className: 'w-full h-32 relative rounded-md overflow-hidden cursor-crosshair mb-3 select-none', style: { backgroundColor: bgColor }, onMouseDown: handleMouseDown, children: [_jsx("div", { className: 'absolute inset-0 bg-linear-to-r from-white to-transparent' }), _jsx("div", { className: 'absolute inset-0 bg-linear-to-t from-black to-transparent' }), _jsx("div", { className: `
116
- absolute w-3 h-3 border-2 border-white rounded-full
117
- shadow-md -translate-x-1/2 -translate-y-1/2 pointer-events-none
118
- `, style: { left: `${hsv.s}%`, top: `${100 - hsv.v}%` } })] }));
119
- }
120
- function HuePicker({ hue, onChange }) {
121
- const containerRef = useRef(null);
122
- function handleMove(e) {
123
- if (!containerRef.current)
124
- return;
125
- const { left, width } = containerRef.current.getBoundingClientRect();
126
- const x = Math.min(Math.max((e.clientX - left) / width, 0), 1);
127
- onChange(x * 360);
128
- }
129
- function handleMouseDown(e) {
130
- handleMove(e);
131
- function moveHandler(e) { handleMove(e); }
132
- function upHandler() {
133
- window.removeEventListener('mousemove', moveHandler);
134
- window.removeEventListener('mouseup', upHandler);
135
- }
136
- window.addEventListener('mousemove', moveHandler);
137
- window.addEventListener('mouseup', upHandler);
138
- }
139
- return (_jsx("div", { ref: containerRef, className: 'w-full h-3 relative rounded-full cursor-pointer mb-4 select-none', style: { background: 'linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)' }, onMouseDown: handleMouseDown, children: _jsx("div", { className: `
140
- absolute w-4 h-4 bg-white border border-gray-200
141
- rounded-full shadow-sm -translate-x-1/2 -translate-y-1/2
142
- top-1/2 pointer-events-none
143
- `, style: { left: `${(hue / 360) * 100}%` } }) }));
144
- }
145
- export default function ColorPickerPopup({ value, onChange, onClose, anchorName }) {
146
- const [hsv, setHsv] = useState(() => hexToHsv(value || '#000000'));
147
- const [hexInput, setHexInput] = useState(value || '#000000');
148
- useEffect(() => {
149
- if (value && value !== hexInput) {
150
- setHsv(hexToHsv(value));
151
- setHexInput(value);
152
- }
153
- }, [value]);
154
- function handleColorChange(newHsv) {
155
- setHsv(newHsv);
156
- const hex = hsvToHex(newHsv.h, newHsv.s, newHsv.v);
157
- setHexInput(hex);
158
- onChange(hex);
159
- }
160
- function handleSaturationChange(s, v) { handleColorChange({ ...hsv, s, v }); }
161
- function handleHueChange(h) { handleColorChange({ ...hsv, h }); }
162
- function manualHexChange(e) {
163
- const val = e.target.value;
164
- setHexInput(val);
165
- if (/^#[0-9A-F]{6}$/i.test(val)) {
166
- const newHsv = hexToHsv(val);
167
- setHsv(newHsv);
168
- onChange(val);
169
- }
170
- }
171
- return (_jsxs("div", { className: 'fixed z-50 bg-login-600 border border-login-500 rounded-md shadow-lg p-3 w-64 select-none anchor-popup', style: {
172
- positionAnchor: anchorName,
173
- positionArea: 'bottom span-right',
174
- insetArea: 'bottom span-right',
175
- positionTryFallbacks: 'flip-block',
176
- margin: '0.25rem 0',
177
- }, children: [_jsx(SaturationPicker, { hsv: hsv, onChange: handleSaturationChange }), _jsx(HuePicker, { hue: hsv.h, onChange: handleHueChange }), _jsxs("div", { className: 'flex items-center gap-2 mb-3', children: [_jsx("div", { className: 'text-xs text-login-200 font-mono', children: "HEX" }), _jsx("input", { type: 'text', value: hexInput, onChange: manualHexChange, className: `
178
- flex-1 min-w-0 bg-login-500 border border-login-500 rounded
179
- px-2 py-1 text-sm text-login-text focus:outline-none
180
- focus:border-login focus:ring-1 focus:ring-login
181
- `, spellCheck: false }), _jsx("div", { className: 'w-8 h-8 rounded border border-login-500 shrink-0', style: { backgroundColor: hexInput } })] }), _jsx("div", { className: 'grid grid-cols-8 gap-1.5 pt-3 border-t border-login-500', children: PRESET_COLORS.map(color => (_jsx("button", { type: 'button', className: `
182
- w-6 h-6 rounded-sm cursor-pointer hover:scale-110
183
- hover:zIndex-10 transition-transform ring-1 ring-inset ring-black/10
184
- `, style: { backgroundColor: color }, onClick: () => {
185
- const newHsv = hexToHsv(color);
186
- setHsv(newHsv);
187
- setHexInput(color);
188
- onChange(color);
189
- onClose();
190
- }, title: color }, color))) })] }));
191
- }
@@ -1,9 +0,0 @@
1
- type DateTimePickerPopupProps = {
2
- value: Date | null;
3
- onChange: (date: Date) => void;
4
- type: 'date' | 'time' | 'datetime-local';
5
- onClose?: () => void;
6
- anchorName?: string;
7
- };
8
- export default function DateTimePickerPopup({ value, onChange, type, onClose, anchorName, }: DateTimePickerPopupProps): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,128 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from 'react';
3
- import { ChevronLeft, ChevronRight } from 'lucide-react';
4
- const DAYS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
5
- const MONTHS = [
6
- 'January', 'February', 'March', 'April', 'May', 'June',
7
- 'July', 'August', 'September', 'October', 'November', 'December'
8
- ];
9
- export default function DateTimePickerPopup({ value, onChange, type, onClose, anchorName, }) {
10
- const [currentDate, setCurrentDate] = useState(new Date());
11
- const [timeInput, setTimeInput] = useState({
12
- hours: value ? value.getHours().toString() : '0',
13
- minutes: value ? value.getMinutes().toString() : '0',
14
- });
15
- useEffect(() => {
16
- if (value) {
17
- setCurrentDate(value);
18
- setTimeInput(prev => ({
19
- hours: prev.hours === '' && value.getHours() === 0 ? '' : value.getHours().toString(),
20
- minutes: prev.minutes === '' && value.getMinutes() === 0 ? '' : value.getMinutes().toString(),
21
- }));
22
- }
23
- }, [value]);
24
- function handleDateSelect(day) {
25
- const newDate = new Date(currentDate);
26
- newDate.setDate(day);
27
- if (value) {
28
- newDate.setHours(value.getHours());
29
- newDate.setMinutes(value.getMinutes());
30
- }
31
- else {
32
- newDate.setHours(0, 0, 0, 0);
33
- }
34
- onChange(newDate);
35
- if (type === 'date' && onClose) {
36
- onClose();
37
- }
38
- }
39
- function handleTimeChange(timeUnit, val) {
40
- const newDate = value ? new Date(value) : new Date();
41
- if (!value) {
42
- newDate.setHours(0, 0, 0, 0);
43
- }
44
- if (timeUnit === 'hours') {
45
- if (val < 0 || val > 23)
46
- return;
47
- newDate.setHours(val);
48
- }
49
- if (timeUnit === 'minutes') {
50
- if (val < 0 || val > 59)
51
- return;
52
- newDate.setMinutes(val);
53
- }
54
- onChange(newDate);
55
- }
56
- function onTimeInputChange(unit, val) {
57
- if (val === '') {
58
- setTimeInput(prev => ({ ...prev, [unit]: '' }));
59
- handleTimeChange(unit, 0);
60
- return;
61
- }
62
- if (!/^\d+$/.test(val))
63
- return;
64
- const num = parseInt(val);
65
- if (unit === 'hours' && num > 23)
66
- return;
67
- if (unit === 'minutes' && num > 59)
68
- return;
69
- setTimeInput(prev => ({ ...prev, [unit]: val }));
70
- handleTimeChange(unit, num);
71
- }
72
- function onTimeInputBlur(unit) {
73
- if (timeInput[unit] === '') {
74
- const num = unit === 'hours' ? (value?.getHours() ?? 0) : (value?.getMinutes() ?? 0);
75
- setTimeInput(prev => ({ ...prev, [unit]: num.toString() }));
76
- }
77
- }
78
- function getDaysInMonth(year, month) {
79
- return new Date(year, month + 1, 0).getDate();
80
- }
81
- function getFirstDayOfMonth(year, month) {
82
- return new Date(year, month, 1).getDay();
83
- }
84
- function renderCalendar() {
85
- const year = currentDate.getFullYear();
86
- const month = currentDate.getMonth();
87
- const daysInMonth = getDaysInMonth(year, month);
88
- const firstDay = getFirstDayOfMonth(year, month);
89
- const days = [];
90
- const adjustedFirstDay = firstDay === 0 ? 6 : firstDay - 1;
91
- for (let i = 0; i < adjustedFirstDay; i++) {
92
- days.push(_jsx("div", { className: 'w-8 h-8' }, `empty-${i}`));
93
- }
94
- for (let i = 1; i <= daysInMonth; i++) {
95
- const isSelected = value &&
96
- value.getDate() === i &&
97
- value.getMonth() === month &&
98
- value.getFullYear() === year;
99
- const isToday = new Date().getDate() === i &&
100
- new Date().getMonth() === month &&
101
- new Date().getFullYear() === year;
102
- days.push(_jsx("button", { type: 'button', onClick: () => handleDateSelect(i), className: `
103
- w-8 h-8 flex items-center justify-center rounded-full text-sm
104
- hover:bg-login-500 transition-colors
105
- ${isSelected ? 'bg-login! text-white! hover:bg-login!' : ''}
106
- ${!isSelected && isToday ? 'text-login! font-bold' : ''}
107
- ${!isSelected && !isToday ? 'text-login-text!' : ''}
108
- `, children: i }, i));
109
- }
110
- return (_jsxs("div", { className: 'p-2', children: [_jsxs("div", { className: 'flex items-center justify-between mb-2', children: [_jsx("button", { type: 'button', onClick: () => setCurrentDate(new Date(year, month - 1)), className: 'p-1 hover:bg-login-500 rounded-full text-login-text', children: _jsx(ChevronLeft, { className: 'w-4 h-4' }) }), _jsxs("span", { className: 'font-medium text-login-text', children: [MONTHS[month], " ", year] }), _jsx("button", { type: 'button', onClick: () => setCurrentDate(new Date(year, month + 1)), className: 'p-1 hover:bg-login-500 rounded-full text-login-text', children: _jsx(ChevronRight, { className: 'w-4 h-4' }) })] }), _jsx("div", { className: 'grid grid-cols-7 gap-1 mb-1', children: DAYS.map(d => (_jsx("div", { className: 'w-8 text-center text-xs text-login-200 font-medium', children: d }, d))) }), _jsx("div", { className: 'grid grid-cols-7 gap-1', children: days })] }));
111
- }
112
- function renderTimePicker() {
113
- return (_jsxs("div", { className: 'p-2 border-t border-login-500 flex justify-center gap-2', children: [_jsxs("div", { className: 'flex flex-col items-center', children: [_jsx("label", { className: 'text-xs text-login-200 mb-1', children: "Hour" }), _jsx("input", { type: 'text', inputMode: 'numeric', value: timeInput.hours, onChange: (e) => onTimeInputChange('hours', e.target.value), onBlur: () => onTimeInputBlur('hours'), className: `
114
- w-16 p-1 bg-login-500 rounded text-center text-login-text
115
- border border-login-500 focus:border-login outline-none
116
- ` })] }), _jsx("div", { className: 'flex items-end pb-2 text-login-text', children: ":" }), _jsxs("div", { className: 'flex flex-col items-center', children: [_jsx("label", { className: 'text-xs text-login-200 mb-1', children: "Minute" }), _jsx("input", { type: 'text', inputMode: 'numeric', value: timeInput.minutes, onChange: (e) => onTimeInputChange('minutes', e.target.value), onBlur: () => onTimeInputBlur('minutes'), className: `
117
- w-16 p-1 bg-login-500 rounded text-center text-login-text
118
- border border-login-500 focus:border-login outline-none
119
- ` })] })] }));
120
- }
121
- return (_jsxs("div", { className: 'fixed z-50 bg-login-600 border border-login-500 rounded-md shadow-lg p-1 min-w-70 anchor-popup', style: {
122
- positionAnchor: anchorName,
123
- positionArea: 'bottom span-right',
124
- insetArea: 'bottom span-right',
125
- positionTryFallbacks: 'flip-block',
126
- margin: '0.25rem 0',
127
- }, children: [type !== 'time' && renderCalendar(), (type === 'time' || type === 'datetime-local') && renderTimePicker()] }));
128
- }
@@ -1,14 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface FieldWrapperProps {
3
- label?: string;
4
- name: string;
5
- required?: boolean;
6
- info?: string;
7
- error?: string;
8
- description?: string;
9
- textSize?: 'sm' | 'md';
10
- children: ReactNode;
11
- className?: string;
12
- }
13
- export default function FieldWrapper({ label, name, required, info, error, description, textSize, children, className, }: FieldWrapperProps): import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import InputLabel from './inputLabel';
3
- import InputInfo from './inputInfo';
4
- import InputError from './inputError';
5
- import MarkdownRender from '../../markdownrender/markdownRender';
6
- export default function FieldWrapper({ label, name, required, info, error, description, textSize = 'sm', children, className, }) {
7
- return (_jsxs("div", { className: `flex flex-col gap-1 w-full relative ${className || ''}`, children: [(label || info) && (_jsxs("div", { className: 'flex items-center justify-between mb-1', children: [label && (_jsx(InputLabel, { label: label, name: name, required: required, className: `ml-1 ${textSize === 'sm' ? 'text-sm!' : 'text-base!'}` })), info && _jsx(InputInfo, { info: info })] })), description && (_jsx("div", { className: 'text-login-100 **:text-xs! ml-1 mb-1', children: _jsx(MarkdownRender, { MDstr: String(description || '') }) })), children, _jsx(InputError, { error: error, id: `${name}-error` })] }));
8
- }
@@ -1,5 +0,0 @@
1
- export { default as FieldWrapper } from './fieldWrapper';
2
- export { default as InputLabel } from './inputLabel';
3
- export { default as InputInfo } from './inputInfo';
4
- export { default as InputError } from './inputError';
5
- export { default as ColorPickerPopup } from './colorPickerPopup';
@@ -1,5 +0,0 @@
1
- export { default as FieldWrapper } from './fieldWrapper';
2
- export { default as InputLabel } from './inputLabel';
3
- export { default as InputInfo } from './inputInfo';
4
- export { default as InputError } from './inputError';
5
- export { default as ColorPickerPopup } from './colorPickerPopup';
@@ -1,6 +0,0 @@
1
- interface InputErrorProps {
2
- error?: string;
3
- id?: string;
4
- }
5
- export default function InputError({ error, id }: InputErrorProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export default function InputError({ error, id }) {
3
- if (!error)
4
- return _jsx("div", { className: 'h-4' });
5
- return (_jsx("div", { className: 'h-4', children: _jsx("span", { id: id, className: 'text-xs text-red-500 ml-1 truncate block', role: 'alert', title: error, children: error }) }));
6
- }
@@ -1,5 +0,0 @@
1
- interface InputInfoProps {
2
- info: string;
3
- }
4
- export default function InputInfo({ info }: InputInfoProps): import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CircleHelp } from 'lucide-react';
3
- export default function InputInfo({ info }) {
4
- return (_jsx("div", { className: 'text-login-200 hover:text-login-text transition-colors', "aria-label": info, title: info, children: _jsx(CircleHelp, { className: 'w-4 h-4' }) }));
5
- }
@@ -1,9 +0,0 @@
1
- interface InputLabelProps {
2
- label: string;
3
- name: string;
4
- required?: boolean;
5
- disabled?: boolean;
6
- className?: string;
7
- }
8
- export default function InputLabel({ label, name, required, disabled, className }: InputLabelProps): import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export default function InputLabel({ label, name, required, disabled, className }) {
3
- return (_jsxs("label", { htmlFor: name, className: `text-sm font-medium text-login-text ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className || ''}`, title: label, children: [label, " ", required && _jsx("span", { className: 'text-red-500', children: "*" })] }));
4
- }
@@ -1,11 +0,0 @@
1
- export type SwitchProps = Omit<React.ComponentProps<'input'>, 'name'> & {
2
- name: string;
3
- label?: string;
4
- error?: string;
5
- info?: string;
6
- description?: string;
7
- className?: string;
8
- switchOnly?: boolean;
9
- textSize?: 'sm' | 'md';
10
- };
11
- export default function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FieldWrapper } from './shared';
3
- export default function Switch(props) {
4
- const { name, label, error, info, description, className, switchOnly, textSize = 'sm', ...inputProps } = props;
5
- return (_jsx(FieldWrapper, { label: label, name: name, required: inputProps.required, info: info, error: error, description: description, textSize: textSize, className: className, children: _jsxs("label", { className: `relative inline-flex items-center cursor-pointer ${switchOnly ? 'h-fit' : 'h-10.5'}`, children: [_jsx("input", { ...inputProps, type: 'checkbox', id: name, name: name, className: 'sr-only peer' }), _jsx("div", { className: `
6
- w-11 h-6 bg-login-500/50 rounded-full peer
7
- peer-checked:after:translate-x-full peer-checked:after:border-white
8
- after:content-[''] after:absolute ${switchOnly ? 'after:top-0.5' : 'after:top-2.75'} after:left-0.5
9
- after:bg-white after:border-gray-300 after:border after:rounded-full
10
- after:h-5 after:w-5 after:transition-all peer-checked:bg-login
11
- ${inputProps.disabled ? 'opacity-50 cursor-not-allowed' : ''}
12
- ${error ? 'ring-1 ring-red-500' : ''}
13
- ` })] }) }));
14
- }
@@ -1,15 +0,0 @@
1
- export type TagInputProps = {
2
- label?: string;
3
- name: string;
4
- value?: string[];
5
- onChange?: (value: string[]) => void;
6
- placeholder?: string;
7
- error?: string;
8
- className?: string;
9
- disabled?: boolean;
10
- required?: boolean;
11
- info?: string;
12
- description?: string;
13
- textSize?: 'sm' | 'md';
14
- };
15
- export default function TagInput({ label, name, value, onChange, placeholder, error, className, disabled, required, info, description, textSize, }: TagInputProps): import("react/jsx-runtime").JSX.Element;
@@ -1,40 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- import { X } from 'lucide-react';
5
- import { FieldWrapper } from './shared';
6
- export default function TagInput({ label, name, value = [], onChange, placeholder = 'Add...', error, className, disabled, required, info, description, textSize = 'sm', }) {
7
- const [inputValue, setInputValue] = useState('');
8
- function handleKeyDown(e) {
9
- if ((e.key === 'Enter' || e.key === ',') && inputValue.trim()) {
10
- e.preventDefault();
11
- const val = inputValue.trim().replace(/,$/, '');
12
- if (val && !value.includes(val)) {
13
- const newValue = [...value, val];
14
- if (onChange)
15
- onChange(newValue);
16
- }
17
- setInputValue('');
18
- }
19
- else if (e.key === 'Backspace' && !inputValue && value.length > 0) {
20
- const newValue = value.slice(0, -1);
21
- if (onChange)
22
- onChange(newValue);
23
- }
24
- }
25
- function removeTag(index) {
26
- if (disabled)
27
- return;
28
- const newValue = value.filter((_, i) => i !== index);
29
- if (onChange)
30
- onChange(newValue);
31
- }
32
- return (_jsxs(FieldWrapper, { label: label, name: name, required: required, info: info, description: description, error: error, className: className, textSize: textSize, children: [_jsxs("div", { className: `
33
- flex flex-wrap gap-2 p-2 rounded-md bg-login-500/50 border border-login-500
34
- text-login-text min-h-10.5
35
- focus-within:border-login focus-within:ring-1 focus-within:ring-login
36
- disabled:opacity-50 disabled:cursor-not-allowed
37
- transition-all duration-200
38
- ${error ? 'border-red-500 focus-within:border-red-500 focus-within:ring-red-500' : ''}
39
- `, children: [value.map((tag, index) => (_jsxs("span", { className: 'flex items-center gap-1 px-2 py-1 bg-login rounded text-sm text-white', children: [tag, !disabled && (_jsx("button", { type: 'button', onClick: () => removeTag(index), className: 'hover:text-red-200 transition-colors', children: _jsx(X, { size: 14 }) }))] }, index))), _jsx("input", { type: 'text', value: inputValue, required: required && value.length === 0, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, disabled: disabled, placeholder: value.length === 0 ? placeholder : '', className: 'flex-1 bg-transparent outline-none min-w-30 text-login-text placeholder:text-login-200' })] }), _jsx("input", { type: 'hidden', name: name, value: value.join(',') })] }));
40
- }
@@ -1,11 +0,0 @@
1
- export type TextareaProps = Omit<React.ComponentProps<'textarea'>, 'name'> & {
2
- name: string;
3
- label?: string;
4
- error?: string;
5
- className?: string;
6
- info?: string;
7
- description?: string;
8
- type?: 'markdown' | 'json' | 'text';
9
- textSize?: 'sm' | 'md';
10
- };
11
- export default function Textarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Eye, Pencil } from 'lucide-react';
4
- import { FieldWrapper } from './shared';
5
- import MarkdownRender from '../markdownrender/markdownRender';
6
- function isValidJson(str) {
7
- try {
8
- JSON.parse(str);
9
- return null;
10
- }
11
- catch (error) {
12
- return error.message;
13
- }
14
- }
15
- export default function Textarea(props) {
16
- const { name, label, error, className, info, description, type = 'text', rows = 4, textSize = 'sm', ...textareaProps } = props;
17
- const { value } = textareaProps;
18
- const [preview, setPreview] = useState(false);
19
- const jsonError = type === 'json' && value ? isValidJson(value) : undefined;
20
- const displayError = jsonError || error;
21
- console.log(value);
22
- return (_jsx(FieldWrapper, { label: label, name: name, required: textareaProps.required, info: info, description: description, error: displayError, textSize: textSize, className: className, children: _jsxs("div", { className: 'relative', children: [type === 'markdown' && (_jsx("div", { className: 'absolute right-2 top-2 z-10 flex gap-2', children: _jsx("button", { type: 'button', onClick: () => setPreview(!preview), className: 'p-1 rounded hover:bg-login-500/50 text-login-text transition-colors', title: preview ? 'Edit' : 'Preview', children: preview ? _jsx(Pencil, { size: 16 }) : _jsx(Eye, { size: 16 }) }) })), type === 'markdown' && preview && (_jsx("div", { className: `
23
- w-full rounded-md bg-login-500/50 border border-login-500
24
- p-3 overflow-y-auto ${error ? 'border-red-500' : ''}
25
- `, children: _jsx(MarkdownRender, { MDstr: String(value || '') }) })), _jsx("textarea", { ...textareaProps, id: name, name: name, rows: rows, title: label, "aria-invalid": !!error, "aria-describedby": error ? `${name}-error` : undefined, className: `
26
- ${type === 'markdown' && preview ? 'hidden' : ''}
27
- w-full rounded-md bg-login-500/50 border border-login-500
28
- text-login-text placeholder-login-200
29
- focus:outline-none focus:border-login focus:ring-1 focus:ring-login
30
- disabled:opacity-50 disabled:cursor-not-allowed
31
- p-3 pr-10
32
- transition-all duration-200
33
- resize-y
34
- ${error ? 'border-red-500 focus:border-red-500 focus:ring-red-500' : ''}
35
- ` })] }) }));
36
- }
@@ -1,14 +0,0 @@
1
- type ToggleOption<T> = {
2
- value: T;
3
- label?: string;
4
- text?: string;
5
- icon?: React.ReactNode;
6
- };
7
- type ToggleProps<T> = {
8
- value: T;
9
- onChange: (value: T) => void;
10
- left: ToggleOption<T>;
11
- right: ToggleOption<T>;
12
- };
13
- export default function Toggle<T>({ value, onChange, left, right, }: ToggleProps<T>): import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- export default function Toggle({ value, onChange, left, right, }) {
3
- const active = 'bg-login-200 text-login-950 shadow';
4
- const idle = 'text-login-200 hover:bg-login-50/10 hover:text-login-50';
5
- const base = 'flex items-center justify-center rounded-lg transition gap-1';
6
- function renderContent(opt) {
7
- return (_jsxs(_Fragment, { children: [opt.icon, opt.text && _jsx("span", { children: opt.text })] }));
8
- }
9
- const isLeftActive = value === left.value;
10
- const isRightActive = value === right.value;
11
- return (_jsxs("div", { className: 'flex items-center border rounded-lg border-login-100/10 bg-login-50/5 p-1', children: [_jsx("button", { type: 'button', onClick: () => onChange(left.value), "aria-label": left.label ?? left.text, "aria-pressed": isLeftActive, className: `${base} px-2 h-7 ${isLeftActive ? active : idle}`, children: renderContent(left) }), _jsx("button", { type: 'button', onClick: () => onChange(right.value), "aria-label": right.label ?? right.text, "aria-pressed": isRightActive, className: `${base} px-2 h-7 ${isRightActive ? active : idle}`, children: renderContent(right) })] }));
12
- }
@@ -1,2 +0,0 @@
1
- import { LoginPageProps } from 'uibee/components';
2
- export default function LoginPage({ title, description, redirectPath, version, btg, handleSubmit, guestRedirectPath, guestText }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LogIn } from 'lucide-react';
3
- import Logo from '../logo/logo';
4
- import Link from 'next/link';
5
- export default function LoginPage({ title, description, redirectPath, version, btg, handleSubmit, guestRedirectPath, guestText }) {
6
- return (_jsx("main", { className: 'w-full h-full flex items-center justify-center bg-login-800 p-8', children: _jsxs("div", { className: 'flex flex-col justify-center items-center bg-login-600 px-4 py-12 rounded-xl w-full max-w-md gap-4 md:gap-6', children: [_jsx("div", { className: 'relative aspect-3/1 w-full', children: _jsx(Logo, { className: 'object-contain px-6 sm:px-12' }) }), _jsxs("h1", { className: 'text-3xl font-extrabold text-login text-center tracking-tight', children: [title, " ", btg ? ' - Break the Glass' : ''] }), description && (_jsx("p", { className: 'text-center font-medium text-lg mb-2 max-w-xs', children: description })), btg ? (_jsxs("form", { className: 'w-full flex flex-col gap-3 max-w-xs', onSubmit: e => {
7
- e.preventDefault();
8
- handleSubmit?.(new FormData(e.currentTarget));
9
- e.currentTarget.reset();
10
- }, children: [_jsx("input", { type: 'text', name: 'name', placeholder: 'Name', className: 'py-2 px-3 rounded bg-login-900 font-medium focus:outline-none', required: true }), _jsx("input", { type: 'password', name: 'token', placeholder: 'Token', className: 'py-2 px-3 rounded bg-login-900 font-medium focus:outline-none', required: true }), _jsx("button", { type: 'submit', className: 'py-2 px-4 rounded-xl bg-login font-bold text-lg ' +
11
- 'hover:bg-login/80 transition-all duration-200 mt-2', children: "Login" })] })) : (_jsxs(Link, { href: redirectPath, className: `
12
- flex items-center justify-center gap-2 w-full
13
- max-w-xs py-3 px-6 rounded-xl bg-login font-bold
14
- text-lg hover:bg-login/80 transition-all
15
- duration-200 mb-2 mt-2 cursor-pointer
16
- `, children: ["Login", _jsx(LogIn, { className: 'w-6 h-6' })] })), guestRedirectPath &&
17
- _jsx(Link, { href: guestRedirectPath, className: 'text-sm font-semibold cursor-pointer opacity-50', children: guestText || 'Continue as guest' }), _jsxs("span", { className: 'text-sm mt-2', children: ["v", version] })] }) }));
18
- }
@@ -1,5 +0,0 @@
1
- interface LogoProps {
2
- className?: string;
3
- }
4
- export default function Logo({ className }: LogoProps): import("react/jsx-runtime").JSX.Element;
5
- export {};