@jsudc/react 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +555 -2
- package/dist/all.d.ts +9 -0
- package/dist/all.js +14 -0
- package/dist/all.js.map +1 -0
- package/dist/calendar/CalendarRenderer.d.ts +9 -0
- package/dist/calendar/CalendarRenderer.js +314 -0
- package/dist/calendar/CalendarRenderer.js.map +1 -0
- package/dist/calendar/EventBlock.d.ts +16 -0
- package/dist/calendar/EventBlock.js +57 -0
- package/dist/calendar/EventBlock.js.map +1 -0
- package/dist/calendar/EventDetail.d.ts +20 -0
- package/dist/calendar/EventDetail.js +186 -0
- package/dist/calendar/EventDetail.js.map +1 -0
- package/dist/calendar/MonthGrid.d.ts +19 -0
- package/dist/calendar/MonthGrid.js +121 -0
- package/dist/calendar/MonthGrid.js.map +1 -0
- package/dist/calendar/TimeGrid.d.ts +24 -0
- package/dist/calendar/TimeGrid.js +331 -0
- package/dist/calendar/TimeGrid.js.map +1 -0
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/model.d.ts +97 -0
- package/dist/calendar/model.js +279 -0
- package/dist/calendar/model.js.map +1 -0
- package/dist/calendar/useCalendarUrl.d.ts +13 -0
- package/dist/calendar/useCalendarUrl.js +35 -0
- package/dist/calendar/useCalendarUrl.js.map +1 -0
- package/dist/calendar.d.ts +1 -0
- package/dist/calendar.js +22 -0
- package/dist/calendar.js.map +1 -0
- package/dist/cards/CardRenderer.d.ts +24 -0
- package/dist/cards/CardRenderer.js +277 -0
- package/dist/cards/CardRenderer.js.map +1 -0
- package/dist/cards/cardModel.d.ts +48 -0
- package/dist/cards/cardModel.js +86 -0
- package/dist/cards/cardModel.js.map +1 -0
- package/dist/cards/index.d.ts +4 -0
- package/dist/cards.d.ts +1 -0
- package/dist/cards.js +15 -0
- package/dist/cards.js.map +1 -0
- package/dist/chart/ChartRenderer.d.ts +16 -0
- package/dist/chart/ChartRenderer.js +531 -0
- package/dist/chart/ChartRenderer.js.map +1 -0
- package/dist/chart/ChartWindowControl.d.ts +13 -0
- package/dist/chart/ChartWindowControl.js +103 -0
- package/dist/chart/ChartWindowControl.js.map +1 -0
- package/dist/chart/index.d.ts +7 -0
- package/dist/chart/model.d.ts +45 -0
- package/dist/chart/model.js +184 -0
- package/dist/chart/model.js.map +1 -0
- package/dist/chart/useChartWindow.d.ts +18 -0
- package/dist/chart/useChartWindow.js +70 -0
- package/dist/chart/useChartWindow.js.map +1 -0
- package/dist/chart/window.d.ts +50 -0
- package/dist/chart/window.js +133 -0
- package/dist/chart/window.js.map +1 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +18 -0
- package/dist/chart.js.map +1 -0
- package/dist/components/ui/button.d.ts +21 -0
- package/dist/components/ui/button.js +30 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +2 -0
- package/dist/components/ui/checkbox.js +23 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +14 -0
- package/dist/components/ui/dialog.js +52 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +12 -0
- package/dist/components/ui/dropdown-menu.js +35 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.js +24 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/misc.d.ts +6 -0
- package/dist/components/ui/misc.js +24 -0
- package/dist/components/ui/misc.js.map +1 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/popover.js +21 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +11 -0
- package/dist/components/ui/segmented.js +35 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select.d.ts +12 -0
- package/dist/components/ui/select.js +39 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/toast.d.ts +10 -0
- package/dist/components/ui/toast.js +72 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +19 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/data-view/DocTab.d.ts +8 -0
- package/dist/data-view/DocTab.js +26 -0
- package/dist/data-view/DocTab.js.map +1 -0
- package/dist/data-view/FilePreview.d.ts +10 -0
- package/dist/data-view/FilePreview.js +71 -0
- package/dist/data-view/FilePreview.js.map +1 -0
- package/dist/data-view/FilterBuilder.d.ts +26 -0
- package/dist/data-view/FilterBuilder.js +349 -0
- package/dist/data-view/FilterBuilder.js.map +1 -0
- package/dist/data-view/FilterChips.d.ts +12 -0
- package/dist/data-view/FilterChips.js +296 -0
- package/dist/data-view/FilterChips.js.map +1 -0
- package/dist/data-view/FolderBar.d.ts +5 -0
- package/dist/data-view/FolderBar.js +46 -0
- package/dist/data-view/FolderBar.js.map +1 -0
- package/dist/data-view/FolderEntry.d.ts +13 -0
- package/dist/data-view/FolderEntry.js +37 -0
- package/dist/data-view/FolderEntry.js.map +1 -0
- package/dist/data-view/Freshness.d.ts +18 -0
- package/dist/data-view/Freshness.js +87 -0
- package/dist/data-view/Freshness.js.map +1 -0
- package/dist/data-view/SearchBox.d.ts +7 -0
- package/dist/data-view/SearchBox.js +65 -0
- package/dist/data-view/SearchBox.js.map +1 -0
- package/dist/data-view/SourceTab.d.ts +9 -0
- package/dist/data-view/SourceTab.js +104 -0
- package/dist/data-view/SourceTab.js.map +1 -0
- package/dist/data-view/UdcDataView.d.ts +12 -0
- package/dist/data-view/UdcDataView.js +365 -0
- package/dist/data-view/UdcDataView.js.map +1 -0
- package/dist/data-view/compose.d.ts +24 -0
- package/dist/data-view/compose.js +86 -0
- package/dist/data-view/compose.js.map +1 -0
- package/dist/data-view/folder.d.ts +13 -0
- package/dist/data-view/folder.js +52 -0
- package/dist/data-view/folder.js.map +1 -0
- package/dist/data-view/liveView.d.ts +20 -0
- package/dist/data-view/liveView.js +67 -0
- package/dist/data-view/liveView.js.map +1 -0
- package/dist/data-view/urlState.d.ts +44 -0
- package/dist/data-view/urlState.js +139 -0
- package/dist/data-view/urlState.js.map +1 -0
- package/dist/data-view/useDataViewState.d.ts +39 -0
- package/dist/data-view/useDataViewState.js +79 -0
- package/dist/data-view/useDataViewState.js.map +1 -0
- package/dist/headless.d.ts +31 -0
- package/dist/headless.js +31 -0
- package/dist/i18n/i18n.d.ts +71 -0
- package/dist/i18n/i18n.js +151 -0
- package/dist/i18n/i18n.js.map +1 -0
- package/dist/i18n/translations.d.ts +16 -0
- package/dist/i18n/translations.js +967 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/icons/lucide.generated.d.ts +2 -0
- package/dist/icons/lucide.generated.js +32 -0
- package/dist/icons/lucide.generated.js.map +1 -0
- package/dist/icons/resolve.d.ts +9 -0
- package/dist/icons/resolve.js +25 -0
- package/dist/icons/resolve.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +23 -0
- package/dist/kanban/CardDetailDialog.d.ts +17 -0
- package/dist/kanban/CardDetailDialog.js +53 -0
- package/dist/kanban/CardDetailDialog.js.map +1 -0
- package/dist/kanban/KanbanBoardSwitcher.d.ts +6 -0
- package/dist/kanban/KanbanBoardSwitcher.js +27 -0
- package/dist/kanban/KanbanBoardSwitcher.js.map +1 -0
- package/dist/kanban/KanbanCard.d.ts +21 -0
- package/dist/kanban/KanbanCard.js +189 -0
- package/dist/kanban/KanbanCard.js.map +1 -0
- package/dist/kanban/KanbanColumn.d.ts +30 -0
- package/dist/kanban/KanbanColumn.js +228 -0
- package/dist/kanban/KanbanColumn.js.map +1 -0
- package/dist/kanban/KanbanRenderer.d.ts +3 -0
- package/dist/kanban/KanbanRenderer.js +472 -0
- package/dist/kanban/KanbanRenderer.js.map +1 -0
- package/dist/kanban/index.d.ts +5 -0
- package/dist/kanban/model.d.ts +89 -0
- package/dist/kanban/model.js +159 -0
- package/dist/kanban/model.js.map +1 -0
- package/dist/kanban/persist.d.ts +27 -0
- package/dist/kanban/persist.js +54 -0
- package/dist/kanban/persist.js.map +1 -0
- package/dist/kanban/useKanbanBoard.d.ts +21 -0
- package/dist/kanban/useKanbanBoard.js +47 -0
- package/dist/kanban/useKanbanBoard.js.map +1 -0
- package/dist/kanban.d.ts +1 -0
- package/dist/kanban.js +17 -0
- package/dist/kanban.js.map +1 -0
- package/dist/lib/storage.d.ts +7 -0
- package/dist/lib/storage.js +24 -0
- package/dist/lib/storage.js.map +1 -0
- package/dist/lib/theme.d.ts +11 -0
- package/dist/lib/theme.js +43 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +12 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/map/MapRenderer.d.ts +13 -0
- package/dist/map/MapRenderer.js +405 -0
- package/dist/map/MapRenderer.js.map +1 -0
- package/dist/map/index.d.ts +4 -0
- package/dist/map/model.d.ts +68 -0
- package/dist/map/model.js +143 -0
- package/dist/map/model.js.map +1 -0
- package/dist/map.d.ts +1 -0
- package/dist/map.js +15 -0
- package/dist/map.js.map +1 -0
- package/dist/react-router/UdcReactRouterUrlState.d.ts +10 -0
- package/dist/react-router/UdcReactRouterUrlState.js +35 -0
- package/dist/react-router/UdcReactRouterUrlState.js.map +1 -0
- package/dist/react-router/index.d.ts +1 -0
- package/dist/react-router.d.ts +1 -0
- package/dist/react-router.js +1 -0
- package/dist/renderers/AllRowsStatus.d.ts +8 -0
- package/dist/renderers/AllRowsStatus.js +34 -0
- package/dist/renderers/AllRowsStatus.js.map +1 -0
- package/dist/renderers/context.d.ts +11 -0
- package/dist/renderers/context.js +15 -0
- package/dist/renderers/context.js.map +1 -0
- package/dist/renderers/registry.d.ts +25 -0
- package/dist/renderers/registry.js +40 -0
- package/dist/renderers/registry.js.map +1 -0
- package/dist/renderers/types.d.ts +90 -0
- package/dist/renderers/types.js +8 -0
- package/dist/renderers/types.js.map +1 -0
- package/dist/schema-editor/ColumnHeaderMenu.d.ts +11 -0
- package/dist/schema-editor/ColumnHeaderMenu.js +75 -0
- package/dist/schema-editor/ColumnHeaderMenu.js.map +1 -0
- package/dist/schema-editor/DeleteFieldDialog.d.ts +8 -0
- package/dist/schema-editor/DeleteFieldDialog.js +79 -0
- package/dist/schema-editor/DeleteFieldDialog.js.map +1 -0
- package/dist/schema-editor/FieldFormDialog.d.ts +22 -0
- package/dist/schema-editor/FieldFormDialog.js +312 -0
- package/dist/schema-editor/FieldFormDialog.js.map +1 -0
- package/dist/schema-editor/TagInput.d.ts +9 -0
- package/dist/schema-editor/TagInput.js +46 -0
- package/dist/schema-editor/TagInput.js.map +1 -0
- package/dist/schema-editor/fieldForm.d.ts +52 -0
- package/dist/schema-editor/fieldForm.js +132 -0
- package/dist/schema-editor/fieldForm.js.map +1 -0
- package/dist/schema-editor/index.d.ts +6 -0
- package/dist/schema-editor/useSchemaEditor.d.ts +15 -0
- package/dist/schema-editor/useSchemaEditor.js +87 -0
- package/dist/schema-editor/useSchemaEditor.js.map +1 -0
- package/dist/schema-editor.d.ts +1 -0
- package/dist/schema-editor.js +7 -0
- package/dist/styles.css +2 -0
- package/dist/table/CellEditor.d.ts +31 -0
- package/dist/table/CellEditor.js +145 -0
- package/dist/table/CellEditor.js.map +1 -0
- package/dist/table/Pager.d.ts +8 -0
- package/dist/table/Pager.js +90 -0
- package/dist/table/Pager.js.map +1 -0
- package/dist/table/TableRenderer.d.ts +27 -0
- package/dist/table/TableRenderer.js +458 -0
- package/dist/table/TableRenderer.js.map +1 -0
- package/dist/table/cells.d.ts +16 -0
- package/dist/table/cells.js +106 -0
- package/dist/table/cells.js.map +1 -0
- package/dist/table/format.d.ts +24 -0
- package/dist/table/format.js +117 -0
- package/dist/table/format.js.map +1 -0
- package/dist/table/index.d.ts +6 -0
- package/dist/table/sparkline.d.ts +31 -0
- package/dist/table/sparkline.js +105 -0
- package/dist/table/sparkline.js.map +1 -0
- package/dist/table/states.d.ts +17 -0
- package/dist/table/states.js +86 -0
- package/dist/table/states.js.map +1 -0
- package/dist/table/style.d.ts +15 -0
- package/dist/table/style.js +53 -0
- package/dist/table/style.js.map +1 -0
- package/dist/table/transforms.d.ts +17 -0
- package/dist/table/transforms.js +95 -0
- package/dist/table/transforms.js.map +1 -0
- package/dist/table/useInfiniteSentinel.d.ts +8 -0
- package/dist/table/useInfiniteSentinel.js +34 -0
- package/dist/table/useInfiniteSentinel.js.map +1 -0
- package/dist/table.d.ts +1 -0
- package/dist/table.js +18 -0
- package/dist/table.js.map +1 -0
- package/dist/time/timezone.d.ts +27 -0
- package/dist/time/timezone.js +65 -0
- package/dist/time/timezone.js.map +1 -0
- package/dist/time/zoned.d.ts +65 -0
- package/dist/time/zoned.js +208 -0
- package/dist/time/zoned.js.map +1 -0
- package/dist/tokens.css +457 -0
- package/dist/tree/TreeNode.d.ts +9 -0
- package/dist/tree/TreeNode.js +292 -0
- package/dist/tree/TreeNode.js.map +1 -0
- package/dist/tree/TreeRenderer.d.ts +54 -0
- package/dist/tree/TreeRenderer.js +446 -0
- package/dist/tree/TreeRenderer.js.map +1 -0
- package/dist/tree/expand.d.ts +31 -0
- package/dist/tree/expand.js +80 -0
- package/dist/tree/expand.js.map +1 -0
- package/dist/tree/index.d.ts +4 -0
- package/dist/tree/model.d.ts +108 -0
- package/dist/tree/model.js +294 -0
- package/dist/tree/model.js.map +1 -0
- package/dist/tree.d.ts +1 -0
- package/dist/tree.js +15 -0
- package/dist/tree.js.map +1 -0
- package/dist/udc/client.d.ts +11 -0
- package/dist/udc/client.js +30 -0
- package/dist/udc/client.js.map +1 -0
- package/dist/udc/hooks.d.ts +644 -0
- package/dist/udc/hooks.js +353 -0
- package/dist/udc/hooks.js.map +1 -0
- package/dist/udc/keys.d.ts +19 -0
- package/dist/udc/keys.js +30 -0
- package/dist/udc/keys.js.map +1 -0
- package/dist/udc/provider.d.ts +19 -0
- package/dist/udc/provider.js +29 -0
- package/dist/udc/provider.js.map +1 -0
- package/dist/ui-kit/context.d.ts +11 -0
- package/dist/ui-kit/context.js +19 -0
- package/dist/ui-kit/context.js.map +1 -0
- package/dist/ui-kit/default.d.ts +3 -0
- package/dist/ui-kit/default.js +45 -0
- package/dist/ui-kit/default.js.map +1 -0
- package/dist/ui-kit/index.d.ts +2 -0
- package/dist/ui-kit/types.d.ts +227 -0
- package/dist/ui-kit/ui.d.ts +12 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +13 -0
- package/dist/url-state/UrlState.d.ts +20 -0
- package/dist/url-state/UrlState.js +27 -0
- package/dist/url-state/UrlState.js.map +1 -0
- package/dist/url-state/adapter.d.ts +24 -0
- package/dist/url-state/adapter.js +33 -0
- package/dist/url-state/adapter.js.map +1 -0
- package/dist/url-state/index.d.ts +2 -0
- package/package.json +185 -4
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type { ChangeEvent, ComponentType, CSSProperties, FocusEventHandler, HTMLInputTypeAttribute, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, ReactNode, Ref, SelectHTMLAttributes } from "react";
|
|
2
|
+
/** What the renderers put on nearly every primitive. */
|
|
3
|
+
interface Base {
|
|
4
|
+
className?: string;
|
|
5
|
+
"data-testid"?: string;
|
|
6
|
+
}
|
|
7
|
+
/** A cancellable event: the renderers only ever call `preventDefault()` on it. */
|
|
8
|
+
export interface PreventableEvent {
|
|
9
|
+
preventDefault(): void;
|
|
10
|
+
}
|
|
11
|
+
export type ButtonVariant = "primary" | "outline" | "ghost" | "subtle" | "danger";
|
|
12
|
+
export type ButtonSize = "sm" | "md" | "icon" | "icon-sm";
|
|
13
|
+
export interface UiButtonProps extends Base {
|
|
14
|
+
/** Default `outline`. */
|
|
15
|
+
variant?: ButtonVariant;
|
|
16
|
+
/** Default `md`; `icon` and `icon-sm` are square. */
|
|
17
|
+
size?: ButtonSize;
|
|
18
|
+
type?: "button" | "submit";
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
21
|
+
onPointerDown?: PointerEventHandler<HTMLButtonElement>;
|
|
22
|
+
"aria-label"?: string;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface UiInputProps extends Base {
|
|
26
|
+
ref?: Ref<HTMLInputElement>;
|
|
27
|
+
id?: string;
|
|
28
|
+
type?: HTMLInputTypeAttribute;
|
|
29
|
+
value?: string | number;
|
|
30
|
+
defaultValue?: string | number;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
min?: string | number;
|
|
33
|
+
max?: string | number;
|
|
34
|
+
step?: string | number;
|
|
35
|
+
readOnly?: boolean;
|
|
36
|
+
autoFocus?: boolean;
|
|
37
|
+
autoComplete?: string;
|
|
38
|
+
spellCheck?: boolean;
|
|
39
|
+
inputMode?: "text" | "numeric" | "decimal" | "search";
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
"aria-invalid"?: boolean;
|
|
42
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
43
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
44
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
45
|
+
onPointerDown?: PointerEventHandler<HTMLInputElement>;
|
|
46
|
+
}
|
|
47
|
+
/** A native `<select>` with `<option>` children: keyboard and test friendly. */
|
|
48
|
+
export interface UiNativeSelectProps extends Base {
|
|
49
|
+
id?: string;
|
|
50
|
+
value?: SelectHTMLAttributes<HTMLSelectElement>["value"];
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
"aria-label"?: string;
|
|
53
|
+
onChange?: (e: ChangeEvent<HTMLSelectElement>) => void;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
export interface UiCheckboxProps extends Base {
|
|
57
|
+
id?: string;
|
|
58
|
+
checked: boolean;
|
|
59
|
+
onCheckedChange: (checked: boolean | "indeterminate") => void;
|
|
60
|
+
}
|
|
61
|
+
export interface SelectOption {
|
|
62
|
+
value: string;
|
|
63
|
+
label: string;
|
|
64
|
+
}
|
|
65
|
+
/** A single choice from a list. `value` is never "" (Radix reserves it); `undefined` shows the placeholder. */
|
|
66
|
+
export interface UiSelectProps extends Base {
|
|
67
|
+
value: string | undefined;
|
|
68
|
+
onValueChange: (v: string) => void;
|
|
69
|
+
options: readonly SelectOption[];
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
"aria-label"?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface SegmentedOption<V extends string> {
|
|
74
|
+
value: V;
|
|
75
|
+
label: ReactNode;
|
|
76
|
+
testId?: string;
|
|
77
|
+
/** Shown, not choosable; `tooltip` says why. */
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
tooltip?: string;
|
|
80
|
+
}
|
|
81
|
+
/** A single-choice segmented control (pages | infinite, table | cards, en | sr). */
|
|
82
|
+
export interface UiSegmentedProps<V extends string> extends Base {
|
|
83
|
+
value: V;
|
|
84
|
+
onChange: (v: V) => void;
|
|
85
|
+
options: readonly SegmentedOption<V>[];
|
|
86
|
+
"aria-label": string;
|
|
87
|
+
}
|
|
88
|
+
export interface UiSkeletonProps extends Base {
|
|
89
|
+
style?: CSSProperties;
|
|
90
|
+
}
|
|
91
|
+
export interface UiKbdProps {
|
|
92
|
+
className?: string;
|
|
93
|
+
children?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
export interface UiSpinnerProps {
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
/** A controlled modal dialog. */
|
|
99
|
+
export interface UiDialogProps {
|
|
100
|
+
open: boolean;
|
|
101
|
+
onOpenChange: (open: boolean) => void;
|
|
102
|
+
children?: ReactNode;
|
|
103
|
+
}
|
|
104
|
+
/** The dialog panel: a title row with a close button, then `children` (`DialogBody`, `DialogFooter`). */
|
|
105
|
+
export interface UiDialogContentProps extends Base {
|
|
106
|
+
title: ReactNode;
|
|
107
|
+
description?: ReactNode;
|
|
108
|
+
role?: "dialog" | "alertdialog";
|
|
109
|
+
"data-mode"?: string;
|
|
110
|
+
/** `preventDefault()` keeps the dialog open (a save in flight). */
|
|
111
|
+
onEscapeKeyDown?: (e: PreventableEvent) => void;
|
|
112
|
+
onInteractOutside?: (e: PreventableEvent) => void;
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
}
|
|
115
|
+
export interface UiBlockProps {
|
|
116
|
+
className?: string;
|
|
117
|
+
children?: ReactNode;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* A trigger renders its own button unless `asChild`: then it merges its
|
|
121
|
+
* behaviour into its single child element, which must forward a ref.
|
|
122
|
+
*/
|
|
123
|
+
export interface UiTriggerProps extends Base {
|
|
124
|
+
asChild?: boolean;
|
|
125
|
+
"aria-label"?: string;
|
|
126
|
+
children?: ReactNode;
|
|
127
|
+
}
|
|
128
|
+
/** An uncontrolled menu that opens from its trigger. */
|
|
129
|
+
export interface UiDropdownMenuProps {
|
|
130
|
+
/** `false`: the page behind stays interactive while the menu is open. */
|
|
131
|
+
modal?: boolean;
|
|
132
|
+
children?: ReactNode;
|
|
133
|
+
}
|
|
134
|
+
export interface UiDropdownMenuContentProps extends Base {
|
|
135
|
+
align?: "start" | "center" | "end";
|
|
136
|
+
children?: ReactNode;
|
|
137
|
+
}
|
|
138
|
+
export interface UiDropdownMenuItemProps extends Base {
|
|
139
|
+
tone?: "default" | "danger";
|
|
140
|
+
disabled?: boolean;
|
|
141
|
+
/** Runs on click or Enter; the menu then closes. */
|
|
142
|
+
onSelect?: () => void;
|
|
143
|
+
children?: ReactNode;
|
|
144
|
+
}
|
|
145
|
+
/** Controlled when `open` is given, otherwise it toggles from its trigger. */
|
|
146
|
+
export interface UiPopoverProps {
|
|
147
|
+
open?: boolean;
|
|
148
|
+
onOpenChange?: (open: boolean) => void;
|
|
149
|
+
children?: ReactNode;
|
|
150
|
+
}
|
|
151
|
+
export interface UiPopoverContentProps extends Base {
|
|
152
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
153
|
+
align?: "start" | "center" | "end";
|
|
154
|
+
collisionPadding?: number;
|
|
155
|
+
"data-event-id"?: string;
|
|
156
|
+
/** `preventDefault()` keeps the focus where it was. */
|
|
157
|
+
onOpenAutoFocus?: (e: PreventableEvent) => void;
|
|
158
|
+
children?: ReactNode;
|
|
159
|
+
}
|
|
160
|
+
/** Positions the popover at an element that is not its trigger (a calendar event). */
|
|
161
|
+
export interface UiPopoverAnchorProps {
|
|
162
|
+
virtualRef: {
|
|
163
|
+
current: {
|
|
164
|
+
getBoundingClientRect(): DOMRect;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** A hover / focus label on its single child, which must forward a ref. */
|
|
169
|
+
export interface UiTipProps {
|
|
170
|
+
label: ReactNode;
|
|
171
|
+
children: ReactNode;
|
|
172
|
+
}
|
|
173
|
+
export type ToastVariant = "info" | "success" | "warning" | "danger";
|
|
174
|
+
export interface ToastInput {
|
|
175
|
+
title: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
variant?: ToastVariant;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Every primitive the renderers draw. Hand one to `UdcUiProvider kit={…}` (or
|
|
181
|
+
* `UdcProvider kit={…}`); without a provider the renderers use `defaultUiKit`
|
|
182
|
+
* from `@jsudc/react/ui`. A kit is read once per render, so keep the object
|
|
183
|
+
* stable (a module constant), and `useToast` is called as a hook.
|
|
184
|
+
*/
|
|
185
|
+
export interface UiKit {
|
|
186
|
+
Button: ComponentType<UiButtonProps>;
|
|
187
|
+
Input: ComponentType<UiInputProps>;
|
|
188
|
+
NativeSelect: ComponentType<UiNativeSelectProps>;
|
|
189
|
+
Checkbox: ComponentType<UiCheckboxProps>;
|
|
190
|
+
Select: ComponentType<UiSelectProps>;
|
|
191
|
+
Segmented: <V extends string>(props: UiSegmentedProps<V>) => ReactNode;
|
|
192
|
+
Spinner: ComponentType<UiSpinnerProps>;
|
|
193
|
+
Skeleton: ComponentType<UiSkeletonProps>;
|
|
194
|
+
Kbd: ComponentType<UiKbdProps>;
|
|
195
|
+
Dialog: ComponentType<UiDialogProps>;
|
|
196
|
+
DialogContent: ComponentType<UiDialogContentProps>;
|
|
197
|
+
/** The scrolling middle of a dialog. */
|
|
198
|
+
DialogBody: ComponentType<UiBlockProps>;
|
|
199
|
+
/** The button row at the bottom of a dialog. */
|
|
200
|
+
DialogFooter: ComponentType<UiBlockProps>;
|
|
201
|
+
DropdownMenu: ComponentType<UiDropdownMenuProps>;
|
|
202
|
+
DropdownMenuTrigger: ComponentType<UiTriggerProps>;
|
|
203
|
+
DropdownMenuContent: ComponentType<UiDropdownMenuContentProps>;
|
|
204
|
+
DropdownMenuItem: ComponentType<UiDropdownMenuItemProps>;
|
|
205
|
+
DropdownMenuLabel: ComponentType<UiBlockProps>;
|
|
206
|
+
DropdownMenuSeparator: ComponentType<{
|
|
207
|
+
className?: string;
|
|
208
|
+
}>;
|
|
209
|
+
Popover: ComponentType<UiPopoverProps>;
|
|
210
|
+
PopoverTrigger: ComponentType<UiTriggerProps>;
|
|
211
|
+
PopoverContent: ComponentType<UiPopoverContentProps>;
|
|
212
|
+
PopoverAnchor: ComponentType<UiPopoverAnchorProps>;
|
|
213
|
+
/** Mounted once by the host around the view; `Tip` may need it. */
|
|
214
|
+
TooltipProvider: ComponentType<{
|
|
215
|
+
children: ReactNode;
|
|
216
|
+
}>;
|
|
217
|
+
Tip: ComponentType<UiTipProps>;
|
|
218
|
+
/** Mounted once by the host around the view: the toast stack and its viewport. */
|
|
219
|
+
Toaster: ComponentType<{
|
|
220
|
+
children: ReactNode;
|
|
221
|
+
}>;
|
|
222
|
+
/** A hook: returns the function that shows a toast. */
|
|
223
|
+
useToast: () => {
|
|
224
|
+
toast: (t: ToastInput) => void;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from "../components/ui/button.js";
|
|
2
|
+
export { Checkbox } from "../components/ui/checkbox.js";
|
|
3
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogTrigger, } from "../components/ui/dialog.js";
|
|
4
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "../components/ui/dropdown-menu.js";
|
|
5
|
+
export { Input, inputClass, NativeSelect } from "../components/ui/input.js";
|
|
6
|
+
export { Kbd, Skeleton, Spinner } from "../components/ui/misc.js";
|
|
7
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, } from "../components/ui/popover.js";
|
|
8
|
+
export { Segmented, type SegmentedOption } from "../components/ui/segmented.js";
|
|
9
|
+
export { Select, type SelectOption } from "../components/ui/select.js";
|
|
10
|
+
export { Toaster, type ToastInput, type ToastVariant, useToast } from "../components/ui/toast.js";
|
|
11
|
+
export { Tip, TooltipProvider } from "../components/ui/tooltip.js";
|
|
12
|
+
export { defaultUiKit } from "./default.js";
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ui-kit/ui.js";
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Button } from "./components/ui/button.js";
|
|
2
|
+
import { Checkbox } from "./components/ui/checkbox.js";
|
|
3
|
+
import { Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogTrigger } from "./components/ui/dialog.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
5
|
+
import { Input, NativeSelect, inputClass } from "./components/ui/input.js";
|
|
6
|
+
import { Kbd, Skeleton, Spinner } from "./components/ui/misc.js";
|
|
7
|
+
import { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger } from "./components/ui/popover.js";
|
|
8
|
+
import { Segmented } from "./components/ui/segmented.js";
|
|
9
|
+
import { Select } from "./components/ui/select.js";
|
|
10
|
+
import { Toaster, useToast } from "./components/ui/toast.js";
|
|
11
|
+
import { Tip, TooltipProvider } from "./components/ui/tooltip.js";
|
|
12
|
+
import { defaultUiKit } from "./ui-kit/default.js";
|
|
13
|
+
export { Button, Checkbox, Dialog, DialogBody, DialogClose, DialogContent, DialogFooter, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Input, Kbd, NativeSelect, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Segmented, Select, Skeleton, Spinner, Tip, Toaster, TooltipProvider, defaultUiKit, inputClass, useToast };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type UrlStateAdapter } from "./adapter.js";
|
|
3
|
+
export interface UdcUrlStateProviderProps {
|
|
4
|
+
adapter: UrlStateAdapter;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/** Route the data view's URL state through `adapter`; without it, `windowLocationAdapter`. */
|
|
8
|
+
export declare function UdcUrlStateProvider({ adapter, children }: UdcUrlStateProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<UrlStateAdapter>>;
|
|
9
|
+
/** The adapter in effect: the nearest provider's, else `windowLocationAdapter`. */
|
|
10
|
+
export declare function useUrlStateAdapter(): UrlStateAdapter;
|
|
11
|
+
export type SetUrlSearchParams = (next: URLSearchParams | ((prev: URLSearchParams) => URLSearchParams), opts?: {
|
|
12
|
+
replace?: boolean;
|
|
13
|
+
}) => void;
|
|
14
|
+
/**
|
|
15
|
+
* `[params, setParams]` over the adapter in effect, shaped like a router's
|
|
16
|
+
* `useSearchParams`. A function passed to `setParams` gets the query string as
|
|
17
|
+
* the adapter has it now, not as the last render saw it, so two quick updates
|
|
18
|
+
* do not both start from the same state.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useUrlSearchParams(): [URLSearchParams, SetUrlSearchParams];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { windowLocationAdapter } from "./adapter.js";
|
|
2
|
+
import { createContext, createElement, useCallback, useContext, useMemo, useSyncExternalStore } from "react";
|
|
3
|
+
// src/url-state/UrlState.ts
|
|
4
|
+
var UrlStateContext = createContext(windowLocationAdapter);
|
|
5
|
+
/** Route the data view's URL state through `adapter`; without it, `windowLocationAdapter`. */
|
|
6
|
+
function UdcUrlStateProvider({ adapter, children }) {
|
|
7
|
+
return createElement(UrlStateContext.Provider, { value: adapter }, children);
|
|
8
|
+
}
|
|
9
|
+
/** The adapter in effect: the nearest provider's, else `windowLocationAdapter`. */
|
|
10
|
+
function useUrlStateAdapter() {
|
|
11
|
+
return useContext(UrlStateContext);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `[params, setParams]` over the adapter in effect, shaped like a router's
|
|
15
|
+
* `useSearchParams`. A function passed to `setParams` gets the query string as
|
|
16
|
+
* the adapter has it now, not as the last render saw it, so two quick updates
|
|
17
|
+
* do not both start from the same state.
|
|
18
|
+
*/
|
|
19
|
+
function useUrlSearchParams() {
|
|
20
|
+
const adapter = useUrlStateAdapter();
|
|
21
|
+
const snapshot = () => adapter.get().toString();
|
|
22
|
+
const search = useSyncExternalStore(adapter.subscribe, snapshot, snapshot);
|
|
23
|
+
return [useMemo(() => new URLSearchParams(search), [search]), useCallback((next, opts) => adapter.set(typeof next === "function" ? next(adapter.get()) : next, opts), [adapter])];
|
|
24
|
+
}
|
|
25
|
+
export { UdcUrlStateProvider, useUrlSearchParams, useUrlStateAdapter };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=UrlState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UrlState.js","names":[],"sources":["../../src/url-state/UrlState.ts"],"sourcesContent":["import {\n createContext,\n createElement,\n type ReactNode,\n useCallback,\n useContext,\n useMemo,\n useSyncExternalStore,\n} from \"react\";\nimport { type UrlStateAdapter, windowLocationAdapter } from \"./adapter.js\";\n\nconst UrlStateContext = createContext<UrlStateAdapter>(windowLocationAdapter);\n\nexport interface UdcUrlStateProviderProps {\n adapter: UrlStateAdapter;\n children?: ReactNode;\n}\n\n/** Route the data view's URL state through `adapter`; without it, `windowLocationAdapter`. */\nexport function UdcUrlStateProvider({ adapter, children }: UdcUrlStateProviderProps) {\n return createElement(UrlStateContext.Provider, { value: adapter }, children);\n}\n\n/** The adapter in effect: the nearest provider's, else `windowLocationAdapter`. */\nexport function useUrlStateAdapter(): UrlStateAdapter {\n return useContext(UrlStateContext);\n}\n\nexport type SetUrlSearchParams = (\n next: URLSearchParams | ((prev: URLSearchParams) => URLSearchParams),\n opts?: { replace?: boolean },\n) => void;\n\n/**\n * `[params, setParams]` over the adapter in effect, shaped like a router's\n * `useSearchParams`. A function passed to `setParams` gets the query string as\n * the adapter has it now, not as the last render saw it, so two quick updates\n * do not both start from the same state.\n */\nexport function useUrlSearchParams(): [URLSearchParams, SetUrlSearchParams] {\n const adapter = useUrlStateAdapter();\n const snapshot = () => adapter.get().toString();\n // The snapshot is the string: equal strings are equal state, so no render loop.\n const search = useSyncExternalStore(adapter.subscribe, snapshot, snapshot);\n const params = useMemo(() => new URLSearchParams(search), [search]);\n const setParams = useCallback<SetUrlSearchParams>(\n (next, opts) => adapter.set(typeof next === \"function\" ? next(adapter.get()) : next, opts),\n [adapter],\n );\n return [params, setParams];\n}\n"],"mappings":";;;AAWA,IAAM,kBAAkB,cAA+B,qBAAqB;;AAQ5E,SAAgB,oBAAoB,EAAE,SAAS,YAAsC;CACnF,OAAO,cAAc,gBAAgB,UAAU,EAAE,OAAO,QAAQ,GAAG,QAAQ;AAC7E;;AAGA,SAAgB,qBAAsC;CACpD,OAAO,WAAW,eAAe;AACnC;;;;;;;AAaA,SAAgB,qBAA4D;CAC1E,MAAM,UAAU,mBAAmB;CACnC,MAAM,iBAAiB,QAAQ,IAAI,CAAC,CAAC,SAAS;CAE9C,MAAM,SAAS,qBAAqB,QAAQ,WAAW,UAAU,QAAQ;CAMzE,OAAO,CALQ,cAAc,IAAI,gBAAgB,MAAM,GAAG,CAAC,MAAM,CAKzD,GAJU,aACf,MAAM,SAAS,QAAQ,IAAI,OAAO,SAAS,aAAa,KAAK,QAAQ,IAAI,CAAC,IAAI,MAAM,IAAI,GACzF,CAAC,OAAO,CAEM,CAAS;AAC3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the data view keeps what the user chose (filters, sort, page, the
|
|
3
|
+
* kanban board, the chart and calendar windows): the query string of the
|
|
4
|
+
* address bar, behind three calls so the library needs no router. A host on
|
|
5
|
+
* a router passes an adapter over it (the package ships one on a subpath);
|
|
6
|
+
* without one the History API is used directly.
|
|
7
|
+
*/
|
|
8
|
+
export interface UrlStateAdapter {
|
|
9
|
+
/** The query string as it is now. Called during render and before every update. */
|
|
10
|
+
get(): URLSearchParams;
|
|
11
|
+
/** Write the whole query string; `replace` rewrites the current history entry. */
|
|
12
|
+
set(next: URLSearchParams, opts?: {
|
|
13
|
+
replace?: boolean;
|
|
14
|
+
}): void;
|
|
15
|
+
/** Call `listener` when the query string changed by other means (back, forward). */
|
|
16
|
+
subscribe(listener: () => void): () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The default adapter: `window.location.search`, written with
|
|
20
|
+
* `history.pushState` / `replaceState`, read again on `popstate`. The path
|
|
21
|
+
* and the hash stay as they are; a replace keeps `history.state`, so a
|
|
22
|
+
* router that keys its entries there is not confused.
|
|
23
|
+
*/
|
|
24
|
+
export declare const windowLocationAdapter: UrlStateAdapter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/url-state/adapter.ts
|
|
2
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
3
|
+
var emit = () => {
|
|
4
|
+
for (const listener of listeners) listener();
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The default adapter: `window.location.search`, written with
|
|
8
|
+
* `history.pushState` / `replaceState`, read again on `popstate`. The path
|
|
9
|
+
* and the hash stay as they are; a replace keeps `history.state`, so a
|
|
10
|
+
* router that keys its entries there is not confused.
|
|
11
|
+
*/
|
|
12
|
+
var windowLocationAdapter = {
|
|
13
|
+
get: () => new URLSearchParams(typeof window === "undefined" ? "" : window.location.search),
|
|
14
|
+
set(next, opts) {
|
|
15
|
+
const qs = next.toString();
|
|
16
|
+
const { pathname, hash } = window.location;
|
|
17
|
+
const url = `${pathname}${qs ? `?${qs}` : ""}${hash}`;
|
|
18
|
+
if (opts?.replace) window.history.replaceState(window.history.state, "", url);
|
|
19
|
+
else window.history.pushState(null, "", url);
|
|
20
|
+
emit();
|
|
21
|
+
},
|
|
22
|
+
subscribe(listener) {
|
|
23
|
+
if (listeners.size === 0) window.addEventListener("popstate", emit);
|
|
24
|
+
listeners.add(listener);
|
|
25
|
+
return () => {
|
|
26
|
+
listeners.delete(listener);
|
|
27
|
+
if (listeners.size === 0) window.removeEventListener("popstate", emit);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export { windowLocationAdapter };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../src/url-state/adapter.ts"],"sourcesContent":["/**\n * Where the data view keeps what the user chose (filters, sort, page, the\n * kanban board, the chart and calendar windows): the query string of the\n * address bar, behind three calls so the library needs no router. A host on\n * a router passes an adapter over it (the package ships one on a subpath);\n * without one the History API is used directly.\n */\nexport interface UrlStateAdapter {\n /** The query string as it is now. Called during render and before every update. */\n get(): URLSearchParams;\n /** Write the whole query string; `replace` rewrites the current history entry. */\n set(next: URLSearchParams, opts?: { replace?: boolean }): void;\n /** Call `listener` when the query string changed by other means (back, forward). */\n subscribe(listener: () => void): () => void;\n}\n\nconst listeners = new Set<() => void>();\nconst emit = () => {\n for (const listener of listeners) listener();\n};\n\n/**\n * The default adapter: `window.location.search`, written with\n * `history.pushState` / `replaceState`, read again on `popstate`. The path\n * and the hash stay as they are; a replace keeps `history.state`, so a\n * router that keys its entries there is not confused.\n */\nexport const windowLocationAdapter: UrlStateAdapter = {\n get: () => new URLSearchParams(typeof window === \"undefined\" ? \"\" : window.location.search),\n set(next, opts) {\n const qs = next.toString();\n const { pathname, hash } = window.location;\n const url = `${pathname}${qs ? `?${qs}` : \"\"}${hash}`;\n if (opts?.replace) window.history.replaceState(window.history.state, \"\", url);\n else window.history.pushState(null, \"\", url);\n emit();\n },\n subscribe(listener) {\n if (listeners.size === 0) window.addEventListener(\"popstate\", emit);\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) window.removeEventListener(\"popstate\", emit);\n };\n },\n};\n"],"mappings":";AAgBA,IAAM,4BAAY,IAAI,IAAgB;AACtC,IAAM,aAAa;CACjB,KAAK,MAAM,YAAY,WAAW,SAAS;AAC7C;;;;;;;AAQA,IAAa,wBAAyC;CACpD,WAAW,IAAI,gBAAgB,OAAO,WAAW,cAAc,KAAK,OAAO,SAAS,MAAM;CAC1F,IAAI,MAAM,MAAM;EACd,MAAM,KAAK,KAAK,SAAS;EACzB,MAAM,EAAE,UAAU,SAAS,OAAO;EAClC,MAAM,MAAM,GAAG,WAAW,KAAK,IAAI,OAAO,KAAK;EAC/C,IAAI,MAAM,SAAS,OAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,GAAG;OACvE,OAAO,QAAQ,UAAU,MAAM,IAAI,GAAG;EAC3C,KAAK;CACP;CACA,UAAU,UAAU;EAClB,IAAI,UAAU,SAAS,GAAG,OAAO,iBAAiB,YAAY,IAAI;EAClE,UAAU,IAAI,QAAQ;EACtB,aAAa;GACX,UAAU,OAAO,QAAQ;GACzB,IAAI,UAAU,SAAS,GAAG,OAAO,oBAAoB,YAAY,IAAI;EACvE;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,187 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsudc/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "React components for UDC collections: the data view, its table, cards, kanban, calendar, tree, map and chart renderers (one subpath each), the schema editor, headless hooks and models, i18n, theme and a compiled, udc:-prefixed stylesheet.",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"udc",
|
|
9
|
+
"jsudc",
|
|
10
|
+
"universal-data-collection",
|
|
11
|
+
"universal-data-collections",
|
|
12
|
+
"data-grid",
|
|
13
|
+
"react",
|
|
14
|
+
"data-table",
|
|
15
|
+
"kanban",
|
|
16
|
+
"calendar",
|
|
17
|
+
"tanstack-query",
|
|
18
|
+
"tailwindcss"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "DigitalCube",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/digital-cube/jsudc-react.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/digital-cube/jsudc-react#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/digital-cube/jsudc-react/issues"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=24"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"*.css"
|
|
35
|
+
],
|
|
36
|
+
"main": "./dist/index.js",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./headless": {
|
|
44
|
+
"types": "./dist/headless.d.ts",
|
|
45
|
+
"default": "./dist/headless.js"
|
|
46
|
+
},
|
|
47
|
+
"./all": {
|
|
48
|
+
"types": "./dist/all.d.ts",
|
|
49
|
+
"default": "./dist/all.js"
|
|
50
|
+
},
|
|
51
|
+
"./table": {
|
|
52
|
+
"types": "./dist/table.d.ts",
|
|
53
|
+
"default": "./dist/table.js"
|
|
54
|
+
},
|
|
55
|
+
"./cards": {
|
|
56
|
+
"types": "./dist/cards.d.ts",
|
|
57
|
+
"default": "./dist/cards.js"
|
|
58
|
+
},
|
|
59
|
+
"./kanban": {
|
|
60
|
+
"types": "./dist/kanban.d.ts",
|
|
61
|
+
"default": "./dist/kanban.js"
|
|
62
|
+
},
|
|
63
|
+
"./calendar": {
|
|
64
|
+
"types": "./dist/calendar.d.ts",
|
|
65
|
+
"default": "./dist/calendar.js"
|
|
66
|
+
},
|
|
67
|
+
"./tree": {
|
|
68
|
+
"types": "./dist/tree.d.ts",
|
|
69
|
+
"default": "./dist/tree.js"
|
|
70
|
+
},
|
|
71
|
+
"./map": {
|
|
72
|
+
"types": "./dist/map.d.ts",
|
|
73
|
+
"default": "./dist/map.js"
|
|
74
|
+
},
|
|
75
|
+
"./chart": {
|
|
76
|
+
"types": "./dist/chart.d.ts",
|
|
77
|
+
"default": "./dist/chart.js"
|
|
78
|
+
},
|
|
79
|
+
"./schema-editor": {
|
|
80
|
+
"types": "./dist/schema-editor.d.ts",
|
|
81
|
+
"default": "./dist/schema-editor.js"
|
|
82
|
+
},
|
|
83
|
+
"./ui": {
|
|
84
|
+
"types": "./dist/ui.d.ts",
|
|
85
|
+
"default": "./dist/ui.js"
|
|
86
|
+
},
|
|
87
|
+
"./react-router": {
|
|
88
|
+
"types": "./dist/react-router.d.ts",
|
|
89
|
+
"default": "./dist/react-router.js"
|
|
90
|
+
},
|
|
91
|
+
"./styles.css": "./dist/styles.css",
|
|
92
|
+
"./tokens.css": "./dist/tokens.css",
|
|
93
|
+
"./package.json": "./package.json"
|
|
94
|
+
},
|
|
95
|
+
"files": [
|
|
96
|
+
"dist",
|
|
97
|
+
"README.md",
|
|
98
|
+
"LICENSE"
|
|
99
|
+
],
|
|
100
|
+
"publishConfig": {
|
|
101
|
+
"access": "public"
|
|
102
|
+
},
|
|
103
|
+
"scripts": {
|
|
104
|
+
"build": "vite build && tsc -p tsconfig.build.json && npm run build:css",
|
|
105
|
+
"build:css": "tailwindcss -i src/styles.css -o dist/styles.css --minify && node -e \"require('node:fs').copyFileSync('src/tokens.css', 'dist/tokens.css')\" && node scripts/check-css.mjs",
|
|
106
|
+
"prepare": "npm run build",
|
|
107
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
108
|
+
"check:types": "tsc -p smoke/tsconfig.nodenext.json && tsc -p smoke/tsconfig.bundler.json",
|
|
109
|
+
"lint": "biome check .",
|
|
110
|
+
"test": "vitest run",
|
|
111
|
+
"test:watch": "vitest"
|
|
112
|
+
},
|
|
113
|
+
"dependencies": {
|
|
114
|
+
"clsx": "^2.1.1",
|
|
115
|
+
"marked": "^18.1.2",
|
|
116
|
+
"tailwind-merge": "^3.7.0"
|
|
117
|
+
},
|
|
118
|
+
"peerDependencies": {
|
|
119
|
+
"@dnd-kit/core": "^6.3.1",
|
|
120
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
121
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
122
|
+
"@jsudc/core": "^0.2.0",
|
|
123
|
+
"@tanstack/react-query": "^5.104.4",
|
|
124
|
+
"@tanstack/react-table": "^8.21.3",
|
|
125
|
+
"leaflet": "^1.9.4",
|
|
126
|
+
"lucide-react": "^1.59.0",
|
|
127
|
+
"radix-ui": "^1.8.1",
|
|
128
|
+
"react": "^19",
|
|
129
|
+
"react-dom": "^19",
|
|
130
|
+
"react-router": "^7",
|
|
131
|
+
"recharts": "^3.10.1"
|
|
132
|
+
},
|
|
133
|
+
"peerDependenciesMeta": {
|
|
134
|
+
"@dnd-kit/core": {
|
|
135
|
+
"optional": true
|
|
136
|
+
},
|
|
137
|
+
"@dnd-kit/sortable": {
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"@dnd-kit/utilities": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"@tanstack/react-table": {
|
|
144
|
+
"optional": true
|
|
145
|
+
},
|
|
146
|
+
"leaflet": {
|
|
147
|
+
"optional": true
|
|
148
|
+
},
|
|
149
|
+
"react-router": {
|
|
150
|
+
"optional": true
|
|
151
|
+
},
|
|
152
|
+
"recharts": {
|
|
153
|
+
"optional": true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"devDependencies": {
|
|
157
|
+
"@biomejs/biome": "^2.5.15",
|
|
158
|
+
"@dnd-kit/core": "^6.3.1",
|
|
159
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
160
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
161
|
+
"@jsudc/core": "^0.1.1",
|
|
162
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
163
|
+
"@tanstack/react-query": "^5.104.4",
|
|
164
|
+
"@tanstack/react-table": "^8.21.3",
|
|
165
|
+
"@testing-library/dom": "^10.4.2",
|
|
166
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
167
|
+
"@testing-library/react": "^16.3.3",
|
|
168
|
+
"@testing-library/user-event": "^14.6.8",
|
|
169
|
+
"@types/leaflet": "^1.9.22",
|
|
170
|
+
"@types/node": "^24",
|
|
171
|
+
"@types/react": "^19.3.0",
|
|
172
|
+
"@types/react-dom": "^19.3.0",
|
|
173
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
174
|
+
"jsdom": "^30.1.3",
|
|
175
|
+
"leaflet": "^1.9.4",
|
|
176
|
+
"lucide-react": "^1.59.0",
|
|
177
|
+
"radix-ui": "^1.8.1",
|
|
178
|
+
"react": "^19.3.1",
|
|
179
|
+
"react-dom": "^19.3.1",
|
|
180
|
+
"react-router": "^7.18.4",
|
|
181
|
+
"recharts": "^3.10.1",
|
|
182
|
+
"tailwindcss": "^4.3.3",
|
|
183
|
+
"typescript": "^5.9.3",
|
|
184
|
+
"vite": "^8.3.4",
|
|
185
|
+
"vitest": "^5.0.5"
|
|
186
|
+
}
|
|
187
|
+
}
|