@cronocode/react-box 3.0.12 → 3.0.14
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.
- package/README.md +8 -7
- package/array.d.ts +13 -0
- package/box.cjs +1 -1
- package/box.d.ts +8 -9
- package/box.mjs +16 -16
- package/components/button.d.ts +7 -6
- package/components/checkbox.d.ts +5 -3
- package/components/checkbox.mjs +4 -4
- package/components/dataGrid/contracts/dataGridContract.d.ts +36 -0
- package/components/dataGrid/dataGridCell.d.ts +8 -0
- package/components/dataGrid/dataGridGroupRow.d.ts +6 -0
- package/components/dataGrid/dataGridHeaderCell.d.ts +6 -0
- package/components/dataGrid/dataGridPagination.d.ts +6 -0
- package/components/dataGrid/dataGridRow.d.ts +6 -0
- package/components/dataGrid/models/cellModel.d.ts +10 -0
- package/components/dataGrid/models/columnModel.d.ts +36 -0
- package/components/dataGrid/models/gridModel.d.ts +44 -0
- package/components/dataGrid/models/groupRowCellModel.d.ts +10 -0
- package/components/dataGrid/models/groupRowModel.d.ts +23 -0
- package/components/dataGrid/models/rowModel.d.ts +16 -0
- package/components/dataGrid/useGrid.d.ts +3 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +2 -7
- package/components/dataGrid.mjs +656 -18
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.d.ts +2 -2
- package/components/dropdown.mjs +63 -62
- package/components/flex.d.ts +2 -1
- package/components/form.cjs +1 -1
- package/components/form.mjs +11 -8
- package/components/grid.d.ts +2 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +7 -6
- package/components/radioButton.mjs +9 -9
- package/components/semantics.cjs +1 -1
- package/components/semantics.d.ts +27 -25
- package/components/semantics.mjs +26 -25
- package/components/textarea.d.ts +7 -6
- package/components/textbox.d.ts +7 -6
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -1
- package/components/tooltip.mjs +20 -22
- package/core/boxConstants.d.ts +1 -0
- package/core/boxStyles.d.ts +112 -37
- package/core/boxStylesFormatters.d.ts +1 -1
- package/core/classNames.d.ts +1 -1
- package/core/extends/boxComponents.d.ts +391 -0
- package/core/{boxExtends.d.ts → extends/boxExtends.d.ts} +4 -1
- package/core/extends/useComponents.d.ts +2 -0
- package/core/theme/theme.d.ts +1 -3
- package/core/theme/themeContext.d.ts +2 -4
- package/core/useStyles.d.ts +2 -2
- package/core/variables.d.ts +1 -0
- package/core.cjs +4 -4
- package/core.mjs +634 -511
- package/hooks/useVisibility.d.ts +9 -1
- package/icons/arrowIcon.d.ts +2 -0
- package/icons/dotsIcon.d.ts +2 -0
- package/icons/groupingIcon.d.ts +2 -0
- package/icons/pinIcon.d.ts +2 -0
- package/package.json +1 -1
- package/types.d.ts +35 -6
- package/utils/fn/fnUtils.d.ts +4 -0
- package/utils/memo.d.ts +5 -0
- package/utils/object/objectUtils.d.ts +1 -1
- package/components/dataGrid/dataGridContract.d.ts +0 -24
- package/components/dataGrid/useGridData.d.ts +0 -7
- package/components/label.cjs +0 -1
- package/components/label.d.ts +0 -5
- package/components/label.mjs +0 -10
- package/core/theme/defaultTheme.d.ts +0 -3
- package/core/theme/themeContract.d.ts +0 -25
- package/core/theme/useTheme.d.ts +0 -2
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { BoxComponentStyles } from '../../types';
|
|
2
|
+
export interface BoxComponent {
|
|
3
|
+
clean?: boolean;
|
|
4
|
+
styles: BoxComponentStyles;
|
|
5
|
+
variants?: Record<string, BoxComponentStyles>;
|
|
6
|
+
children?: Record<string, BoxComponent>;
|
|
7
|
+
}
|
|
8
|
+
export type Components = Record<string, BoxComponent>;
|
|
9
|
+
declare const boxComponents: {
|
|
10
|
+
button: {
|
|
11
|
+
styles: {
|
|
12
|
+
display: "inline-flex";
|
|
13
|
+
color: "white";
|
|
14
|
+
bgColor: "violet-500";
|
|
15
|
+
borderColor: "violet-500";
|
|
16
|
+
p: number;
|
|
17
|
+
cursor: "pointer";
|
|
18
|
+
b: number;
|
|
19
|
+
borderRadius: number;
|
|
20
|
+
userSelect: "none";
|
|
21
|
+
lineHeight: number;
|
|
22
|
+
hover: {
|
|
23
|
+
bgColor: "violet-600";
|
|
24
|
+
borderColor: "violet-600";
|
|
25
|
+
};
|
|
26
|
+
disabled: {
|
|
27
|
+
cursor: "not-allowed";
|
|
28
|
+
bgColor: "violet-50";
|
|
29
|
+
color: "gray-400";
|
|
30
|
+
borderColor: "gray-300";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
variants: {
|
|
34
|
+
test: {};
|
|
35
|
+
test2: {};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
textbox: {
|
|
39
|
+
styles: {
|
|
40
|
+
display: "inline-block";
|
|
41
|
+
b: number;
|
|
42
|
+
borderColor: "violet-200";
|
|
43
|
+
bgColor: "violet-50";
|
|
44
|
+
color: "violet-950";
|
|
45
|
+
borderRadius: number;
|
|
46
|
+
p: number;
|
|
47
|
+
transition: "none";
|
|
48
|
+
lineHeight: number;
|
|
49
|
+
hover: {
|
|
50
|
+
borderColor: "violet-300";
|
|
51
|
+
};
|
|
52
|
+
focus: {
|
|
53
|
+
outline: number;
|
|
54
|
+
borderColor: "violet-500";
|
|
55
|
+
outlineColor: "violet-500";
|
|
56
|
+
};
|
|
57
|
+
disabled: {
|
|
58
|
+
cursor: "not-allowed";
|
|
59
|
+
bgColor: "violet-50";
|
|
60
|
+
color: "gray-400";
|
|
61
|
+
borderColor: "gray-300";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
textarea: {
|
|
66
|
+
styles: {
|
|
67
|
+
display: "inline-block";
|
|
68
|
+
b: number;
|
|
69
|
+
borderColor: "violet-200";
|
|
70
|
+
bgColor: "violet-50";
|
|
71
|
+
color: "violet-950";
|
|
72
|
+
borderRadius: number;
|
|
73
|
+
p: number;
|
|
74
|
+
transition: "none";
|
|
75
|
+
hover: {
|
|
76
|
+
borderColor: "violet-300";
|
|
77
|
+
};
|
|
78
|
+
focus: {
|
|
79
|
+
outline: number;
|
|
80
|
+
borderColor: "violet-500";
|
|
81
|
+
outlineColor: "violet-500";
|
|
82
|
+
};
|
|
83
|
+
disabled: {
|
|
84
|
+
cursor: "not-allowed";
|
|
85
|
+
bgColor: "violet-50";
|
|
86
|
+
color: "gray-400";
|
|
87
|
+
borderColor: "gray-300";
|
|
88
|
+
resize: "none";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
checkbox: {
|
|
93
|
+
styles: {
|
|
94
|
+
display: "inline-block";
|
|
95
|
+
appearance: "none";
|
|
96
|
+
b: number;
|
|
97
|
+
borderColor: "violet-300";
|
|
98
|
+
borderRadius: number;
|
|
99
|
+
p: number;
|
|
100
|
+
cursor: "pointer";
|
|
101
|
+
transition: "none";
|
|
102
|
+
hover: {
|
|
103
|
+
borderColor: "violet-500";
|
|
104
|
+
};
|
|
105
|
+
focus: {
|
|
106
|
+
outline: number;
|
|
107
|
+
outlineOffset: number;
|
|
108
|
+
outlineColor: "violet-500";
|
|
109
|
+
};
|
|
110
|
+
checked: {
|
|
111
|
+
bgColor: "violet-500";
|
|
112
|
+
borderColor: "violet-500";
|
|
113
|
+
bgImage: "bg-img-checked";
|
|
114
|
+
};
|
|
115
|
+
indeterminate: {
|
|
116
|
+
color: "violet-500";
|
|
117
|
+
bgImage: "bg-img-indeterminate";
|
|
118
|
+
};
|
|
119
|
+
disabled: {
|
|
120
|
+
cursor: "not-allowed";
|
|
121
|
+
bgColor: "violet-100";
|
|
122
|
+
color: "gray-400";
|
|
123
|
+
borderColor: "gray-300";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
radioButton: {
|
|
128
|
+
styles: {
|
|
129
|
+
appearance: "none";
|
|
130
|
+
b: number;
|
|
131
|
+
borderColor: "violet-300";
|
|
132
|
+
borderRadius: number;
|
|
133
|
+
p: number;
|
|
134
|
+
cursor: "pointer";
|
|
135
|
+
transition: "none";
|
|
136
|
+
hover: {
|
|
137
|
+
borderColor: "violet-500";
|
|
138
|
+
};
|
|
139
|
+
focus: {
|
|
140
|
+
outline: number;
|
|
141
|
+
outlineOffset: number;
|
|
142
|
+
outlineColor: "violet-500";
|
|
143
|
+
};
|
|
144
|
+
checked: {
|
|
145
|
+
bgColor: "violet-500";
|
|
146
|
+
borderColor: "violet-500";
|
|
147
|
+
bgImage: "bg-img-radio";
|
|
148
|
+
};
|
|
149
|
+
disabled: {
|
|
150
|
+
cursor: "not-allowed";
|
|
151
|
+
bgColor: "violet-100";
|
|
152
|
+
color: "gray-400";
|
|
153
|
+
borderColor: "violet-200";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
dropdown: {
|
|
158
|
+
styles: {
|
|
159
|
+
display: "inline-flex";
|
|
160
|
+
ai: "center";
|
|
161
|
+
gap: number;
|
|
162
|
+
jc: "space-between";
|
|
163
|
+
p: number;
|
|
164
|
+
cursor: "pointer";
|
|
165
|
+
bgColor: "violet-50";
|
|
166
|
+
color: "violet-950";
|
|
167
|
+
b: number;
|
|
168
|
+
borderColor: "violet-200";
|
|
169
|
+
borderRadius: number;
|
|
170
|
+
userSelect: "none";
|
|
171
|
+
lineHeight: number;
|
|
172
|
+
minWidth: number;
|
|
173
|
+
transition: "none";
|
|
174
|
+
hover: {
|
|
175
|
+
borderColor: "violet-300";
|
|
176
|
+
};
|
|
177
|
+
focus: {
|
|
178
|
+
outline: number;
|
|
179
|
+
borderColor: "violet-500";
|
|
180
|
+
outlineColor: "violet-500";
|
|
181
|
+
};
|
|
182
|
+
disabled: {
|
|
183
|
+
cursor: "not-allowed";
|
|
184
|
+
bgColor: "violet-50";
|
|
185
|
+
color: "gray-400";
|
|
186
|
+
borderColor: "gray-300";
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
children: {
|
|
190
|
+
display: {
|
|
191
|
+
styles: {
|
|
192
|
+
whiteSpace: "nowrap";
|
|
193
|
+
textOverflow: "ellipsis";
|
|
194
|
+
overflow: "hidden";
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
items: {
|
|
198
|
+
styles: {
|
|
199
|
+
display: "flex";
|
|
200
|
+
d: "column";
|
|
201
|
+
gap: number;
|
|
202
|
+
p: number;
|
|
203
|
+
b: number;
|
|
204
|
+
borderRadius: number;
|
|
205
|
+
position: "relative";
|
|
206
|
+
top: number;
|
|
207
|
+
bgColor: "white";
|
|
208
|
+
overflow: "auto";
|
|
209
|
+
maxHeight: number;
|
|
210
|
+
borderColor: "violet-300";
|
|
211
|
+
color: "violet-950";
|
|
212
|
+
shadow: "medium-shadow";
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
item: {
|
|
216
|
+
styles: {
|
|
217
|
+
display: "flex";
|
|
218
|
+
width: "fit";
|
|
219
|
+
p: number;
|
|
220
|
+
cursor: "pointer";
|
|
221
|
+
borderRadius: number;
|
|
222
|
+
hover: {
|
|
223
|
+
bgColor: "gray-100";
|
|
224
|
+
};
|
|
225
|
+
focus: {
|
|
226
|
+
bgColor: "violet-50";
|
|
227
|
+
};
|
|
228
|
+
selected: {
|
|
229
|
+
bgColor: "violet-50";
|
|
230
|
+
cursor: "default";
|
|
231
|
+
hover: {
|
|
232
|
+
bgColor: "violet-100";
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
variants: {
|
|
237
|
+
multiple: {
|
|
238
|
+
selected: {
|
|
239
|
+
cursor: "pointer";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
unselect: {
|
|
245
|
+
styles: {
|
|
246
|
+
display: "flex";
|
|
247
|
+
width: "fit";
|
|
248
|
+
p: number;
|
|
249
|
+
cursor: "pointer";
|
|
250
|
+
lineHeight: number;
|
|
251
|
+
borderRadius: number;
|
|
252
|
+
color: "violet-400";
|
|
253
|
+
hover: {
|
|
254
|
+
bgColor: "violet-50";
|
|
255
|
+
};
|
|
256
|
+
focus: {
|
|
257
|
+
bgColor: "violet-50";
|
|
258
|
+
};
|
|
259
|
+
selected: {
|
|
260
|
+
bgColor: "violet-50";
|
|
261
|
+
cursor: "default";
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
selectAll: {
|
|
266
|
+
styles: {
|
|
267
|
+
display: "flex";
|
|
268
|
+
width: "fit";
|
|
269
|
+
p: number;
|
|
270
|
+
cursor: "pointer";
|
|
271
|
+
lineHeight: number;
|
|
272
|
+
borderRadius: number;
|
|
273
|
+
color: "violet-400";
|
|
274
|
+
hover: {
|
|
275
|
+
bgColor: "violet-50";
|
|
276
|
+
};
|
|
277
|
+
focus: {
|
|
278
|
+
bgColor: "violet-50";
|
|
279
|
+
};
|
|
280
|
+
selected: {
|
|
281
|
+
bgColor: "violet-50";
|
|
282
|
+
cursor: "default";
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
emptyItem: {
|
|
287
|
+
styles: {
|
|
288
|
+
display: "flex";
|
|
289
|
+
width: "fit";
|
|
290
|
+
p: number;
|
|
291
|
+
cursor: "default";
|
|
292
|
+
lineHeight: number;
|
|
293
|
+
borderRadius: number;
|
|
294
|
+
color: "violet-400";
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
label: {
|
|
300
|
+
styles: {};
|
|
301
|
+
};
|
|
302
|
+
datagrid: {
|
|
303
|
+
styles: {
|
|
304
|
+
b: number;
|
|
305
|
+
borderColor: "gray-400";
|
|
306
|
+
overflow: "hidden";
|
|
307
|
+
borderRadius: number;
|
|
308
|
+
};
|
|
309
|
+
children: {
|
|
310
|
+
header: {
|
|
311
|
+
styles: {
|
|
312
|
+
position: "sticky";
|
|
313
|
+
top: number;
|
|
314
|
+
width: "max-content";
|
|
315
|
+
minWidth: "fit";
|
|
316
|
+
zIndex: 1;
|
|
317
|
+
};
|
|
318
|
+
variants: {
|
|
319
|
+
isResizeMode: {
|
|
320
|
+
userSelect: "none";
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
children: {
|
|
324
|
+
cell: {
|
|
325
|
+
styles: {
|
|
326
|
+
bgColor: "gray-200";
|
|
327
|
+
borderColor: "gray-400";
|
|
328
|
+
bb: number;
|
|
329
|
+
minHeight: number;
|
|
330
|
+
position: "relative";
|
|
331
|
+
transition: "none";
|
|
332
|
+
};
|
|
333
|
+
variants: {
|
|
334
|
+
isRowNumber: {};
|
|
335
|
+
isRowSelection: {};
|
|
336
|
+
isPinned: {
|
|
337
|
+
position: "sticky";
|
|
338
|
+
zIndex: 2;
|
|
339
|
+
};
|
|
340
|
+
isFirstLeftPinned: {};
|
|
341
|
+
isLastLeftPinned: {
|
|
342
|
+
br: number;
|
|
343
|
+
};
|
|
344
|
+
isFirstRightPinned: {
|
|
345
|
+
bl: number;
|
|
346
|
+
};
|
|
347
|
+
isLastRightPinned: {};
|
|
348
|
+
isSortable: {
|
|
349
|
+
cursor: "pointer";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
cell: {
|
|
356
|
+
styles: {
|
|
357
|
+
bgColor: "gray-100";
|
|
358
|
+
bb: number;
|
|
359
|
+
borderColor: "gray-400";
|
|
360
|
+
transition: "none";
|
|
361
|
+
ai: "center";
|
|
362
|
+
overflow: "hidden";
|
|
363
|
+
minHeight: number;
|
|
364
|
+
hoverGroup: {
|
|
365
|
+
'grid-row': {
|
|
366
|
+
bgColor: "gray-200";
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
variants: {
|
|
371
|
+
isRowNumber: {
|
|
372
|
+
bgColor: "gray-200";
|
|
373
|
+
};
|
|
374
|
+
isRowSelection: {};
|
|
375
|
+
isPinned: {
|
|
376
|
+
position: "sticky";
|
|
377
|
+
};
|
|
378
|
+
isFirstLeftPinned: {};
|
|
379
|
+
isLastLeftPinned: {
|
|
380
|
+
br: number;
|
|
381
|
+
};
|
|
382
|
+
isFirstRightPinned: {
|
|
383
|
+
bl: number;
|
|
384
|
+
};
|
|
385
|
+
isLastRightPinned: {};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
export default boxComponents;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { BoxStyle } from '
|
|
1
|
+
import { BoxStyle } from '../coreTypes';
|
|
2
|
+
import { Components } from './boxComponents';
|
|
2
3
|
declare namespace BoxExtends {
|
|
3
4
|
function extend<TProps extends Record<string, BoxStyle[]>, TPropTypes extends Record<string, BoxStyle[]>>(variables: Record<string, string>, extendedProps: TProps, extendedPropTypes: TPropTypes): {
|
|
4
5
|
extendedProps: TProps;
|
|
5
6
|
extendedPropTypes: TPropTypes;
|
|
6
7
|
};
|
|
8
|
+
let componentsStyles: Components;
|
|
9
|
+
function components<T extends Components>(components: T): T;
|
|
7
10
|
}
|
|
8
11
|
export default BoxExtends;
|
package/core/theme/theme.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Themes } from './themeContract';
|
|
3
2
|
interface ThemeProps {
|
|
4
3
|
children: React.ReactNode;
|
|
5
4
|
theme: string;
|
|
5
|
+
use?: 'global' | 'local';
|
|
6
6
|
}
|
|
7
7
|
declare function Theme(props: ThemeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare namespace Theme {
|
|
9
|
-
let userThemes: Maybe<Themes>;
|
|
10
|
-
function setup(themes: Themes): void;
|
|
11
9
|
function useTheme(): [string, (theme: string) => void];
|
|
12
10
|
}
|
|
13
11
|
export default Theme;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
interface IThemeContext {
|
|
4
|
-
themeStyles: ThemeType;
|
|
2
|
+
interface ThemeContextProps {
|
|
5
3
|
theme: string;
|
|
6
4
|
setTheme(theme: string): void;
|
|
7
5
|
}
|
|
8
|
-
declare const ThemeContext: React.Context<
|
|
6
|
+
declare const ThemeContext: React.Context<ThemeContextProps>;
|
|
9
7
|
export default ThemeContext;
|
package/core/useStyles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoxStyleProps, PseudoClassesType } from '../types';
|
|
2
|
-
export default function useStyles(props: BoxStyleProps
|
|
2
|
+
export default function useStyles(props: BoxStyleProps<any>, isSvg: boolean): string[];
|
|
3
3
|
declare namespace StylesContextImpl {
|
|
4
|
-
function addClassNames(props: BoxStyleProps
|
|
4
|
+
function addClassNames(props: BoxStyleProps<any>, classNames: string[], currentPseudoClasses: PseudoClassesType[], breakpoint?: string, pseudoClassParentName?: string): void;
|
|
5
5
|
function flush(): void;
|
|
6
6
|
function clear(): void;
|
|
7
7
|
}
|
package/core/variables.d.ts
CHANGED
|
@@ -253,6 +253,7 @@ declare namespace Variables {
|
|
|
253
253
|
'rose-950': string;
|
|
254
254
|
};
|
|
255
255
|
type ColorType = keyof typeof colors | 'none';
|
|
256
|
+
const percentages: readonly ["1/2", "1/3", "2/3", "1/4", "2/4", "3/4", "1/5", "2/5", "3/5", "4/5", "1/6", "2/6", "3/6", "4/6", "5/6", "1/12", "2/12", "3/12", "4/12", "5/12", "6/12", "7/12", "8/12", "9/12", "10/12", "11/12"];
|
|
256
257
|
function getVariableValue(name: string): string;
|
|
257
258
|
function generateVariables(): string;
|
|
258
259
|
function setUserVariables(variables: Record<string, string>): void;
|