@dashadmin/dash-components 1.3.73 → 1.3.74-srcfree.1

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 (60) hide show
  1. package/package.json +24 -21
  2. package/src/components/AuditLog/AuditLog.tsx +0 -490
  3. package/src/components/AuditLog/index.ts +0 -2
  4. package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +0 -917
  5. package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +0 -39
  6. package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +0 -916
  7. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -42
  8. package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +0 -44
  9. package/src/components/Json/Json.tsx +0 -312
  10. package/src/components/JsonColorSelector/JsonColorSelector.tsx +0 -1443
  11. package/src/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -746
  12. package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +0 -1135
  13. package/src/components/JsonColorSelector/JsonCssVarValues.tsx +0 -867
  14. package/src/components/JsonColorSelector/components/BasicColorSelector.tsx +0 -333
  15. package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +0 -495
  16. package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +0 -80
  17. package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +0 -420
  18. package/src/components/JsonColorSelector/helpers/functions.tsx +0 -123
  19. package/src/components/JsonColorSelector/helpers/paletteDerivation.ts +0 -367
  20. package/src/components/JsonColorSelector/interfaces/interfaces.tsx +0 -22
  21. package/src/components/JsonColorSelector/useAsyncColorThief.tsx +0 -97
  22. package/src/components/ListActive/ListActive.tsx +0 -106
  23. package/src/components/ListActive/ListBoolean.tsx +0 -96
  24. package/src/components/NotificationPreferences/NotificationPreferences.tsx +0 -480
  25. package/src/components/NotificationPreferences/index.tsx +0 -2
  26. package/src/components/SearchableSelects/RASearchableSelect.tsx +0 -303
  27. package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +0 -617
  28. package/src/components/SearchableSelects/RASearchableSelectChips.tsx +0 -561
  29. package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +0 -366
  30. package/src/components/SearchableSelects/SearchableSelect.tsx +0 -323
  31. package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +0 -358
  32. package/src/components/SortableDataGrid/README.md +0 -1
  33. package/src/components/SortableDataGrid/SortableDataGrid.tsx +0 -56
  34. package/src/components/SortableDataGrid/SortableDataGridBody.tsx +0 -175
  35. package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +0 -171
  36. package/src/components/SortableDataGrid/SortableDataGridRow.tsx +0 -247
  37. package/src/components/Upload/SingleImageUploader.tsx +0 -55
  38. package/src/components/custom/PackageCopyMethod.tsx +0 -109
  39. package/src/components/custom/PackageRadioButtonGroup.tsx +0 -49
  40. package/src/components/dialog/Basic.tsx +0 -11
  41. package/src/components/dialog/Correct.tsx +0 -16
  42. package/src/components/dialog/Error.tsx +0 -15
  43. package/src/components/dialog/Info.tsx +0 -15
  44. package/src/components/dialog/InfoV2.tsx +0 -35
  45. package/src/components/dialog/NotFound.tsx +0 -18
  46. package/src/components/dialog/QuickSearch.tsx +0 -115
  47. package/src/components/notifications/NotificationsCenter.tsx +0 -743
  48. package/src/components/notifications/index.ts +0 -42
  49. package/src/components/tables/PaginationComponent.tsx +0 -17
  50. package/src/components/theme/AppLoadingFallback.tsx +0 -42
  51. package/src/components/theme/ErrorBoundary.tsx +0 -57
  52. package/src/components/theme/InitialLoader.tsx +0 -16
  53. package/src/components/theme/NotFound.tsx +0 -124
  54. package/src/components/theme/NotResults.tsx +0 -56
  55. package/src/hooks/useDraggable.ts +0 -11
  56. package/src/hooks/useNotifications.ts +0 -14
  57. package/src/hooks/useQuickSearch.tsx +0 -29
  58. package/src/index.tsx +0 -77
  59. package/src/styles/index.less +0 -0
  60. package/src/utils/setNativeValue.tsx +0 -23
@@ -1,333 +0,0 @@
1
- import { Box, Card, TextField, Typography } from '@mui/material';
2
- import { useRef } from 'react';
3
- import {
4
- BASIC_COLOR_DEFS,
5
- BasicPalette,
6
- ThemeMode,
7
- contrastText,
8
- deriveModePalette,
9
- lighten,
10
- parseColor,
11
- toHex,
12
- withAlpha,
13
- } from '../helpers/paletteDerivation';
14
-
15
- interface BasicColorSelectorProps {
16
- lightBases: BasicPalette;
17
- darkBases: BasicPalette;
18
- onBaseChange: (mode: ThemeMode, key: keyof BasicPalette, color: string) => void;
19
- readOnly?: boolean;
20
- }
21
-
22
- /** Mini browser-like preview painted with the derived palette for one mode. */
23
- const MiniPreview: React.FC<{ bases: BasicPalette; mode: ThemeMode }> = ({ bases, mode }) => {
24
- const derived = deriveModePalette(bases, mode);
25
- const dark = mode === 'dark';
26
-
27
- // Page background pair, driven by the two new base swatches — primary is the
28
- // overall content surface, secondary shows on the "row"/card beneath it, echoing
29
- // their real usage as MUI DataGrid even/odd row backgrounds.
30
- const surface = derived['bodybg-primary'];
31
- const text = dark ? '#f2f2f2' : '#1a1a1a';
32
- const textLight = dark ? '#b5b5b5' : '#6c6c6c';
33
- const moduleBg = derived['bodybg-secondary'];
34
- const moduleBorder = dark ? '#404040' : '#dddddd';
35
-
36
- return (
37
- <Box
38
- sx={{
39
- borderRadius: 1.5,
40
- overflow: 'hidden',
41
- border: `1px solid ${moduleBorder}`,
42
- fontSize: 0,
43
- userSelect: 'none',
44
- }}
45
- >
46
- {/* Browser chrome bar */}
47
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, px: 1, py: 0.5, backgroundColor: dark ? '#1c1c1c' : '#e4e4e4' }}>
48
- {['#ff5f57', '#febc2e', '#28c840'].map(c => (
49
- <Box key={c} sx={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: c }} />
50
- ))}
51
- </Box>
52
-
53
- <Box
54
- sx={{
55
- display: 'flex',
56
- height: 168,
57
- // Page surface as a gradient between the two body-background bases,
58
- // rather than a flat fill — echoes how the pair reads together
59
- // instead of showing bodybg-secondary only via row striping.
60
- background: `linear-gradient(160deg, ${surface} 0%, ${moduleBg} 100%)`,
61
- }}
62
- >
63
- {/* Sidebar — mimics the real dash menu: logo, then nav rows with an
64
- icon dot + label bar each, one marked "active" with a highlight-
65
- color accent stripe and hover-tinted pill background. Every row
66
- (including the logo) shares the same icon-slot width so label
67
- bars all start at the same x-offset instead of drifting per row. */}
68
- <Box sx={{ width: 56, backgroundColor: derived['dash-sidebar-bg'], display: 'flex', flexDirection: 'column', gap: 0.4, p: 0.6, flexShrink: 0 }}>
69
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, pr: 0.4, pl: 0.3, borderLeft: '2px solid transparent', mb: 0.2 }}>
70
- <Box sx={{ width: 8, height: 8, borderRadius: '50%', backgroundColor: derived['highlight-color'], flexShrink: 0 }} />
71
- <Box sx={{ flexGrow: 1, height: 6, borderRadius: 0.5, backgroundColor: derived['dash-sidebar-color'], opacity: 0.85 }} />
72
- </Box>
73
- {[true, false, false, false].map((active, i) => (
74
- <Box
75
- key={i}
76
- sx={{
77
- display: 'flex',
78
- alignItems: 'center',
79
- gap: 0.5,
80
- py: 0.3,
81
- pr: 0.4,
82
- pl: 0.3,
83
- borderRadius: 0.5,
84
- backgroundColor: active ? derived['dash-sidebar-bg-hover'] : 'transparent',
85
- borderLeft: `2px solid ${active ? derived['highlight-color'] : 'transparent'}`,
86
- }}
87
- >
88
- <Box
89
- sx={{
90
- width: 8,
91
- height: 8,
92
- borderRadius: 0.5,
93
- flexShrink: 0,
94
- backgroundColor: active ? derived['dash-sidebar-icon-color-active'] : derived['dash-sidebar-icon-color'],
95
- }}
96
- />
97
- <Box
98
- sx={{
99
- flexGrow: 1,
100
- height: 5,
101
- borderRadius: 0.5,
102
- width: `${70 + (i % 3) * 8}%`,
103
- backgroundColor: active ? derived['dash-sidebar-color-active'] : derived['dash-sidebar-color'],
104
- opacity: active ? 0.95 : 0.55,
105
- }}
106
- />
107
- </Box>
108
- ))}
109
- </Box>
110
-
111
- {/* Main area */}
112
- <Box sx={{ flexGrow: 1, display: 'flex', flexDirection: 'column' }}>
113
- {/* Header */}
114
- <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', px: 1, py: 0.75, borderBottom: `1px solid ${moduleBorder}` }}>
115
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
116
- <Box sx={{ width: 10, height: 10, borderRadius: 0.5, backgroundColor: derived['table-header-bg'] }} />
117
- <Box sx={{ width: 50, height: 7, borderRadius: 0.5, backgroundColor: textLight, opacity: 0.6 }} />
118
- </Box>
119
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
120
- <Box sx={{ position: 'relative', width: 14, height: 14 }}>
121
- <Box sx={{ width: 14, height: 14, borderRadius: '50%', backgroundColor: derived['header-badge'] }} />
122
- <Box
123
- sx={{
124
- position: 'absolute',
125
- top: -2,
126
- right: -2,
127
- width: 7,
128
- height: 7,
129
- borderRadius: '50%',
130
- backgroundColor: derived['highlight-color'],
131
- border: `1px solid ${dark ? '#1c1c1c' : '#e4e4e4'}`,
132
- }}
133
- />
134
- </Box>
135
- <Box sx={{ width: 14, height: 14, borderRadius: '50%', backgroundColor: text, opacity: 0.15 }} />
136
- </Box>
137
- </Box>
138
-
139
- {/* Content */}
140
- <Box sx={{ p: 1, display: 'flex', flexDirection: 'column', gap: 0.75, flexGrow: 1 }}>
141
- <Typography sx={{ fontSize: 11, fontWeight: 700, color: text, lineHeight: 1.2 }}>
142
- Title text
143
- </Typography>
144
- <Typography sx={{ fontSize: 8, color: textLight, lineHeight: 1.3 }}>
145
- Subtext preview of body copy rendered over the {mode} surface.
146
- </Typography>
147
- <Typography sx={{ fontSize: 8, color: derived['link-color'], textDecoration: 'underline', lineHeight: 1.2 }}>
148
- A link in primary
149
- </Typography>
150
-
151
- {/* Tag chip + status badge — a couple more miniature details */}
152
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
153
- <Box
154
- sx={{
155
- px: 0.75,
156
- py: 0.15,
157
- borderRadius: 4,
158
- backgroundColor: withAlpha(derived['primary-color'], dark ? 0.25 : 0.12),
159
- border: `1px solid ${derived['primary-color']}`,
160
- }}
161
- >
162
- <Typography sx={{ fontSize: 7, fontWeight: 600, lineHeight: 1.4, color: dark ? lighten(derived['primary-color'], 0.4) : derived['primary-color'] }}>
163
- Tag
164
- </Typography>
165
- </Box>
166
- <Box
167
- sx={{
168
- minWidth: 14,
169
- height: 12,
170
- px: 0.4,
171
- borderRadius: 4,
172
- backgroundColor: derived['highlight-color'],
173
- display: 'flex',
174
- alignItems: 'center',
175
- justifyContent: 'center',
176
- }}
177
- >
178
- <Typography sx={{ fontSize: 7, fontWeight: 700, lineHeight: 1.4, color: contrastText(derived['highlight-color']) }}>
179
- 3
180
- </Typography>
181
- </Box>
182
- </Box>
183
-
184
- {/* Mini card + button */}
185
- <Box sx={{ display: 'flex', gap: 1, alignItems: 'flex-end', mt: 'auto' }}>
186
- <Box sx={{ flexGrow: 1, backgroundColor: moduleBg, border: `1px solid ${moduleBorder}`, borderRadius: 0.75, p: 0.75 }}>
187
- <Box sx={{ width: '55%', height: 6, borderRadius: 0.5, backgroundColor: text, opacity: 0.75, mb: 0.5 }} />
188
- <Box sx={{ width: '85%', height: 5, borderRadius: 0.5, backgroundColor: textLight, opacity: 0.6 }} />
189
- </Box>
190
- <Box
191
- sx={{
192
- px: 1,
193
- py: 0.5,
194
- borderRadius: 0.75,
195
- backgroundColor: derived['btn-bg'],
196
- color: derived['btn-color'],
197
- fontSize: 8,
198
- fontWeight: 600,
199
- lineHeight: 1,
200
- }}
201
- >
202
- Button
203
- </Box>
204
- </Box>
205
- </Box>
206
- </Box>
207
- </Box>
208
- </Box>
209
- );
210
- };
211
-
212
- /** One swatch row: color square (native picker) + hex text input. */
213
- const BaseSwatch: React.FC<{
214
- def: (typeof BASIC_COLOR_DEFS)[number];
215
- value: string;
216
- onChange: (color: string) => void;
217
- readOnly?: boolean;
218
- labelColor: string;
219
- sublabelColor: string;
220
- }> = ({ def, value, onChange, readOnly, labelColor, sublabelColor }) => {
221
- const inputRef = useRef<HTMLInputElement>(null);
222
- const parsed = parseColor(value);
223
- const pickerValue = parsed ? toHex(parsed) : '#000000';
224
-
225
- return (
226
- <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.25 }}>
227
- <Box
228
- onClick={() => !readOnly && inputRef.current?.click()}
229
- sx={{
230
- width: 36,
231
- height: 36,
232
- borderRadius: 1,
233
- backgroundColor: value,
234
- border: '2px solid rgba(128,128,128,0.35)',
235
- cursor: readOnly ? 'default' : 'pointer',
236
- flexShrink: 0,
237
- display: 'flex',
238
- alignItems: 'center',
239
- justifyContent: 'center',
240
- position: 'relative',
241
- }}
242
- >
243
- <input
244
- ref={inputRef}
245
- type="color"
246
- value={pickerValue}
247
- disabled={readOnly}
248
- onChange={e => onChange(e.target.value)}
249
- style={{ position: 'absolute', inset: 0, opacity: 0, width: '100%', height: '100%', cursor: 'pointer', border: 'none', padding: 0 }}
250
- />
251
- </Box>
252
- <Box sx={{ flexGrow: 1, minWidth: 0 }}>
253
- <Typography sx={{ fontSize: 12, fontWeight: 600, color: labelColor, lineHeight: 1.2 }}>
254
- {def.label}
255
- </Typography>
256
- <Typography noWrap sx={{ fontSize: 10, color: sublabelColor, lineHeight: 1.2 }}>
257
- {def.description}
258
- </Typography>
259
- </Box>
260
- <TextField
261
- value={value}
262
- size="small"
263
- disabled={readOnly}
264
- onChange={e => onChange(e.target.value)}
265
- sx={{ '& .MuiInputBase-root': { backgroundColor: 'rgba(255,255,255,0.85)' } }}
266
- slotProps={{
267
- htmlInput: { style: { fontFamily: 'monospace', fontSize: 11, padding: '4px 8px', width: 84 } }
268
- }}
269
- />
270
- </Box>
271
- );
272
- };
273
-
274
- /**
275
- * Basic color selector: one card per mode (light-grey card for light mode,
276
- * dark-grey card for dark mode), each with a mini browser-style preview and
277
- * the base design-system colors (5 brand colors + the bodybg page-surface pair).
278
- */
279
- const BasicColorSelector: React.FC<BasicColorSelectorProps> = ({ lightBases, darkBases, onBaseChange, readOnly }) => {
280
- const cards: { mode: ThemeMode; bases: BasicPalette; cardBg: string; title: string }[] = [
281
- { mode: 'light', bases: lightBases, cardBg: '#e9e9e9', title: '☀️ Light mode' },
282
- { mode: 'dark', bases: darkBases, cardBg: '#3a3a3a', title: '🌙 Dark mode' },
283
- ];
284
-
285
- return (
286
- <Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 2 }}>
287
- {cards.map(({ mode, bases, cardBg, title }) => {
288
- const labelColor = contrastText(cardBg);
289
- const sublabelColor = mode === 'dark' ? 'rgba(255,255,255,0.6)' : 'rgba(0,0,0,0.55)';
290
- return (
291
- <Card
292
- key={mode}
293
- elevation={2}
294
- sx={{
295
- backgroundColor: cardBg,
296
- // MUI layers a semi-transparent white elevation overlay onto any
297
- // Paper/Card whenever the app's ACTIVE theme is dark, regardless of
298
- // this card's own explicit background — that washes out low-contrast
299
- // text (e.g. dark text on the light-mode card) while saturated chips/
300
- // buttons still show through. These cards are intentionally themed
301
- // independently of the app's current mode, so opt out of it.
302
- backgroundImage: 'none',
303
- p: 2,
304
- borderRadius: 2,
305
- }}
306
- >
307
- <Typography sx={{ fontSize: 13, fontWeight: 700, color: labelColor, mb: 1.5 }}>
308
- {title}
309
- </Typography>
310
- <Box sx={{ mb: 2 }}>
311
- <MiniPreview bases={bases} mode={mode} />
312
- </Box>
313
- <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.25 }}>
314
- {BASIC_COLOR_DEFS.map(def => (
315
- <BaseSwatch
316
- key={def.key}
317
- def={def}
318
- value={bases[def.key]}
319
- readOnly={readOnly}
320
- labelColor={labelColor}
321
- sublabelColor={sublabelColor}
322
- onChange={color => onBaseChange(mode, def.key, color)}
323
- />
324
- ))}
325
- </Box>
326
- </Card>
327
- );
328
- })}
329
- </Box>
330
- );
331
- };
332
-
333
- export default BasicColorSelector;