@marktiderman/genesis-ui 1.2.0 → 1.3.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/dist/{chunk-DGRHPJ3M.js → chunk-44TULYGG.js} +3 -3
- package/dist/{chunk-DGRHPJ3M.js.map → chunk-44TULYGG.js.map} +1 -1
- package/dist/{chunk-AI6CCNWK.js → chunk-6NPEMLBA.js} +2 -2
- package/dist/chunk-6NPEMLBA.js.map +1 -0
- package/dist/{chunk-UKSBLFEK.js → chunk-6VVVGYKS.js} +4 -4
- package/dist/{chunk-UKSBLFEK.js.map → chunk-6VVVGYKS.js.map} +1 -1
- package/dist/chunk-A2OXCNNY.js +65 -0
- package/dist/chunk-A2OXCNNY.js.map +1 -0
- package/dist/{chunk-O4B5ALO7.js → chunk-AUECDWP2.js} +3 -3
- package/dist/{chunk-O4B5ALO7.js.map → chunk-AUECDWP2.js.map} +1 -1
- package/dist/{chunk-FCGFG4RV.js → chunk-D4JTQYP5.js} +3 -3
- package/dist/{chunk-FCGFG4RV.js.map → chunk-D4JTQYP5.js.map} +1 -1
- package/dist/chunk-GCQFVMPI.js +56 -0
- package/dist/chunk-GCQFVMPI.js.map +1 -0
- package/dist/{chunk-LDPPIBIJ.js → chunk-KB5T5LWM.js} +3 -3
- package/dist/{chunk-LDPPIBIJ.js.map → chunk-KB5T5LWM.js.map} +1 -1
- package/dist/{chunk-I6JQHP6D.js → chunk-ZJFSZFPI.js} +4 -2
- package/dist/chunk-ZJFSZFPI.js.map +1 -0
- package/dist/components/data/index.d.ts +186 -20
- package/dist/components/data/index.js +1163 -179
- package/dist/components/data/index.js.map +1 -1
- package/dist/components/ui/button.d.ts +3 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/command-palette.d.ts +30 -0
- package/dist/components/ui/command-palette.js +6 -0
- package/dist/components/ui/command-palette.js.map +1 -0
- package/dist/components/ui/date-picker.js +3 -3
- package/dist/components/ui/pagination.js +2 -2
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/index.js +8 -3
- package/dist/hooks/use-data-filters.d.ts +1 -1
- package/dist/hooks/use-data-filters.js +2 -2
- package/dist/hooks/use-resource-page.d.ts +2 -1
- package/dist/hooks/use-saved-views.d.ts +28 -0
- package/dist/hooks/use-saved-views.js +3 -0
- package/dist/hooks/use-saved-views.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +20 -19
- package/dist/{navigation-qI86Ldug.d.ts → navigation-CpOEyUSb.d.ts} +4 -0
- package/dist/{use-resource-page-B-CFcikK.d.ts → use-resource-page-BXBv_Xah.d.ts} +9 -1
- package/package.json +5 -1
- package/dist/chunk-AI6CCNWK.js.map +0 -1
- package/dist/chunk-I6JQHP6D.js.map +0 -1
|
@@ -1,19 +1,83 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ReactNode, RefObject } from 'react';
|
|
4
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
5
|
import { V as ViewMode } from '../../ViewToggle-DDe_Luj2.js';
|
|
5
6
|
export { a as ViewToggle } from '../../ViewToggle-DDe_Luj2.js';
|
|
6
|
-
import { LucideIcon } from 'lucide-react';
|
|
7
7
|
import { Density } from '../../hooks/use-view-settings.js';
|
|
8
|
-
import { a as ResourceColumnDef } from '../../use-resource-page-
|
|
9
|
-
export { D as DataTable, c as DataTableColumn, d as DataTableProps, L as LinkCell, R as ResourceActions, T as ThumbnailCell } from '../../use-resource-page-
|
|
10
|
-
import { L as LinkComponent, N as NavigateFn } from '../../navigation-
|
|
11
|
-
export { D as DefaultLink, G as GenesisLinkProps, d as defaultNavigate, i as isPathActive } from '../../navigation-
|
|
8
|
+
import { a as ResourceColumnDef } from '../../use-resource-page-BXBv_Xah.js';
|
|
9
|
+
export { D as DataTable, c as DataTableColumn, d as DataTableProps, L as LinkCell, R as ResourceActions, T as ThumbnailCell } from '../../use-resource-page-BXBv_Xah.js';
|
|
10
|
+
import { L as LinkComponent, N as NavigateFn } from '../../navigation-CpOEyUSb.js';
|
|
11
|
+
export { D as DefaultLink, G as GenesisLinkProps, d as defaultNavigate, i as isPathActive } from '../../navigation-CpOEyUSb.js';
|
|
12
12
|
import { UseFormReturn, Control, FieldErrors } from 'react-hook-form';
|
|
13
13
|
import { WizardStep, UseResourceOptions } from '@marktiderman/genesis-core/hooks';
|
|
14
14
|
import { FilterParam } from '@marktiderman/genesis-core/provider';
|
|
15
15
|
import { ResourceFormFieldDef } from '@marktiderman/genesis-core';
|
|
16
16
|
export { FieldType, ResourceFormFieldDef, SelectOption } from '@marktiderman/genesis-core';
|
|
17
|
+
export { CommandPalette, CommandPaletteItem, CommandPaletteProps, useCommandPaletteHotkey } from '../ui/command-palette.js';
|
|
18
|
+
export { UseSavedViewsReturn, useSavedViews } from '../../hooks/use-saved-views.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Declarative chrome for PageHeader — developer defaults + optional
|
|
22
|
+
* in-header user toggles (Notion/Linear “customize view” pattern).
|
|
23
|
+
*
|
|
24
|
+
* @stability Beta
|
|
25
|
+
*/
|
|
26
|
+
interface PageHeaderOptions {
|
|
27
|
+
showIcon?: boolean;
|
|
28
|
+
showSubtitle?: boolean;
|
|
29
|
+
showCount?: boolean;
|
|
30
|
+
showViewToggle?: boolean;
|
|
31
|
+
showViewSettings?: boolean;
|
|
32
|
+
showCreate?: boolean;
|
|
33
|
+
/** Ghost ListFilter control in the actions cluster */
|
|
34
|
+
showDetailsToggle?: boolean;
|
|
35
|
+
/** Quiet hint beside actions while details are collapsed */
|
|
36
|
+
showDetailsHint?: boolean;
|
|
37
|
+
/** Move subtitle into the details panel (default true when details exist) */
|
|
38
|
+
subtitleInDetails?: boolean;
|
|
39
|
+
defaultDetailsOpen?: boolean;
|
|
40
|
+
detailsLabel?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Show the in-header Header options popover so users can customize chrome.
|
|
43
|
+
* Default true when the header has more than one chrome affordance.
|
|
44
|
+
*/
|
|
45
|
+
configurable?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface PageHeaderProps {
|
|
48
|
+
title: string;
|
|
49
|
+
subtitle?: string;
|
|
50
|
+
icon?: LucideIcon;
|
|
51
|
+
/**
|
|
52
|
+
* Header chrome config (developer defaults). Merged under user picks from
|
|
53
|
+
* the in-header options menu when `options.configurable` / storage is on.
|
|
54
|
+
*/
|
|
55
|
+
options?: PageHeaderOptions;
|
|
56
|
+
/** Persist user header-option overrides (localStorage) */
|
|
57
|
+
optionsStorageKey?: string;
|
|
58
|
+
/** Extra trailing actions (after create); prefer first-class slots below */
|
|
59
|
+
actions?: ReactNode;
|
|
60
|
+
/** Collapsible details region below the title row */
|
|
61
|
+
details?: ReactNode;
|
|
62
|
+
detailsOpen?: boolean;
|
|
63
|
+
onDetailsOpenChange?: (open: boolean) => void;
|
|
64
|
+
detailsActive?: boolean;
|
|
65
|
+
detailsHint?: ReactNode;
|
|
66
|
+
/** Count badge */
|
|
67
|
+
count?: number;
|
|
68
|
+
totalCount?: number;
|
|
69
|
+
/** Singular entity for “N rows” copy when unfiltered */
|
|
70
|
+
entityName?: string;
|
|
71
|
+
countActive?: boolean;
|
|
72
|
+
viewMode?: ViewMode;
|
|
73
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
74
|
+
pageSize?: number;
|
|
75
|
+
onPageSizeChange?: (size: number) => void;
|
|
76
|
+
density?: Density;
|
|
77
|
+
onDensityChange?: (density: Density) => void;
|
|
78
|
+
createAction?: ReactNode;
|
|
79
|
+
}
|
|
80
|
+
declare function PageHeader({ title, subtitle, icon: Icon, options: optionsProp, optionsStorageKey, actions, details, detailsOpen, onDetailsOpenChange, detailsActive, detailsHint, count, totalCount, entityName, countActive, viewMode, onViewModeChange, pageSize, onPageSizeChange, density, onDensityChange, createAction, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
17
81
|
|
|
18
82
|
interface DataPageShellProps {
|
|
19
83
|
/** Display title for the page */
|
|
@@ -49,9 +113,26 @@ interface DataPageShellProps {
|
|
|
49
113
|
/** Whether filters are currently active */
|
|
50
114
|
hasActiveFilters?: boolean;
|
|
51
115
|
onClearFilters?: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* When true, filters render inside PageHeader details (collapsed by default).
|
|
118
|
+
* Default false preserves always-visible filters on existing boards.
|
|
119
|
+
*/
|
|
120
|
+
filtersCollapsible?: boolean;
|
|
121
|
+
defaultFiltersOpen?: boolean;
|
|
122
|
+
filtersOpen?: boolean;
|
|
123
|
+
onFiltersOpenChange?: (open: boolean) => void;
|
|
124
|
+
filtersLabel?: string;
|
|
125
|
+
filtersHint?: ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* PageHeader chrome config — developer defaults; users can further
|
|
128
|
+
* customize via the in-header Header options menu.
|
|
129
|
+
*/
|
|
130
|
+
headerOptions?: PageHeaderOptions;
|
|
131
|
+
/** Persist user header-option overrides (localStorage) */
|
|
132
|
+
headerOptionsStorageKey?: string;
|
|
52
133
|
children: ReactNode;
|
|
53
134
|
}
|
|
54
|
-
declare function DataPageShell({ title, icon
|
|
135
|
+
declare function DataPageShell({ title, icon, entityName, subtitle, createAction, isLoading, isEmpty, emptyIcon, emptyMessage, emptyAction, hasError, errorMessage, onRetry, count, totalCount, viewMode, onViewModeChange, pageSize, onPageSizeChange, density, onDensityChange, filters, hasActiveFilters, onClearFilters, filtersCollapsible, defaultFiltersOpen, filtersOpen, onFiltersOpenChange, filtersLabel, filtersHint, headerOptions, headerOptionsStorageKey, children, }: DataPageShellProps): react_jsx_runtime.JSX.Element;
|
|
55
136
|
|
|
56
137
|
interface FilterOption {
|
|
57
138
|
value: string;
|
|
@@ -343,6 +424,11 @@ interface ResourcePageProps<T extends Record<string, unknown> = Record<string, u
|
|
|
343
424
|
onNavigate?: NavigateFn;
|
|
344
425
|
resourceOptions?: UseResourceOptions<T>;
|
|
345
426
|
defaultView?: ViewMode;
|
|
427
|
+
/**
|
|
428
|
+
* Persist key for density / page size via `useViewSettings`.
|
|
429
|
+
* Defaults to `resource` or a slug of `title`.
|
|
430
|
+
*/
|
|
431
|
+
viewSettingsKey?: string;
|
|
346
432
|
}
|
|
347
433
|
declare function ResourcePage<T extends Record<string, unknown> = Record<string, unknown>>(props: ResourcePageProps<T>): react_jsx_runtime.JSX.Element;
|
|
348
434
|
|
|
@@ -409,6 +495,54 @@ interface NavItem {
|
|
|
409
495
|
to: string;
|
|
410
496
|
icon: LucideIcon;
|
|
411
497
|
label: string;
|
|
498
|
+
/** Nested items — rendered as a collapsible group when the rail is expanded */
|
|
499
|
+
children?: NavItem[];
|
|
500
|
+
badge?: string | number;
|
|
501
|
+
disabled?: boolean;
|
|
502
|
+
/** Exact-match active state (e.g. overview `/`) */
|
|
503
|
+
end?: boolean;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Declarative chrome for AppShell — developer defaults + optional
|
|
507
|
+
* in-sidebar user toggles (Notion/Linear “customize chrome” pattern).
|
|
508
|
+
*
|
|
509
|
+
* @stability Beta
|
|
510
|
+
*/
|
|
511
|
+
interface AppShellOptions {
|
|
512
|
+
showLogo?: boolean;
|
|
513
|
+
showAppName?: boolean;
|
|
514
|
+
showThemeToggle?: boolean;
|
|
515
|
+
/** Desktop rail collapse control */
|
|
516
|
+
showCollapse?: boolean;
|
|
517
|
+
showUserSlot?: boolean;
|
|
518
|
+
showFooter?: boolean;
|
|
519
|
+
showSecondaryNav?: boolean;
|
|
520
|
+
/** Mobile fixed bottom tab bar */
|
|
521
|
+
showMobileBottomNav?: boolean;
|
|
522
|
+
defaultCollapsed?: boolean;
|
|
523
|
+
/**
|
|
524
|
+
* Show the in-sidebar Sidebar options popover so users can customize chrome.
|
|
525
|
+
* Default true when collapse / secondary / theme / slots are available.
|
|
526
|
+
*/
|
|
527
|
+
configurable?: boolean;
|
|
528
|
+
/**
|
|
529
|
+
* Toggle keys the developer has decided on and users may not override —
|
|
530
|
+
* e.g. hiding `showThemeToggle` for a brand that manages theme elsewhere.
|
|
531
|
+
* Locked keys are dropped from the options popover and any stored user
|
|
532
|
+
* override for them is ignored on resolve.
|
|
533
|
+
*/
|
|
534
|
+
lockedOptions?: (keyof AppShellOptions)[];
|
|
535
|
+
/** Comfortable (default) vs compact row padding */
|
|
536
|
+
density?: "comfortable" | "compact";
|
|
537
|
+
/** Expanded rail width in rem-ish tokens: narrow ≈ 13rem, wide ≈ 16rem */
|
|
538
|
+
railWidth?: "narrow" | "wide";
|
|
539
|
+
/**
|
|
540
|
+
* Where page content scrolls.
|
|
541
|
+
* - `container` (default): main panel scrolls — classic app-shell chrome.
|
|
542
|
+
* - `window`: document/window scrolls with a sticky rail so React Router
|
|
543
|
+
* `ScrollRestoration` keeps working (dashboard dogfood).
|
|
544
|
+
*/
|
|
545
|
+
scrollRoot?: "container" | "window";
|
|
412
546
|
}
|
|
413
547
|
/**
|
|
414
548
|
* @stability Beta
|
|
@@ -416,14 +550,55 @@ interface NavItem {
|
|
|
416
550
|
interface AppShellProps {
|
|
417
551
|
/** App name shown in sidebar header */
|
|
418
552
|
appName: string;
|
|
419
|
-
/** App logo letter or short text */
|
|
553
|
+
/** App logo letter or short text (ignored when `logo` is set) */
|
|
420
554
|
appLogo?: string;
|
|
421
|
-
/**
|
|
555
|
+
/** Custom logo node — preferred over `appLogo` letter tile */
|
|
556
|
+
logo?: ReactNode;
|
|
557
|
+
/** Primary navigation items */
|
|
422
558
|
navItems: NavItem[];
|
|
559
|
+
/** Secondary nav (e.g. “More”) — rendered below a divider when shown */
|
|
560
|
+
secondaryNavItems?: NavItem[];
|
|
561
|
+
/** Label above secondary nav (default “More”) */
|
|
562
|
+
secondaryNavLabel?: string;
|
|
563
|
+
/**
|
|
564
|
+
* Items for the mobile bottom tab bar. Defaults to top-level `navItems`
|
|
565
|
+
* (no children). Pass a short list for apps with large sidebars; pass `[]`
|
|
566
|
+
* and set `options.showMobileBottomNav: false` to hide.
|
|
567
|
+
*/
|
|
568
|
+
mobileNavItems?: NavItem[];
|
|
569
|
+
/** Slot below the logo row (product switcher, workspace picker, …) */
|
|
570
|
+
headerSlot?: ReactNode;
|
|
571
|
+
/**
|
|
572
|
+
* Compact slot shown in the **collapsed** desktop rail, where `headerSlot`
|
|
573
|
+
* is hidden for space. Use it to keep a core affordance reachable without
|
|
574
|
+
* expanding — e.g. an icon-only product switcher. Omit to hide the header
|
|
575
|
+
* region entirely while collapsed.
|
|
576
|
+
*/
|
|
577
|
+
collapsedHeaderSlot?: ReactNode;
|
|
578
|
+
/** Footer region above the user slot (version, links) */
|
|
579
|
+
footer?: ReactNode;
|
|
580
|
+
/**
|
|
581
|
+
* User / account block at the bottom of the sidebar. When the rail is
|
|
582
|
+
* collapsed, AppShell hides any descendant carrying the
|
|
583
|
+
* `data-shell-user-detail` attribute (e.g. name/email text) so only a
|
|
584
|
+
* compact element (avatar, initial) remains — tag the detail wrapper you
|
|
585
|
+
* want hidden in the collapsed rail with that attribute.
|
|
586
|
+
*/
|
|
587
|
+
userSlot?: ReactNode;
|
|
423
588
|
/** Page content */
|
|
424
589
|
children: ReactNode;
|
|
425
|
-
/**
|
|
590
|
+
/**
|
|
591
|
+
* @deprecated Prefer `options.showThemeToggle`. Kept for sample-app
|
|
592
|
+
* back-compat; merges into resolved options when `options` omits it.
|
|
593
|
+
*/
|
|
426
594
|
showThemeToggle?: boolean;
|
|
595
|
+
/** Chrome config (developer defaults + optional in-sidebar menu) */
|
|
596
|
+
options?: AppShellOptions;
|
|
597
|
+
/** Persist user sidebar-option overrides + collapse state (localStorage) */
|
|
598
|
+
optionsStorageKey?: string;
|
|
599
|
+
/** Controlled collapse (desktop rail) */
|
|
600
|
+
collapsed?: boolean;
|
|
601
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
427
602
|
/**
|
|
428
603
|
* Injectable link component. Defaults to a plain `<a>` (no router). Pass a
|
|
429
604
|
* router adapter — e.g. React Router `({ href, ...p }) => <Link to={href} {...p} />`
|
|
@@ -442,15 +617,6 @@ interface AppShellProps {
|
|
|
442
617
|
*/
|
|
443
618
|
isActive?: (to: string, activePath?: string) => boolean;
|
|
444
619
|
}
|
|
445
|
-
declare function AppShell({ appName, appLogo, navItems, children, showThemeToggle, linkComponent, activePath, isActive, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
446
|
-
|
|
447
|
-
interface PageHeaderProps {
|
|
448
|
-
title: string;
|
|
449
|
-
subtitle?: string;
|
|
450
|
-
icon?: LucideIcon;
|
|
451
|
-
/** Optional action area (buttons, etc.) */
|
|
452
|
-
actions?: ReactNode;
|
|
453
|
-
}
|
|
454
|
-
declare function PageHeader({ title, subtitle, icon: Icon, actions }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
620
|
+
declare function AppShell({ appName, appLogo, logo, navItems, secondaryNavItems, secondaryNavLabel, mobileNavItems, headerSlot, collapsedHeaderSlot, footer, userSlot, children, showThemeToggle: showThemeToggleProp, options: optionsProp, optionsStorageKey, collapsed: collapsedProp, onCollapsedChange, linkComponent, activePath, isActive, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
455
621
|
|
|
456
|
-
export { AppShell, type AppShellProps, BadgeCell, type BulkAction, type ColumnStatus, CurrencyCell, DataBulkBar, type DataFilterConfig, DataFilters, DataGrid, DataList, type DataListProps, DataPageShell, type DataPageShellProps, DateCell, DetailPanel, type DetailPanelProps, EmptyState, FieldArrayRenderer, FileUploadField, FilterCombobox, type FilterOption, KanbanBoard, type KanbanBoardProps, type KanbanColumn, LinkComponent, type NavItem, NavigateFn, NumberCell, PageHeader, type PageHeaderProps, RelationField, ResourceColumnDef, ResourceForm, type ResourceFormProps, ResourcePage, type ResourcePageProps, StatCard, type StatCardColor, type StatCardProps, ViewMode, ViewSettings, WizardForm };
|
|
622
|
+
export { AppShell, type AppShellOptions, type AppShellProps, BadgeCell, type BulkAction, type ColumnStatus, CurrencyCell, DataBulkBar, type DataFilterConfig, DataFilters, DataGrid, DataList, type DataListProps, DataPageShell, type DataPageShellProps, DateCell, Density, DetailPanel, type DetailPanelProps, EmptyState, FieldArrayRenderer, FileUploadField, FilterCombobox, type FilterOption, KanbanBoard, type KanbanBoardProps, type KanbanColumn, LinkComponent, type NavItem, NavigateFn, NumberCell, PageHeader, type PageHeaderOptions, type PageHeaderProps, RelationField, ResourceColumnDef, ResourceForm, type ResourceFormProps, ResourcePage, type ResourcePageProps, type SavedViewItem, StatCard, type StatCardColor, type StatCardProps, ViewMode, ViewSettings, WizardForm };
|