@appdirect/design-system 0.0.10 → 0.0.12
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 +85 -5
- 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/PageContentHeader.tsx +24 -34
- package/dist/ComplexComponents/PageContentHeader/index.js +1 -0
- package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
- 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/PageContentHeader.json +10 -5
- package/dist/contracts/index.json +1 -1
- 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/index.ts +3 -4
- package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
- package/dist/stories/Buttons/Button.stories.tsx +145 -0
- package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
- package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
- package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
- package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
- package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
- package/dist/stories/Combobox/Select.stories.tsx +311 -0
- package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
- package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
- package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
- package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
- package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
- package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
- package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
- package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
- package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
- package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
- package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
- package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
- package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
- package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
- package/dist/stories/DataDisplay/List.stories.tsx +376 -0
- package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
- package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
- package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
- package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
- package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
- package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
- package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
- package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
- package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
- package/dist/stories/Inputs/Radio.stories.tsx +437 -0
- package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
- package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
- package/dist/stories/Inputs/Slider.stories.tsx +22 -0
- package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
- package/dist/stories/Inputs/Switch.stories.tsx +361 -0
- package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
- package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
- package/dist/stories/Misc/Divider.stories.tsx +581 -0
- package/dist/stories/Misc/Paper.stories.tsx +557 -0
- package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
- package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
- package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
- package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
- package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
- package/dist/stories/Overlays/Menu.stories.tsx +941 -0
- package/dist/stories/Overlays/Modal.stories.tsx +249 -0
- package/dist/stories/Overlays/Popover.stories.tsx +780 -0
- package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
- package/dist/stories/Typography/Code.stories.tsx +368 -0
- package/dist/stories/Typography/Kbd.stories.tsx +514 -0
- package/dist/stories/Typography/Text.stories.tsx +117 -0
- package/dist/stories/Typography/Title.stories.tsx +112 -0
- package/dist/stories/index.json +1435 -0
- package/dist/types.js +127 -0
- package/package.json +12 -7
- package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Box, CloseButton } from '@mantine/core';
|
|
5
|
+
import { Inline } from '../Layout/index.js';
|
|
6
|
+
// Size configurations
|
|
7
|
+
const sizeConfig = {
|
|
8
|
+
xs: {
|
|
9
|
+
height: 18,
|
|
10
|
+
fontSize: 10,
|
|
11
|
+
lineHeight: 10,
|
|
12
|
+
letterSpacing: 0.1563,
|
|
13
|
+
px: 8,
|
|
14
|
+
gap: 0,
|
|
15
|
+
closeSize: 18,
|
|
16
|
+
},
|
|
17
|
+
sm: {
|
|
18
|
+
height: 24,
|
|
19
|
+
fontSize: 11,
|
|
20
|
+
lineHeight: 12,
|
|
21
|
+
letterSpacing: 0.17,
|
|
22
|
+
px: 8,
|
|
23
|
+
gap: 6,
|
|
24
|
+
closeSize: 14,
|
|
25
|
+
},
|
|
26
|
+
md: {
|
|
27
|
+
height: 25,
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
lineHeight: 14,
|
|
30
|
+
letterSpacing: 0.2184,
|
|
31
|
+
px: 11.2,
|
|
32
|
+
gap: 8,
|
|
33
|
+
closeSize: 25,
|
|
34
|
+
},
|
|
35
|
+
lg: {
|
|
36
|
+
height: 32,
|
|
37
|
+
fontSize: 13,
|
|
38
|
+
lineHeight: 14,
|
|
39
|
+
letterSpacing: 0.2,
|
|
40
|
+
px: 12,
|
|
41
|
+
gap: 8,
|
|
42
|
+
closeSize: 18,
|
|
43
|
+
},
|
|
44
|
+
xl: {
|
|
45
|
+
height: 36,
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
lineHeight: 16,
|
|
48
|
+
letterSpacing: 0.22,
|
|
49
|
+
px: 14,
|
|
50
|
+
gap: 8,
|
|
51
|
+
closeSize: 20,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const Pill = forwardRef(({ children, size = 'md', withRemoveButton = false, onRemove, style, ...others }, ref) => {
|
|
55
|
+
const config = sizeConfig[size];
|
|
56
|
+
const colors = {
|
|
57
|
+
backgroundColor: 'var(--ad-color-bg-subtle)',
|
|
58
|
+
color: 'var(--ad-color-text-dimmed)',
|
|
59
|
+
border: 'none',
|
|
60
|
+
};
|
|
61
|
+
return (_jsx(Box, { ref: ref, style: {
|
|
62
|
+
display: 'inline-flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
height: config.height,
|
|
65
|
+
paddingLeft: config.px,
|
|
66
|
+
paddingRight: withRemoveButton ? 0 : config.px,
|
|
67
|
+
borderRadius: config.height / 2,
|
|
68
|
+
fontSize: config.fontSize,
|
|
69
|
+
fontWeight: 400,
|
|
70
|
+
lineHeight: `${config.lineHeight}px`,
|
|
71
|
+
letterSpacing: config.letterSpacing,
|
|
72
|
+
userSelect: 'none',
|
|
73
|
+
...colors,
|
|
74
|
+
...style,
|
|
75
|
+
}, ...others, children: _jsxs(Inline, { gap: config.gap, wrap: "nowrap", children: [_jsx("span", { children: children }), withRemoveButton && (_jsx(CloseButton, { size: config.closeSize, onClick: onRemove, variant: "transparent", style: {
|
|
76
|
+
color: 'currentColor',
|
|
77
|
+
minWidth: config.closeSize,
|
|
78
|
+
minHeight: config.closeSize,
|
|
79
|
+
}, "aria-label": "Remove" }))] }) }));
|
|
80
|
+
});
|
|
81
|
+
Pill.displayName = 'Pill';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Progress as MantineProgress } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Progress Component
|
|
7
|
+
*
|
|
8
|
+
* A progress bar component built on top of Mantine's Progress with
|
|
9
|
+
* consistent design system styling and blue color scheme.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <Progress value={60} />
|
|
15
|
+
*
|
|
16
|
+
* // Different sizes
|
|
17
|
+
* <Progress value={30} size="xs" />
|
|
18
|
+
* <Progress value={50} size="sm" />
|
|
19
|
+
* <Progress value={70} size="md" />
|
|
20
|
+
* <Progress value={80} size="lg" />
|
|
21
|
+
* <Progress value={90} size="xl" />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // With animation
|
|
27
|
+
* <Progress value={75} animated />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // Different progress levels
|
|
33
|
+
* <Progress value={25} /> // Low progress
|
|
34
|
+
* <Progress value={60} /> // Medium progress
|
|
35
|
+
* <Progress value={90} /> // High progress
|
|
36
|
+
* <Progress value={100} /> // Complete
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export const Progress = forwardRef(({ size = 'md', value, animated = false, ...props }, ref) => {
|
|
40
|
+
return (_jsx(MantineProgress, { ref: ref, size: size, value: value, color: "blue", radius: "xl", animated: animated, ...props }));
|
|
41
|
+
});
|
|
42
|
+
Progress.displayName = 'Progress';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { Table as MantineTable } from '@mantine/core';
|
|
5
|
+
// ========================== COMPONENT ==========================
|
|
6
|
+
/**
|
|
7
|
+
* Table Component
|
|
8
|
+
*
|
|
9
|
+
* A simple table component for displaying tabular data with consistent styling.
|
|
10
|
+
* Built on top of Mantine's Table component with Design System patterns.
|
|
11
|
+
*
|
|
12
|
+
* For complex data tables with features like sorting, filtering, and pagination,
|
|
13
|
+
* use the ComplexComponents/DataTable component instead.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* Basic table usage with compound components
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Table with data prop for simple data
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* Styled table with borders and spacing
|
|
23
|
+
*/
|
|
24
|
+
const TableBase = forwardRef((props, ref) => {
|
|
25
|
+
return (_jsx(MantineTable, { ref: ref, horizontalSpacing: "sm", verticalSpacing: "xs", ...props }));
|
|
26
|
+
});
|
|
27
|
+
TableBase.displayName = 'DSTable';
|
|
28
|
+
// Create compound component with proper typing
|
|
29
|
+
export const Table = Object.assign(TableBase, {
|
|
30
|
+
Thead: MantineTable.Thead,
|
|
31
|
+
Tbody: MantineTable.Tbody,
|
|
32
|
+
Tfoot: MantineTable.Tfoot,
|
|
33
|
+
Tr: MantineTable.Tr,
|
|
34
|
+
Th: MantineTable.Th,
|
|
35
|
+
Td: MantineTable.Td,
|
|
36
|
+
Caption: MantineTable.Caption,
|
|
37
|
+
ScrollContainer: MantineTable.ScrollContainer,
|
|
38
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeIcon as MantineThemeIcon } from '@mantine/core';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
export const ThemeIcon = forwardRef(({ children, size = 'md', color = 'default', variant = 'default', style, ...props }, ref) => {
|
|
6
|
+
// Handle xxl size which should be 58x58px
|
|
7
|
+
const getSize = () => {
|
|
8
|
+
if (size === 'xxl') {
|
|
9
|
+
return 58;
|
|
10
|
+
}
|
|
11
|
+
return size;
|
|
12
|
+
};
|
|
13
|
+
const resolvedVariant = variant === 'info' || variant === 'success' || variant === 'danger' || variant === 'pending'
|
|
14
|
+
? 'light'
|
|
15
|
+
: variant;
|
|
16
|
+
const resolvedColor = color !== 'default'
|
|
17
|
+
? color
|
|
18
|
+
: variant === 'info'
|
|
19
|
+
? 'blue'
|
|
20
|
+
: variant === 'success'
|
|
21
|
+
? 'green'
|
|
22
|
+
: variant === 'danger'
|
|
23
|
+
? 'red'
|
|
24
|
+
: variant === 'pending'
|
|
25
|
+
? 'yellow'
|
|
26
|
+
: 'default';
|
|
27
|
+
// For blue/default semantic variants, prefer explicit icon color
|
|
28
|
+
const iconStyle = resolvedColor === 'blue' ? { color: 'var(--ad-color-brand-primary)', ...style } : style;
|
|
29
|
+
return (_jsx(MantineThemeIcon, { ref: ref, size: getSize(), variant: resolvedVariant, color: resolvedColor === 'default' ? undefined : resolvedColor, style: iconStyle, ...props, children: children }));
|
|
30
|
+
});
|
|
31
|
+
ThemeIcon.displayName = 'ThemeIcon';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataDisplay Components
|
|
3
|
+
*
|
|
4
|
+
* Components for displaying and organizing data in various formats.
|
|
5
|
+
*/
|
|
6
|
+
export { Alert } from './Alert.js';
|
|
7
|
+
export { Avatar } from './Avatar.js';
|
|
8
|
+
export { Badge } from './Badge.js';
|
|
9
|
+
export { Card, CardSection } from './Card.js';
|
|
10
|
+
export { Chip } from './Chip.js';
|
|
11
|
+
export { Pill } from './Pill.js';
|
|
12
|
+
export { Indicator } from './Indicator.js';
|
|
13
|
+
export { Progress } from './Progress.js';
|
|
14
|
+
export { ThemeIcon } from './ThemeIcon.js';
|
|
15
|
+
export { List } from './List.js';
|
|
16
|
+
export { Table } from './Table.js';
|
|
17
|
+
// Future data display component exports will go here:
|
|
18
|
+
// export { ADDSKbd } from './Kbd';
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { Checkbox as MantineCheckbox } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Checkbox Component
|
|
7
|
+
*
|
|
8
|
+
* A clean checkbox component built on top of Mantine's Checkbox with
|
|
9
|
+
* consistent design system styling and enforced radius.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <Checkbox label="Accept terms" />
|
|
15
|
+
*
|
|
16
|
+
* // Controlled
|
|
17
|
+
* <Checkbox
|
|
18
|
+
* label="Subscribe to newsletter"
|
|
19
|
+
* checked={subscribed}
|
|
20
|
+
* onChange={(event) => setSubscribed(event.currentTarget.checked)}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* // Required
|
|
24
|
+
* <Checkbox
|
|
25
|
+
* label="I agree to the terms"
|
|
26
|
+
* required
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // Different sizes
|
|
33
|
+
* <Checkbox size="xs" label="Extra small" />
|
|
34
|
+
* <Checkbox size="sm" label="Small" />
|
|
35
|
+
* <Checkbox size="md" label="Medium" />
|
|
36
|
+
* <Checkbox size="lg" label="Large" />
|
|
37
|
+
* <Checkbox size="xl" label="Extra large" />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // States
|
|
43
|
+
* <Checkbox label="Default checkbox" />
|
|
44
|
+
* <Checkbox label="Checked" defaultChecked />
|
|
45
|
+
* <Checkbox label="Disabled" disabled />
|
|
46
|
+
* <Checkbox label="Disabled checked" disabled defaultChecked />
|
|
47
|
+
* <Checkbox label="Indeterminate" indeterminate />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export const Checkbox = forwardRef(({ size = 'md', label, ...props }, ref) => {
|
|
51
|
+
// Construct label with required asterisk if needed
|
|
52
|
+
const enhancedLabel = React.useMemo(() => {
|
|
53
|
+
if (!label)
|
|
54
|
+
return label;
|
|
55
|
+
if (props.required) {
|
|
56
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx("span", { style: { color: 'var(--ad-color-status-error)' }, children: "*" })] }));
|
|
57
|
+
}
|
|
58
|
+
return label;
|
|
59
|
+
}, [label, props.required]);
|
|
60
|
+
return (_jsx(MantineCheckbox, { ref: ref, size: size, radius: "sm", label: enhancedLabel, ...props }));
|
|
61
|
+
});
|
|
62
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { ColorInput as MantineColorInput, 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 ColorInput Component
|
|
11
|
+
*
|
|
12
|
+
* A color picker input built on top of Mantine's ColorInput with
|
|
13
|
+
* consistent design system styling and enforced radius.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ColorInput label="Brand Color" placeholder="#000000" format="hex" />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <ColorInput
|
|
23
|
+
* label="Theme Color"
|
|
24
|
+
* format="hex"
|
|
25
|
+
* swatches={['#FF0000', '#00FF00', '#0000FF']}
|
|
26
|
+
* showOptional
|
|
27
|
+
* hasHelpIcon
|
|
28
|
+
* helpIconLabel="Choose the primary brand color"
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const ColorInput = forwardRef(({ size = 'md', showOptional = false, required, label, hasHelpIcon = false, helpIconLabel, onHelpIconClick, rightSection, error, errorCaption, ...props }, ref) => {
|
|
33
|
+
const effectiveError = error === true ? (errorCaption ?? true) : error;
|
|
34
|
+
const enhancedLabel = React.useMemo(() => {
|
|
35
|
+
if (!label)
|
|
36
|
+
return label;
|
|
37
|
+
if (showOptional && !required) {
|
|
38
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx(Text, { span: true, c: "dimmed", fw: "normal", children: "(Optional)" })] }));
|
|
39
|
+
}
|
|
40
|
+
return label;
|
|
41
|
+
}, [label, showOptional, required]);
|
|
42
|
+
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;
|
|
43
|
+
const composedRightSection = (helpIconElement && rightSection)
|
|
44
|
+
? _jsxs(Group, { gap: 4, wrap: "nowrap", children: [rightSection, helpIconElement] })
|
|
45
|
+
: helpIconElement || rightSection;
|
|
46
|
+
return (_jsx(MantineColorInput, { ref: ref, size: size, radius: "sm", required: required, label: enhancedLabel, rightSection: composedRightSection, error: effectiveError, ...props }));
|
|
47
|
+
});
|
|
48
|
+
ColorInput.displayName = 'ColorInput';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dropzone, IMAGE_MIME_TYPE } from '@mantine/dropzone';
|
|
4
|
+
import { Text } from '@mantine/core';
|
|
5
|
+
import { Inline } from '../Layout/Inline.js';
|
|
6
|
+
import { IconUpload, IconX } from '@tabler/icons-react';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
export const DropZone = forwardRef(({ title = "This is the title", description = "This is the description for the Dropzone component", maxSize = 5 * 1024 ** 2, // 5MB
|
|
9
|
+
accept = IMAGE_MIME_TYPE, onDrop, onReject, ...props }, ref) => {
|
|
10
|
+
return (_jsx(Dropzone, { ref: ref, onDrop: onDrop || ((files) => console.log('accepted files', files)), onReject: onReject || ((files) => console.log('rejected files', files)), maxSize: maxSize, accept: accept, ...props, children: _jsxs(Inline, { justify: "flex-start", gap: "md", mih: 80, style: { pointerEvents: 'none' }, children: [_jsx(Dropzone.Accept, { children: _jsx(IconUpload, { size: 32, color: "var(--ad-color-brand-primary)", stroke: 1.5 }) }), _jsx(Dropzone.Reject, { children: _jsx(IconX, { size: 32, color: "var(--ad-color-status-error)", stroke: 1.5 }) }), _jsx(Dropzone.Idle, { children: _jsx(IconUpload, { size: 32, color: "var(--ad-color-text-dimmed)", stroke: 1.5 }) }), _jsxs("div", { children: [_jsx(Text, { size: "md", fw: 500, mb: 4, children: title }), _jsx(Text, { size: "sm", c: "dimmed", children: description })] })] }) }));
|
|
11
|
+
});
|
|
12
|
+
DropZone.displayName = 'DropZone';
|
|
@@ -0,0 +1,77 @@
|
|
|
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 { FileInput as MantineFileInput } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System FileInput Component
|
|
7
|
+
*
|
|
8
|
+
* A clean file input component built on top of Mantine's FileInput with
|
|
9
|
+
* consistent design system styling and enforced radius.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage (no indication)
|
|
14
|
+
* <FileInput label="Upload File" placeholder="Choose file" />
|
|
15
|
+
*
|
|
16
|
+
* // Required field (shows asterisk)
|
|
17
|
+
* <FileInput
|
|
18
|
+
* label="Resume"
|
|
19
|
+
* placeholder="Upload your resume"
|
|
20
|
+
* required
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* // Optional field (shows "(Optional)")
|
|
24
|
+
* <FileInput
|
|
25
|
+
* label="Profile Picture"
|
|
26
|
+
* placeholder="Upload image"
|
|
27
|
+
* showOptional
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* // With error
|
|
31
|
+
* <FileInput
|
|
32
|
+
* label="Document"
|
|
33
|
+
* error="File is required"
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Different sizes
|
|
40
|
+
* <FileInput size="xs" placeholder="Extra small" />
|
|
41
|
+
* <FileInput size="sm" placeholder="Small" />
|
|
42
|
+
* <FileInput size="md" placeholder="Medium" />
|
|
43
|
+
* <FileInput size="lg" placeholder="Large" />
|
|
44
|
+
* <FileInput size="xl" placeholder="Extra large" />
|
|
45
|
+
*
|
|
46
|
+
* // With file type restrictions
|
|
47
|
+
* <FileInput
|
|
48
|
+
* accept="image/png,image/jpeg"
|
|
49
|
+
* placeholder="Upload image"
|
|
50
|
+
* />
|
|
51
|
+
*
|
|
52
|
+
* // Multiple files
|
|
53
|
+
* <FileInput
|
|
54
|
+
* multiple
|
|
55
|
+
* placeholder="Upload multiple files"
|
|
56
|
+
* />
|
|
57
|
+
*
|
|
58
|
+
* // With clearable option
|
|
59
|
+
* <FileInput
|
|
60
|
+
* clearable
|
|
61
|
+
* placeholder="Upload file (clearable)"
|
|
62
|
+
* />
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export const FileInput = forwardRef(({ size = 'md', className, leftSection, rightSection, showOptional = false, label, ...props }, ref) => {
|
|
66
|
+
// Construct label with optional text if needed
|
|
67
|
+
const enhancedLabel = React.useMemo(() => {
|
|
68
|
+
if (!label)
|
|
69
|
+
return label;
|
|
70
|
+
if (showOptional && !props.required) {
|
|
71
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx("span", { style: { fontWeight: 'normal', color: 'var(--ad-color-text-dimmed)' }, children: "(Optional)" })] }));
|
|
72
|
+
}
|
|
73
|
+
return label;
|
|
74
|
+
}, [label, showOptional, props.required]);
|
|
75
|
+
return (_jsx(MantineFileInput, { ref: ref, size: size, radius: "sm", className: className, leftSection: leftSection, rightSection: rightSection, label: enhancedLabel, ...props }));
|
|
76
|
+
});
|
|
77
|
+
FileInput.displayName = 'FileInput';
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { NumberInput as MantineNumberInput, 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 NumberInput Component
|
|
11
|
+
*
|
|
12
|
+
* A numeric input built on top of Mantine's NumberInput with
|
|
13
|
+
* consistent design system styling and enforced radius.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <NumberInput label="Quantity" placeholder="Enter a number" />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <NumberInput
|
|
23
|
+
* label="Price"
|
|
24
|
+
* prefix="$"
|
|
25
|
+
* decimalScale={2}
|
|
26
|
+
* fixedDecimalScale
|
|
27
|
+
* showOptional
|
|
28
|
+
* hasHelpIcon
|
|
29
|
+
* helpIconLabel="Enter the item price"
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const NumberInput = forwardRef(({ size = 'md', showOptional = false, required, label, hasHelpIcon = false, helpIconLabel, onHelpIconClick, rightSection, error, errorCaption, ...props }, ref) => {
|
|
34
|
+
const effectiveError = error === true ? (errorCaption ?? true) : error;
|
|
35
|
+
const enhancedLabel = React.useMemo(() => {
|
|
36
|
+
if (!label)
|
|
37
|
+
return label;
|
|
38
|
+
if (showOptional && !required) {
|
|
39
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx(Text, { span: true, c: "dimmed", fw: "normal", children: "(Optional)" })] }));
|
|
40
|
+
}
|
|
41
|
+
return label;
|
|
42
|
+
}, [label, showOptional, required]);
|
|
43
|
+
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;
|
|
44
|
+
const composedRightSection = (helpIconElement && rightSection)
|
|
45
|
+
? _jsxs(Group, { gap: 4, wrap: "nowrap", children: [rightSection, helpIconElement] })
|
|
46
|
+
: helpIconElement || rightSection;
|
|
47
|
+
return (_jsx(MantineNumberInput, { ref: ref, size: size, radius: "sm", required: required, label: enhancedLabel, rightSection: composedRightSection, error: effectiveError, ...props }));
|
|
48
|
+
});
|
|
49
|
+
NumberInput.displayName = 'NumberInput';
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { Radio as MantineRadio } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System Radio Component
|
|
7
|
+
*
|
|
8
|
+
* A clean radio button component built on top of Mantine's Radio with
|
|
9
|
+
* consistent design system styling and enforced radius.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <Radio label="Option 1" value="option1" />
|
|
15
|
+
*
|
|
16
|
+
* // In a Radio.Group
|
|
17
|
+
* <Radio.Group label="Choose an option" value={value} onChange={setValue}>
|
|
18
|
+
* <Radio value="option1" label="First option" />
|
|
19
|
+
* <Radio value="option2" label="Second option" />
|
|
20
|
+
* <Radio value="option3" label="Third option" />
|
|
21
|
+
* </Radio.Group>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Different sizes
|
|
27
|
+
* <Radio size="xs" label="Extra small" value="xs" />
|
|
28
|
+
* <Radio size="sm" label="Small" value="sm" />
|
|
29
|
+
* <Radio size="md" label="Medium" value="md" />
|
|
30
|
+
* <Radio size="lg" label="Large" value="lg" />
|
|
31
|
+
* <Radio size="xl" label="Extra large" value="xl" />
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // States
|
|
37
|
+
* <Radio label="Default radio" value="default" />
|
|
38
|
+
* <Radio label="Checked radio" value="checked" defaultChecked />
|
|
39
|
+
* <Radio label="Disabled radio" value="disabled" disabled />
|
|
40
|
+
* <Radio label="Required radio" value="required" required />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const Radio = forwardRef(({ size = 'md', label, ...props }, ref) => {
|
|
44
|
+
// Construct label with required asterisk if needed
|
|
45
|
+
const enhancedLabel = React.useMemo(() => {
|
|
46
|
+
if (!label)
|
|
47
|
+
return label;
|
|
48
|
+
if (props.required) {
|
|
49
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx("span", { style: { color: 'var(--ad-color-status-error)' }, children: "*" })] }));
|
|
50
|
+
}
|
|
51
|
+
return label;
|
|
52
|
+
}, [label, props.required]);
|
|
53
|
+
return (_jsx(MantineRadio, { ref: ref, size: size, label: enhancedLabel, ...props }));
|
|
54
|
+
});
|
|
55
|
+
Radio.displayName = 'Radio';
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { Radio as MantineRadio } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* AppDirect Design System RadioGroup Component
|
|
7
|
+
*
|
|
8
|
+
* A radio group component built on top of Mantine's Radio.Group with
|
|
9
|
+
* consistent design system styling and required asterisk support.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <RadioGroup label="Choose an option" value={value} onChange={setValue}>
|
|
15
|
+
* <Radio value="option1" label="First option" />
|
|
16
|
+
* <Radio value="option2" label="Second option" />
|
|
17
|
+
* <Radio value="option3" label="Third option" />
|
|
18
|
+
* </RadioGroup>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Required group
|
|
24
|
+
* <RadioGroup label="Payment method" required value={payment} onChange={setPayment}>
|
|
25
|
+
* <Radio value="card" label="Credit Card" />
|
|
26
|
+
* <Radio value="paypal" label="PayPal" />
|
|
27
|
+
* <Radio value="bank" label="Bank Transfer" />
|
|
28
|
+
* </RadioGroup>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* // With description and error
|
|
34
|
+
* <RadioGroup
|
|
35
|
+
* label="Subscription plan"
|
|
36
|
+
* description="Choose your preferred plan"
|
|
37
|
+
* error="Please select a plan"
|
|
38
|
+
* value={plan}
|
|
39
|
+
* onChange={setPlan}
|
|
40
|
+
* >
|
|
41
|
+
* <Radio value="basic" label="Basic - $9/month" />
|
|
42
|
+
* <Radio value="pro" label="Pro - $29/month" />
|
|
43
|
+
* <Radio value="enterprise" label="Enterprise - $99/month" />
|
|
44
|
+
* </RadioGroup>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export const RadioGroup = forwardRef(({ size = 'md', label, ...props }, ref) => {
|
|
48
|
+
// Construct label with required asterisk if needed
|
|
49
|
+
const enhancedLabel = React.useMemo(() => {
|
|
50
|
+
if (!label)
|
|
51
|
+
return label;
|
|
52
|
+
if (props.required) {
|
|
53
|
+
return (_jsxs(_Fragment, { children: [label, " ", _jsx("span", { style: { color: 'var(--ad-color-status-error)' }, children: "*" })] }));
|
|
54
|
+
}
|
|
55
|
+
return label;
|
|
56
|
+
}, [label, props.required]);
|
|
57
|
+
return (_jsx(MantineRadio.Group, { ref: ref, size: size, label: enhancedLabel, ...props }));
|
|
58
|
+
});
|
|
59
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { SegmentedControl as MantineSegmentedControl } from '@mantine/core';
|
|
5
|
+
/**
|
|
6
|
+
* SegmentedControl component with consistent design system styling.
|
|
7
|
+
* Built on top of Mantine's SegmentedControl component with enforced radius.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Basic segmented control
|
|
12
|
+
* <SegmentedControl
|
|
13
|
+
* data={['Segment 1', 'Segment 2', 'Segment 3']}
|
|
14
|
+
* defaultValue="Segment 1"
|
|
15
|
+
* />
|
|
16
|
+
*
|
|
17
|
+
* // With different sizes
|
|
18
|
+
* <SegmentedControl
|
|
19
|
+
* size="sm"
|
|
20
|
+
* data={['Small', 'Medium', 'Large']}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* // With custom data structure
|
|
24
|
+
* <SegmentedControl
|
|
25
|
+
* data={[
|
|
26
|
+
* { label: 'React', value: 'react' },
|
|
27
|
+
* { label: 'Vue', value: 'vue' },
|
|
28
|
+
* { label: 'Angular', value: 'angular' }
|
|
29
|
+
* ]}
|
|
30
|
+
* defaultValue="react"
|
|
31
|
+
* />
|
|
32
|
+
*
|
|
33
|
+
* // Controlled component
|
|
34
|
+
* <SegmentedControl
|
|
35
|
+
* value={value}
|
|
36
|
+
* onChange={setValue}
|
|
37
|
+
* data={['Option 1', 'Option 2', 'Option 3']}
|
|
38
|
+
* />
|
|
39
|
+
*
|
|
40
|
+
* // Disabled state
|
|
41
|
+
* <SegmentedControl
|
|
42
|
+
* disabled
|
|
43
|
+
* data={['Disabled', 'Control']}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export const SegmentedControl = ({ ...props }) => {
|
|
48
|
+
return (_jsx(MantineSegmentedControl, { radius: "sm", ...props }));
|
|
49
|
+
};
|
|
50
|
+
export default SegmentedControl;
|