@appdirect/design-system 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +12 -2
  2. package/dist/Buttons/ActionIcon.tsx +37 -0
  3. package/dist/Buttons/Button.module.css +5 -0
  4. package/dist/Buttons/Button.tsx +124 -0
  5. package/dist/Buttons/CloseButton.tsx +83 -0
  6. package/dist/Buttons/index.ts +20 -0
  7. package/dist/Combobox/AutocompleteClearable.tsx +128 -0
  8. package/dist/Combobox/Combobox.tsx +37 -0
  9. package/dist/Combobox/Multiselect.tsx +158 -0
  10. package/dist/Combobox/SearchableSelect.tsx +131 -0
  11. package/dist/Combobox/Select.tsx +154 -0
  12. package/dist/Combobox/index.ts +20 -0
  13. package/dist/ComplexComponents/DashboardWidget/DashboardWidget.tsx +280 -0
  14. package/dist/ComplexComponents/DashboardWidget/index.ts +2 -0
  15. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.tsx +177 -0
  16. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.ts +35 -0
  17. package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.tsx +74 -0
  18. package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.tsx +358 -0
  19. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.tsx +48 -0
  20. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.tsx +26 -0
  21. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.tsx +71 -0
  22. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.tsx +158 -0
  23. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.tsx +79 -0
  24. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.tsx +65 -0
  25. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.ts +70 -0
  26. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.ts +140 -0
  27. package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.tsx +76 -0
  28. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.tsx +73 -0
  29. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.tsx +50 -0
  30. package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.tsx +788 -0
  31. package/dist/ComplexComponents/DataTable/DataTable.tsx +582 -0
  32. package/dist/ComplexComponents/DataTable/ErrorOverlay/index.tsx +29 -0
  33. package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.tsx +57 -0
  34. package/dist/ComplexComponents/DataTable/index.ts +2 -0
  35. package/dist/ComplexComponents/DataTable/translations/en.ts +115 -0
  36. package/dist/ComplexComponents/DataTable/translations/index.ts +23 -0
  37. package/dist/ComplexComponents/KeyInsight/KeyInsights.tsx +221 -0
  38. package/dist/ComplexComponents/KeyInsight/index.ts +2 -0
  39. package/dist/ComplexComponents/NameValue/NameValue.tsx +175 -0
  40. package/dist/ComplexComponents/NameValue/NameValueItem.tsx +100 -0
  41. package/dist/ComplexComponents/NameValue/index.ts +4 -0
  42. package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +65 -0
  43. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +383 -0
  44. package/dist/ComplexComponents/PageContentHeader/index.ts +4 -0
  45. package/dist/ComplexComponents/Utilities/CopyButton.tsx +82 -0
  46. package/dist/ComplexComponents/Utilities/index.ts +2 -0
  47. package/dist/DataDisplay/Alert.tsx +130 -0
  48. package/dist/DataDisplay/Avatar.tsx +216 -0
  49. package/dist/DataDisplay/Badge.tsx +119 -0
  50. package/dist/DataDisplay/Card.module.css +26 -0
  51. package/dist/DataDisplay/Card.tsx +163 -0
  52. package/dist/DataDisplay/Chip.tsx +66 -0
  53. package/dist/DataDisplay/Indicator.tsx +122 -0
  54. package/dist/DataDisplay/List.tsx +90 -0
  55. package/dist/DataDisplay/Pill.tsx +125 -0
  56. package/dist/DataDisplay/Progress.tsx +77 -0
  57. package/dist/DataDisplay/Table.tsx +57 -0
  58. package/dist/DataDisplay/ThemeIcon.tsx +67 -0
  59. package/dist/DataDisplay/index.ts +41 -0
  60. package/dist/Inputs/Checkbox.tsx +94 -0
  61. package/dist/Inputs/ColorInput.tsx +124 -0
  62. package/dist/Inputs/DropZone.tsx +78 -0
  63. package/dist/Inputs/FileInput.tsx +120 -0
  64. package/dist/Inputs/NumberInput.tsx +125 -0
  65. package/dist/Inputs/Radio.tsx +86 -0
  66. package/dist/Inputs/RadioGroup.tsx +90 -0
  67. package/dist/Inputs/SegmentedControl.tsx +64 -0
  68. package/dist/Inputs/Slider.tsx +69 -0
  69. package/dist/Inputs/Switch.tsx +67 -0
  70. package/dist/Inputs/TextArea.tsx +126 -0
  71. package/dist/Inputs/TextInput.tsx +167 -0
  72. package/dist/Inputs/index.ts +51 -0
  73. package/dist/Layout/Box.tsx +82 -0
  74. package/dist/Layout/Center.tsx +17 -0
  75. package/dist/Layout/Container.tsx +17 -0
  76. package/dist/Layout/Flex.tsx +18 -0
  77. package/dist/Layout/Grid.tsx +31 -0
  78. package/dist/Layout/Group.tsx +54 -0
  79. package/dist/Layout/Inline.tsx +86 -0
  80. package/dist/Layout/SimpleGrid.tsx +50 -0
  81. package/dist/Layout/Stack.tsx +86 -0
  82. package/dist/Layout/index.ts +29 -0
  83. package/dist/Misc/Divider.tsx +27 -0
  84. package/dist/Misc/Paper.tsx +47 -0
  85. package/dist/Misc/index.ts +15 -0
  86. package/dist/Navigation/Breadcrumb.tsx +138 -0
  87. package/dist/Navigation/NavLink.tsx +37 -0
  88. package/dist/Navigation/Stepper.tsx +17 -0
  89. package/dist/Navigation/Tabs.tsx +29 -0
  90. package/dist/Navigation/index.ts +17 -0
  91. package/dist/Overlays/Drawer.tsx +123 -0
  92. package/dist/Overlays/Menu.tsx +192 -0
  93. package/dist/Overlays/Modal.tsx +159 -0
  94. package/dist/Overlays/Popover.tsx +319 -0
  95. package/dist/Overlays/Tooltip.tsx +131 -0
  96. package/dist/Overlays/index.ts +19 -0
  97. package/dist/Shell/AppShellLayout.tsx +56 -0
  98. package/dist/Shell/HeaderBar.tsx +26 -0
  99. package/dist/Shell/SidebarNav.tsx +47 -0
  100. package/dist/Shell/SidebarNavLink.tsx +50 -0
  101. package/dist/Shell/SingleColumnLayout.tsx +22 -0
  102. package/dist/Shell/TertiaryColumnLayout.tsx +32 -0
  103. package/dist/Shell/index.ts +17 -0
  104. package/dist/Typography/Code.tsx +27 -0
  105. package/dist/Typography/Kbd.tsx +87 -0
  106. package/dist/Typography/Text.tsx +27 -0
  107. package/dist/Typography/Title.tsx +34 -0
  108. package/dist/Typography/index.ts +21 -0
  109. package/dist/bin/ds-audit.js +521 -0
  110. package/dist/config.ts +226 -0
  111. package/dist/contracts/Alert.json +80 -0
  112. package/dist/contracts/Badge.json +78 -0
  113. package/dist/contracts/Box.json +52 -0
  114. package/dist/contracts/Button.json +111 -0
  115. package/dist/contracts/DataTable.json +68 -0
  116. package/dist/contracts/Grid.json +35 -0
  117. package/dist/contracts/Group.json +44 -0
  118. package/dist/contracts/Inline.json +73 -0
  119. package/dist/contracts/PageContentHeader.json +107 -0
  120. package/dist/contracts/Stack.json +62 -0
  121. package/dist/contracts/ds-component-contract.v1.json +23 -0
  122. package/dist/contracts/index.json +55 -0
  123. package/dist/css/foundations.css +703 -0
  124. package/dist/css/mantine.css +1797 -0
  125. package/dist/hooks/useTableHandlers.ts +179 -0
  126. package/dist/hooks/useTableRenderFunctions.tsx +283 -0
  127. package/dist/hooks/useTableState.ts +81 -0
  128. package/dist/index.ts +210 -0
  129. package/dist/types.ts +202 -0
  130. package/package.json +56 -4
@@ -0,0 +1,319 @@
1
+ 'use client';
2
+
3
+ import React, { forwardRef } from 'react';
4
+ import { Popover as MantinePopover, PopoverProps as MantinePopoverProps, Stack,Text } from '@mantine/core';
5
+ import { Inline } from '..';
6
+ import { Button } from '../Buttons';
7
+
8
+ /**
9
+ * Popover Action Button interface (same as Modal for consistency)
10
+ */
11
+ export interface PopoverAction {
12
+ /** Unique identifier for the action */
13
+ id: string;
14
+ /** Button label */
15
+ label: string;
16
+ /** Button variant */
17
+ variant?: 'primary' | 'outline' | 'default' | 'danger';
18
+ /** Click handler */
19
+ onClick?: () => void;
20
+ /** Whether button is disabled */
21
+ disabled?: boolean;
22
+ /** Whether button is loading */
23
+ loading?: boolean;
24
+ /** Whether button should close popover on click */
25
+ closeOnClick?: boolean;
26
+ }
27
+
28
+ /**
29
+ * Enhanced Popover props extending Mantine's PopoverProps
30
+ */
31
+ export interface DSPopoverProps extends Omit<MantinePopoverProps, 'children'> {
32
+ /** Popover trigger element */
33
+ trigger: React.ReactNode;
34
+ /** Popover title (optional) */
35
+ title?: string;
36
+ /** Popover content */
37
+ children: React.ReactNode;
38
+ /** Primary/secondary action buttons (left-aligned) */
39
+ actions?: PopoverAction[];
40
+ /** Tertiary action buttons (right-aligned) */
41
+ tertiaryActions?: PopoverAction[];
42
+ /** Popover position relative to target */
43
+ position?: 'top' | 'left' | 'right' | 'bottom';
44
+ /** Whether popover is opened */
45
+ opened?: boolean;
46
+ /** Called when popover state changes */
47
+ onChange?: (opened: boolean) => void;
48
+ /** Called when popover is closed */
49
+ onClose?: () => void;
50
+ /** Popover width */
51
+ width?: number | 'auto';
52
+ /** Whether to show arrow */
53
+ withArrow?: boolean;
54
+ /** Arrow size */
55
+ arrowSize?: number;
56
+ /** Arrow radius */
57
+ arrowRadius?: number;
58
+ /** Whether popover can be closed by clicking outside */
59
+ closeOnClickOutside?: boolean;
60
+ /** Whether popover can be closed by pressing Escape */
61
+ closeOnEscape?: boolean;
62
+ }
63
+
64
+ /**
65
+ * AppDirect Design System Popover Component
66
+ *
67
+ * A popover component built on top of Mantine's Popover with
68
+ * consistent design system styling and flexible content support.
69
+ * Arrow size is set to 10 and arrow radius to 0 by default.
70
+ *
71
+ * @example
72
+ * ```tsx
73
+ * // Simple text popover
74
+ * <Popover
75
+ * trigger={<Button>Show Info</Button>}
76
+ * title="Information"
77
+ * position="top"
78
+ * >
79
+ * <Text>This is some helpful information.</Text>
80
+ * </Popover>
81
+ * ```
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * // Popover with actions
86
+ * <Popover
87
+ * trigger={<Button>Actions</Button>}
88
+ * title="Quick Actions"
89
+ * position="bottom"
90
+ * actions={[
91
+ * {
92
+ * id: "save",
93
+ * label: "Save",
94
+ * variant: "primary",
95
+ * onClick: handleSave,
96
+ * closeOnClick: true
97
+ * },
98
+ * {
99
+ * id: "cancel",
100
+ * label: "Cancel",
101
+ * variant: "outline",
102
+ * closeOnClick: true
103
+ * }
104
+ * ]}
105
+ * tertiaryActions={[
106
+ * {
107
+ * id: "help",
108
+ * label: "Help",
109
+ * variant: "default",
110
+ * onClick: showHelp
111
+ * }
112
+ * ]}
113
+ * >
114
+ * <Text>Are you sure you want to continue?</Text>
115
+ * </Popover>
116
+ * ```
117
+ *
118
+ * @example
119
+ * ```tsx
120
+ * // Form popover
121
+ * <Popover
122
+ * trigger={<ActionIcon><RiSettingsLine /></ActionIcon>}
123
+ * title="Quick Settings"
124
+ * position="left"
125
+ * width={300}
126
+ * actions={[
127
+ * {
128
+ * id: "apply",
129
+ * label: "Apply",
130
+ * variant: "primary",
131
+ * onClick: applySettings
132
+ * }
133
+ * ]}
134
+ * >
135
+ * <Stack gap="sm">
136
+ * <Switch label="Enable notifications" />
137
+ * <Select label="Theme" data={themes} />
138
+ * </Stack>
139
+ * </Popover>
140
+ * ```
141
+ */
142
+ export const Popover = forwardRef<HTMLDivElement, DSPopoverProps>(
143
+ (
144
+ {
145
+ trigger,
146
+ title,
147
+ children,
148
+ actions = [],
149
+ tertiaryActions = [],
150
+ position = 'bottom',
151
+ opened,
152
+ onChange,
153
+ onClose,
154
+ width = 'auto',
155
+ withArrow = true,
156
+ arrowSize = 10,
157
+ arrowRadius = 0,
158
+ closeOnClickOutside = true,
159
+ closeOnEscape = true,
160
+ ...props
161
+ },
162
+ ref
163
+ ) => {
164
+ const handleActionClick = (action: PopoverAction) => {
165
+ if (action.onClick) {
166
+ action.onClick();
167
+ }
168
+ if (action.closeOnClick && onClose) {
169
+ onClose();
170
+ }
171
+ };
172
+
173
+ const hasActions = actions.length > 0 || tertiaryActions.length > 0;
174
+
175
+ return (
176
+ <MantinePopover
177
+ opened={opened}
178
+ onChange={onChange}
179
+ position={position}
180
+ width={width}
181
+ withArrow={withArrow}
182
+ arrowSize={arrowSize}
183
+ arrowRadius={arrowRadius}
184
+ closeOnClickOutside={closeOnClickOutside}
185
+ closeOnEscape={closeOnEscape}
186
+ shadow="md"
187
+ {...props}
188
+ >
189
+ <MantinePopover.Target>
190
+ {trigger}
191
+ </MantinePopover.Target>
192
+
193
+ <MantinePopover.Dropdown>
194
+ <Stack gap="sm">
195
+ {/* Popover Content */}
196
+ <div>
197
+ {title && (
198
+ <Text fw={600} size="sm" mb="xs">
199
+ {title}
200
+ </Text>
201
+ )}
202
+ {children}
203
+ </div>
204
+
205
+ {/* Popover Actions Footer */}
206
+ {hasActions && (
207
+ <Inline justify="space-between" gap="sm">
208
+ {/* Left-aligned primary/secondary actions */}
209
+ <Inline gap="sm">
210
+ {actions.map((action) => (
211
+ <Button
212
+ key={action.id}
213
+ variant={action.variant || 'outline'}
214
+ onClick={() => handleActionClick(action)}
215
+ disabled={action.disabled}
216
+ loading={action.loading}
217
+ size="xs"
218
+ >
219
+ {action.label}
220
+ </Button>
221
+ ))}
222
+ </Inline>
223
+
224
+ {/* Right-aligned tertiary actions */}
225
+ <Inline gap="sm">
226
+ {tertiaryActions.map((action) => (
227
+ <Button
228
+ key={action.id}
229
+ variant={action.variant || 'outline'}
230
+ onClick={() => handleActionClick(action)}
231
+ disabled={action.disabled}
232
+ loading={action.loading}
233
+ size="xs"
234
+ >
235
+ {action.label}
236
+ </Button>
237
+ ))}
238
+ </Inline>
239
+ </Inline>
240
+ )}
241
+ </Stack>
242
+ </MantinePopover.Dropdown>
243
+ </MantinePopover>
244
+ );
245
+ }
246
+ );
247
+
248
+ Popover.displayName = 'Popover';
249
+
250
+ /**
251
+ * Pre-configured Popover variants for common use cases
252
+ */
253
+
254
+ /**
255
+ * Confirmation Popover - Pre-configured for quick confirmations
256
+ */
257
+ export interface ConfirmationPopoverProps extends Omit<DSPopoverProps, 'actions' | 'tertiaryActions'> {
258
+ /** Confirmation button label */
259
+ confirmLabel?: string;
260
+ /** Cancel button label */
261
+ cancelLabel?: string;
262
+ /** Confirmation button variant */
263
+ confirmVariant?: 'primary' | 'danger';
264
+ /** Confirm action handler */
265
+ onConfirm?: () => void;
266
+ /** Cancel action handler */
267
+ onCancel?: () => void;
268
+ /** Whether confirm button is loading */
269
+ confirmLoading?: boolean;
270
+ /** Optional tertiary actions (right-aligned) */
271
+ tertiaryActions?: PopoverAction[];
272
+ }
273
+
274
+ export const ConfirmationPopover = forwardRef<HTMLDivElement, ConfirmationPopoverProps>(
275
+ (
276
+ {
277
+ confirmLabel = 'Confirm',
278
+ cancelLabel = 'Cancel',
279
+ confirmVariant = 'primary',
280
+ onConfirm,
281
+ onCancel,
282
+ confirmLoading = false,
283
+ tertiaryActions = [],
284
+ onClose,
285
+ ...props
286
+ },
287
+ ref
288
+ ) => {
289
+ const actions: PopoverAction[] = [
290
+ {
291
+ id: 'confirm',
292
+ label: confirmLabel,
293
+ variant: confirmVariant,
294
+ onClick: onConfirm,
295
+ loading: confirmLoading,
296
+ closeOnClick: !confirmLoading,
297
+ },
298
+ {
299
+ id: 'cancel',
300
+ label: cancelLabel,
301
+ variant: 'outline',
302
+ onClick: onCancel,
303
+ closeOnClick: true,
304
+ },
305
+ ];
306
+
307
+ return (
308
+ <Popover
309
+ ref={ref}
310
+ actions={actions}
311
+ tertiaryActions={tertiaryActions}
312
+ onClose={onClose}
313
+ {...props}
314
+ />
315
+ );
316
+ }
317
+ );
318
+
319
+ ConfirmationPopover.displayName = 'ConfirmationPopover';
@@ -0,0 +1,131 @@
1
+ 'use client';
2
+
3
+ import React, { forwardRef } from 'react';
4
+ import { Tooltip as MantineTooltip, TooltipProps as MantineTooltipProps } from '@mantine/core';
5
+
6
+ // ========================== TYPES ==========================
7
+
8
+ export interface DSTooltipProps extends Omit<MantineTooltipProps, 'color' | 'radius'> {
9
+ /** Tooltip content */
10
+ label: React.ReactNode;
11
+ /** Element that triggers the tooltip */
12
+ children: React.ReactNode;
13
+ /** Tooltip position relative to target */
14
+ position?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
15
+ /** Whether tooltip is disabled */
16
+ disabled?: boolean;
17
+ /** Delay in ms before showing tooltip */
18
+ openDelay?: number;
19
+ /** Delay in ms before hiding tooltip */
20
+ closeDelay?: number;
21
+ /** Whether tooltip stays open when hovering over it */
22
+ keepMounted?: boolean;
23
+ /** Custom width for tooltip */
24
+ width?: number | 'auto';
25
+ /** Whether to show arrow pointer */
26
+ withArrow?: boolean;
27
+ /** Size of arrow pointer */
28
+ arrowSize?: number;
29
+ }
30
+
31
+ // ========================== COMPONENT ==========================
32
+
33
+ /**
34
+ * Tooltip Component
35
+ *
36
+ * Built on top of Mantine's Tooltip component with design system styling.
37
+ * Uses consistent dark background with white text and arrow pointer.
38
+ *
39
+ * @example
40
+ * // Basic tooltip
41
+ * <Tooltip label="This is a tooltip! Rejoice!">
42
+ * <Button>Hover me</Button>
43
+ * </Tooltip>
44
+ *
45
+ * @example
46
+ * // Different positions
47
+ * <Tooltip label="Top tooltip" position="top">
48
+ * <Button>Top</Button>
49
+ * </Tooltip>
50
+ *
51
+ * @example
52
+ * // Custom width and multiline
53
+ * <Tooltip
54
+ * label="This is a longer tooltip that can span multiple lines"
55
+ * width={200}
56
+ * position="bottom"
57
+ * >
58
+ * <Button>Long tooltip</Button>
59
+ * </Tooltip>
60
+ *
61
+ * @example
62
+ * // With delays
63
+ * <Tooltip
64
+ * label="Delayed tooltip"
65
+ * openDelay={500}
66
+ * closeDelay={200}
67
+ * >
68
+ * <Button>Delayed</Button>
69
+ * </Tooltip>
70
+ */
71
+ export const Tooltip = forwardRef<HTMLDivElement, DSTooltipProps>(
72
+ ({
73
+ label,
74
+ children,
75
+ position = 'top',
76
+ disabled = false,
77
+ openDelay = 0,
78
+ closeDelay = 0,
79
+ keepMounted = false,
80
+ width = 'auto',
81
+ withArrow = true,
82
+ arrowSize = 6,
83
+ ...props
84
+ }, ref) => {
85
+
86
+ return (
87
+ <MantineTooltip
88
+ ref={ref}
89
+ label={label}
90
+ position={position}
91
+ disabled={disabled}
92
+ openDelay={openDelay}
93
+ closeDelay={closeDelay}
94
+ keepMounted={keepMounted}
95
+ withArrow={withArrow}
96
+ arrowSize={arrowSize}
97
+ // Design system styling from Figma
98
+ color="dark"
99
+ radius="sm"
100
+ // Custom styles to match Figma design exactly
101
+ styles={{
102
+ tooltip: {
103
+ backgroundColor: '#212529',
104
+ color: '#ffffff',
105
+ fontFamily: 'Inter, sans-serif',
106
+ fontSize: '14px',
107
+ fontWeight: 400,
108
+ lineHeight: 1.55,
109
+ padding: '5px 8px',
110
+ borderRadius: '4px',
111
+ border: 'none',
112
+ width: width !== 'auto' ? width : undefined,
113
+ maxWidth: width === 'auto' ? '300px' : undefined,
114
+ },
115
+ arrow: {
116
+ backgroundColor: '#212529',
117
+ borderColor: '#212529',
118
+ }
119
+ }}
120
+ {...props}
121
+ >
122
+ {children}
123
+ </MantineTooltip>
124
+ );
125
+ }
126
+ );
127
+
128
+ Tooltip.displayName = 'Tooltip';
129
+
130
+ // Default export for convenience
131
+ export default Tooltip;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Overlays Components
3
+ *
4
+ * Components that appear on top of other content like modals, drawers, and popovers.
5
+ */
6
+
7
+ export { Drawer } from './Drawer';
8
+ export { Menu } from './Menu';
9
+ export { Modal, ConfirmationModal } from './Modal';
10
+ export { Popover, ConfirmationPopover } from './Popover';
11
+ export { Tooltip } from './Tooltip';
12
+ export type { DSDrawerProps } from './Drawer';
13
+ export type { DSMenuProps, MenuItem, MenuSection } from './Menu';
14
+ export type { DSModalProps, ConfirmationModalProps } from './Modal';
15
+ export type { DSPopoverProps, PopoverAction, ConfirmationPopoverProps } from './Popover';
16
+ export type { DSTooltipProps } from './Tooltip';
17
+
18
+ // Future overlay component exports will go here:
19
+ // export { HoverCard } from './HoverCard';
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+
3
+ import React, { ReactNode } from 'react';
4
+ import { AppShell } from '@mantine/core';
5
+ import { Stack } from '../Layout/Stack';
6
+ import { HeaderBar, type DSHeaderBarProps } from './HeaderBar';
7
+ import { SidebarNav, type NavItem } from './SidebarNav';
8
+
9
+ const APP_DIRECT_NAVY = '#011B58';
10
+
11
+ export interface DSAppShellLayoutProps {
12
+ children: ReactNode;
13
+ /** Application or prototype title shown in the header */
14
+ title?: string;
15
+ /** Navigation items for the left sidebar */
16
+ navItems?: NavItem[];
17
+ /** Hide the left navigation to use header-only layout */
18
+ hideNav?: boolean;
19
+ /** Additional header props */
20
+ headerProps?: Omit<DSHeaderBarProps, 'title'>;
21
+ }
22
+
23
+ export function AppShellLayout({
24
+ children,
25
+ title,
26
+ navItems = [],
27
+ hideNav = false,
28
+ }: DSAppShellLayoutProps) {
29
+ const showNav = !hideNav && navItems.length > 0;
30
+
31
+ return (
32
+ <AppShell
33
+ header={{ height: 68 }}
34
+ navbar={showNav ? { width: 300, breakpoint: 'sm', collapsed: { mobile: false } } : undefined}
35
+ padding="lg"
36
+ >
37
+ <AppShell.Header style={{ background: APP_DIRECT_NAVY }}>
38
+ <HeaderBar title={title} />
39
+ </AppShell.Header>
40
+
41
+ {showNav && (
42
+ <AppShell.Navbar pt={0} pb="md" pl="md" pr={0}>
43
+ <SidebarNav navItems={navItems} title={title ?? 'Navigation'} />
44
+ </AppShell.Navbar>
45
+ )}
46
+
47
+ <AppShell.Main>
48
+ <Stack gap="xl">
49
+ {children}
50
+ </Stack>
51
+ </AppShell.Main>
52
+ </AppShell>
53
+ );
54
+ }
55
+
56
+ AppShellLayout.displayName = 'AppShellLayout';
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { ThemeIcon, Title } from '@mantine/core';
3
+ import { Inline } from '../Layout/Inline';
4
+
5
+ export interface DSHeaderBarProps {
6
+ /** Application or prototype title shown in the header */
7
+ title?: string;
8
+ }
9
+
10
+ export function HeaderBar({ title = 'Prototype' }: DSHeaderBarProps) {
11
+ return (
12
+ <Inline h="100%" px="xl" gap="lg">
13
+ <ThemeIcon variant="transparent" size="lg" color="white">
14
+ <i className="ri-grid-fill" style={{ fontSize: 28 }} />
15
+ </ThemeIcon>
16
+ <ThemeIcon variant="transparent" p="xs" size={48}>
17
+ <img src="/assets/AppDirect-Mark_White.svg" alt="Logo" width={38} height={38} />
18
+ </ThemeIcon>
19
+ <Title order={1} c="white" fw={300} fz={22} ml={12}>
20
+ {title}
21
+ </Title>
22
+ </Inline>
23
+ );
24
+ }
25
+
26
+ HeaderBar.displayName = 'HeaderBar';
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { ThemeIcon, Divider, Title } from '@mantine/core';
3
+ import { Inline } from '../Layout/Inline';
4
+ import { SidebarNavLink } from './SidebarNavLink';
5
+
6
+ export interface NavItem {
7
+ label: string;
8
+ icon: string;
9
+ href?: string;
10
+ active?: boolean;
11
+ color?: string;
12
+ rightSection?: React.ReactNode;
13
+ }
14
+
15
+ export interface DSSidebarNavProps {
16
+ navItems: NavItem[];
17
+ title: string;
18
+ }
19
+
20
+ export function SidebarNav({ navItems, title }: DSSidebarNavProps) {
21
+ return (
22
+ <nav aria-label="Sidebar Navigation">
23
+ <Inline align="center" gap="sm" mb={0} h={66} pl="xs">
24
+ <ThemeIcon variant="transparent" size="lg" color="dark">
25
+ <i className="ri-group-line" style={{ fontSize: 28 }} />
26
+ </ThemeIcon>
27
+ <Title order={5} fw={700} m={0}>
28
+ {title}
29
+ </Title>
30
+ </Inline>
31
+ <Divider mb="md" />
32
+ {navItems.map((item) => (
33
+ <SidebarNavLink
34
+ key={item.label}
35
+ label={item.label}
36
+ icon={item.icon}
37
+ href={item.href}
38
+ active={item.active}
39
+ color={item.color}
40
+ rightSection={item.rightSection}
41
+ />
42
+ ))}
43
+ </nav>
44
+ );
45
+ }
46
+
47
+ SidebarNav.displayName = 'SidebarNav';
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { NavLink as MantineNavLink, ThemeIcon } from '@mantine/core';
3
+
4
+ const navLinkStyles = {
5
+ root: {
6
+ height: 44,
7
+ paddingLeft: 'var(--mantine-spacing-xs)',
8
+ borderTopLeftRadius: 'var(--mantine-radius-sm)',
9
+ borderBottomLeftRadius: 'var(--mantine-radius-sm)',
10
+ borderTopRightRadius: 0,
11
+ borderBottomRightRadius: 0,
12
+ },
13
+ };
14
+
15
+ export interface DSSidebarNavLinkProps {
16
+ label: string;
17
+ icon: string;
18
+ href?: string;
19
+ active?: boolean;
20
+ color?: string;
21
+ rightSection?: React.ReactNode;
22
+ }
23
+
24
+ export function SidebarNavLink({
25
+ label,
26
+ icon,
27
+ href,
28
+ active,
29
+ color = 'dark',
30
+ rightSection,
31
+ }: DSSidebarNavLinkProps) {
32
+ return (
33
+ <MantineNavLink
34
+ component="a"
35
+ href={href ?? '#'}
36
+ label={label}
37
+ leftSection={
38
+ <ThemeIcon variant="transparent" size="md" color={color}>
39
+ <i className={icon} style={{ fontSize: 20 }} />
40
+ </ThemeIcon>
41
+ }
42
+ rightSection={rightSection}
43
+ active={active}
44
+ aria-current={active ? 'page' : undefined}
45
+ styles={navLinkStyles}
46
+ />
47
+ );
48
+ }
49
+
50
+ SidebarNavLink.displayName = 'SidebarNavLink';
@@ -0,0 +1,22 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Stack } from '../Layout/Stack';
3
+
4
+ export interface DSSingleColumnLayoutProps {
5
+ children: ReactNode;
6
+ /** Gap between content sections. Defaults to 'lg'. */
7
+ gap?: string;
8
+ }
9
+
10
+ /**
11
+ * Full-width single-column content layout.
12
+ * Use inside AppShellLayout for standard page content.
13
+ */
14
+ export function SingleColumnLayout({ children, gap = 'lg' }: DSSingleColumnLayoutProps) {
15
+ return (
16
+ <Stack gap={gap}>
17
+ {children}
18
+ </Stack>
19
+ );
20
+ }
21
+
22
+ SingleColumnLayout.displayName = 'SingleColumnLayout';
@@ -0,0 +1,32 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Grid } from '../Layout/Grid';
3
+
4
+ export interface DSTertiaryColumnLayoutProps {
5
+ /** Primary content area (left, wider) */
6
+ main: ReactNode;
7
+ /** Secondary aside area (right, narrower) */
8
+ aside: ReactNode;
9
+ /** Column span for the main area out of 12. Defaults to 8. */
10
+ mainSpan?: number;
11
+ }
12
+
13
+ /**
14
+ * Two-column content layout with a primary area and a narrower aside.
15
+ * Use inside AppShellLayout for pages that need a side panel.
16
+ */
17
+ export function TertiaryColumnLayout({
18
+ main,
19
+ aside,
20
+ mainSpan = 8,
21
+ }: DSTertiaryColumnLayoutProps) {
22
+ const asideSpan = 12 - mainSpan;
23
+
24
+ return (
25
+ <Grid gap="lg">
26
+ <Grid.Col span={mainSpan}>{main}</Grid.Col>
27
+ <Grid.Col span={asideSpan}>{aside}</Grid.Col>
28
+ </Grid>
29
+ );
30
+ }
31
+
32
+ TertiaryColumnLayout.displayName = 'TertiaryColumnLayout';