@marktiderman/genesis-ui 1.3.0 → 2.0.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/AppShell-BJarYZzz.d.ts +198 -0
- package/dist/{chunk-NJMO3VPA.js → chunk-22XB3Q6H.js} +8 -8
- package/dist/chunk-22XB3Q6H.js.map +1 -0
- package/dist/{chunk-2MXMWBDV.js → chunk-27ELYTGE.js} +6 -6
- package/dist/chunk-27ELYTGE.js.map +1 -0
- package/dist/chunk-46TZGMFW.js +159 -0
- package/dist/chunk-46TZGMFW.js.map +1 -0
- package/dist/chunk-4CQHPWJD.js +117 -0
- package/dist/chunk-4CQHPWJD.js.map +1 -0
- package/dist/{chunk-ZDAT5JDH.js → chunk-65SPT7EA.js} +24 -6
- package/dist/chunk-65SPT7EA.js.map +1 -0
- package/dist/chunk-6KHY647C.js +67 -0
- package/dist/chunk-6KHY647C.js.map +1 -0
- package/dist/chunk-6M4NHHKG.js +51 -0
- package/dist/chunk-6M4NHHKG.js.map +1 -0
- package/dist/chunk-6Q6CLLJ4.js +9 -0
- package/dist/chunk-6Q6CLLJ4.js.map +1 -0
- package/dist/{chunk-UGHQFQOE.js → chunk-6TVMQH6M.js} +28 -28
- package/dist/chunk-6TVMQH6M.js.map +1 -0
- package/dist/{chunk-6VVVGYKS.js → chunk-6XPMU65K.js} +5 -5
- package/dist/{chunk-6VVVGYKS.js.map → chunk-6XPMU65K.js.map} +1 -1
- package/dist/{chunk-YZEA5TGK.js → chunk-7XMZVISM.js} +16 -16
- package/dist/chunk-7XMZVISM.js.map +1 -0
- package/dist/chunk-A7AHVDG7.js +52 -0
- package/dist/chunk-A7AHVDG7.js.map +1 -0
- package/dist/chunk-AFZ76Q26.js +84 -0
- package/dist/chunk-AFZ76Q26.js.map +1 -0
- package/dist/{chunk-4V4H2ZM7.js → chunk-AL5TMEZQ.js} +31 -31
- package/dist/chunk-AL5TMEZQ.js.map +1 -0
- package/dist/{chunk-AUECDWP2.js → chunk-AOZGQM6W.js} +3 -3
- package/dist/chunk-AOZGQM6W.js.map +1 -0
- package/dist/chunk-ARJI2JUV.js +122 -0
- package/dist/chunk-ARJI2JUV.js.map +1 -0
- package/dist/chunk-AVFZ4P4B.js +25 -0
- package/dist/chunk-AVFZ4P4B.js.map +1 -0
- package/dist/chunk-B2GIBUQD.js +11 -0
- package/dist/chunk-B2GIBUQD.js.map +1 -0
- package/dist/{chunk-JXI2MYL3.js → chunk-C46ITXE4.js} +5 -5
- package/dist/chunk-C46ITXE4.js.map +1 -0
- package/dist/{chunk-A2OXCNNY.js → chunk-CNTWQSUT.js} +3 -3
- package/dist/{chunk-A2OXCNNY.js.map → chunk-CNTWQSUT.js.map} +1 -1
- package/dist/chunk-D2LIXA2Y.js +65 -0
- package/dist/chunk-D2LIXA2Y.js.map +1 -0
- package/dist/{chunk-T5VX5DYO.js → chunk-F47U5KNW.js} +5 -5
- package/dist/chunk-F47U5KNW.js.map +1 -0
- package/dist/chunk-FEJAZFP3.js +1100 -0
- package/dist/chunk-FEJAZFP3.js.map +1 -0
- package/dist/{chunk-2B3MFHBQ.js → chunk-FK42ZGGV.js} +21 -21
- package/dist/chunk-FK42ZGGV.js.map +1 -0
- package/dist/{chunk-XISSLIMH.js → chunk-FTTNGGLA.js} +2 -2
- package/dist/{chunk-XISSLIMH.js.map → chunk-FTTNGGLA.js.map} +1 -1
- package/dist/chunk-G5YKBPBF.js +74 -0
- package/dist/chunk-G5YKBPBF.js.map +1 -0
- package/dist/{chunk-KB5T5LWM.js → chunk-IJCT5IJD.js} +3 -3
- package/dist/{chunk-KB5T5LWM.js.map → chunk-IJCT5IJD.js.map} +1 -1
- package/dist/{chunk-44TULYGG.js → chunk-J6FBA7PH.js} +3 -3
- package/dist/{chunk-44TULYGG.js.map → chunk-J6FBA7PH.js.map} +1 -1
- package/dist/chunk-JAMLFMDS.js +12 -0
- package/dist/chunk-JAMLFMDS.js.map +1 -0
- package/dist/{chunk-C6H7AMO4.js → chunk-LNFF2RBD.js} +9 -9
- package/dist/chunk-LNFF2RBD.js.map +1 -0
- package/dist/{chunk-QBZMY2AF.js → chunk-M62CHO3N.js} +18 -18
- package/dist/chunk-M62CHO3N.js.map +1 -0
- package/dist/{chunk-5Q4FABZQ.js → chunk-NUXW6NPP.js} +8 -8
- package/dist/chunk-NUXW6NPP.js.map +1 -0
- package/dist/{chunk-ZJFSZFPI.js → chunk-NWSCYLPT.js} +77 -18
- package/dist/chunk-NWSCYLPT.js.map +1 -0
- package/dist/{chunk-63FW5ZUA.js → chunk-P3ZL6FGR.js} +7 -7
- package/dist/chunk-P3ZL6FGR.js.map +1 -0
- package/dist/chunk-P64MFQXZ.js +191 -0
- package/dist/chunk-P64MFQXZ.js.map +1 -0
- package/dist/chunk-PLIYF6KI.js +52 -0
- package/dist/chunk-PLIYF6KI.js.map +1 -0
- package/dist/chunk-PSR47JRA.js +26 -0
- package/dist/chunk-PSR47JRA.js.map +1 -0
- package/dist/{chunk-QLCDAFS7.js → chunk-Q4I4SFBD.js} +3 -3
- package/dist/chunk-Q4I4SFBD.js.map +1 -0
- package/dist/{chunk-SBJV3K4G.js → chunk-QJ6P2DW6.js} +28 -28
- package/dist/chunk-QJ6P2DW6.js.map +1 -0
- package/dist/{chunk-IP6TMT3D.js → chunk-R7QFP6EL.js} +3 -3
- package/dist/chunk-R7QFP6EL.js.map +1 -0
- package/dist/{chunk-WZWR2ELB.js → chunk-SEBU6JCK.js} +6 -6
- package/dist/chunk-SEBU6JCK.js.map +1 -0
- package/dist/{chunk-7OBL3H5P.js → chunk-SEFK4NZV.js} +3 -3
- package/dist/chunk-SEFK4NZV.js.map +1 -0
- package/dist/chunk-SRIT4NFQ.js +67 -0
- package/dist/chunk-SRIT4NFQ.js.map +1 -0
- package/dist/chunk-SY62XJFA.js +19 -0
- package/dist/chunk-SY62XJFA.js.map +1 -0
- package/dist/{chunk-SVXDWPLO.js → chunk-THD3YOOZ.js} +17 -17
- package/dist/chunk-THD3YOOZ.js.map +1 -0
- package/dist/chunk-VXFYETRK.js +58 -0
- package/dist/chunk-VXFYETRK.js.map +1 -0
- package/dist/chunk-XBX6QMR5.js +58 -0
- package/dist/chunk-XBX6QMR5.js.map +1 -0
- package/dist/{chunk-SCUT2ZCD.js → chunk-XCGZPFT7.js} +17 -17
- package/dist/chunk-XCGZPFT7.js.map +1 -0
- package/dist/chunk-XMK3T4TA.js +73 -0
- package/dist/chunk-XMK3T4TA.js.map +1 -0
- package/dist/chunk-YJ6MPS6U.js +226 -0
- package/dist/chunk-YJ6MPS6U.js.map +1 -0
- package/dist/chunk-YRYQXU3G.js +38 -0
- package/dist/chunk-YRYQXU3G.js.map +1 -0
- package/dist/{chunk-5J7BP5DI.js → chunk-YWFPMND7.js} +10 -10
- package/dist/chunk-YWFPMND7.js.map +1 -0
- package/dist/chunk-YYEGAFUE.js +94 -0
- package/dist/chunk-YYEGAFUE.js.map +1 -0
- package/dist/{chunk-TKA4LOMT.js → chunk-ZZ7H7VVX.js} +8 -8
- package/dist/chunk-ZZ7H7VVX.js.map +1 -0
- package/dist/components/data/index.d.ts +194 -211
- package/dist/components/data/index.js +362 -1381
- package/dist/components/data/index.js.map +1 -1
- package/dist/components/layout/dashboard-page.d.ts +4 -0
- package/dist/components/layout/dashboard-page.js +5 -0
- package/dist/components/layout/dashboard-page.js.map +1 -0
- package/dist/components/layout/detail-page.d.ts +91 -0
- package/dist/components/layout/detail-page.js +6 -0
- package/dist/components/layout/detail-page.js.map +1 -0
- package/dist/components/layout/form-page.d.ts +82 -0
- package/dist/components/layout/form-page.js +5 -0
- package/dist/components/layout/form-page.js.map +1 -0
- package/dist/components/layout/index.d.ts +15 -0
- package/dist/components/layout/index.js +21 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/settings-page.d.ts +114 -0
- package/dist/components/layout/settings-page.js +6 -0
- package/dist/components/layout/settings-page.js.map +1 -0
- package/dist/components/patterns/empty-state.d.ts +74 -0
- package/dist/components/{ui → patterns}/empty-state.js +2 -1
- package/dist/components/{ui → patterns}/form-field.d.ts +2 -2
- package/dist/components/{ui → patterns}/form-field.js +2 -2
- package/dist/components/patterns/index.d.ts +18 -0
- package/dist/components/patterns/index.js +18 -0
- package/dist/components/patterns/index.js.map +1 -0
- package/dist/components/patterns/page-loading.d.ts +25 -0
- package/dist/components/patterns/page-loading.js +5 -0
- package/dist/components/patterns/page-loading.js.map +1 -0
- package/dist/components/patterns/settings-row.d.ts +42 -0
- package/dist/components/patterns/settings-row.js +6 -0
- package/dist/components/patterns/settings-row.js.map +1 -0
- package/dist/components/patterns/status-badge.d.ts +38 -0
- package/dist/components/patterns/status-badge.js +4 -0
- package/dist/components/patterns/status-badge.js.map +1 -0
- package/dist/components/patterns/toggle-row.d.ts +36 -0
- package/dist/components/patterns/toggle-row.js +8 -0
- package/dist/components/patterns/toggle-row.js.map +1 -0
- package/dist/components/patterns/user-avatar.d.ts +34 -0
- package/dist/components/patterns/user-avatar.js +5 -0
- package/dist/components/patterns/user-avatar.js.map +1 -0
- package/dist/components/ui/accessible-icon.d.ts +48 -0
- package/dist/components/ui/accessible-icon.js +3 -0
- package/dist/components/ui/accessible-icon.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +5 -5
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.d.ts +10 -10
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +2 -2
- package/dist/components/ui/aspect-ratio.js +1 -1
- package/dist/components/ui/avatar.d.ts +4 -4
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/button.d.ts +73 -8
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/carousel.d.ts +4 -3
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/collapsible.d.ts +4 -4
- package/dist/components/ui/collapsible.js +1 -1
- package/dist/components/ui/command-palette.js +3 -3
- package/dist/components/ui/command.d.ts +9 -9
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/context-menu.d.ts +15 -15
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/date-picker.js +4 -4
- package/dist/components/ui/dialog.d.ts +9 -9
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/drawer.d.ts +7 -7
- package/dist/components/ui/dropdown-menu.d.ts +15 -15
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/hover-card.d.ts +4 -4
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/input-otp.d.ts +2 -2
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.d.ts +16 -16
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/navigation-menu.d.ts +9 -9
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/password-toggle-field.d.ts +121 -0
- package/dist/components/ui/password-toggle-field.js +4 -0
- package/dist/components/ui/password-toggle-field.js.map +1 -0
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/radio-group.d.ts +3 -3
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/scroll-area.d.ts +60 -3
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/select.d.ts +9 -9
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.d.ts +11 -9
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/tabs.d.ts +29 -14
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toggle-group.d.ts +3 -3
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/toolbar.d.ts +104 -0
- package/dist/components/ui/toolbar.js +6 -0
- package/dist/components/ui/toolbar.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +46 -4
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/visually-hidden.d.ts +48 -0
- package/dist/components/ui/visually-hidden.js +4 -0
- package/dist/components/ui/visually-hidden.js.map +1 -0
- package/dist/dashboard-page-C0TihRl5.d.ts +107 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/use-keyboard-navigation.d.ts +58 -2
- package/dist/hooks/use-keyboard-navigation.js +1 -1
- package/dist/hooks/use-resource-page.d.ts +2 -2
- package/dist/hooks/use-resource-page.js +2 -2
- package/dist/hooks/use-view-preference.d.ts +1 -1
- package/dist/hooks/use-view-preference.js +1 -1
- package/dist/index.d.ts +23 -25
- package/dist/index.js +54 -38
- package/dist/spacing-BS6qECD4.d.ts +191 -0
- package/dist/split-Dk9f4Mi0.d.ts +57 -0
- package/dist/{use-resource-page-BXBv_Xah.d.ts → use-resource-page-CPs6wjKt.d.ts} +1 -1
- package/dist/view-settings--KXNT_jE.d.ts +12 -0
- package/package.json +73 -32
- package/dist/chunk-2B3MFHBQ.js.map +0 -1
- package/dist/chunk-2MXMWBDV.js.map +0 -1
- package/dist/chunk-4V4H2ZM7.js.map +0 -1
- package/dist/chunk-5J7BP5DI.js.map +0 -1
- package/dist/chunk-5Q4FABZQ.js.map +0 -1
- package/dist/chunk-63FW5ZUA.js.map +0 -1
- package/dist/chunk-7OBL3H5P.js.map +0 -1
- package/dist/chunk-AUECDWP2.js.map +0 -1
- package/dist/chunk-C6H7AMO4.js.map +0 -1
- package/dist/chunk-EI5EGKHL.js +0 -32
- package/dist/chunk-EI5EGKHL.js.map +0 -1
- package/dist/chunk-IP6TMT3D.js.map +0 -1
- package/dist/chunk-JJ4NOMMI.js +0 -73
- package/dist/chunk-JJ4NOMMI.js.map +0 -1
- package/dist/chunk-JXI2MYL3.js.map +0 -1
- package/dist/chunk-KBS4BHME.js +0 -11
- package/dist/chunk-KBS4BHME.js.map +0 -1
- package/dist/chunk-LRXDZBV2.js +0 -26
- package/dist/chunk-LRXDZBV2.js.map +0 -1
- package/dist/chunk-NJMO3VPA.js.map +0 -1
- package/dist/chunk-OCTV3S4I.js +0 -29
- package/dist/chunk-OCTV3S4I.js.map +0 -1
- package/dist/chunk-QBZMY2AF.js.map +0 -1
- package/dist/chunk-QLCDAFS7.js.map +0 -1
- package/dist/chunk-SBJV3K4G.js.map +0 -1
- package/dist/chunk-SCUT2ZCD.js.map +0 -1
- package/dist/chunk-SVXDWPLO.js.map +0 -1
- package/dist/chunk-T465NJRL.js +0 -134
- package/dist/chunk-T465NJRL.js.map +0 -1
- package/dist/chunk-T5VX5DYO.js.map +0 -1
- package/dist/chunk-TKA4LOMT.js.map +0 -1
- package/dist/chunk-UGHQFQOE.js.map +0 -1
- package/dist/chunk-WALXVR6V.js +0 -9
- package/dist/chunk-WALXVR6V.js.map +0 -1
- package/dist/chunk-WZWR2ELB.js.map +0 -1
- package/dist/chunk-YZEA5TGK.js.map +0 -1
- package/dist/chunk-ZDAT5JDH.js.map +0 -1
- package/dist/chunk-ZJFSZFPI.js.map +0 -1
- package/dist/components/ui/empty-state.d.ts +0 -22
- /package/dist/components/{ui → patterns}/empty-state.js.map +0 -0
- /package/dist/components/{ui → patterns}/form-field.js.map +0 -0
- /package/dist/{ViewToggle-DDe_Luj2.d.ts → view-toggle-DDe_Luj2.d.ts} +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
|
+
import { V as ViewMode } from './view-toggle-DDe_Luj2.js';
|
|
5
|
+
import { Density } from './hooks/use-view-settings.js';
|
|
6
|
+
import { L as LinkComponent } from './navigation-CpOEyUSb.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Declarative chrome for PageHeader — developer defaults + optional
|
|
10
|
+
* in-header user toggles (Notion/Linear “customize view” pattern).
|
|
11
|
+
*
|
|
12
|
+
* @stability Beta
|
|
13
|
+
*/
|
|
14
|
+
interface PageHeaderOptions {
|
|
15
|
+
showIcon?: boolean;
|
|
16
|
+
showSubtitle?: boolean;
|
|
17
|
+
showCount?: boolean;
|
|
18
|
+
showViewToggle?: boolean;
|
|
19
|
+
showViewSettings?: boolean;
|
|
20
|
+
showCreate?: boolean;
|
|
21
|
+
/** Ghost ListFilter control in the actions cluster */
|
|
22
|
+
showDetailsToggle?: boolean;
|
|
23
|
+
/** Quiet hint beside actions while details are collapsed */
|
|
24
|
+
showDetailsHint?: boolean;
|
|
25
|
+
/** Move subtitle into the details panel (default true when details exist) */
|
|
26
|
+
subtitleInDetails?: boolean;
|
|
27
|
+
defaultDetailsOpen?: boolean;
|
|
28
|
+
detailsLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Show the in-header Header options popover so users can customize chrome.
|
|
31
|
+
* Default true when the header has more than one chrome affordance.
|
|
32
|
+
*/
|
|
33
|
+
configurable?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface PageHeaderProps {
|
|
36
|
+
title: string;
|
|
37
|
+
subtitle?: string;
|
|
38
|
+
icon?: LucideIcon;
|
|
39
|
+
/**
|
|
40
|
+
* Header chrome config (developer defaults). Merged under user picks from
|
|
41
|
+
* the in-header options menu when `options.configurable` / storage is on.
|
|
42
|
+
*/
|
|
43
|
+
options?: PageHeaderOptions;
|
|
44
|
+
/** Persist user header-option overrides (localStorage) */
|
|
45
|
+
optionsStorageKey?: string;
|
|
46
|
+
/** Extra trailing actions (after create); prefer first-class slots below */
|
|
47
|
+
actions?: ReactNode;
|
|
48
|
+
/** Collapsible details region below the title row */
|
|
49
|
+
details?: ReactNode;
|
|
50
|
+
detailsOpen?: boolean;
|
|
51
|
+
onDetailsOpenChange?: (open: boolean) => void;
|
|
52
|
+
detailsActive?: boolean;
|
|
53
|
+
detailsHint?: ReactNode;
|
|
54
|
+
/** Count badge */
|
|
55
|
+
count?: number;
|
|
56
|
+
totalCount?: number;
|
|
57
|
+
/** Singular entity for “N rows” copy when unfiltered */
|
|
58
|
+
entityName?: string;
|
|
59
|
+
countActive?: boolean;
|
|
60
|
+
viewMode?: ViewMode;
|
|
61
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
62
|
+
pageSize?: number;
|
|
63
|
+
onPageSizeChange?: (size: number) => void;
|
|
64
|
+
density?: Density;
|
|
65
|
+
onDensityChange?: (density: Density) => void;
|
|
66
|
+
createAction?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
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;
|
|
69
|
+
|
|
70
|
+
interface NavItem {
|
|
71
|
+
to: string;
|
|
72
|
+
icon: LucideIcon;
|
|
73
|
+
label: string;
|
|
74
|
+
/** Nested items — rendered as a collapsible group when the rail is expanded */
|
|
75
|
+
children?: NavItem[];
|
|
76
|
+
badge?: string | number;
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/** Exact-match active state (e.g. overview `/`) */
|
|
79
|
+
end?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Declarative chrome for AppShell — developer defaults + optional
|
|
83
|
+
* in-sidebar user toggles (Notion/Linear “customize chrome” pattern).
|
|
84
|
+
*
|
|
85
|
+
* @stability Beta
|
|
86
|
+
*/
|
|
87
|
+
interface AppShellOptions {
|
|
88
|
+
showLogo?: boolean;
|
|
89
|
+
showAppName?: boolean;
|
|
90
|
+
showThemeToggle?: boolean;
|
|
91
|
+
/** Desktop rail collapse control */
|
|
92
|
+
showCollapse?: boolean;
|
|
93
|
+
showUserSlot?: boolean;
|
|
94
|
+
showFooter?: boolean;
|
|
95
|
+
showSecondaryNav?: boolean;
|
|
96
|
+
/** Mobile fixed bottom tab bar */
|
|
97
|
+
showMobileBottomNav?: boolean;
|
|
98
|
+
defaultCollapsed?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Show the in-sidebar Sidebar options popover so users can customize chrome.
|
|
101
|
+
* Default true when collapse / secondary / theme / slots are available.
|
|
102
|
+
*/
|
|
103
|
+
configurable?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Toggle keys the developer has decided on and users may not override —
|
|
106
|
+
* e.g. hiding `showThemeToggle` for a brand that manages theme elsewhere.
|
|
107
|
+
* Locked keys are dropped from the options popover and any stored user
|
|
108
|
+
* override for them is ignored on resolve.
|
|
109
|
+
*/
|
|
110
|
+
lockedOptions?: (keyof AppShellOptions)[];
|
|
111
|
+
/** Comfortable (default) vs compact row padding */
|
|
112
|
+
density?: "comfortable" | "compact";
|
|
113
|
+
/** Expanded rail width in rem-ish tokens: narrow ≈ 13rem, wide ≈ 16rem */
|
|
114
|
+
railWidth?: "narrow" | "wide";
|
|
115
|
+
/**
|
|
116
|
+
* Where page content scrolls.
|
|
117
|
+
* - `container` (default): main panel scrolls — classic app-shell chrome.
|
|
118
|
+
* - `window`: document/window scrolls with a sticky rail so React Router
|
|
119
|
+
* `ScrollRestoration` keeps working (dashboard dogfood).
|
|
120
|
+
*/
|
|
121
|
+
scrollRoot?: "container" | "window";
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @stability Beta
|
|
125
|
+
*/
|
|
126
|
+
interface AppShellProps {
|
|
127
|
+
/** App name shown in sidebar header */
|
|
128
|
+
appName: string;
|
|
129
|
+
/** App logo letter or short text (ignored when `logo` is set) */
|
|
130
|
+
appLogo?: string;
|
|
131
|
+
/** Custom logo node — preferred over `appLogo` letter tile */
|
|
132
|
+
logo?: ReactNode;
|
|
133
|
+
/** Primary navigation items */
|
|
134
|
+
navItems: NavItem[];
|
|
135
|
+
/** Secondary nav (e.g. “More”) — rendered below a divider when shown */
|
|
136
|
+
secondaryNavItems?: NavItem[];
|
|
137
|
+
/** Label above secondary nav (default “More”) */
|
|
138
|
+
secondaryNavLabel?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Items for the mobile bottom tab bar. Defaults to top-level `navItems`
|
|
141
|
+
* (no children). Pass a short list for apps with large sidebars; pass `[]`
|
|
142
|
+
* and set `options.showMobileBottomNav: false` to hide.
|
|
143
|
+
*/
|
|
144
|
+
mobileNavItems?: NavItem[];
|
|
145
|
+
/** Slot below the logo row (product switcher, workspace picker, …) */
|
|
146
|
+
headerSlot?: ReactNode;
|
|
147
|
+
/**
|
|
148
|
+
* Compact slot shown in the **collapsed** desktop rail, where `headerSlot`
|
|
149
|
+
* is hidden for space. Use it to keep a core affordance reachable without
|
|
150
|
+
* expanding — e.g. an icon-only product switcher. Omit to hide the header
|
|
151
|
+
* region entirely while collapsed.
|
|
152
|
+
*/
|
|
153
|
+
collapsedHeaderSlot?: ReactNode;
|
|
154
|
+
/** Footer region above the user slot (version, links) */
|
|
155
|
+
footer?: ReactNode;
|
|
156
|
+
/**
|
|
157
|
+
* User / account block at the bottom of the sidebar. When the rail is
|
|
158
|
+
* collapsed, AppShell hides any descendant carrying the
|
|
159
|
+
* `data-shell-user-detail` attribute (e.g. name/email text) so only a
|
|
160
|
+
* compact element (avatar, initial) remains — tag the detail wrapper you
|
|
161
|
+
* want hidden in the collapsed rail with that attribute.
|
|
162
|
+
*/
|
|
163
|
+
userSlot?: ReactNode;
|
|
164
|
+
/** Page content */
|
|
165
|
+
children: ReactNode;
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated Prefer `options.showThemeToggle`. Kept for sample-app
|
|
168
|
+
* back-compat; merges into resolved options when `options` omits it.
|
|
169
|
+
*/
|
|
170
|
+
showThemeToggle?: boolean;
|
|
171
|
+
/** Chrome config (developer defaults + optional in-sidebar menu) */
|
|
172
|
+
options?: AppShellOptions;
|
|
173
|
+
/** Persist user sidebar-option overrides + collapse state (localStorage) */
|
|
174
|
+
optionsStorageKey?: string;
|
|
175
|
+
/** Controlled collapse (desktop rail) */
|
|
176
|
+
collapsed?: boolean;
|
|
177
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
178
|
+
/**
|
|
179
|
+
* Injectable link component. Defaults to a plain `<a>` (no router). Pass a
|
|
180
|
+
* router adapter — e.g. React Router `({ href, ...p }) => <Link to={href} {...p} />`
|
|
181
|
+
* or Next.js `next/link` — to get client-side navigation.
|
|
182
|
+
*/
|
|
183
|
+
linkComponent?: LinkComponent;
|
|
184
|
+
/**
|
|
185
|
+
* Current path used to highlight the active nav item. Router consumers pass
|
|
186
|
+
* `useLocation().pathname` (RR) or `usePathname()` (Next). Omit to disable
|
|
187
|
+
* active highlighting.
|
|
188
|
+
*/
|
|
189
|
+
activePath?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Optional custom active-state matcher. Defaults to a prefix match (with `/`
|
|
192
|
+
* treated as exact), mirroring React Router `NavLink`.
|
|
193
|
+
*/
|
|
194
|
+
isActive?: (to: string, activePath?: string) => boolean;
|
|
195
|
+
}
|
|
196
|
+
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;
|
|
197
|
+
|
|
198
|
+
export { AppShell as A, type NavItem as N, PageHeader as P, type AppShellOptions as a, type AppShellProps as b, type PageHeaderOptions as c, type PageHeaderProps as d };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { Popover as Popover$1 } from 'radix-ui';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var Popover =
|
|
8
|
-
var PopoverTrigger =
|
|
9
|
-
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
-
|
|
7
|
+
var Popover = Popover$1.Root;
|
|
8
|
+
var PopoverTrigger = Popover$1.Trigger;
|
|
9
|
+
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
10
|
+
Popover$1.Content,
|
|
11
11
|
{
|
|
12
12
|
ref,
|
|
13
13
|
align,
|
|
@@ -19,8 +19,8 @@ var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset
|
|
|
19
19
|
...props
|
|
20
20
|
}
|
|
21
21
|
) }));
|
|
22
|
-
PopoverContent.displayName =
|
|
22
|
+
PopoverContent.displayName = Popover$1.Content.displayName;
|
|
23
23
|
|
|
24
24
|
export { Popover, PopoverContent, PopoverTrigger };
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-22XB3Q6H.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-22XB3Q6H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/popover.tsx"],"names":["PopoverPrimitive"],"mappings":";;;;;AAOA,IAAM,UAAUA,SAAA,CAAiB;AACjC,IAAM,iBAAiBA,SAAA,CAAiB;AAExC,IAAM,iBAAuB,KAAA,CAAA,UAAA,CAG3B,CAAC,EAAE,SAAA,EAAW,QAAQ,QAAA,EAAU,UAAA,GAAa,CAAA,EAAG,GAAG,OAAM,EAAG,GAAA,qBAC5D,GAAA,CAACA,SAAA,CAAiB,QAAjB,EACC,QAAA,kBAAA,GAAA;AAAA,EAACA,SAAA,CAAiB,OAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,4aAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CAAA,EACF,CACD;AACD,cAAA,CAAe,WAAA,GAAcA,UAAiB,OAAA,CAAQ,WAAA","file":"chunk-22XB3Q6H.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\n\nimport { cn } from \"../../utils\";\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { Switch as Switch$1 } from 'radix-ui';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
-
|
|
8
|
+
Switch$1.Root,
|
|
9
9
|
{
|
|
10
10
|
className: cn(
|
|
11
11
|
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
@@ -14,7 +14,7 @@ var Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
14
14
|
...props,
|
|
15
15
|
ref,
|
|
16
16
|
children: /* @__PURE__ */ jsx(
|
|
17
|
-
|
|
17
|
+
Switch$1.Thumb,
|
|
18
18
|
{
|
|
19
19
|
className: cn(
|
|
20
20
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
@@ -23,8 +23,8 @@ var Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
));
|
|
26
|
-
Switch.displayName =
|
|
26
|
+
Switch.displayName = Switch$1.Root.displayName;
|
|
27
27
|
|
|
28
28
|
export { Switch };
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-27ELYTGE.js.map
|
|
30
|
+
//# sourceMappingURL=chunk-27ELYTGE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/switch.tsx"],"names":["SwitchPrimitive"],"mappings":";;;;;AAMA,IAAM,MAAA,GAAe,iBAGnB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,QAAA,CAAgB,IAAA;AAAA,EAAhB;AAAA,IACC,SAAA,EAAW,EAAA;AAAA,MACT,oXAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IACJ,GAAA;AAAA,IAEA,QAAA,kBAAA,GAAA;AAAA,MAACA,QAAA,CAAgB,KAAA;AAAA,MAAhB;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT;AAAA;AACF;AAAA;AACF;AACF,CACD;AACD,MAAA,CAAO,WAAA,GAAcA,SAAgB,IAAA,CAAK,WAAA","file":"chunk-27ELYTGE.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Switch as SwitchPrimitive } from \"radix-ui\";\nimport { cn } from \"../../utils\";\n\nconst Switch = React.forwardRef<\n React.ComponentRef<typeof SwitchPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitive.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitive.Root>\n));\nSwitch.displayName = SwitchPrimitive.Root.displayName;\n\nexport { Switch };\n"]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-FK42ZGGV.js';
|
|
2
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-22XB3Q6H.js';
|
|
3
|
+
import { Button } from './chunk-NWSCYLPT.js';
|
|
4
|
+
import { LayoutGrid, Table2, List, Settings2 } from 'lucide-react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { useId } from 'react';
|
|
7
|
+
|
|
8
|
+
function ViewToggle({ viewMode, onViewModeChange }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: "flex items-center border rounded-lg overflow-hidden",
|
|
13
|
+
role: "group",
|
|
14
|
+
"aria-label": "View mode",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
variant: viewMode === "grid" ? "default" : "ghost",
|
|
20
|
+
size: "icon",
|
|
21
|
+
className: "h-8 w-8 rounded-none",
|
|
22
|
+
onClick: () => onViewModeChange("grid"),
|
|
23
|
+
title: "Grid view",
|
|
24
|
+
"aria-label": "Grid view",
|
|
25
|
+
"aria-pressed": viewMode === "grid",
|
|
26
|
+
testID: "view-toggle-grid",
|
|
27
|
+
children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Button,
|
|
32
|
+
{
|
|
33
|
+
variant: viewMode === "table" ? "default" : "ghost",
|
|
34
|
+
size: "icon",
|
|
35
|
+
className: "h-8 w-8 rounded-none",
|
|
36
|
+
onClick: () => onViewModeChange("table"),
|
|
37
|
+
title: "Table view",
|
|
38
|
+
"aria-label": "Table view",
|
|
39
|
+
"aria-pressed": viewMode === "table",
|
|
40
|
+
testID: "view-toggle-table",
|
|
41
|
+
children: /* @__PURE__ */ jsx(Table2, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
variant: viewMode === "list" ? "default" : "ghost",
|
|
48
|
+
size: "icon",
|
|
49
|
+
className: "h-8 w-8 rounded-none",
|
|
50
|
+
onClick: () => onViewModeChange("list"),
|
|
51
|
+
title: "List view",
|
|
52
|
+
"aria-label": "List view",
|
|
53
|
+
"aria-pressed": viewMode === "list",
|
|
54
|
+
testID: "view-toggle-list",
|
|
55
|
+
children: /* @__PURE__ */ jsx(List, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
var PAGE_SIZE_OPTIONS = [10, 25, 50, 100];
|
|
63
|
+
var DENSITY_OPTIONS = [
|
|
64
|
+
{ value: "compact", label: "Compact" },
|
|
65
|
+
{ value: "comfortable", label: "Comfortable" },
|
|
66
|
+
{ value: "spacious", label: "Spacious" }
|
|
67
|
+
];
|
|
68
|
+
function ViewSettings({
|
|
69
|
+
pageSize,
|
|
70
|
+
onPageSizeChange,
|
|
71
|
+
density,
|
|
72
|
+
onDensityChange
|
|
73
|
+
}) {
|
|
74
|
+
const baseId = useId();
|
|
75
|
+
const pageSizeLabelId = `${baseId}-page-size`;
|
|
76
|
+
const densityLabelId = `${baseId}-density`;
|
|
77
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
79
|
+
Button,
|
|
80
|
+
{
|
|
81
|
+
variant: "ghost",
|
|
82
|
+
size: "icon",
|
|
83
|
+
className: "h-8 w-8",
|
|
84
|
+
title: "View settings",
|
|
85
|
+
"aria-label": "View settings",
|
|
86
|
+
testID: "view-settings-trigger",
|
|
87
|
+
children: /* @__PURE__ */ jsx(Settings2, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
88
|
+
}
|
|
89
|
+
) }),
|
|
90
|
+
/* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-56 space-y-4", children: [
|
|
91
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold", children: "Display Settings" }),
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
id: pageSizeLabelId,
|
|
97
|
+
className: "block text-xs text-muted-foreground",
|
|
98
|
+
children: "Page size"
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsxs(
|
|
102
|
+
Select,
|
|
103
|
+
{
|
|
104
|
+
value: String(pageSize),
|
|
105
|
+
onValueChange: (v) => onPageSizeChange(Number(v)),
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
SelectTrigger,
|
|
109
|
+
{
|
|
110
|
+
className: "h-8 text-xs",
|
|
111
|
+
"aria-labelledby": pageSizeLabelId,
|
|
112
|
+
"data-testid": "view-settings-page-size",
|
|
113
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx(SelectContent, { className: "bg-popover z-50", children: PAGE_SIZE_OPTIONS.map((n) => /* @__PURE__ */ jsxs(SelectItem, { value: String(n), children: [
|
|
117
|
+
n,
|
|
118
|
+
" items"
|
|
119
|
+
] }, n)) })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
id: densityLabelId,
|
|
129
|
+
className: "block text-xs text-muted-foreground",
|
|
130
|
+
children: "Density"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsxs(
|
|
134
|
+
Select,
|
|
135
|
+
{
|
|
136
|
+
value: density,
|
|
137
|
+
onValueChange: (v) => onDensityChange(v),
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ jsx(
|
|
140
|
+
SelectTrigger,
|
|
141
|
+
{
|
|
142
|
+
className: "h-8 text-xs",
|
|
143
|
+
"aria-labelledby": densityLabelId,
|
|
144
|
+
"data-testid": "view-settings-density",
|
|
145
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx(SelectContent, { className: "bg-popover z-50", children: DENSITY_OPTIONS.map((opt) => /* @__PURE__ */ jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] })
|
|
153
|
+
] })
|
|
154
|
+
] });
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { ViewSettings, ViewToggle };
|
|
158
|
+
//# sourceMappingURL=chunk-46TZGMFW.js.map
|
|
159
|
+
//# sourceMappingURL=chunk-46TZGMFW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/patterns/view-toggle.tsx","../src/components/patterns/view-settings.tsx"],"names":["jsxs","jsx"],"mappings":";;;;;;;AAUO,SAAS,UAAA,CAAW,EAAE,QAAA,EAAU,gBAAA,EAAiB,EAAoB;AAK1E,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAU,qDAAA;AAAA,MACV,IAAA,EAAK,OAAA;AAAA,MACL,YAAA,EAAW,WAAA;AAAA,MAEX,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAA,EAAS,QAAA,KAAa,MAAA,GAAS,SAAA,GAAY,OAAA;AAAA,YAC3C,IAAA,EAAK,MAAA;AAAA,YACL,SAAA,EAAU,sBAAA;AAAA,YACV,OAAA,EAAS,MAAM,gBAAA,CAAiB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AAAA,wBACAD,IAAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO,OAAA;AAAA,YACP,aAAA,EAAe,CAAC,CAAA,KAAM,eAAA,CAAgB,CAAY,CAAA;AAAA,YAElD,QAAA,EAAA;AAAA,8BAAAC,GAAAA;AAAA,gBAAC,aAAA;AAAA,gBAAA;AAAA,kBACC,SAAA,EAAU,aAAA;AAAA,kBACV,iBAAA,EAAiB,cAAA;AAAA,kBACjB,aAAA,EAAY,uBAAA;AAAA,kBAEZ,QAAA,kBAAAA,IAAC,WAAA,EAAA,EAAY;AAAA;AAAA,eACf;AAAA,8BACAA,IAAC,aAAA,EAAA,EAAc,SAAA,EAAU,mBACtB,QAAA,EAAA,eAAA,CAAgB,GAAA,CAAI,CAAC,GAAA,qBACpBA,IAAC,UAAA,EAAA,EAA2B,KAAA,EAAO,IAAI,KAAA,EACpC,QAAA,EAAA,GAAA,CAAI,SADU,GAAA,CAAI,KAErB,CACD,CAAA,EACH;AAAA;AAAA;AAAA;AACF,OAAA,EACF;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-46TZGMFW.js","sourcesContent":["import { Button } from \"../ui/button\";\nimport { LayoutGrid, Table2, List } from \"lucide-react\";\n\nexport type ViewMode = \"grid\" | \"table\" | \"list\";\n\ninterface ViewToggleProps {\n viewMode: ViewMode;\n onViewModeChange: (mode: ViewMode) => void;\n}\n\nexport function ViewToggle({ viewMode, onViewModeChange }: ViewToggleProps) {\n // Each button is icon-only, so `aria-label` supplies the accessible name\n // (`title` alone is not a reliable one) and `aria-pressed` reports which of\n // the three is current — the `default`/`ghost` variant swap conveys that to\n // sighted users only.\n return (\n <div\n className=\"flex items-center border rounded-lg overflow-hidden\"\n role=\"group\"\n aria-label=\"View mode\"\n >\n <Button\n variant={viewMode === \"grid\" ? \"default\" : \"ghost\"}\n size=\"icon\"\n className=\"h-8 w-8 rounded-none\"\n onClick={() => onViewModeChange(\"grid\")}\n title=\"Grid view\"\n aria-label=\"Grid view\"\n aria-pressed={viewMode === \"grid\"}\n testID=\"view-toggle-grid\"\n >\n <LayoutGrid className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n <Button\n variant={viewMode === \"table\" ? \"default\" : \"ghost\"}\n size=\"icon\"\n className=\"h-8 w-8 rounded-none\"\n onClick={() => onViewModeChange(\"table\")}\n title=\"Table view\"\n aria-label=\"Table view\"\n aria-pressed={viewMode === \"table\"}\n testID=\"view-toggle-table\"\n >\n <Table2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n <Button\n variant={viewMode === \"list\" ? \"default\" : \"ghost\"}\n size=\"icon\"\n className=\"h-8 w-8 rounded-none\"\n onClick={() => onViewModeChange(\"list\")}\n title=\"List view\"\n aria-label=\"List view\"\n aria-pressed={viewMode === \"list\"}\n testID=\"view-toggle-list\"\n >\n <List className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n </div>\n );\n}\n","import { useId } from \"react\";\nimport { Settings2 } from \"lucide-react\";\nimport { Button } from \"../ui/button\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../ui/popover\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../ui/select\";\nimport type { Density } from \"../../hooks/use-view-settings\";\n\ninterface ViewSettingsProps {\n pageSize: number;\n onPageSizeChange: (size: number) => void;\n density: Density;\n onDensityChange: (density: Density) => void;\n}\n\nconst PAGE_SIZE_OPTIONS = [10, 25, 50, 100];\nconst DENSITY_OPTIONS: { value: Density; label: string }[] = [\n { value: \"compact\", label: \"Compact\" },\n { value: \"comfortable\", label: \"Comfortable\" },\n { value: \"spacious\", label: \"Spacious\" },\n];\n\nexport function ViewSettings({\n pageSize,\n onPageSizeChange,\n density,\n onDensityChange,\n}: ViewSettingsProps) {\n // Radix renders each `SelectTrigger` as a <button>, and a <label> cannot be\n // associated with a button via `htmlFor`. `aria-labelledby` pointing at the\n // visible label is the association that actually reaches assistive tech.\n // `useId` keeps the ids unique when more than one ViewSettings is mounted.\n const baseId = useId();\n const pageSizeLabelId = `${baseId}-page-size`;\n const densityLabelId = `${baseId}-density`;\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-8 w-8\"\n title=\"View settings\"\n // Icon-only trigger: `title` is not a dependable accessible name.\n aria-label=\"View settings\"\n testID=\"view-settings-trigger\"\n >\n <Settings2 className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-56 space-y-4\">\n <h4 className=\"text-sm font-semibold\">Display Settings</h4>\n\n <div className=\"space-y-2\">\n <span\n id={pageSizeLabelId}\n className=\"block text-xs text-muted-foreground\"\n >\n Page size\n </span>\n <Select\n value={String(pageSize)}\n onValueChange={(v) => onPageSizeChange(Number(v))}\n >\n <SelectTrigger\n className=\"h-8 text-xs\"\n aria-labelledby={pageSizeLabelId}\n data-testid=\"view-settings-page-size\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent className=\"bg-popover z-50\">\n {PAGE_SIZE_OPTIONS.map((n) => (\n <SelectItem key={n} value={String(n)}>\n {n} items\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"space-y-2\">\n <span\n id={densityLabelId}\n className=\"block text-xs text-muted-foreground\"\n >\n Density\n </span>\n <Select\n value={density}\n onValueChange={(v) => onDensityChange(v as Density)}\n >\n <SelectTrigger\n className=\"h-8 text-xs\"\n aria-labelledby={densityLabelId}\n data-testid=\"view-settings-density\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent className=\"bg-popover z-50\">\n {DENSITY_OPTIONS.map((opt) => (\n <SelectItem key={opt.value} value={opt.value}>\n {opt.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { GAP_CLASSES } from './chunk-AVFZ4P4B.js';
|
|
2
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var stackVariants = cva("flex", {
|
|
8
|
+
variants: {
|
|
9
|
+
direction: {
|
|
10
|
+
row: "flex-row",
|
|
11
|
+
column: "flex-col"
|
|
12
|
+
},
|
|
13
|
+
gap: GAP_CLASSES,
|
|
14
|
+
// Exactly `@marktiderman/genesis-ui-native`'s `FlexAlign` / `FlexJustify`
|
|
15
|
+
// — see `./spacing` for why the two surfaces share one vocabulary.
|
|
16
|
+
// Web flexbox also supports `baseline` and `space-evenly`, and an
|
|
17
|
+
// earlier draft offered both; they are deliberately NOT here, because
|
|
18
|
+
// native's Yoga vocabulary has neither, so a spec written against them
|
|
19
|
+
// could not be applied to the native surface. Since `align`/`justify`
|
|
20
|
+
// emit nothing when unset, `className="items-baseline"` reaches them
|
|
21
|
+
// with no class to fight. Widening is additive and can happen later on
|
|
22
|
+
// BOTH surfaces at once; shipping them here first and withdrawing them
|
|
23
|
+
// to restore parity would be a breaking change.
|
|
24
|
+
align: {
|
|
25
|
+
start: "items-start",
|
|
26
|
+
center: "items-center",
|
|
27
|
+
end: "items-end",
|
|
28
|
+
stretch: "items-stretch"
|
|
29
|
+
},
|
|
30
|
+
justify: {
|
|
31
|
+
start: "justify-start",
|
|
32
|
+
center: "justify-center",
|
|
33
|
+
end: "justify-end",
|
|
34
|
+
between: "justify-between",
|
|
35
|
+
around: "justify-around"
|
|
36
|
+
},
|
|
37
|
+
wrap: {
|
|
38
|
+
true: "flex-wrap",
|
|
39
|
+
// Empty, not `flex-nowrap`: nowrap is already flexbox's initial value,
|
|
40
|
+
// so emitting it would only add noise. Same reasoning as the
|
|
41
|
+
// undefaulted `align`/`justify` below.
|
|
42
|
+
false: ""
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
// `align` and `justify` have NO default on purpose. Defaulting them would
|
|
46
|
+
// emit `items-stretch`/`justify-start` on every Stack ever rendered — the
|
|
47
|
+
// browser's own initial values — which is noise in the DOM and, worse,
|
|
48
|
+
// beats a consumer's `className` at equal specificity for anyone not
|
|
49
|
+
// going through `cn()`. Unset means "whatever flexbox already does".
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
direction: "column",
|
|
52
|
+
gap: "md",
|
|
53
|
+
wrap: false
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var Stack = React.forwardRef(
|
|
57
|
+
({ className, direction, gap, align, justify, wrap, testID, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
ref,
|
|
61
|
+
"data-slot": "stack",
|
|
62
|
+
"data-testid": testID,
|
|
63
|
+
className: cn(
|
|
64
|
+
stackVariants({ direction, gap, align, justify, wrap }),
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
Stack.displayName = "Stack";
|
|
72
|
+
var containerVariants = cva("mx-auto w-full", {
|
|
73
|
+
variants: {
|
|
74
|
+
// A deliberately short list. Named widths are a shared decision — five
|
|
75
|
+
// of them means two pages can't be 4px apart for no reason, which is
|
|
76
|
+
// exactly what happens once `max-w-[1180px]` is on the table.
|
|
77
|
+
size: {
|
|
78
|
+
/** Forms, settings, single-column detail. */
|
|
79
|
+
sm: "max-w-3xl",
|
|
80
|
+
/** Standard content pages. */
|
|
81
|
+
md: "max-w-5xl",
|
|
82
|
+
/** Application pages — the default. */
|
|
83
|
+
lg: "max-w-7xl",
|
|
84
|
+
/** Dashboards and wide tables: gutters, no ceiling. */
|
|
85
|
+
full: "max-w-none",
|
|
86
|
+
/** Long-form reading, capped by character count rather than width. */
|
|
87
|
+
prose: "max-w-prose"
|
|
88
|
+
},
|
|
89
|
+
// The three steps are the design system's own page spacing token
|
|
90
|
+
// (`spacing.page` = 1rem / 1.5rem / 2rem) expressed as utilities.
|
|
91
|
+
gutter: {
|
|
92
|
+
true: "px-4 sm:px-6 lg:px-8",
|
|
93
|
+
false: "px-0"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
defaultVariants: {
|
|
97
|
+
size: "lg",
|
|
98
|
+
gutter: true
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
var Container = React.forwardRef(
|
|
102
|
+
({ className, size, gutter, testID, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
"data-slot": "container",
|
|
107
|
+
"data-testid": testID,
|
|
108
|
+
className: cn(containerVariants({ size, gutter }), className),
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
Container.displayName = "Container";
|
|
114
|
+
|
|
115
|
+
export { Container, Stack, containerVariants, stackVariants };
|
|
116
|
+
//# sourceMappingURL=chunk-4CQHPWJD.js.map
|
|
117
|
+
//# sourceMappingURL=chunk-4CQHPWJD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/layout/stack.tsx","../src/components/layout/container.tsx"],"names":["cva","React2","jsx"],"mappings":";;;;;;AAKA,IAAM,aAAA,GAAgB,IAAI,MAAA,EAAQ;AAAA,EAChC,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,GAAA,EAAK,UAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,GAAA,EAAK,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWL,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,aAAA;AAAA,MACP,MAAA,EAAQ,cAAA;AAAA,MACR,GAAA,EAAK,WAAA;AAAA,MACL,OAAA,EAAS;AAAA,KACX;AAAA,IACA,OAAA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AAAA;AAAA;AAAA,IAGA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,sBAAA;AAAA,MACN,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,IAAA;AAAA,IACN,MAAA,EAAQ;AAAA;AAEZ,CAAC;AAkCM,IAAM,SAAA,GAAkBC,KAAA,CAAA,UAAA;AAAA,EAC7B,CAAC,EAAE,SAAA,EAAW,IAAA,EAAM,MAAA,EAAQ,QAAQ,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC9CC,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,GAAG,iBAAA,CAAkB,EAAE,MAAM,MAAA,EAAQ,GAAG,SAAS,CAAA;AAAA,MAC3D,GAAG;AAAA;AAAA;AAGV;AACA,SAAA,CAAU,WAAA,GAAc,WAAA","file":"chunk-4CQHPWJD.js","sourcesContent":["import * as React from \"react\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { cn } from \"../../utils\";\nimport { GAP_CLASSES } from \"./spacing\";\n\nconst stackVariants = cva(\"flex\", {\n variants: {\n direction: {\n row: \"flex-row\",\n column: \"flex-col\",\n },\n gap: GAP_CLASSES,\n // Exactly `@marktiderman/genesis-ui-native`'s `FlexAlign` / `FlexJustify`\n // — see `./spacing` for why the two surfaces share one vocabulary.\n // Web flexbox also supports `baseline` and `space-evenly`, and an\n // earlier draft offered both; they are deliberately NOT here, because\n // native's Yoga vocabulary has neither, so a spec written against them\n // could not be applied to the native surface. Since `align`/`justify`\n // emit nothing when unset, `className=\"items-baseline\"` reaches them\n // with no class to fight. Widening is additive and can happen later on\n // BOTH surfaces at once; shipping them here first and withdrawing them\n // to restore parity would be a breaking change.\n align: {\n start: \"items-start\",\n center: \"items-center\",\n end: \"items-end\",\n stretch: \"items-stretch\",\n },\n justify: {\n start: \"justify-start\",\n center: \"justify-center\",\n end: \"justify-end\",\n between: \"justify-between\",\n around: \"justify-around\",\n },\n wrap: {\n true: \"flex-wrap\",\n // Empty, not `flex-nowrap`: nowrap is already flexbox's initial value,\n // so emitting it would only add noise. Same reasoning as the\n // undefaulted `align`/`justify` below.\n false: \"\",\n },\n },\n // `align` and `justify` have NO default on purpose. Defaulting them would\n // emit `items-stretch`/`justify-start` on every Stack ever rendered — the\n // browser's own initial values — which is noise in the DOM and, worse,\n // beats a consumer's `className` at equal specificity for anyone not\n // going through `cn()`. Unset means \"whatever flexbox already does\".\n defaultVariants: {\n direction: \"column\",\n gap: \"md\",\n wrap: false,\n },\n});\n\nexport interface StackProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof stackVariants> {\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * Stack — one-dimensional flow. The single most-repeated shape in any\n * application: a run of things in a line, evenly spaced.\n *\n * It replaces the `flex flex-col gap-4` / `flex items-center gap-2` strings\n * that otherwise get retyped in every file, and it is the reason `gap`\n * stays on the shared `SpaceToken` scale (see `./spacing`) instead of\n * drifting per page.\n *\n * ```tsx\n * <Stack gap=\"lg\">\n * <Card />\n * <Card />\n * </Stack>\n *\n * <Stack direction=\"row\" align=\"center\" justify=\"between\" gap=\"sm\">\n * <h2>Members</h2>\n * <Button>Invite</Button>\n * </Stack>\n * ```\n *\n * Deliberately NOT here: responsive per-breakpoint directions. A layout\n * that changes axis at a breakpoint is a `Split`, which owns that idea and\n * names the breakpoint explicitly.\n *\n * Note for consumers of both surfaces: `@marktiderman/genesis-ui-native`\n * splits this shape into two components, `Stack` (column) and `Inline`\n * (row). On web they are one component with a `direction` prop, which is\n * the established web idiom. The `gap` / `align` / `justify` vocabulary is\n * identical either way — deliberately, and enforced by a test that reads\n * the native definitions directly — so a spec written once still reads the\n * same on both. That means the web unions are the SHARED vocabulary, not\n * everything web flexbox can do; see the note on `align` below.\n *\n * @stability Beta\n */\nexport const Stack = React.forwardRef<HTMLDivElement, StackProps>(\n (\n { className, direction, gap, align, justify, wrap, testID, ...props },\n ref\n ) => (\n <div\n ref={ref}\n data-slot=\"stack\"\n data-testid={testID}\n className={cn(\n stackVariants({ direction, gap, align, justify, wrap }),\n className\n )}\n {...props}\n />\n )\n);\nStack.displayName = \"Stack\";\n\nexport { stackVariants };\n","import * as React from \"react\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { cn } from \"../../utils\";\n\nconst containerVariants = cva(\"mx-auto w-full\", {\n variants: {\n // A deliberately short list. Named widths are a shared decision — five\n // of them means two pages can't be 4px apart for no reason, which is\n // exactly what happens once `max-w-[1180px]` is on the table.\n size: {\n /** Forms, settings, single-column detail. */\n sm: \"max-w-3xl\",\n /** Standard content pages. */\n md: \"max-w-5xl\",\n /** Application pages — the default. */\n lg: \"max-w-7xl\",\n /** Dashboards and wide tables: gutters, no ceiling. */\n full: \"max-w-none\",\n /** Long-form reading, capped by character count rather than width. */\n prose: \"max-w-prose\",\n },\n // The three steps are the design system's own page spacing token\n // (`spacing.page` = 1rem / 1.5rem / 2rem) expressed as utilities.\n gutter: {\n true: \"px-4 sm:px-6 lg:px-8\",\n false: \"px-0\",\n },\n },\n defaultVariants: {\n size: \"lg\",\n gutter: true,\n },\n});\n\nexport interface ContainerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof containerVariants> {\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * Container — the page gutter: a centered column with a named maximum\n * width and responsive side padding.\n *\n * ```tsx\n * <Container>\n * <Section title=\"Overview\">{…}</Section>\n * </Container>\n *\n * <Container size=\"sm\">\n * <SettingsForm />\n * </Container>\n *\n * <Container size=\"full\" gutter={false}>\n * <FullBleedMap />\n * </Container>\n * ```\n *\n * `gutter` is a real prop rather than a `className` override because the\n * padding is responsive: passing `px-0` would only cancel the base step\n * and leave `sm:px-6` and `lg:px-8` intact, so the escape hatch that looks\n * like it should work silently doesn't.\n *\n * @stability Beta\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ className, size, gutter, testID, ...props }, ref) => (\n <div\n ref={ref}\n data-slot=\"container\"\n data-testid={testID}\n className={cn(containerVariants({ size, gutter }), className)}\n {...props}\n />\n )\n);\nContainer.displayName = \"Container\";\n\nexport { containerVariants };\n"]}
|
|
@@ -1,14 +1,32 @@
|
|
|
1
|
+
import { Button } from './chunk-NWSCYLPT.js';
|
|
1
2
|
import { cn } from './chunk-NZ5WBA4R.js';
|
|
2
3
|
import { FileQuestion, Lightbulb, MessageSquare, Search } from 'lucide-react';
|
|
3
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
6
|
+
var DEFAULT_TITLE = "No results found";
|
|
7
|
+
var FILTERED_TITLE = "No results match your filters";
|
|
5
8
|
function EmptyState({
|
|
6
9
|
icon: Icon = FileQuestion,
|
|
7
10
|
title,
|
|
8
11
|
description,
|
|
9
12
|
action,
|
|
10
|
-
className
|
|
13
|
+
className,
|
|
14
|
+
message,
|
|
15
|
+
hasFilters = false,
|
|
16
|
+
onClearFilters
|
|
11
17
|
}) {
|
|
18
|
+
const resolvedTitle = hasFilters ? FILTERED_TITLE : title ?? message ?? DEFAULT_TITLE;
|
|
19
|
+
const resolvedDescription = hasFilters ? void 0 : description;
|
|
20
|
+
const resolvedAction = hasFilters && onClearFilters ? /* @__PURE__ */ jsx(
|
|
21
|
+
Button,
|
|
22
|
+
{
|
|
23
|
+
variant: "link",
|
|
24
|
+
size: "sm",
|
|
25
|
+
testID: "empty-state-clear-filters",
|
|
26
|
+
onClick: onClearFilters,
|
|
27
|
+
children: "Clear all filters"
|
|
28
|
+
}
|
|
29
|
+
) : action;
|
|
12
30
|
return /* @__PURE__ */ jsxs(
|
|
13
31
|
"div",
|
|
14
32
|
{
|
|
@@ -18,9 +36,9 @@ function EmptyState({
|
|
|
18
36
|
),
|
|
19
37
|
children: [
|
|
20
38
|
/* @__PURE__ */ jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ jsx(Icon, { className: "h-8 w-8 text-muted-foreground", "aria-hidden": "true" }) }),
|
|
21
|
-
/* @__PURE__ */ jsx("h3", { className: "mt-4 text-lg font-semibold", children:
|
|
22
|
-
|
|
23
|
-
|
|
39
|
+
/* @__PURE__ */ jsx("h3", { className: "mt-4 text-lg font-semibold", children: resolvedTitle }),
|
|
40
|
+
resolvedDescription && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground max-w-sm", children: resolvedDescription }),
|
|
41
|
+
resolvedAction && /* @__PURE__ */ jsx("div", { className: "mt-6", children: resolvedAction })
|
|
24
42
|
]
|
|
25
43
|
}
|
|
26
44
|
);
|
|
@@ -78,5 +96,5 @@ function NoSearchResults({
|
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
export { EmptyState, NoFeaturesFound, NoFeedbackFound, NoSearchResults };
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-65SPT7EA.js.map
|
|
100
|
+
//# sourceMappingURL=chunk-65SPT7EA.js.map
|