@appdirect/design-system 0.0.0-stage → 0.0.2
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 +12 -2
- package/dist/Buttons/ActionIcon.tsx +37 -0
- package/dist/Buttons/Button.module.css +5 -0
- package/dist/Buttons/Button.tsx +124 -0
- package/dist/Buttons/CloseButton.tsx +83 -0
- package/dist/Buttons/index.ts +20 -0
- package/dist/Combobox/AutocompleteClearable.tsx +128 -0
- package/dist/Combobox/Combobox.tsx +37 -0
- package/dist/Combobox/Multiselect.tsx +158 -0
- package/dist/Combobox/SearchableSelect.tsx +131 -0
- package/dist/Combobox/Select.tsx +154 -0
- package/dist/Combobox/index.ts +20 -0
- package/dist/ComplexComponents/DashboardWidget/DashboardWidget.tsx +313 -0
- package/dist/ComplexComponents/DashboardWidget/index.ts +2 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.tsx +177 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.ts +35 -0
- package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.tsx +74 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.tsx +358 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.tsx +48 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.tsx +26 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.tsx +71 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.tsx +158 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.tsx +79 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.tsx +65 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.ts +70 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.ts +140 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.tsx +76 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.tsx +73 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.tsx +50 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.tsx +788 -0
- package/dist/ComplexComponents/DataTable/DataTable.tsx +582 -0
- package/dist/ComplexComponents/DataTable/ErrorOverlay/index.tsx +29 -0
- package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.tsx +57 -0
- package/dist/ComplexComponents/DataTable/index.ts +2 -0
- package/dist/ComplexComponents/DataTable/translations/en.ts +115 -0
- package/dist/ComplexComponents/DataTable/translations/index.ts +23 -0
- package/dist/ComplexComponents/KeyInsight/KeyInsights.tsx +221 -0
- package/dist/ComplexComponents/KeyInsight/index.ts +2 -0
- package/dist/ComplexComponents/NameValue/NameValue.tsx +175 -0
- package/dist/ComplexComponents/NameValue/NameValueItem.tsx +100 -0
- package/dist/ComplexComponents/NameValue/index.ts +4 -0
- package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +65 -0
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +383 -0
- package/dist/ComplexComponents/PageContentHeader/index.ts +4 -0
- package/dist/ComplexComponents/Utilities/CopyButton.tsx +82 -0
- package/dist/ComplexComponents/Utilities/index.ts +2 -0
- package/dist/DataDisplay/Alert.tsx +130 -0
- package/dist/DataDisplay/Avatar.tsx +216 -0
- package/dist/DataDisplay/Badge.tsx +119 -0
- package/dist/DataDisplay/Card.module.css +26 -0
- package/dist/DataDisplay/Card.tsx +163 -0
- package/dist/DataDisplay/Chip.tsx +66 -0
- package/dist/DataDisplay/Indicator.tsx +122 -0
- package/dist/DataDisplay/List.tsx +90 -0
- package/dist/DataDisplay/Pill.tsx +125 -0
- package/dist/DataDisplay/Progress.tsx +77 -0
- package/dist/DataDisplay/Table.tsx +57 -0
- package/dist/DataDisplay/ThemeIcon.tsx +67 -0
- package/dist/DataDisplay/index.ts +41 -0
- package/dist/Inputs/Checkbox.tsx +94 -0
- package/dist/Inputs/ColorInput.tsx +124 -0
- package/dist/Inputs/DropZone.tsx +78 -0
- package/dist/Inputs/FileInput.tsx +120 -0
- package/dist/Inputs/NumberInput.tsx +125 -0
- package/dist/Inputs/Radio.tsx +86 -0
- package/dist/Inputs/RadioGroup.tsx +90 -0
- package/dist/Inputs/SegmentedControl.tsx +64 -0
- package/dist/Inputs/Slider.tsx +69 -0
- package/dist/Inputs/Switch.tsx +67 -0
- package/dist/Inputs/TextArea.tsx +126 -0
- package/dist/Inputs/TextInput.tsx +167 -0
- package/dist/Inputs/index.ts +51 -0
- package/dist/Layout/Box.tsx +82 -0
- package/dist/Layout/Center.tsx +17 -0
- package/dist/Layout/Container.tsx +17 -0
- package/dist/Layout/Flex.tsx +18 -0
- package/dist/Layout/Grid.tsx +31 -0
- package/dist/Layout/Group.tsx +54 -0
- package/dist/Layout/Inline.tsx +86 -0
- package/dist/Layout/SimpleGrid.tsx +50 -0
- package/dist/Layout/Stack.tsx +86 -0
- package/dist/Layout/index.ts +29 -0
- package/dist/Misc/Divider.tsx +27 -0
- package/dist/Misc/Paper.tsx +47 -0
- package/dist/Misc/index.ts +15 -0
- package/dist/Navigation/Breadcrumb.tsx +138 -0
- package/dist/Navigation/NavLink.tsx +37 -0
- package/dist/Navigation/Stepper.tsx +17 -0
- package/dist/Navigation/Tabs.tsx +29 -0
- package/dist/Navigation/index.ts +17 -0
- package/dist/Overlays/Drawer.tsx +123 -0
- package/dist/Overlays/Menu.tsx +192 -0
- package/dist/Overlays/Modal.tsx +159 -0
- package/dist/Overlays/Popover.tsx +319 -0
- package/dist/Overlays/Tooltip.tsx +131 -0
- package/dist/Overlays/index.ts +19 -0
- package/dist/Shell/AppShellLayout.tsx +56 -0
- package/dist/Shell/HeaderBar.tsx +26 -0
- package/dist/Shell/SidebarNav.tsx +47 -0
- package/dist/Shell/SidebarNavLink.tsx +50 -0
- package/dist/Shell/SingleColumnLayout.tsx +22 -0
- package/dist/Shell/TertiaryColumnLayout.tsx +32 -0
- package/dist/Shell/index.ts +17 -0
- package/dist/Typography/Code.tsx +27 -0
- package/dist/Typography/Kbd.tsx +87 -0
- package/dist/Typography/Text.tsx +27 -0
- package/dist/Typography/Title.tsx +34 -0
- package/dist/Typography/index.ts +21 -0
- package/dist/bin/ds-audit.js +521 -0
- package/dist/config.ts +226 -0
- package/dist/contracts/Alert.json +80 -0
- package/dist/contracts/Badge.json +78 -0
- package/dist/contracts/Box.json +52 -0
- package/dist/contracts/Button.json +111 -0
- package/dist/contracts/DataTable.json +68 -0
- package/dist/contracts/Grid.json +35 -0
- package/dist/contracts/Group.json +44 -0
- package/dist/contracts/Inline.json +73 -0
- package/dist/contracts/PageContentHeader.json +107 -0
- package/dist/contracts/Stack.json +62 -0
- package/dist/contracts/ds-component-contract.v1.json +23 -0
- package/dist/contracts/index.json +55 -0
- package/dist/css/foundations.css +703 -0
- package/dist/css/mantine.css +1777 -0
- package/dist/hooks/useTableHandlers.ts +179 -0
- package/dist/hooks/useTableRenderFunctions.tsx +283 -0
- package/dist/hooks/useTableState.ts +81 -0
- package/dist/index.ts +210 -0
- package/dist/types.ts +202 -0
- package/package.json +56 -4
package/dist/index.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppDirect Design System Components
|
|
3
|
+
*
|
|
4
|
+
* This module exports all AppDirect design system components built on top of Mantine.
|
|
5
|
+
* Components are organized by category and provide consistent styling,
|
|
6
|
+
* behavior, and API across the application.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Import specific components
|
|
10
|
+
* import { Button, TextInput, Badge } from '.';
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Import by category
|
|
14
|
+
* import { Inputs, Buttons, DataDisplay } from '.';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Import components for category exports
|
|
18
|
+
import { TextInput, TextArea, NumberInput, ColorInput, Slider, Switch, SegmentedControl, Checkbox, Radio, RadioGroup, DropZone, FileInput } from './Inputs';
|
|
19
|
+
import { Button, ActionIcon, CloseButton } from './Buttons';
|
|
20
|
+
import { Alert, Avatar, Badge, Card, CardSection, Chip, Pill, Indicator, Progress, ThemeIcon, List, Table } from './DataDisplay';
|
|
21
|
+
import { SearchableSelect, AutocompleteClearable, Multiselect, Select, Combobox } from './Combobox';
|
|
22
|
+
import { Breadcrumb, BackBreadcrumb, NavLink, Stepper, Tabs } from './Navigation';
|
|
23
|
+
import { Drawer, Menu, Modal, ConfirmationModal, Popover, ConfirmationPopover, Tooltip } from './Overlays';
|
|
24
|
+
import { Kbd, Code, Text, Title } from './Typography';
|
|
25
|
+
import { Divider, Paper } from './Misc';
|
|
26
|
+
import { Stack, Group, Inline, Box, SimpleGrid, Grid, Flex, Container, Center } from './Layout';
|
|
27
|
+
import { AppShellLayout, HeaderBar, SidebarNav, SidebarNavLink, SingleColumnLayout, TertiaryColumnLayout } from './Shell';
|
|
28
|
+
import { KeyInsight } from './ComplexComponents/KeyInsight';
|
|
29
|
+
import { NameValue, NameValueItem } from './ComplexComponents/NameValue';
|
|
30
|
+
import { CopyButton } from './ComplexComponents/Utilities';
|
|
31
|
+
import { PageContentHeader, DescriptionBlock } from './ComplexComponents/PageContentHeader';
|
|
32
|
+
import { DataTable } from './ComplexComponents/DataTable';
|
|
33
|
+
import { DashboardWidget } from './ComplexComponents/DashboardWidget';
|
|
34
|
+
|
|
35
|
+
// ========================== INPUTS ==========================
|
|
36
|
+
export { TextInput, TextArea, NumberInput, ColorInput, Slider, Switch, SegmentedControl, Checkbox, Radio, RadioGroup, DropZone, FileInput } from './Inputs';
|
|
37
|
+
export type { DSTextInputProps, DSTextAreaProps, DSNumberInputProps, DSColorInputProps, DSSliderProps, DSSwitchProps, DSSegmentedControlProps, DSCheckboxProps, DSRadioProps, DSRadioGroupProps, DropZoneProps, DSFileInputProps } from './Inputs';
|
|
38
|
+
|
|
39
|
+
// ========================== BUTTONS ==========================
|
|
40
|
+
export { Button, ActionIcon, CloseButton } from './Buttons';
|
|
41
|
+
export type { DSButtonProps, DSActionIconProps, DSCloseButtonProps } from './Buttons';
|
|
42
|
+
|
|
43
|
+
// ========================== COMBOBOX ==========================
|
|
44
|
+
export { SearchableSelect, AutocompleteClearable, Multiselect, Select, Combobox } from './Combobox';
|
|
45
|
+
export type { DSSearchableSelectProps, DSAutocompleteClearableProps, DSMultiselectProps, DSSelectProps, DSComboboxProps } from './Combobox';
|
|
46
|
+
|
|
47
|
+
// ========================== NAVIGATION ==========================
|
|
48
|
+
export { Breadcrumb, BackBreadcrumb, NavLink, Stepper, Tabs } from './Navigation';
|
|
49
|
+
export type { DSBreadcrumbProps, DSBackBreadcrumbProps, BreadcrumbItem, DSNavLinkProps, DSStepperProps, DSTabsProps } from './Navigation';
|
|
50
|
+
|
|
51
|
+
// ========================== OVERLAYS ==========================
|
|
52
|
+
export { Drawer, Menu, Modal, ConfirmationModal, Popover, ConfirmationPopover, Tooltip } from './Overlays';
|
|
53
|
+
export type { DSDrawerProps, DSMenuProps, MenuItem, MenuSection, DSModalProps, ConfirmationModalProps, DSPopoverProps, PopoverAction, ConfirmationPopoverProps, DSTooltipProps } from './Overlays';
|
|
54
|
+
|
|
55
|
+
// ========================== DATA DISPLAY ==========================
|
|
56
|
+
export { Alert, Avatar, Badge, Card, CardSection, Chip, Pill, Indicator, Progress, ThemeIcon, List, Table } from './DataDisplay';
|
|
57
|
+
export type { DSAlertProps, DSAvatarProps, AvatarVariant, AvatarSize, DSBadgeProps, DSCardProps, DSCardSectionProps, DSChipProps, DSPillProps, DSIndicatorProps, DSProgressProps, DSThemeIconProps, ThemeIconSize, ThemeIconColor, DSListProps, DSTableProps } from './DataDisplay';
|
|
58
|
+
|
|
59
|
+
// ========================== TYPOGRAPHY ==========================
|
|
60
|
+
export { Kbd, Code, Text, Title } from './Typography';
|
|
61
|
+
export type { DSKbdProps, DSCodeProps, DSTextProps, DSTitleProps } from './Typography';
|
|
62
|
+
|
|
63
|
+
// ========================== MISC ==========================
|
|
64
|
+
export { Divider, Paper } from './Misc';
|
|
65
|
+
export type { DSDividerProps, DSPaperProps } from './Misc';
|
|
66
|
+
|
|
67
|
+
// ========================== LAYOUT ==========================
|
|
68
|
+
export { Stack, Group, Inline, Box, SimpleGrid, Grid, Flex, Container, Center } from './Layout';
|
|
69
|
+
export type {
|
|
70
|
+
DSStackProps,
|
|
71
|
+
DSGroupProps,
|
|
72
|
+
DSInlineProps,
|
|
73
|
+
DSBoxProps,
|
|
74
|
+
DSSimpleGridProps,
|
|
75
|
+
DSGridProps,
|
|
76
|
+
DSGridColProps,
|
|
77
|
+
DSFlexProps,
|
|
78
|
+
DSContainerProps,
|
|
79
|
+
DSCenterProps,
|
|
80
|
+
SpacingScale,
|
|
81
|
+
} from './Layout';
|
|
82
|
+
|
|
83
|
+
// ========================== SHELL ==========================
|
|
84
|
+
export { AppShellLayout, HeaderBar, SidebarNav, SidebarNavLink, SingleColumnLayout, TertiaryColumnLayout } from './Shell';
|
|
85
|
+
export type { DSAppShellLayoutProps, DSHeaderBarProps, DSSidebarNavProps, NavItem, DSSidebarNavLinkProps, DSSingleColumnLayoutProps, DSTertiaryColumnLayoutProps } from './Shell';
|
|
86
|
+
|
|
87
|
+
// ========================== COMPLEX COMPONENTS ==========================
|
|
88
|
+
export { KeyInsight } from './ComplexComponents/KeyInsight';
|
|
89
|
+
export type { KeyInsightProps } from './ComplexComponents/KeyInsight';
|
|
90
|
+
export { NameValue, NameValueItem } from './ComplexComponents/NameValue';
|
|
91
|
+
export type { NameValueProps, NameValuePair, NameValueItemProps } from './ComplexComponents/NameValue';
|
|
92
|
+
export { CopyButton } from './ComplexComponents/Utilities';
|
|
93
|
+
export type { CopyButtonProps } from './ComplexComponents/Utilities';
|
|
94
|
+
export { PageContentHeader, DescriptionBlock } from './ComplexComponents/PageContentHeader';
|
|
95
|
+
export type { PageContentHeaderProps, ContentSection, DescriptionBlockProps } from './ComplexComponents/PageContentHeader';
|
|
96
|
+
export { DataTable } from './ComplexComponents/DataTable';
|
|
97
|
+
export type { DataTableProps, DataTableColumn, PageInfo } from './ComplexComponents/DataTable';
|
|
98
|
+
export { DashboardWidget } from './ComplexComponents/DashboardWidget';
|
|
99
|
+
export type { DashboardWidgetProps, DashboardWidgetLink } from './ComplexComponents/DashboardWidget';
|
|
100
|
+
|
|
101
|
+
// ========================== CATEGORY EXPORTS ==========================
|
|
102
|
+
// Export components grouped by category for convenient importing
|
|
103
|
+
export const Inputs = {
|
|
104
|
+
TextInput,
|
|
105
|
+
TextArea,
|
|
106
|
+
NumberInput,
|
|
107
|
+
ColorInput,
|
|
108
|
+
Slider,
|
|
109
|
+
Switch,
|
|
110
|
+
SegmentedControl,
|
|
111
|
+
Checkbox,
|
|
112
|
+
Radio,
|
|
113
|
+
RadioGroup,
|
|
114
|
+
DropZone,
|
|
115
|
+
FileInput,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Buttons = {
|
|
119
|
+
Button,
|
|
120
|
+
ActionIcon,
|
|
121
|
+
CloseButton,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const ComboboxComponents = {
|
|
125
|
+
SearchableSelect,
|
|
126
|
+
AutocompleteClearable,
|
|
127
|
+
Multiselect,
|
|
128
|
+
Select,
|
|
129
|
+
Combobox,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const Navigation = {
|
|
133
|
+
Breadcrumb,
|
|
134
|
+
BackBreadcrumb,
|
|
135
|
+
NavLink,
|
|
136
|
+
Stepper,
|
|
137
|
+
Tabs,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const Overlays = {
|
|
141
|
+
Drawer,
|
|
142
|
+
Menu,
|
|
143
|
+
Modal,
|
|
144
|
+
ConfirmationModal,
|
|
145
|
+
Popover,
|
|
146
|
+
ConfirmationPopover,
|
|
147
|
+
Tooltip,
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const DataDisplay = {
|
|
151
|
+
Alert,
|
|
152
|
+
Avatar,
|
|
153
|
+
Badge,
|
|
154
|
+
Card,
|
|
155
|
+
CardSection,
|
|
156
|
+
Chip,
|
|
157
|
+
Pill,
|
|
158
|
+
Indicator,
|
|
159
|
+
Progress,
|
|
160
|
+
ThemeIcon,
|
|
161
|
+
List,
|
|
162
|
+
Table,
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const Typography = {
|
|
166
|
+
Kbd,
|
|
167
|
+
Code,
|
|
168
|
+
Text,
|
|
169
|
+
Title,
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const Misc = {
|
|
173
|
+
Divider,
|
|
174
|
+
Paper,
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const Layout = {
|
|
178
|
+
Stack,
|
|
179
|
+
Group,
|
|
180
|
+
Inline,
|
|
181
|
+
Box,
|
|
182
|
+
SimpleGrid,
|
|
183
|
+
Grid,
|
|
184
|
+
Flex,
|
|
185
|
+
Container,
|
|
186
|
+
Center,
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const Shell = {
|
|
190
|
+
AppShellLayout,
|
|
191
|
+
HeaderBar,
|
|
192
|
+
SidebarNav,
|
|
193
|
+
SidebarNavLink,
|
|
194
|
+
SingleColumnLayout,
|
|
195
|
+
TertiaryColumnLayout,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const ComplexComponents = {
|
|
199
|
+
KeyInsight,
|
|
200
|
+
NameValue,
|
|
201
|
+
NameValueItem,
|
|
202
|
+
CopyButton,
|
|
203
|
+
PageContentHeader,
|
|
204
|
+
DescriptionBlock,
|
|
205
|
+
DataTable,
|
|
206
|
+
DashboardWidget,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// Placeholder export to prevent empty module errors
|
|
210
|
+
export {};
|
package/dist/types.ts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared unions imported by DS wrappers.
|
|
3
|
+
*
|
|
4
|
+
* Wrapper TSX is still the implementation source of truth. These arrays must
|
|
5
|
+
* match the wrappers that import them (`Button`, `Badge`, `Alert`). Do not
|
|
6
|
+
* treat this file as a second API.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// ========================== SIZE TOKENS ==========================
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Standardized size tokens for all Design System components
|
|
13
|
+
* Maps 1:1 with Mantine's size tokens
|
|
14
|
+
*/
|
|
15
|
+
export const DS_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
16
|
+
export type DSSize = typeof DS_SIZES[number];
|
|
17
|
+
|
|
18
|
+
// ========================== VARIANT TOKENS ==========================
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Canonical variant values for the Design System
|
|
22
|
+
* Not all components support all variants - each component defines its subset
|
|
23
|
+
*/
|
|
24
|
+
export const DS_VARIANTS = ['filled', 'outline', 'light', 'subtle', 'transparent'] as const;
|
|
25
|
+
export type DSVariant = typeof DS_VARIANTS[number];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Button-specific variants (extends canonical variants with semantic additions)
|
|
29
|
+
*/
|
|
30
|
+
export const DS_BUTTON_VARIANTS = [
|
|
31
|
+
'primary',
|
|
32
|
+
'secondary',
|
|
33
|
+
'default',
|
|
34
|
+
'disabled',
|
|
35
|
+
'link',
|
|
36
|
+
'secret',
|
|
37
|
+
'outline',
|
|
38
|
+
'danger',
|
|
39
|
+
] as const;
|
|
40
|
+
export type DSButtonVariant = typeof DS_BUTTON_VARIANTS[number];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Badge `variant` values on the wrapper. Figma Code Connect exposes
|
|
44
|
+
* `filled` | `outline`; the wrapper also accepts semantic names as shortcuts.
|
|
45
|
+
*/
|
|
46
|
+
export const DS_BADGE_VARIANTS = [
|
|
47
|
+
'filled',
|
|
48
|
+
'outline',
|
|
49
|
+
'info',
|
|
50
|
+
'success',
|
|
51
|
+
'danger',
|
|
52
|
+
'pending',
|
|
53
|
+
'default',
|
|
54
|
+
'warning',
|
|
55
|
+
] as const;
|
|
56
|
+
export type DSBadgeVariant = typeof DS_BADGE_VARIANTS[number];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Badge `color` values on the wrapper (semantic names plus Mantine aliases).
|
|
60
|
+
*/
|
|
61
|
+
export const DS_BADGE_COLORS = [
|
|
62
|
+
'info',
|
|
63
|
+
'success',
|
|
64
|
+
'danger',
|
|
65
|
+
'pending',
|
|
66
|
+
'default',
|
|
67
|
+
'warning',
|
|
68
|
+
'blue',
|
|
69
|
+
'green',
|
|
70
|
+
'red',
|
|
71
|
+
'yellow',
|
|
72
|
+
'gray',
|
|
73
|
+
] as const;
|
|
74
|
+
export type DSBadgeColor = typeof DS_BADGE_COLORS[number];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Alert `color` / deprecated `type` on the wrapper. No `warning` — use `pending`.
|
|
78
|
+
*/
|
|
79
|
+
export const DS_ALERT_COLORS = ['info', 'success', 'danger', 'pending', 'default'] as const;
|
|
80
|
+
export type DSAlertColor = typeof DS_ALERT_COLORS[number];
|
|
81
|
+
|
|
82
|
+
// ========================== SEMANTIC COLOR TOKENS ==========================
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Semantic color names for the Design System
|
|
86
|
+
* These are the ONLY color values that should be exposed in the public API
|
|
87
|
+
*/
|
|
88
|
+
export const DS_SEMANTIC_COLORS = [
|
|
89
|
+
'neutral', // Gray scale - for default/inactive states
|
|
90
|
+
'info', // Blue - for informational content
|
|
91
|
+
'success', // Green - for success/positive states
|
|
92
|
+
'warning', // Yellow/Orange - for warnings/caution
|
|
93
|
+
'danger', // Red - for errors/destructive actions
|
|
94
|
+
'highlight', // Violet/Accent - for highlighting/emphasis
|
|
95
|
+
] as const;
|
|
96
|
+
export type DSSemanticColor = typeof DS_SEMANTIC_COLORS[number];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Status-oriented semantic colors (commonly used for feedback)
|
|
100
|
+
* A subset focused on status indication
|
|
101
|
+
*/
|
|
102
|
+
export const DS_STATUS_COLORS = ['default', 'info', 'success', 'warning', 'danger', 'pending'] as const;
|
|
103
|
+
export type DSStatusColor = typeof DS_STATUS_COLORS[number];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Semantic → Mantine color map. Wrappers that import a map must stay in sync.
|
|
107
|
+
*/
|
|
108
|
+
export const SEMANTIC_TO_MANTINE_COLOR: Record<DSSemanticColor, string> = {
|
|
109
|
+
neutral: 'gray',
|
|
110
|
+
info: 'blue',
|
|
111
|
+
success: 'green',
|
|
112
|
+
warning: 'yellow',
|
|
113
|
+
danger: 'red',
|
|
114
|
+
highlight: 'violet',
|
|
115
|
+
} as const;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Status color mapping (Badge / Chip / Indicator). Alert uses `DS_ALERT_COLORS`
|
|
119
|
+
* (no `warning`).
|
|
120
|
+
*/
|
|
121
|
+
export const STATUS_TO_MANTINE_COLOR: Record<DSStatusColor, string> = {
|
|
122
|
+
default: 'gray',
|
|
123
|
+
info: 'blue',
|
|
124
|
+
success: 'green',
|
|
125
|
+
warning: 'yellow',
|
|
126
|
+
danger: 'red',
|
|
127
|
+
pending: 'yellow',
|
|
128
|
+
} as const;
|
|
129
|
+
|
|
130
|
+
export const ALERT_TO_MANTINE_COLOR: Record<DSAlertColor, string> = {
|
|
131
|
+
default: 'gray',
|
|
132
|
+
info: 'blue',
|
|
133
|
+
success: 'green',
|
|
134
|
+
danger: 'red',
|
|
135
|
+
pending: 'yellow',
|
|
136
|
+
} as const;
|
|
137
|
+
|
|
138
|
+
// ========================== HELPER FUNCTIONS ==========================
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Convert semantic color to Mantine color
|
|
142
|
+
*/
|
|
143
|
+
export function getSemanticColor(semanticColor: DSSemanticColor): string {
|
|
144
|
+
return SEMANTIC_TO_MANTINE_COLOR[semanticColor];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Convert status color to Mantine color
|
|
149
|
+
*/
|
|
150
|
+
export function getStatusColor(statusColor: DSStatusColor): string {
|
|
151
|
+
return STATUS_TO_MANTINE_COLOR[statusColor];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ========================== COMMON PROP INTERFACES ==========================
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Base props that many components share
|
|
158
|
+
*/
|
|
159
|
+
export interface DSCommonProps {
|
|
160
|
+
/** Size from design system scale */
|
|
161
|
+
size?: DSSize;
|
|
162
|
+
/** Whether component is disabled */
|
|
163
|
+
disabled?: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Common input props (for TextInput, TextArea, Select, etc.)
|
|
168
|
+
*/
|
|
169
|
+
export interface DSInputCommonProps extends DSCommonProps {
|
|
170
|
+
/** Input label */
|
|
171
|
+
label?: React.ReactNode;
|
|
172
|
+
/** Description text below the input */
|
|
173
|
+
description?: string;
|
|
174
|
+
/** Error message or boolean for error state */
|
|
175
|
+
error?: React.ReactNode;
|
|
176
|
+
/** Whether input is required */
|
|
177
|
+
required?: boolean;
|
|
178
|
+
/** Whether to show "(Optional)" text */
|
|
179
|
+
showOptional?: boolean;
|
|
180
|
+
/** Placeholder text */
|
|
181
|
+
placeholder?: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Common button props
|
|
186
|
+
*/
|
|
187
|
+
export interface DSButtonCommonProps extends DSCommonProps {
|
|
188
|
+
/** Button variant */
|
|
189
|
+
variant?: DSButtonVariant;
|
|
190
|
+
/** Whether button takes full width */
|
|
191
|
+
fullWidth?: boolean;
|
|
192
|
+
/** Loading state */
|
|
193
|
+
loading?: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Common feedback props (for Alert, Badge, Indicator, etc.)
|
|
198
|
+
*/
|
|
199
|
+
export interface DSFeedbackCommonProps {
|
|
200
|
+
/** Semantic type/color for feedback */
|
|
201
|
+
type?: DSStatusColor;
|
|
202
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appdirect/design-system",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
|
|
5
|
+
"main": "./dist/index.ts",
|
|
6
|
+
"types": "./dist/index.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ds-audit": "./dist/bin/ds-audit.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.ts",
|
|
13
|
+
"default": "./dist/index.ts"
|
|
14
|
+
},
|
|
15
|
+
"./config": {
|
|
16
|
+
"types": "./dist/config.ts",
|
|
17
|
+
"default": "./dist/config.ts"
|
|
18
|
+
},
|
|
19
|
+
"./types": {
|
|
20
|
+
"types": "./dist/types.ts",
|
|
21
|
+
"default": "./dist/types.ts"
|
|
22
|
+
},
|
|
23
|
+
"./css/foundations.css": "./dist/css/foundations.css",
|
|
24
|
+
"./css/mantine.css": "./dist/css/mantine.css",
|
|
25
|
+
"./contracts": "./dist/contracts/index.json",
|
|
26
|
+
"./contracts/*": "./dist/contracts/*"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"build": "node scripts/build.js",
|
|
35
|
+
"tarball": "npm run build && npm pack",
|
|
36
|
+
"verify:package": "npm pack --dry-run --ignore-scripts",
|
|
37
|
+
"prepublishOnly": "npm run build"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@appdirect/ad-design-tokens": "0.0.2",
|
|
41
|
+
"@mantine/dropzone": "^9.6.0",
|
|
42
|
+
"@remixicon/react": "^4.6.0",
|
|
43
|
+
"@tabler/icons-react": "^3.33.0",
|
|
44
|
+
"mantine-react-table-open": "^9.0.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@mantine/core": "^9.6.0",
|
|
48
|
+
"@mantine/dates": "^9.6.0",
|
|
49
|
+
"@mantine/hooks": "^9.6.0",
|
|
50
|
+
"react": "^19.2.0",
|
|
51
|
+
"react-dom": "^19.2.0"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/AppDirect/ad-design-system.git"
|
|
56
|
+
},
|
|
57
|
+
"license": "UNLICENSED"
|
|
58
|
+
}
|