@particle-network/ui-react 0.7.0-beta.1 → 0.7.0-beta.10

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 (49) hide show
  1. package/dist/components/ProgressWrapper/index.js +1 -1
  2. package/dist/components/UXColorPicker/color-fields.js +1 -1
  3. package/dist/components/UXSimplePopover/simple-popover.d.ts +1 -3
  4. package/dist/components/UXSimplePopover/simple-popover.js +4 -4
  5. package/dist/components/UXTable/base/index.d.ts +10 -0
  6. package/dist/components/UXTable/base/index.js +6 -0
  7. package/dist/components/UXTable/base/table-body.d.ts +20 -0
  8. package/dist/components/UXTable/base/table-body.js +4 -0
  9. package/dist/components/UXTable/base/table-cell.d.ts +6 -0
  10. package/dist/components/UXTable/base/table-cell.js +4 -0
  11. package/dist/components/UXTable/base/table-column.d.ts +6 -0
  12. package/dist/components/UXTable/base/table-column.js +4 -0
  13. package/dist/components/UXTable/base/table-header.d.ts +6 -0
  14. package/dist/components/UXTable/base/table-header.js +4 -0
  15. package/dist/components/UXTable/base/table-row.d.ts +6 -0
  16. package/dist/components/UXTable/base/table-row.js +4 -0
  17. package/dist/components/UXTable/index.d.ts +7 -37
  18. package/dist/components/UXTable/index.js +5 -14
  19. package/dist/components/UXTable/table-body.d.ts +15 -0
  20. package/dist/components/UXTable/table-body.js +87 -0
  21. package/dist/components/UXTable/table-cell.d.ts +19 -0
  22. package/dist/components/UXTable/table-cell.js +45 -0
  23. package/dist/components/UXTable/table-checkbox-cell.d.ts +23 -0
  24. package/dist/components/UXTable/table-checkbox-cell.js +48 -0
  25. package/dist/components/UXTable/table-column-header.d.ts +25 -0
  26. package/dist/components/UXTable/table-column-header.js +66 -0
  27. package/dist/components/UXTable/table-header-row.d.ts +14 -0
  28. package/dist/components/UXTable/table-header-row.js +29 -0
  29. package/dist/components/UXTable/table-row-group.d.ts +8 -0
  30. package/dist/components/UXTable/table-row-group.js +24 -0
  31. package/dist/components/UXTable/table-row.d.ts +15 -0
  32. package/dist/components/UXTable/table-row.js +61 -0
  33. package/dist/components/UXTable/table-select-all-checkbox.d.ts +18 -0
  34. package/dist/components/UXTable/table-select-all-checkbox.js +46 -0
  35. package/dist/components/UXTable/table-theme.d.ts +452 -0
  36. package/dist/components/UXTable/table-theme.js +282 -0
  37. package/dist/components/UXTable/table.d.ts +8 -0
  38. package/dist/components/UXTable/table.js +96 -0
  39. package/dist/components/UXTable/use-table.d.ts +145 -0
  40. package/dist/components/UXTable/use-table.js +127 -0
  41. package/dist/components/UXTable/virtualized-table-body.d.ts +17 -0
  42. package/dist/components/UXTable/virtualized-table-body.js +107 -0
  43. package/dist/components/UXTable/virtualized-table.d.ts +8 -0
  44. package/dist/components/UXTable/virtualized-table.js +115 -0
  45. package/dist/components/UXThemeSwitch/theme-switch.js +2 -1
  46. package/dist/utils/input-classes.js +4 -4
  47. package/package.json +11 -5
  48. package/dist/components/UXTable/table.extend.d.ts +0 -34
  49. package/dist/components/UXTable/table.extend.js +0 -145
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDOMRef } from "@heroui/react-utils";
4
+ import { mergeProps } from "@heroui/shared-utils";
5
+ import { cn } from "@heroui/theme";
6
+ import { useTableRowGroup } from "@react-aria/table";
7
+ const TableRowGroup = /*#__PURE__*/ forwardRef((props, ref)=>{
8
+ const { as, className, children, slots, classNames, ...otherProps } = props;
9
+ const Component = as || 'thead';
10
+ const domRef = useDOMRef(ref);
11
+ const { rowGroupProps } = useTableRowGroup();
12
+ const theadStyles = cn(classNames?.thead, className);
13
+ return /*#__PURE__*/ jsx(Component, {
14
+ ref: domRef,
15
+ className: slots.thead?.({
16
+ class: theadStyles
17
+ }),
18
+ ...mergeProps(rowGroupProps, otherProps),
19
+ children: children
20
+ });
21
+ });
22
+ TableRowGroup.displayName = 'HeroUI.TableRowGroup';
23
+ const table_row_group = TableRowGroup;
24
+ export { table_row_group as default };
@@ -0,0 +1,15 @@
1
+ import type { GridNode } from '@react-types/grid';
2
+ import type { TableRowProps as BaseTableRowProps } from './base/table-row';
3
+ import type { ValuesType } from './use-table';
4
+ export interface TableRowProps<T = object> extends Omit<BaseTableRowProps, 'children'> {
5
+ /**
6
+ * The table row.
7
+ */
8
+ node: GridNode<T>;
9
+ slots: ValuesType['slots'];
10
+ state: ValuesType['state'];
11
+ isSelectable?: ValuesType['isSelectable'];
12
+ classNames?: ValuesType['classNames'];
13
+ }
14
+ declare const TableRow: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"tr", TableRowProps<object>, never>;
15
+ export default TableRow;
@@ -0,0 +1,61 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { filterDOMProps, useDOMRef } from "@heroui/react-utils";
4
+ import { dataAttr, mergeProps } from "@heroui/shared-utils";
5
+ import { forwardRef } from "@heroui/system";
6
+ import { cn } from "@heroui/theme";
7
+ import { useFocusRing } from "@react-aria/focus";
8
+ import { useHover } from "@react-aria/interactions";
9
+ import { useTableRow } from "@react-aria/table";
10
+ const TableRow = forwardRef((props, ref)=>{
11
+ const { as, className, children, node, slots, state, isSelectable, classNames, ...otherProps } = props;
12
+ const Component = as || (props?.href ? 'a' : 'tr');
13
+ const shouldFilterDOMProps = 'string' == typeof Component;
14
+ const domRef = useDOMRef(ref);
15
+ const { rowProps } = useTableRow({
16
+ node
17
+ }, state, domRef);
18
+ const trStyles = cn(classNames?.tr, className, node.props?.className);
19
+ const { isFocusVisible, focusProps } = useFocusRing();
20
+ const isDisabled = state.disabledKeys.has(node.key);
21
+ const isSelected = state.selectionManager.isSelected(node.key);
22
+ const { isHovered, hoverProps } = useHover({
23
+ isDisabled
24
+ });
25
+ const { isFirst, isLast, isMiddle, isOdd } = useMemo(()=>{
26
+ const isFirst = node.key === state.collection.getFirstKey();
27
+ const isLast = node.key === state.collection.getLastKey();
28
+ const isMiddle = !isFirst && !isLast;
29
+ const isOdd = node?.index ? (node.index + 1) % 2 === 0 : false;
30
+ return {
31
+ isFirst,
32
+ isLast,
33
+ isMiddle,
34
+ isOdd
35
+ };
36
+ }, [
37
+ node,
38
+ state.collection
39
+ ]);
40
+ return /*#__PURE__*/ jsx(Component, {
41
+ ref: domRef,
42
+ "data-disabled": dataAttr(isDisabled),
43
+ "data-first": dataAttr(isFirst),
44
+ "data-focus-visible": dataAttr(isFocusVisible),
45
+ "data-hover": dataAttr(isHovered),
46
+ "data-last": dataAttr(isLast),
47
+ "data-middle": dataAttr(isMiddle),
48
+ "data-odd": dataAttr(isOdd),
49
+ "data-selected": dataAttr(isSelected),
50
+ ...mergeProps(rowProps, focusProps, isSelectable ? hoverProps : {}, filterDOMProps(node.props, {
51
+ enabled: shouldFilterDOMProps
52
+ }), otherProps),
53
+ className: slots.tr?.({
54
+ class: trStyles
55
+ }),
56
+ children: children
57
+ });
58
+ });
59
+ TableRow.displayName = 'HeroUI.TableRow';
60
+ const table_row = TableRow;
61
+ export { table_row as default };
@@ -0,0 +1,18 @@
1
+ import type { HTMLHeroUIProps } from '@heroui/system';
2
+ import type { GridNode } from '@react-types/grid';
3
+ import type { ValuesType } from './use-table';
4
+ export interface TableSelectAllCheckboxProps<T = object> extends HTMLHeroUIProps<'th'> {
5
+ /**
6
+ * The table column.
7
+ */
8
+ node: GridNode<T>;
9
+ slots: ValuesType['slots'];
10
+ state: ValuesType['state'];
11
+ color: ValuesType['color'];
12
+ disableAnimation: ValuesType['disableAnimation'];
13
+ checkboxesProps: ValuesType['checkboxesProps'];
14
+ selectionMode: ValuesType['selectionMode'];
15
+ classNames?: ValuesType['classNames'];
16
+ }
17
+ declare const TableSelectAllCheckbox: import("@heroui/system-rsc").InternalForwardRefRenderFunction<"th", TableSelectAllCheckboxProps<object>, never>;
18
+ export default TableSelectAllCheckbox;
@@ -0,0 +1,46 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Checkbox } from "@heroui/checkbox";
3
+ import { filterDOMProps, useDOMRef } from "@heroui/react-utils";
4
+ import { dataAttr, mergeProps } from "@heroui/shared-utils";
5
+ import { forwardRef } from "@heroui/system";
6
+ import { cn } from "@heroui/theme";
7
+ import { useFocusRing } from "@react-aria/focus";
8
+ import { useTableColumnHeader, useTableSelectAllCheckbox } from "@react-aria/table";
9
+ import { VisuallyHidden } from "@react-aria/visually-hidden";
10
+ const TableSelectAllCheckbox = forwardRef((props, ref)=>{
11
+ const { as, className, node, slots, state, selectionMode, color, checkboxesProps, disableAnimation, classNames, ...otherProps } = props;
12
+ const Component = as || 'th';
13
+ const shouldFilterDOMProps = 'string' == typeof Component;
14
+ const domRef = useDOMRef(ref);
15
+ const { columnHeaderProps } = useTableColumnHeader({
16
+ node
17
+ }, state, domRef);
18
+ const { isFocusVisible, focusProps } = useFocusRing();
19
+ const { checkboxProps } = useTableSelectAllCheckbox(state);
20
+ const thStyles = cn(classNames?.th, className, node.props?.className);
21
+ const isSingleSelectionMode = 'single' === selectionMode;
22
+ const { onChange, ...otherCheckboxProps } = checkboxProps;
23
+ return /*#__PURE__*/ jsx(Component, {
24
+ ref: domRef,
25
+ "data-focus-visible": dataAttr(isFocusVisible),
26
+ ...mergeProps(columnHeaderProps, focusProps, filterDOMProps(node.props, {
27
+ enabled: shouldFilterDOMProps
28
+ }), filterDOMProps(otherProps, {
29
+ enabled: shouldFilterDOMProps
30
+ })),
31
+ className: slots.th?.({
32
+ class: thStyles
33
+ }),
34
+ children: isSingleSelectionMode ? /*#__PURE__*/ jsx(VisuallyHidden, {
35
+ children: checkboxProps['aria-label']
36
+ }) : /*#__PURE__*/ jsx(Checkbox, {
37
+ color: color,
38
+ disableAnimation: disableAnimation,
39
+ onValueChange: onChange,
40
+ ...mergeProps(checkboxesProps, otherCheckboxProps)
41
+ })
42
+ });
43
+ });
44
+ TableSelectAllCheckbox.displayName = 'HeroUI.TableSelectAllCheckbox';
45
+ const table_select_all_checkbox = TableSelectAllCheckbox;
46
+ export { table_select_all_checkbox as default };
@@ -0,0 +1,452 @@
1
+ import type { VariantProps } from 'tailwind-variants';
2
+ /**
3
+ * Table **Tailwind Variants** component
4
+ *
5
+ * @example
6
+ * ```js
7
+ * const {base, table, thead, tbody, tr, th, td, tfoot} = table({...})
8
+ *
9
+ * <div className={base()}>
10
+ * <table className={table()}>
11
+ * <thead className={thead()}>
12
+ * <tr className={tr()}>
13
+ * <th className={th()}>...</th>
14
+ * <th className={th()}>...</th>
15
+ * </tr>
16
+ * </thead>
17
+ * <tbody className={tbody()}>
18
+ * <tr className={tr()}>
19
+ * <td className={td()}>...</td>
20
+ * <td className={td()}>...</td>
21
+ * </tr>
22
+ * <tr className={tr()}>
23
+ * <td className={td()}>...</td>
24
+ * <td className={td()}>...</td>
25
+ * </tr>
26
+ * </tbody>
27
+ * <tfoot className={tfoot()}>
28
+ * <tr className={tr()}>
29
+ * <td className={td()}>...</td>
30
+ * <td className={td()}>...</td>
31
+ * </tr>
32
+ * </tfoot>
33
+ * </table>
34
+ * </div>
35
+ * ```
36
+ */
37
+ declare const table: import("tailwind-variants").TVReturnType<{
38
+ color: {
39
+ default: {
40
+ td: string;
41
+ };
42
+ primary: {
43
+ td: string;
44
+ };
45
+ secondary: {
46
+ td: string;
47
+ };
48
+ success: {
49
+ td: string;
50
+ };
51
+ warning: {
52
+ td: string;
53
+ };
54
+ danger: {
55
+ td: string;
56
+ };
57
+ };
58
+ size: {
59
+ md: {
60
+ th: string;
61
+ };
62
+ lg: {
63
+ th: string;
64
+ td: string;
65
+ };
66
+ };
67
+ layout: {
68
+ auto: {
69
+ table: string;
70
+ };
71
+ fixed: {
72
+ table: string;
73
+ };
74
+ };
75
+ shadow: {
76
+ none: {
77
+ wrapper: string;
78
+ };
79
+ sm: {
80
+ wrapper: string;
81
+ };
82
+ md: {
83
+ wrapper: string;
84
+ };
85
+ lg: {
86
+ wrapper: string;
87
+ };
88
+ };
89
+ hideHeader: {
90
+ true: {
91
+ thead: string;
92
+ };
93
+ };
94
+ isStriped: {
95
+ true: {
96
+ td: string[];
97
+ };
98
+ };
99
+ isCompact: {
100
+ true: {
101
+ td: string;
102
+ };
103
+ false: {};
104
+ };
105
+ isHeaderSticky: {
106
+ true: {
107
+ thead: string;
108
+ };
109
+ };
110
+ isSelectable: {
111
+ true: {
112
+ tr: string;
113
+ td: string[];
114
+ };
115
+ };
116
+ isMultiSelectable: {
117
+ true: {
118
+ td: string[];
119
+ };
120
+ false: {
121
+ td: string[];
122
+ };
123
+ };
124
+ radius: {
125
+ none: {
126
+ wrapper: string;
127
+ th: never[];
128
+ td: never[];
129
+ };
130
+ sm: {
131
+ wrapper: string;
132
+ };
133
+ md: {
134
+ wrapper: string;
135
+ };
136
+ lg: {
137
+ wrapper: string;
138
+ };
139
+ };
140
+ fullWidth: {
141
+ true: {
142
+ base: string;
143
+ wrapper: string;
144
+ table: string;
145
+ };
146
+ };
147
+ align: {
148
+ start: {
149
+ th: string;
150
+ td: string;
151
+ };
152
+ center: {
153
+ th: string;
154
+ td: string;
155
+ };
156
+ end: {
157
+ th: string;
158
+ td: string;
159
+ };
160
+ };
161
+ }, {
162
+ base: string;
163
+ wrapper: string[];
164
+ table: string;
165
+ thead: string;
166
+ tbody: string;
167
+ tr: string[];
168
+ th: string[];
169
+ td: string[];
170
+ tfoot: string;
171
+ sortIcon: string[];
172
+ emptyWrapper: string;
173
+ loadingWrapper: string;
174
+ }, undefined, {
175
+ color: {
176
+ default: {
177
+ td: string;
178
+ };
179
+ primary: {
180
+ td: string;
181
+ };
182
+ secondary: {
183
+ td: string;
184
+ };
185
+ success: {
186
+ td: string;
187
+ };
188
+ warning: {
189
+ td: string;
190
+ };
191
+ danger: {
192
+ td: string;
193
+ };
194
+ };
195
+ size: {
196
+ md: {
197
+ th: string;
198
+ };
199
+ lg: {
200
+ th: string;
201
+ td: string;
202
+ };
203
+ };
204
+ layout: {
205
+ auto: {
206
+ table: string;
207
+ };
208
+ fixed: {
209
+ table: string;
210
+ };
211
+ };
212
+ shadow: {
213
+ none: {
214
+ wrapper: string;
215
+ };
216
+ sm: {
217
+ wrapper: string;
218
+ };
219
+ md: {
220
+ wrapper: string;
221
+ };
222
+ lg: {
223
+ wrapper: string;
224
+ };
225
+ };
226
+ hideHeader: {
227
+ true: {
228
+ thead: string;
229
+ };
230
+ };
231
+ isStriped: {
232
+ true: {
233
+ td: string[];
234
+ };
235
+ };
236
+ isCompact: {
237
+ true: {
238
+ td: string;
239
+ };
240
+ false: {};
241
+ };
242
+ isHeaderSticky: {
243
+ true: {
244
+ thead: string;
245
+ };
246
+ };
247
+ isSelectable: {
248
+ true: {
249
+ tr: string;
250
+ td: string[];
251
+ };
252
+ };
253
+ isMultiSelectable: {
254
+ true: {
255
+ td: string[];
256
+ };
257
+ false: {
258
+ td: string[];
259
+ };
260
+ };
261
+ radius: {
262
+ none: {
263
+ wrapper: string;
264
+ th: never[];
265
+ td: never[];
266
+ };
267
+ sm: {
268
+ wrapper: string;
269
+ };
270
+ md: {
271
+ wrapper: string;
272
+ };
273
+ lg: {
274
+ wrapper: string;
275
+ };
276
+ };
277
+ fullWidth: {
278
+ true: {
279
+ base: string;
280
+ wrapper: string;
281
+ table: string;
282
+ };
283
+ };
284
+ align: {
285
+ start: {
286
+ th: string;
287
+ td: string;
288
+ };
289
+ center: {
290
+ th: string;
291
+ td: string;
292
+ };
293
+ end: {
294
+ th: string;
295
+ td: string;
296
+ };
297
+ };
298
+ }, {
299
+ base: string;
300
+ wrapper: string[];
301
+ table: string;
302
+ thead: string;
303
+ tbody: string;
304
+ tr: string[];
305
+ th: string[];
306
+ td: string[];
307
+ tfoot: string;
308
+ sortIcon: string[];
309
+ emptyWrapper: string;
310
+ loadingWrapper: string;
311
+ }, import("tailwind-variants").TVReturnType<{
312
+ color: {
313
+ default: {
314
+ td: string;
315
+ };
316
+ primary: {
317
+ td: string;
318
+ };
319
+ secondary: {
320
+ td: string;
321
+ };
322
+ success: {
323
+ td: string;
324
+ };
325
+ warning: {
326
+ td: string;
327
+ };
328
+ danger: {
329
+ td: string;
330
+ };
331
+ };
332
+ size: {
333
+ md: {
334
+ th: string;
335
+ };
336
+ lg: {
337
+ th: string;
338
+ td: string;
339
+ };
340
+ };
341
+ layout: {
342
+ auto: {
343
+ table: string;
344
+ };
345
+ fixed: {
346
+ table: string;
347
+ };
348
+ };
349
+ shadow: {
350
+ none: {
351
+ wrapper: string;
352
+ };
353
+ sm: {
354
+ wrapper: string;
355
+ };
356
+ md: {
357
+ wrapper: string;
358
+ };
359
+ lg: {
360
+ wrapper: string;
361
+ };
362
+ };
363
+ hideHeader: {
364
+ true: {
365
+ thead: string;
366
+ };
367
+ };
368
+ isStriped: {
369
+ true: {
370
+ td: string[];
371
+ };
372
+ };
373
+ isCompact: {
374
+ true: {
375
+ td: string;
376
+ };
377
+ false: {};
378
+ };
379
+ isHeaderSticky: {
380
+ true: {
381
+ thead: string;
382
+ };
383
+ };
384
+ isSelectable: {
385
+ true: {
386
+ tr: string;
387
+ td: string[];
388
+ };
389
+ };
390
+ isMultiSelectable: {
391
+ true: {
392
+ td: string[];
393
+ };
394
+ false: {
395
+ td: string[];
396
+ };
397
+ };
398
+ radius: {
399
+ none: {
400
+ wrapper: string;
401
+ th: never[];
402
+ td: never[];
403
+ };
404
+ sm: {
405
+ wrapper: string;
406
+ };
407
+ md: {
408
+ wrapper: string;
409
+ };
410
+ lg: {
411
+ wrapper: string;
412
+ };
413
+ };
414
+ fullWidth: {
415
+ true: {
416
+ base: string;
417
+ wrapper: string;
418
+ table: string;
419
+ };
420
+ };
421
+ align: {
422
+ start: {
423
+ th: string;
424
+ td: string;
425
+ };
426
+ center: {
427
+ th: string;
428
+ td: string;
429
+ };
430
+ end: {
431
+ th: string;
432
+ td: string;
433
+ };
434
+ };
435
+ }, {
436
+ base: string;
437
+ wrapper: string[];
438
+ table: string;
439
+ thead: string;
440
+ tbody: string;
441
+ tr: string[];
442
+ th: string[];
443
+ td: string[];
444
+ tfoot: string;
445
+ sortIcon: string[];
446
+ emptyWrapper: string;
447
+ loadingWrapper: string;
448
+ }, undefined, unknown, unknown, undefined>>;
449
+ export type TableVariantProps = VariantProps<typeof table>;
450
+ export type TableSlots = keyof ReturnType<typeof table>;
451
+ export type TableReturnType = ReturnType<typeof table>;
452
+ export { table };