@skiddph/prui 0.7.0 → 0.8.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 (77) hide show
  1. package/dist/app/resource.d.ts +44 -1
  2. package/dist/app.js +1 -1
  3. package/dist/chunks/auth-shell-DQJ4UmUv.js +1208 -0
  4. package/dist/chunks/data-table-toolbar-B-5J2Ozl.js +736 -0
  5. package/dist/core/accordion.d.ts +16 -0
  6. package/dist/core/accordion.js +108 -0
  7. package/dist/core/alert.d.ts +20 -0
  8. package/dist/core/alert.js +63 -0
  9. package/dist/core/anchor.d.ts +35 -0
  10. package/dist/core/anchor.js +39 -0
  11. package/dist/core/breadcrumb.d.ts +30 -0
  12. package/dist/core/breadcrumb.js +67 -0
  13. package/dist/core/button.d.ts +8 -1
  14. package/dist/core/button.js +23 -18
  15. package/dist/core/calendar.d.ts +29 -0
  16. package/dist/core/calendar.js +180 -0
  17. package/dist/core/card.d.ts +5 -1
  18. package/dist/core/card.js +33 -29
  19. package/dist/core/checkbox.d.ts +19 -0
  20. package/dist/core/checkbox.js +55 -0
  21. package/dist/core/combobox.d.ts +32 -0
  22. package/dist/core/combobox.js +183 -0
  23. package/dist/core/date-picker.d.ts +41 -0
  24. package/dist/core/date-picker.js +202 -0
  25. package/dist/core/dialog.d.ts +8 -0
  26. package/dist/core/dialog.js +59 -61
  27. package/dist/core/drawer.d.ts +34 -0
  28. package/dist/core/drawer.js +129 -0
  29. package/dist/core/dropdown.d.ts +8 -4
  30. package/dist/core/dropdown.js +136 -51
  31. package/dist/core/file-upload.d.ts +28 -0
  32. package/dist/core/file-upload.js +111 -0
  33. package/dist/core/index.d.ts +21 -0
  34. package/dist/core/list-nav.d.ts +27 -0
  35. package/dist/core/list-nav.js +51 -0
  36. package/dist/core/modal.d.ts +14 -5
  37. package/dist/core/modal.js +163 -156
  38. package/dist/core/overlay.d.ts +93 -0
  39. package/dist/core/overlay.js +189 -0
  40. package/dist/core/popover.d.ts +29 -0
  41. package/dist/core/popover.js +124 -0
  42. package/dist/core/progress.d.ts +21 -0
  43. package/dist/core/progress.js +59 -0
  44. package/dist/core/radio.d.ts +20 -0
  45. package/dist/core/radio.js +115 -0
  46. package/dist/core/select.d.ts +6 -0
  47. package/dist/core/select.js +178 -97
  48. package/dist/core/skeleton.d.ts +20 -0
  49. package/dist/core/skeleton.js +41 -0
  50. package/dist/core/spinner.d.ts +15 -0
  51. package/dist/core/spinner.js +41 -0
  52. package/dist/core/tabs.js +82 -53
  53. package/dist/core/timeline.d.ts +22 -0
  54. package/dist/core/timeline.js +57 -0
  55. package/dist/core/toast.d.ts +36 -0
  56. package/dist/core/toast.js +123 -0
  57. package/dist/core/tooltip.d.ts +23 -0
  58. package/dist/core/tooltip.js +96 -0
  59. package/dist/core/tree-view.d.ts +34 -0
  60. package/dist/core/tree-view.js +133 -0
  61. package/dist/core.js +152 -62
  62. package/dist/data-table/data-table.d.ts +22 -1
  63. package/dist/data-table.js +1 -1
  64. package/dist/forms/form.d.ts +8 -0
  65. package/dist/forms.js +213 -200
  66. package/dist/i18n/index.d.ts +83 -0
  67. package/dist/i18n.js +99 -0
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.js +256 -156
  70. package/dist/prui-utilities.css +1 -1
  71. package/dist/prui.css +111 -4
  72. package/dist/theme/base.css +110 -3
  73. package/dist/theme/index.d.ts +27 -0
  74. package/dist/theme.js +86 -58
  75. package/package.json +9 -2
  76. package/dist/chunks/auth-shell-BG5vx9eG.js +0 -1054
  77. package/dist/chunks/data-table-toolbar-BUy2EWPy.js +0 -581
package/dist/core.js CHANGED
@@ -1,67 +1,157 @@
1
- import { cn as e } from "./core/cn.js";
1
+ import { cn as r } from "./core/cn.js";
2
2
  import { resolveSurface as a, withSurface as p } from "./core/surface.js";
3
- import { Button as l, buttonPropsMeta as i } from "./core/button.js";
4
- import { Input as n, Textarea as M, inputPropsMeta as c, textareaPropsMeta as f } from "./core/input.js";
5
- import { Label as P, Separator as x, labelPropsMeta as g, separatorPropsMeta as C } from "./core/label.js";
6
- import { Select as b, SelectContent as D, SelectItem as T, SelectTrigger as u, SelectValue as w, selectPropsMeta as h } from "./core/select.js";
7
- import { Switch as A, switchPropsMeta as B } from "./core/switch.js";
8
- import { Tabs as H, TabsContent as I, TabsList as L, TabsTrigger as V, tabsPropsMeta as j } from "./core/tabs.js";
9
- import { Avatar as q, Badge as y, Card as z, CardContent as E, CardDescription as G, CardFooter as J, CardHeader as K, CardTitle as N, avatarPropsMeta as O, badgePropsMeta as Q, cardPropsMeta as R } from "./core/card.js";
10
- import { Dialog as W, DialogContent as X, DialogDescription as Y, DialogFooter as Z, DialogHeader as _, DialogTitle as $, dialogPropsMeta as rr } from "./core/dialog.js";
11
- import { Dropdown as er, dropdownPropsMeta as tr } from "./core/dropdown.js";
12
- import { ScrollArea as pr, scrollAreaPropsMeta as sr } from "./core/scroll-area.js";
13
- import { Modal as ir, confirmModal as dr, confirmModalPropsMeta as nr, modalPropsMeta as Mr } from "./core/modal.js";
3
+ import { Portal as l, getFocusable as i, isTopOverlay as m, overlayCount as c, overlayPropsMeta as d, pushOverlay as P, removeOverlay as n, useEscapeKey as x, useFocusTrap as M, useInertBackground as f, useOverlay as u, useOverlayStack as b, useReducedMotion as g, useScrollLock as T } from "./core/overlay.js";
4
+ import { endIndex as v, homeIndex as C, moveIndex as D, typeaheadIndex as h } from "./core/list-nav.js";
5
+ import { Button as y, buttonPropsMeta as w } from "./core/button.js";
6
+ import { Input as A, Textarea as B, inputPropsMeta as F, textareaPropsMeta as O } from "./core/input.js";
7
+ import { Label as K, Separator as L, labelPropsMeta as V, separatorPropsMeta as E } from "./core/label.js";
8
+ import { Select as H, SelectContent as U, SelectItem as j, SelectTrigger as q, SelectValue as z, selectPropsMeta as J } from "./core/select.js";
9
+ import { Switch as Q, switchPropsMeta as W } from "./core/switch.js";
10
+ import { Tabs as Y, TabsContent as Z, TabsList as _, TabsTrigger as $, tabsPropsMeta as ee } from "./core/tabs.js";
11
+ import { Avatar as re, Badge as te, Card as ae, CardContent as pe, CardDescription as se, CardFooter as le, CardHeader as ie, CardTitle as me, avatarPropsMeta as ce, badgePropsMeta as de, cardPropsMeta as Pe } from "./core/card.js";
12
+ import { Dialog as xe, DialogContent as Me, DialogDescription as fe, DialogFooter as ue, DialogHeader as be, DialogTitle as ge, dialogPropsMeta as Te } from "./core/dialog.js";
13
+ import { Dropdown as ve, dropdownPropsMeta as Ce } from "./core/dropdown.js";
14
+ import { ScrollArea as he, scrollAreaPropsMeta as ke } from "./core/scroll-area.js";
15
+ import { Modal as we, confirmModal as Ie, confirmModalPropsMeta as Ae, modalPropsMeta as Be } from "./core/modal.js";
16
+ import { computePosition as Oe, useAnchoredPosition as Re } from "./core/anchor.js";
17
+ import { Spinner as Le, spinnerPropsMeta as Ve } from "./core/spinner.js";
18
+ import { Skeleton as Ge, skeletonPropsMeta as He } from "./core/skeleton.js";
19
+ import { Alert as je, alertPropsMeta as qe } from "./core/alert.js";
20
+ import { Progress as Je, progressPropsMeta as Ne } from "./core/progress.js";
21
+ import { Toaster as We, dismissAllToasts as Xe, toast as Ye, toastPropsMeta as Ze, toasterPropsMeta as _e } from "./core/toast.js";
22
+ import { Tooltip as eo, tooltipPropsMeta as oo } from "./core/tooltip.js";
23
+ import { Popover as to, popoverPropsMeta as ao } from "./core/popover.js";
24
+ import { Drawer as so, Sheet as lo, drawerPropsMeta as io, sheetPropsMeta as mo } from "./core/drawer.js";
25
+ import { Checkbox as Po, checkboxPropsMeta as no } from "./core/checkbox.js";
26
+ import { Radio as Mo, RadioGroup as fo, radioGroupPropsMeta as uo } from "./core/radio.js";
27
+ import { Combobox as go, comboboxPropsMeta as To } from "./core/combobox.js";
28
+ import { Accordion as vo, AccordionItem as Co, accordionPropsMeta as Do } from "./core/accordion.js";
29
+ import { Breadcrumb as ko, BreadcrumbEllipsis as yo, BreadcrumbItem as wo, breadcrumbPropsMeta as Io } from "./core/breadcrumb.js";
30
+ import { TreeView as Bo, treeViewPropsMeta as Fo } from "./core/tree-view.js";
31
+ import { Timeline as Ro, timelinePropsMeta as Ko } from "./core/timeline.js";
32
+ import { Calendar as Vo, calendarPropsMeta as Eo, fromDateKey as Go, toDateKey as Ho } from "./core/calendar.js";
33
+ import { DatePicker as jo, DateRangePicker as qo, datePickerPropsMeta as zo, dateRangePickerPropsMeta as Jo } from "./core/date-picker.js";
34
+ import { FileUpload as Qo, fileUploadPropsMeta as Wo } from "./core/file-upload.js";
14
35
  export {
15
- q as Avatar,
16
- y as Badge,
17
- l as Button,
18
- z as Card,
19
- E as CardContent,
20
- G as CardDescription,
21
- J as CardFooter,
22
- K as CardHeader,
23
- N as CardTitle,
24
- W as Dialog,
25
- X as DialogContent,
26
- Y as DialogDescription,
27
- Z as DialogFooter,
28
- _ as DialogHeader,
29
- $ as DialogTitle,
30
- er as Dropdown,
31
- n as Input,
32
- P as Label,
33
- ir as Modal,
34
- pr as ScrollArea,
35
- b as Select,
36
- D as SelectContent,
37
- T as SelectItem,
38
- u as SelectTrigger,
39
- w as SelectValue,
40
- x as Separator,
41
- A as Switch,
42
- H as Tabs,
43
- I as TabsContent,
44
- L as TabsList,
45
- V as TabsTrigger,
46
- M as Textarea,
47
- O as avatarPropsMeta,
48
- Q as badgePropsMeta,
49
- i as buttonPropsMeta,
50
- R as cardPropsMeta,
51
- e as cn,
52
- dr as confirmModal,
53
- nr as confirmModalPropsMeta,
54
- rr as dialogPropsMeta,
55
- tr as dropdownPropsMeta,
56
- c as inputPropsMeta,
57
- g as labelPropsMeta,
58
- Mr as modalPropsMeta,
36
+ vo as Accordion,
37
+ Co as AccordionItem,
38
+ je as Alert,
39
+ re as Avatar,
40
+ te as Badge,
41
+ ko as Breadcrumb,
42
+ yo as BreadcrumbEllipsis,
43
+ wo as BreadcrumbItem,
44
+ y as Button,
45
+ Vo as Calendar,
46
+ ae as Card,
47
+ pe as CardContent,
48
+ se as CardDescription,
49
+ le as CardFooter,
50
+ ie as CardHeader,
51
+ me as CardTitle,
52
+ Po as Checkbox,
53
+ go as Combobox,
54
+ jo as DatePicker,
55
+ qo as DateRangePicker,
56
+ xe as Dialog,
57
+ Me as DialogContent,
58
+ fe as DialogDescription,
59
+ ue as DialogFooter,
60
+ be as DialogHeader,
61
+ ge as DialogTitle,
62
+ so as Drawer,
63
+ ve as Dropdown,
64
+ Qo as FileUpload,
65
+ A as Input,
66
+ K as Label,
67
+ we as Modal,
68
+ to as Popover,
69
+ l as Portal,
70
+ Je as Progress,
71
+ Mo as Radio,
72
+ fo as RadioGroup,
73
+ he as ScrollArea,
74
+ H as Select,
75
+ U as SelectContent,
76
+ j as SelectItem,
77
+ q as SelectTrigger,
78
+ z as SelectValue,
79
+ L as Separator,
80
+ lo as Sheet,
81
+ Ge as Skeleton,
82
+ Le as Spinner,
83
+ Q as Switch,
84
+ Y as Tabs,
85
+ Z as TabsContent,
86
+ _ as TabsList,
87
+ $ as TabsTrigger,
88
+ B as Textarea,
89
+ Ro as Timeline,
90
+ We as Toaster,
91
+ eo as Tooltip,
92
+ Bo as TreeView,
93
+ Do as accordionPropsMeta,
94
+ qe as alertPropsMeta,
95
+ ce as avatarPropsMeta,
96
+ de as badgePropsMeta,
97
+ Io as breadcrumbPropsMeta,
98
+ w as buttonPropsMeta,
99
+ Eo as calendarPropsMeta,
100
+ Pe as cardPropsMeta,
101
+ no as checkboxPropsMeta,
102
+ r as cn,
103
+ To as comboboxPropsMeta,
104
+ Oe as computePosition,
105
+ Ie as confirmModal,
106
+ Ae as confirmModalPropsMeta,
107
+ zo as datePickerPropsMeta,
108
+ Jo as dateRangePickerPropsMeta,
109
+ Te as dialogPropsMeta,
110
+ Xe as dismissAllToasts,
111
+ io as drawerPropsMeta,
112
+ Ce as dropdownPropsMeta,
113
+ v as endIndex,
114
+ Wo as fileUploadPropsMeta,
115
+ Go as fromDateKey,
116
+ i as getFocusable,
117
+ C as homeIndex,
118
+ F as inputPropsMeta,
119
+ m as isTopOverlay,
120
+ V as labelPropsMeta,
121
+ Be as modalPropsMeta,
122
+ D as moveIndex,
123
+ c as overlayCount,
124
+ d as overlayPropsMeta,
125
+ ao as popoverPropsMeta,
126
+ Ne as progressPropsMeta,
127
+ P as pushOverlay,
128
+ uo as radioGroupPropsMeta,
129
+ n as removeOverlay,
59
130
  a as resolveSurface,
60
- sr as scrollAreaPropsMeta,
61
- h as selectPropsMeta,
62
- C as separatorPropsMeta,
63
- B as switchPropsMeta,
64
- j as tabsPropsMeta,
65
- f as textareaPropsMeta,
131
+ ke as scrollAreaPropsMeta,
132
+ J as selectPropsMeta,
133
+ E as separatorPropsMeta,
134
+ mo as sheetPropsMeta,
135
+ He as skeletonPropsMeta,
136
+ Ve as spinnerPropsMeta,
137
+ W as switchPropsMeta,
138
+ ee as tabsPropsMeta,
139
+ O as textareaPropsMeta,
140
+ Ko as timelinePropsMeta,
141
+ Ho as toDateKey,
142
+ Ye as toast,
143
+ Ze as toastPropsMeta,
144
+ _e as toasterPropsMeta,
145
+ oo as tooltipPropsMeta,
146
+ Fo as treeViewPropsMeta,
147
+ h as typeaheadIndex,
148
+ Re as useAnchoredPosition,
149
+ x as useEscapeKey,
150
+ M as useFocusTrap,
151
+ f as useInertBackground,
152
+ u as useOverlay,
153
+ b as useOverlayStack,
154
+ g as useReducedMotion,
155
+ T as useScrollLock,
66
156
  p as withSurface
67
157
  };
@@ -4,6 +4,10 @@ import * as React from "react";
4
4
  * DataTable family: column config, sorting, cursor pagination.
5
5
  * Callers provide rows plus an optional cursor contract; filtering helpers
6
6
  * live in the toolbar/filter components.
7
+ *
8
+ * Enterprise additions: row selection (with a checkbox column), expandable
9
+ * rows (renderExpandedRow), memoized row rendering, and an opt-in windowed
10
+ * rendering mode (virtualized) for very large row sets.
7
11
  */
8
12
  export type SortDirection = "asc" | "desc";
9
13
  export interface Column<T> {
@@ -41,7 +45,24 @@ export interface DataTableProps<T> {
41
45
  loading?: boolean;
42
46
  emptyMessage?: React.ReactNode;
43
47
  onRowClick?: (row: T, index: number) => void;
48
+ /**
49
+ * Row selection: renders a checkbox column. `true` = multiple selection,
50
+ * `{ multiple: false }` = single.
51
+ */
52
+ selectable?: boolean | {
53
+ multiple?: boolean;
54
+ };
55
+ /** Selected row keys (controlled). */
56
+ selectedRowKeys?: (string | number)[];
57
+ onSelectionChange?: (keys: (string | number)[], rows: T[]) => void;
58
+ /** Expandable rows: renders an expander column and this content when open. */
59
+ renderExpandedRow?: (row: T) => React.ReactNode;
60
+ /** Expanded row keys (controlled). */
61
+ expandedRowKeys?: (string | number)[];
62
+ onExpandedRowsChange?: (keys: (string | number)[]) => void;
63
+ /** Window-render large row sets (render only the visible slice + spacers). */
64
+ virtualized?: boolean;
44
65
  className?: string;
45
66
  }
46
- export declare function DataTable<T extends Record<string, unknown>>({ columns, rows, rowKey, sort: sortProp, onSortChange, defaultSort, loading, emptyMessage, onRowClick, className, }: DataTableProps<T>): React.JSX.Element;
67
+ export declare function DataTable<T extends Record<string, unknown>>({ columns, rows, rowKey, sort: sortProp, onSortChange, defaultSort, loading, emptyMessage, onRowClick, selectable, selectedRowKeys, onSelectionChange, renderExpandedRow, expandedRowKeys, onExpandedRowsChange, virtualized, className, }: DataTableProps<T>): React.JSX.Element;
47
68
  export declare const dataTablePropsMeta: PropsMeta;
@@ -1,4 +1,4 @@
1
- import { D as t, a as r, b as s, c as l, d as i, F as o, N as b, P as T, T as F, e as n, f as P, g } from "./chunks/data-table-toolbar-BUy2EWPy.js";
1
+ import { D as t, a as r, b as s, c as l, d as i, F as o, N as b, P as T, T as F, e as n, f as P, g } from "./chunks/data-table-toolbar-B-5J2Ozl.js";
2
2
  export {
3
3
  t as DataTable,
4
4
  r as DataTablePagination,
@@ -15,6 +15,14 @@ export interface FormProps {
15
15
  validateOnChange?: boolean;
16
16
  className?: string;
17
17
  }
18
+ /**
19
+ * Registry-driven form (deprecated).
20
+ *
21
+ * @deprecated Superseded by the schema-driven Form from `@skiddph/prui/app`.
22
+ * This implementation keeps working (FormButton, the form registry, and
23
+ * cross-scope control all remain); it will not be removed before v2.
24
+ * See the docs Forms page for migration notes.
25
+ */
18
26
  export declare function Form({ id, children, schema, initialValues, onSubmit, onReset, validateOnChange, className }: FormProps): React.JSX.Element;
19
27
  export interface FormGroupProps {
20
28
  label?: string;