@appdirect/design-system 0.0.11 → 0.0.13
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/README.md +84 -6
- package/dist/Buttons/ActionIcon.js +14 -0
- package/dist/Buttons/Button.js +66 -0
- package/dist/Buttons/CloseButton.js +48 -0
- package/dist/Buttons/index.js +13 -0
- package/dist/Combobox/AutocompleteClearable.js +36 -0
- package/dist/Combobox/Combobox.js +28 -0
- package/dist/Combobox/Multiselect.js +31 -0
- package/dist/Combobox/SearchableSelect.js +43 -0
- package/dist/Combobox/Select.js +72 -0
- package/dist/Combobox/index.js +10 -0
- package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +96 -0
- package/dist/ComplexComponents/DashboardWidget/index.js +1 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +82 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.js +23 -0
- package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.js +23 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +230 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.js +30 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.js +12 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.js +32 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.js +90 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.js +43 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.js +30 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.js +39 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.js +9 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.js +31 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +42 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.js +21 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.js +410 -0
- package/dist/ComplexComponents/DataTable/DataTable.js +405 -0
- package/dist/ComplexComponents/DataTable/ErrorOverlay/index.js +9 -0
- package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.js +27 -0
- package/dist/ComplexComponents/DataTable/index.js +1 -0
- package/dist/ComplexComponents/DataTable/translations/en.js +99 -0
- package/dist/ComplexComponents/DataTable/translations/index.js +17 -0
- package/dist/ComplexComponents/KeyInsight/KeyInsights.js +176 -0
- package/dist/ComplexComponents/KeyInsight/index.js +1 -0
- package/dist/ComplexComponents/NameValue/NameValue.js +94 -0
- package/dist/ComplexComponents/NameValue/NameValueItem.js +59 -0
- package/dist/ComplexComponents/NameValue/index.js +2 -0
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +92 -0
- package/dist/ComplexComponents/PageContentHeader/index.js +1 -0
- package/dist/ComplexComponents/Placeholder/Placeholder.js +51 -0
- package/dist/ComplexComponents/Placeholder/index.js +1 -0
- package/dist/ComplexComponents/Slat/Slat.js +53 -0
- package/dist/ComplexComponents/Slat/index.js +1 -0
- package/dist/ComplexComponents/Utilities/CopyButton.js +45 -0
- package/dist/ComplexComponents/Utilities/index.js +1 -0
- package/dist/DataDisplay/Alert.js +77 -0
- package/dist/DataDisplay/Avatar.js +157 -0
- package/dist/DataDisplay/Badge.js +78 -0
- package/dist/DataDisplay/Card.js +100 -0
- package/dist/DataDisplay/Chip.js +36 -0
- package/dist/DataDisplay/Indicator.js +59 -0
- package/dist/DataDisplay/List.js +60 -0
- package/dist/DataDisplay/Pill.js +81 -0
- package/dist/DataDisplay/Progress.js +42 -0
- package/dist/DataDisplay/Table.js +38 -0
- package/dist/DataDisplay/ThemeIcon.js +31 -0
- package/dist/DataDisplay/index.js +18 -0
- package/dist/Inputs/Checkbox.js +62 -0
- package/dist/Inputs/ColorInput.js +48 -0
- package/dist/Inputs/DropZone.js +12 -0
- package/dist/Inputs/FileInput.js +77 -0
- package/dist/Inputs/NumberInput.js +49 -0
- package/dist/Inputs/Radio.js +55 -0
- package/dist/Inputs/RadioGroup.js +59 -0
- package/dist/Inputs/SegmentedControl.js +50 -0
- package/dist/Inputs/Slider.js +50 -0
- package/dist/Inputs/SliderWithLabel.js +32 -0
- package/dist/Inputs/Switch.js +47 -0
- package/dist/Inputs/TextArea.js +50 -0
- package/dist/Inputs/TextInput.js +87 -0
- package/dist/Inputs/index.js +27 -0
- package/dist/Layout/Box.js +39 -0
- package/dist/Layout/Center.js +11 -0
- package/dist/Layout/Container.js +11 -0
- package/dist/Layout/Flex.js +12 -0
- package/dist/Layout/Grid.js +13 -0
- package/dist/Layout/Group.js +14 -0
- package/dist/Layout/Inline.js +46 -0
- package/dist/Layout/SimpleGrid.js +14 -0
- package/dist/Layout/Stack.js +45 -0
- package/dist/Layout/index.js +10 -0
- package/dist/Misc/Divider.js +8 -0
- package/dist/Misc/Paper.js +24 -0
- package/dist/Misc/index.js +10 -0
- package/dist/Navigation/Breadcrumb.js +60 -0
- package/dist/Navigation/NavLink.js +28 -0
- package/dist/Navigation/Stepper.js +8 -0
- package/dist/Navigation/Tabs.js +22 -0
- package/dist/Navigation/index.js +9 -0
- package/dist/Overlays/Drawer.js +63 -0
- package/dist/Overlays/Menu.js +85 -0
- package/dist/Overlays/Modal.js +61 -0
- package/dist/Overlays/Popover.js +118 -0
- package/dist/Overlays/Tooltip.js +71 -0
- package/dist/Overlays/index.js +12 -0
- package/dist/Shell/AppShellLayout.js +13 -0
- package/dist/Shell/HeaderBar.js +8 -0
- package/dist/Shell/SidebarNav.js +9 -0
- package/dist/Shell/SidebarNavLink.js +17 -0
- package/dist/Shell/SingleColumnLayout.js +11 -0
- package/dist/Shell/TertiaryColumnLayout.js +12 -0
- package/dist/Shell/index.js +6 -0
- package/dist/Typography/Code.js +8 -0
- package/dist/Typography/Kbd.js +58 -0
- package/dist/Typography/Text.js +8 -0
- package/dist/Typography/Title.js +11 -0
- package/dist/Typography/index.js +12 -0
- package/dist/config.js +202 -0
- package/dist/contracts/index.json +1 -1
- package/dist/css/mantine.css +2 -2
- package/dist/hooks/useTableHandlers.js +136 -0
- package/dist/hooks/useTableRenderFunctions.js +164 -0
- package/dist/hooks/useTableState.js +70 -0
- package/dist/index.js +162 -0
- package/dist/stories/index.json +1 -1
- package/dist/types.js +127 -0
- package/package.json +9 -6
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Textarea as MantineTextarea, ActionIcon, Group } from '@mantine/core';
|
|
5
|
+
import { IconInfoCircle } from '@tabler/icons-react';
|
|
6
|
+
import { Text } from '../Typography/Text.js';
|
|
7
|
+
import { Tooltip } from '../Overlays/Tooltip.js';
|
|
8
|
+
// ========================== COMPONENT ==========================
|
|
9
|
+
/**
|
|
10
|
+
* AppDirect Design System TextArea Component
|
|
11
|
+
*
|
|
12
|
+
* A multi-line text input built on top of Mantine's Textarea with
|
|
13
|
+
* consistent design system styling and enforced radius.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <TextArea label="Comments" placeholder="Enter your comments..." />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <TextArea
|
|
23
|
+
* label="Description"
|
|
24
|
+
* placeholder="Add more details"
|
|
25
|
+
* minRows={3}
|
|
26
|
+
* maxRows={10}
|
|
27
|
+
* autosize
|
|
28
|
+
* showOptional
|
|
29
|
+
* hasHelpIcon
|
|
30
|
+
* helpIconLabel="Provide a detailed description"
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const TextArea = forwardRef(({ size = 'md', showOptional = false, required, label, hasHelpIcon = false, helpIconLabel, onHelpIconClick, rightSection, error, errorCaption, ...props }, ref) => {
|
|
35
|
+
const effectiveError = error === true ? (errorCaption ?? true) : error;
|
|
36
|
+
const enhancedLabel = React.useMemo(() => {
|
|
37
|
+
if (!label)
|
|
38
|
+
return label;
|
|
39
|
+
if (showOptional && !required) {
|
|
40
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx(Text, { span: true, c: "dimmed", fw: "normal", children: "(Optional)" })] }));
|
|
41
|
+
}
|
|
42
|
+
return label;
|
|
43
|
+
}, [label, showOptional, required]);
|
|
44
|
+
const helpIconElement = hasHelpIcon ? (_jsx(Tooltip, { label: helpIconLabel ?? 'Help', position: "top", withArrow: true, children: _jsx(ActionIcon, { variant: "transparent", size: "xs", "aria-label": helpIconLabel ?? 'Help', onClick: onHelpIconClick, color: "gray", style: { cursor: onHelpIconClick ? 'pointer' : 'default' }, children: _jsx(IconInfoCircle, { size: 14, "aria-hidden": true }) }) })) : null;
|
|
45
|
+
const composedRightSection = (helpIconElement && rightSection)
|
|
46
|
+
? _jsxs(Group, { gap: 4, wrap: "nowrap", children: [rightSection, helpIconElement] })
|
|
47
|
+
: helpIconElement || rightSection;
|
|
48
|
+
return (_jsx(MantineTextarea, { ref: ref, size: size, radius: "sm", required: required, label: enhancedLabel, rightSection: composedRightSection, error: effectiveError, ...props }));
|
|
49
|
+
});
|
|
50
|
+
TextArea.displayName = 'TextArea';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { TextInput as MantineTextInput, ActionIcon, Group } from '@mantine/core';
|
|
5
|
+
import { IconInfoCircle } from '@tabler/icons-react';
|
|
6
|
+
import { Text } from '../Typography/Text.js';
|
|
7
|
+
import { Tooltip } from '../Overlays/Tooltip.js';
|
|
8
|
+
/**
|
|
9
|
+
* AppDirect Design System TextInput Component
|
|
10
|
+
*
|
|
11
|
+
* A clean text input component built on top of Mantine's TextInput with
|
|
12
|
+
* consistent design system styling and enforced radius.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic usage (no indication)
|
|
17
|
+
* <TextInput label="Name" placeholder="Enter your name" />
|
|
18
|
+
*
|
|
19
|
+
* // Required field (shows asterisk)
|
|
20
|
+
* <TextInput
|
|
21
|
+
* label="Email"
|
|
22
|
+
* placeholder="Enter email"
|
|
23
|
+
* required
|
|
24
|
+
* />
|
|
25
|
+
*
|
|
26
|
+
* // Optional field (shows "(Optional)")
|
|
27
|
+
* <TextInput
|
|
28
|
+
* label="Phone"
|
|
29
|
+
* placeholder="Enter phone"
|
|
30
|
+
* showOptional
|
|
31
|
+
* />
|
|
32
|
+
*
|
|
33
|
+
* // With error
|
|
34
|
+
* <TextInput
|
|
35
|
+
* label="Password"
|
|
36
|
+
* error="Password is required"
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Different sizes
|
|
43
|
+
* <TextInput size="xs" placeholder="Extra small" />
|
|
44
|
+
* <TextInput size="sm" placeholder="Small" />
|
|
45
|
+
* <TextInput size="md" placeholder="Medium" />
|
|
46
|
+
* <TextInput size="lg" placeholder="Large" />
|
|
47
|
+
* <TextInput size="xl" placeholder="Extra large" />
|
|
48
|
+
*
|
|
49
|
+
* // With icons
|
|
50
|
+
* <TextInput
|
|
51
|
+
* leftSection={<IconUser />}
|
|
52
|
+
* placeholder="Username"
|
|
53
|
+
* />
|
|
54
|
+
*
|
|
55
|
+
* // With help icon tooltip (hover)
|
|
56
|
+
* <TextInput
|
|
57
|
+
* label="API Key"
|
|
58
|
+
* hasHelpIcon
|
|
59
|
+
* helpIconLabel="Your API key can be found in account settings"
|
|
60
|
+
* />
|
|
61
|
+
*
|
|
62
|
+
* // With help icon click handler
|
|
63
|
+
* <TextInput
|
|
64
|
+
* label="API Key"
|
|
65
|
+
* hasHelpIcon
|
|
66
|
+
* helpIconLabel="Learn more about API keys"
|
|
67
|
+
* onHelpIconClick={() => openHelpDrawer()}
|
|
68
|
+
* />
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export const TextInput = forwardRef(({ size = 'md', leftSection, rightSection, showOptional = false, required, label, hasHelpIcon = false, helpIconLabel, onHelpIconClick, error, errorCaption, ...props }, ref) => {
|
|
72
|
+
const effectiveError = error === true ? (errorCaption ?? true) : error;
|
|
73
|
+
const enhancedLabel = React.useMemo(() => {
|
|
74
|
+
if (!label)
|
|
75
|
+
return label;
|
|
76
|
+
if (showOptional && !required) {
|
|
77
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx(Text, { span: true, c: "dimmed", fw: "normal", children: "(Optional)" })] }));
|
|
78
|
+
}
|
|
79
|
+
return label;
|
|
80
|
+
}, [label, showOptional, required]);
|
|
81
|
+
const helpIconElement = hasHelpIcon ? (_jsx(Tooltip, { label: helpIconLabel ?? 'Help', position: "top", withArrow: true, children: _jsx(ActionIcon, { variant: "transparent", size: "xs", "aria-label": helpIconLabel ?? 'Help', onClick: onHelpIconClick, color: "gray", style: { cursor: onHelpIconClick ? 'pointer' : 'default' }, children: _jsx(IconInfoCircle, { size: 14, "aria-hidden": true }) }) })) : null;
|
|
82
|
+
const composedRightSection = (helpIconElement && rightSection)
|
|
83
|
+
? _jsxs(Group, { gap: 4, wrap: "nowrap", children: [rightSection, helpIconElement] })
|
|
84
|
+
: helpIconElement || rightSection;
|
|
85
|
+
return (_jsx(MantineTextInput, { ref: ref, size: size, radius: "sm", required: required, leftSection: leftSection, rightSection: composedRightSection, label: enhancedLabel, error: effectiveError, ...props }));
|
|
86
|
+
});
|
|
87
|
+
TextInput.displayName = 'TextInput';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Components
|
|
3
|
+
*
|
|
4
|
+
* Form input components with consistent styling and behavior.
|
|
5
|
+
*/
|
|
6
|
+
export { TextInput } from './TextInput.js';
|
|
7
|
+
export { TextArea } from './TextArea.js';
|
|
8
|
+
export { NumberInput } from './NumberInput.js';
|
|
9
|
+
export { ColorInput } from './ColorInput.js';
|
|
10
|
+
export { Slider } from './Slider.js';
|
|
11
|
+
export { SliderWithLabel } from './SliderWithLabel.js';
|
|
12
|
+
export { Switch } from './Switch.js';
|
|
13
|
+
export { SegmentedControl } from './SegmentedControl.js';
|
|
14
|
+
export { Checkbox } from './Checkbox.js';
|
|
15
|
+
export { Radio } from './Radio.js';
|
|
16
|
+
export { RadioGroup } from './RadioGroup.js';
|
|
17
|
+
export { DropZone } from './DropZone.js';
|
|
18
|
+
export { FileInput } from './FileInput.js';
|
|
19
|
+
// Future input component exports will go here:
|
|
20
|
+
// export { ADDSCheckbox } from './Checkbox.js';
|
|
21
|
+
// export { ADDSNumberInput } from './NumberInput.js';
|
|
22
|
+
// export { ADDSTextarea } from './Textarea';
|
|
23
|
+
// export { ADDSSwitch } from './Switch.js';
|
|
24
|
+
// export { ADDSSlider } from './Slider.js';
|
|
25
|
+
// export { ADDSRadio } from './Radio.js';
|
|
26
|
+
// export { ADDSSegmentedControl } from './SegmentedControl.js';
|
|
27
|
+
// export { ADDSChip } from './Chip';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Box as MantineBox } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Box Component
|
|
7
|
+
*
|
|
8
|
+
* A flexible container primitive that provides easy access to design system tokens
|
|
9
|
+
* for spacing, colors, and other styling properties. Built on top of Mantine's Box.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic container with padding
|
|
14
|
+
* <Box p="md">
|
|
15
|
+
* <Text>Content with medium padding</Text>
|
|
16
|
+
* </Box>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // Styled container with background and radius
|
|
22
|
+
* <Box p="lg" bg="gray.1" radius="md">
|
|
23
|
+
* <Title>Card-like container</Title>
|
|
24
|
+
* <Text>With background and rounded corners</Text>
|
|
25
|
+
* </Box>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Polymorphic usage as different elements
|
|
31
|
+
* <Box component="section" p="xl" m="md">
|
|
32
|
+
* <Text>Semantic section element</Text>
|
|
33
|
+
* </Box>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const Box = forwardRef(({ p, m, bg, c, children, ...props }, ref) => {
|
|
37
|
+
return (_jsx(MantineBox, { ref: ref, p: p, m: m, bg: bg, c: c, ...props, children: children }));
|
|
38
|
+
});
|
|
39
|
+
Box.displayName = 'Box';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Center as MantineCenter } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Center Component
|
|
7
|
+
*
|
|
8
|
+
* Centers content horizontally and vertically using Mantine's Center API.
|
|
9
|
+
*/
|
|
10
|
+
export const Center = forwardRef(({ ...props }, ref) => _jsx(MantineCenter, { ref: ref, ...props }));
|
|
11
|
+
Center.displayName = 'Center';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Container as MantineContainer } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Container Component
|
|
7
|
+
*
|
|
8
|
+
* Centers content and constrains max width using Mantine's Container API.
|
|
9
|
+
*/
|
|
10
|
+
export const Container = forwardRef(({ ...props }, ref) => _jsx(MantineContainer, { ref: ref, ...props }));
|
|
11
|
+
Container.displayName = 'Container';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Flex as MantineFlex } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Flex Component
|
|
7
|
+
*
|
|
8
|
+
* A lower-level flexbox primitive aligned with Mantine's Flex API. Use it when
|
|
9
|
+
* Group or Stack are not expressive enough for the desired layout.
|
|
10
|
+
*/
|
|
11
|
+
export const Flex = forwardRef(({ ...props }, ref) => _jsx(MantineFlex, { ref: ref, ...props }));
|
|
12
|
+
Flex.displayName = 'Flex';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Grid as MantineGrid, } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Grid Component
|
|
7
|
+
*
|
|
8
|
+
* A responsive 12-column grid aligned with Mantine's Grid API. Use `Grid.Col`
|
|
9
|
+
* when layouts need explicit spans instead of equal-width columns.
|
|
10
|
+
*/
|
|
11
|
+
export const Grid = forwardRef(({ ...props }, ref) => _jsx(MantineGrid, { ref: ref, ...props }));
|
|
12
|
+
Grid.displayName = 'Grid';
|
|
13
|
+
Grid.Col = MantineGrid.Col;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Group as MantineGroup } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Group Component
|
|
7
|
+
*
|
|
8
|
+
* Mantine-named alias of `Inline`. Prefer `Inline` for new Figma-mapped and
|
|
9
|
+
* prototype code so agents have one horizontal primitive.
|
|
10
|
+
*/
|
|
11
|
+
export const Group = forwardRef(({ gap = 'md', align = 'center', justify = 'flex-start', wrap = 'wrap', children, ...props }, ref) => {
|
|
12
|
+
return (_jsx(MantineGroup, { ref: ref, gap: gap, align: align, justify: justify, wrap: wrap, ...props, children: children }));
|
|
13
|
+
});
|
|
14
|
+
Group.displayName = 'Group';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Group as MantineGroup } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Inline Component
|
|
7
|
+
*
|
|
8
|
+
* Horizontal layout primitive for new Figma-mapped and prototype code
|
|
9
|
+
* (`flex-direction: row` → `Inline`). `Group` is the Mantine-named alias of this
|
|
10
|
+
* same primitive — do not mix both in new code.
|
|
11
|
+
*
|
|
12
|
+
* Arranges children horizontally with design-system spacing. Built on Mantine Group.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic horizontal layout
|
|
17
|
+
* <Inline gap="md">
|
|
18
|
+
* <Button>First</Button>
|
|
19
|
+
* <Button>Second</Button>
|
|
20
|
+
* <Button>Third</Button>
|
|
21
|
+
* </Inline>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Inline with alignment and wrapping
|
|
27
|
+
* <Inline gap="sm" align="center" wrap="wrap">
|
|
28
|
+
* <Badge>Tag 1</Badge>
|
|
29
|
+
* <Badge>Tag 2</Badge>
|
|
30
|
+
* <Badge>Tag 3</Badge>
|
|
31
|
+
* </Inline>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Justified inline layout
|
|
37
|
+
* <Inline justify="space-between">
|
|
38
|
+
* <Text>Left content</Text>
|
|
39
|
+
* <Button>Right action</Button>
|
|
40
|
+
* </Inline>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const Inline = forwardRef(({ gap = 'md', align = 'center', justify = 'flex-start', wrap = 'wrap', children, ...props }, ref) => {
|
|
44
|
+
return (_jsx(MantineGroup, { ref: ref, gap: gap, align: align, justify: justify, wrap: wrap, ...props, children: children }));
|
|
45
|
+
});
|
|
46
|
+
Inline.displayName = 'Inline';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { SimpleGrid as MantineSimpleGrid } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System SimpleGrid Component
|
|
7
|
+
*
|
|
8
|
+
* A responsive equal-width grid primitive aligned with Mantine's SimpleGrid
|
|
9
|
+
* naming. Use it when all columns should have the same width.
|
|
10
|
+
*/
|
|
11
|
+
export const SimpleGrid = forwardRef(({ cols = 1, spacing = 'md', verticalSpacing, children, ...props }, ref) => {
|
|
12
|
+
return (_jsx(MantineSimpleGrid, { ref: ref, cols: cols, spacing: spacing, verticalSpacing: verticalSpacing, ...props, children: children }));
|
|
13
|
+
});
|
|
14
|
+
SimpleGrid.displayName = 'SimpleGrid';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Stack as MantineStack } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Stack Component
|
|
7
|
+
*
|
|
8
|
+
* A layout primitive that stacks child elements vertically with consistent spacing
|
|
9
|
+
* using design system tokens. Built on top of Mantine's Stack component.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic vertical stack
|
|
14
|
+
* <Stack gap="md">
|
|
15
|
+
* <Text>First item</Text>
|
|
16
|
+
* <Text>Second item</Text>
|
|
17
|
+
* <Text>Third item</Text>
|
|
18
|
+
* </Stack>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Stack with alignment
|
|
24
|
+
* <Stack gap="lg" align="center">
|
|
25
|
+
* <Button>Centered button</Button>
|
|
26
|
+
* <Text>Centered text</Text>
|
|
27
|
+
* </Stack>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // Nested stacks with different spacing
|
|
33
|
+
* <Stack gap="xl">
|
|
34
|
+
* <Title>Main Section</Title>
|
|
35
|
+
* <Stack gap="sm">
|
|
36
|
+
* <Text>Related item 1</Text>
|
|
37
|
+
* <Text>Related item 2</Text>
|
|
38
|
+
* </Stack>
|
|
39
|
+
* </Stack>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export const Stack = forwardRef(({ gap = 'md', align = 'stretch', justify = 'flex-start', children, ...props }, ref) => {
|
|
43
|
+
return (_jsx(MantineStack, { ref: ref, gap: gap, align: align, justify: justify, ...props, children: children }));
|
|
44
|
+
});
|
|
45
|
+
Stack.displayName = 'Stack';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Layout Primitives
|
|
2
|
+
export { Stack } from './Stack.js';
|
|
3
|
+
export { Group } from './Group.js';
|
|
4
|
+
export { Inline } from './Inline.js';
|
|
5
|
+
export { Box } from './Box.js';
|
|
6
|
+
export { SimpleGrid } from './SimpleGrid.js';
|
|
7
|
+
export { Grid } from './Grid.js';
|
|
8
|
+
export { Flex } from './Flex.js';
|
|
9
|
+
export { Container } from './Container.js';
|
|
10
|
+
export { Center } from './Center.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Divider as MantineDivider } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
export const Divider = forwardRef(({ orientation = 'horizontal', size = 'sm', ...props }, ref) => {
|
|
6
|
+
return (_jsx(MantineDivider, { ref: ref, orientation: orientation, size: size, color: "gray.4", ...props }));
|
|
7
|
+
});
|
|
8
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Paper as MantinePaper } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
export const Paper = forwardRef(({ variant, children, p, shadow, withBorder, ...props }, ref) => {
|
|
6
|
+
const getVariantProps = () => {
|
|
7
|
+
switch (variant) {
|
|
8
|
+
case 'shadow':
|
|
9
|
+
return { shadow: 'xs', withBorder: false };
|
|
10
|
+
case 'border':
|
|
11
|
+
return { withBorder: true, shadow: undefined };
|
|
12
|
+
case 'border-shadow':
|
|
13
|
+
return { withBorder: true, shadow: 'xs' };
|
|
14
|
+
case 'default':
|
|
15
|
+
default:
|
|
16
|
+
return { withBorder: false, shadow: undefined };
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const variantProps = getVariantProps();
|
|
20
|
+
const resolvedShadow = shadow ?? variantProps.shadow;
|
|
21
|
+
const resolvedWithBorder = withBorder ?? variantProps.withBorder;
|
|
22
|
+
return (_jsx(MantinePaper, { ref: ref, p: p, shadow: resolvedShadow, withBorder: resolvedWithBorder, ...props, children: children }));
|
|
23
|
+
});
|
|
24
|
+
Paper.displayName = 'Paper';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Miscellaneous Components
|
|
3
|
+
*
|
|
4
|
+
* Utility components for layout, spacing, and other miscellaneous purposes
|
|
5
|
+
*/
|
|
6
|
+
export { Divider } from './Divider.js';
|
|
7
|
+
export { Paper } from './Paper.js';
|
|
8
|
+
// Future misc component exports will go here:
|
|
9
|
+
// export { Portal } from './Portal';
|
|
10
|
+
// export { Transition } from './Transition';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Breadcrumbs as MantineBreadcrumbs, Anchor, Text, Group } from '@mantine/core';
|
|
5
|
+
import { IconChevronLeft } from '@tabler/icons-react';
|
|
6
|
+
// ========================== COMPONENTS ==========================
|
|
7
|
+
/**
|
|
8
|
+
* Standard Breadcrumb Component
|
|
9
|
+
*
|
|
10
|
+
* Built on top of Mantine's Breadcrumbs component with design system styling.
|
|
11
|
+
* Displays a navigation breadcrumb with clickable links and separators.
|
|
12
|
+
* The last item is rendered as plain text with `aria-current="page"` to
|
|
13
|
+
* represent the current page both visually and semantically.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <Breadcrumb
|
|
17
|
+
* items={[
|
|
18
|
+
* { label: 'Home', href: '/' },
|
|
19
|
+
* { label: 'Products', href: '/products' },
|
|
20
|
+
* { label: 'Details' }
|
|
21
|
+
* ]}
|
|
22
|
+
* />
|
|
23
|
+
*/
|
|
24
|
+
export const Breadcrumb = forwardRef(({ items, separator = '/', ...props }, ref) => {
|
|
25
|
+
if (!items || items.length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const breadcrumbItems = items.map((item, index) => {
|
|
29
|
+
const isLast = index === items.length - 1;
|
|
30
|
+
if (isLast) {
|
|
31
|
+
return (_jsx(Text, { component: "span", "aria-current": "page", children: item.label }, item.label));
|
|
32
|
+
}
|
|
33
|
+
if (item.href) {
|
|
34
|
+
return (_jsx(Anchor, { href: item.href, children: item.label }, item.label));
|
|
35
|
+
}
|
|
36
|
+
return (_jsx(Anchor, { component: "button", onClick: item.onClick, children: item.label }, item.label));
|
|
37
|
+
});
|
|
38
|
+
return (_jsx(MantineBreadcrumbs, { ref: ref, separator: separator, "aria-label": "breadcrumb", ...props, children: breadcrumbItems }));
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Back Breadcrumb Component
|
|
42
|
+
*
|
|
43
|
+
* Displays a simple back navigation with a chevron icon and label.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <BackBreadcrumb
|
|
47
|
+
* label="Back to Products"
|
|
48
|
+
* onClick={() => router.back()}
|
|
49
|
+
* />
|
|
50
|
+
*/
|
|
51
|
+
export const BackBreadcrumb = forwardRef(({ label = 'Back', onClick, href, className, 'aria-label': ariaLabel }, ref) => {
|
|
52
|
+
const content = (_jsxs(Group, { gap: 4, wrap: "nowrap", children: [_jsx(IconChevronLeft, { size: 16 }), _jsx("span", { children: label })] }));
|
|
53
|
+
if (href) {
|
|
54
|
+
return (_jsx(Anchor, { ref: ref, href: href, className: className, "aria-label": ariaLabel, children: content }));
|
|
55
|
+
}
|
|
56
|
+
return (_jsx(Anchor, { ref: ref, component: "button", className: className, onClick: onClick, "aria-label": ariaLabel, children: content }));
|
|
57
|
+
});
|
|
58
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
59
|
+
BackBreadcrumb.displayName = 'BackBreadcrumb';
|
|
60
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { NavLink as MantineNavLink } from '@mantine/core';
|
|
5
|
+
// ========================== COMPONENT ==========================
|
|
6
|
+
/**
|
|
7
|
+
* NavLink Component
|
|
8
|
+
*
|
|
9
|
+
* Thin wrapper around Mantine's NavLink. Used for navigation items
|
|
10
|
+
* in menus and sidebars.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <NavLink
|
|
14
|
+
* leftSection={<RiHomeLine size={18} />}
|
|
15
|
+
* label="Dashboard"
|
|
16
|
+
* onClick={() => navigate('/dashboard')}
|
|
17
|
+
* />
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <NavLink
|
|
21
|
+
* leftSection={<RiSettingsLine size={18} />}
|
|
22
|
+
* label="Settings"
|
|
23
|
+
* description="Manage your preferences"
|
|
24
|
+
* active
|
|
25
|
+
* />
|
|
26
|
+
*/
|
|
27
|
+
export const NavLink = forwardRef((props, ref) => _jsx(MantineNavLink, { ref: ref, ...props }));
|
|
28
|
+
NavLink.displayName = 'NavLink';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Stepper as MantineStepper, } from '@mantine/core';
|
|
5
|
+
export const Stepper = forwardRef(({ ...props }, ref) => _jsx(MantineStepper, { ref: ref, ...props }));
|
|
6
|
+
Stepper.displayName = 'Stepper';
|
|
7
|
+
Stepper.Step = MantineStepper.Step;
|
|
8
|
+
Stepper.Completed = MantineStepper.Completed;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Tabs as MantineTabs } from '@mantine/core';
|
|
3
|
+
// ========================== COMPONENT ==========================
|
|
4
|
+
/**
|
|
5
|
+
* Tabs Component
|
|
6
|
+
*
|
|
7
|
+
* Thin wrapper around Mantine's Tabs compound component.
|
|
8
|
+
* Use Tabs.List, Tabs.Tab, and Tabs.Panel for composition.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Tabs defaultValue="overview">
|
|
12
|
+
* <Tabs.List>
|
|
13
|
+
* <Tabs.Tab value="overview" leftSection={<RiDashboardLine size={14} />}>
|
|
14
|
+
* Overview
|
|
15
|
+
* </Tabs.Tab>
|
|
16
|
+
* <Tabs.Tab value="analytics">Analytics</Tabs.Tab>
|
|
17
|
+
* </Tabs.List>
|
|
18
|
+
* <Tabs.Panel value="overview">Overview content</Tabs.Panel>
|
|
19
|
+
* <Tabs.Panel value="analytics">Analytics content</Tabs.Panel>
|
|
20
|
+
* </Tabs>
|
|
21
|
+
*/
|
|
22
|
+
export const Tabs = MantineTabs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation Components
|
|
3
|
+
*
|
|
4
|
+
* This module exports navigation-related components including breadcrumbs and nav links.
|
|
5
|
+
*/
|
|
6
|
+
export { Breadcrumb, BackBreadcrumb } from './Breadcrumb.js';
|
|
7
|
+
export { NavLink } from './NavLink.js';
|
|
8
|
+
export { Stepper } from './Stepper.js';
|
|
9
|
+
export { Tabs } from './Tabs.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Drawer as MantineDrawer } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Drawer Component
|
|
7
|
+
*
|
|
8
|
+
* A sliding overlay component built on top of Mantine's Drawer with
|
|
9
|
+
* consistent design system styling for right-side drawer layouts.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <Drawer
|
|
15
|
+
* opened={opened}
|
|
16
|
+
* onClose={() => setOpened(false)}
|
|
17
|
+
* title="Settings"
|
|
18
|
+
* >
|
|
19
|
+
* <p>Drawer content goes here</p>
|
|
20
|
+
* </Drawer>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Different sizes
|
|
26
|
+
* <Drawer
|
|
27
|
+
* opened={opened}
|
|
28
|
+
* onClose={close}
|
|
29
|
+
* title="Navigation"
|
|
30
|
+
* size="sm"
|
|
31
|
+
* >
|
|
32
|
+
* <Navigation />
|
|
33
|
+
* </Drawer>
|
|
34
|
+
*
|
|
35
|
+
* <Drawer
|
|
36
|
+
* opened={opened}
|
|
37
|
+
* onClose={close}
|
|
38
|
+
* title="Details"
|
|
39
|
+
* size="lg"
|
|
40
|
+
* >
|
|
41
|
+
* <Details />
|
|
42
|
+
* </Drawer>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // Custom behavior
|
|
48
|
+
* <Drawer
|
|
49
|
+
* opened={opened}
|
|
50
|
+
* onClose={close}
|
|
51
|
+
* title="Modal Dialog"
|
|
52
|
+
* closeOnClickOutside={false}
|
|
53
|
+
* closeOnEscape={false}
|
|
54
|
+
* withCloseButton={true}
|
|
55
|
+
* >
|
|
56
|
+
* <Form />
|
|
57
|
+
* </Drawer>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export const Drawer = forwardRef(({ opened, onClose, title, children, size = 'md', position = 'right', withCloseButton = true, closeOnClickOutside = true, closeOnEscape = true, ...props }, ref) => {
|
|
61
|
+
return (_jsx(MantineDrawer, { ref: ref, opened: opened, onClose: onClose, title: title, size: size, position: position, withCloseButton: withCloseButton, closeOnClickOutside: closeOnClickOutside, closeOnEscape: closeOnEscape, radius: 0, shadow: "lg", ...props, children: children }));
|
|
62
|
+
});
|
|
63
|
+
Drawer.displayName = 'Drawer';
|