@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.
Files changed (179) hide show
  1. package/README.md +85 -5
  2. package/dist/Buttons/ActionIcon.js +14 -0
  3. package/dist/Buttons/Button.js +66 -0
  4. package/dist/Buttons/CloseButton.js +48 -0
  5. package/dist/Buttons/index.js +13 -0
  6. package/dist/Combobox/AutocompleteClearable.js +36 -0
  7. package/dist/Combobox/Combobox.js +28 -0
  8. package/dist/Combobox/Multiselect.js +31 -0
  9. package/dist/Combobox/SearchableSelect.js +43 -0
  10. package/dist/Combobox/Select.js +72 -0
  11. package/dist/Combobox/index.js +10 -0
  12. package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +96 -0
  13. package/dist/ComplexComponents/DashboardWidget/index.js +1 -0
  14. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +82 -0
  15. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.js +23 -0
  16. package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.js +23 -0
  17. package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +230 -0
  18. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.js +30 -0
  19. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.js +12 -0
  20. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.js +32 -0
  21. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.js +90 -0
  22. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.js +43 -0
  23. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.js +30 -0
  24. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.js +39 -0
  25. package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.js +9 -0
  26. package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.js +31 -0
  27. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +42 -0
  28. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.js +21 -0
  29. package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.js +410 -0
  30. package/dist/ComplexComponents/DataTable/DataTable.js +405 -0
  31. package/dist/ComplexComponents/DataTable/ErrorOverlay/index.js +9 -0
  32. package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.js +27 -0
  33. package/dist/ComplexComponents/DataTable/index.js +1 -0
  34. package/dist/ComplexComponents/DataTable/translations/en.js +99 -0
  35. package/dist/ComplexComponents/DataTable/translations/index.js +17 -0
  36. package/dist/ComplexComponents/KeyInsight/KeyInsights.js +176 -0
  37. package/dist/ComplexComponents/KeyInsight/index.js +1 -0
  38. package/dist/ComplexComponents/NameValue/NameValue.js +94 -0
  39. package/dist/ComplexComponents/NameValue/NameValueItem.js +59 -0
  40. package/dist/ComplexComponents/NameValue/index.js +2 -0
  41. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +92 -0
  42. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +24 -34
  43. package/dist/ComplexComponents/PageContentHeader/index.js +1 -0
  44. package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
  45. package/dist/ComplexComponents/Placeholder/Placeholder.js +51 -0
  46. package/dist/ComplexComponents/Placeholder/index.js +1 -0
  47. package/dist/ComplexComponents/Slat/Slat.js +53 -0
  48. package/dist/ComplexComponents/Slat/index.js +1 -0
  49. package/dist/ComplexComponents/Utilities/CopyButton.js +45 -0
  50. package/dist/ComplexComponents/Utilities/index.js +1 -0
  51. package/dist/DataDisplay/Alert.js +77 -0
  52. package/dist/DataDisplay/Avatar.js +157 -0
  53. package/dist/DataDisplay/Badge.js +78 -0
  54. package/dist/DataDisplay/Card.js +100 -0
  55. package/dist/DataDisplay/Chip.js +36 -0
  56. package/dist/DataDisplay/Indicator.js +59 -0
  57. package/dist/DataDisplay/List.js +60 -0
  58. package/dist/DataDisplay/Pill.js +81 -0
  59. package/dist/DataDisplay/Progress.js +42 -0
  60. package/dist/DataDisplay/Table.js +38 -0
  61. package/dist/DataDisplay/ThemeIcon.js +31 -0
  62. package/dist/DataDisplay/index.js +18 -0
  63. package/dist/Inputs/Checkbox.js +62 -0
  64. package/dist/Inputs/ColorInput.js +48 -0
  65. package/dist/Inputs/DropZone.js +12 -0
  66. package/dist/Inputs/FileInput.js +77 -0
  67. package/dist/Inputs/NumberInput.js +49 -0
  68. package/dist/Inputs/Radio.js +55 -0
  69. package/dist/Inputs/RadioGroup.js +59 -0
  70. package/dist/Inputs/SegmentedControl.js +50 -0
  71. package/dist/Inputs/Slider.js +50 -0
  72. package/dist/Inputs/SliderWithLabel.js +32 -0
  73. package/dist/Inputs/Switch.js +47 -0
  74. package/dist/Inputs/TextArea.js +50 -0
  75. package/dist/Inputs/TextInput.js +87 -0
  76. package/dist/Inputs/index.js +27 -0
  77. package/dist/Layout/Box.js +39 -0
  78. package/dist/Layout/Center.js +11 -0
  79. package/dist/Layout/Container.js +11 -0
  80. package/dist/Layout/Flex.js +12 -0
  81. package/dist/Layout/Grid.js +13 -0
  82. package/dist/Layout/Group.js +14 -0
  83. package/dist/Layout/Inline.js +46 -0
  84. package/dist/Layout/SimpleGrid.js +14 -0
  85. package/dist/Layout/Stack.js +45 -0
  86. package/dist/Layout/index.js +10 -0
  87. package/dist/Misc/Divider.js +8 -0
  88. package/dist/Misc/Paper.js +24 -0
  89. package/dist/Misc/index.js +10 -0
  90. package/dist/Navigation/Breadcrumb.js +60 -0
  91. package/dist/Navigation/NavLink.js +28 -0
  92. package/dist/Navigation/Stepper.js +8 -0
  93. package/dist/Navigation/Tabs.js +22 -0
  94. package/dist/Navigation/index.js +9 -0
  95. package/dist/Overlays/Drawer.js +63 -0
  96. package/dist/Overlays/Menu.js +85 -0
  97. package/dist/Overlays/Modal.js +61 -0
  98. package/dist/Overlays/Popover.js +118 -0
  99. package/dist/Overlays/Tooltip.js +71 -0
  100. package/dist/Overlays/index.js +12 -0
  101. package/dist/Shell/AppShellLayout.js +13 -0
  102. package/dist/Shell/HeaderBar.js +8 -0
  103. package/dist/Shell/SidebarNav.js +9 -0
  104. package/dist/Shell/SidebarNavLink.js +17 -0
  105. package/dist/Shell/SingleColumnLayout.js +11 -0
  106. package/dist/Shell/TertiaryColumnLayout.js +12 -0
  107. package/dist/Shell/index.js +6 -0
  108. package/dist/Typography/Code.js +8 -0
  109. package/dist/Typography/Kbd.js +58 -0
  110. package/dist/Typography/Text.js +8 -0
  111. package/dist/Typography/Title.js +11 -0
  112. package/dist/Typography/index.js +12 -0
  113. package/dist/config.js +202 -0
  114. package/dist/contracts/PageContentHeader.json +10 -5
  115. package/dist/contracts/index.json +1 -1
  116. package/dist/hooks/useTableHandlers.js +136 -0
  117. package/dist/hooks/useTableRenderFunctions.js +164 -0
  118. package/dist/hooks/useTableState.js +70 -0
  119. package/dist/index.js +162 -0
  120. package/dist/index.ts +3 -4
  121. package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
  122. package/dist/stories/Buttons/Button.stories.tsx +145 -0
  123. package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
  124. package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
  125. package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
  126. package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
  127. package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
  128. package/dist/stories/Combobox/Select.stories.tsx +311 -0
  129. package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
  130. package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
  131. package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
  132. package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
  133. package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
  134. package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
  135. package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
  136. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
  137. package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
  138. package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
  139. package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
  140. package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
  141. package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
  142. package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
  143. package/dist/stories/DataDisplay/List.stories.tsx +376 -0
  144. package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
  145. package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
  146. package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
  147. package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
  148. package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
  149. package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
  150. package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
  151. package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
  152. package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
  153. package/dist/stories/Inputs/Radio.stories.tsx +437 -0
  154. package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
  155. package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
  156. package/dist/stories/Inputs/Slider.stories.tsx +22 -0
  157. package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
  158. package/dist/stories/Inputs/Switch.stories.tsx +361 -0
  159. package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
  160. package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
  161. package/dist/stories/Misc/Divider.stories.tsx +581 -0
  162. package/dist/stories/Misc/Paper.stories.tsx +557 -0
  163. package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
  164. package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
  165. package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
  166. package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
  167. package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
  168. package/dist/stories/Overlays/Menu.stories.tsx +941 -0
  169. package/dist/stories/Overlays/Modal.stories.tsx +249 -0
  170. package/dist/stories/Overlays/Popover.stories.tsx +780 -0
  171. package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
  172. package/dist/stories/Typography/Code.stories.tsx +368 -0
  173. package/dist/stories/Typography/Kbd.stories.tsx +514 -0
  174. package/dist/stories/Typography/Text.stories.tsx +117 -0
  175. package/dist/stories/Typography/Title.stories.tsx +112 -0
  176. package/dist/stories/index.json +1435 -0
  177. package/dist/types.js +127 -0
  178. package/package.json +12 -7
  179. package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
package/dist/types.js ADDED
@@ -0,0 +1,127 @@
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
+ // ========================== SIZE TOKENS ==========================
9
+ /**
10
+ * Standardized size tokens for all Design System components
11
+ * Maps 1:1 with Mantine's size tokens
12
+ */
13
+ export const DS_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'];
14
+ // ========================== VARIANT TOKENS ==========================
15
+ /**
16
+ * Canonical variant values for the Design System
17
+ * Not all components support all variants - each component defines its subset
18
+ */
19
+ export const DS_VARIANTS = ['filled', 'outline', 'light', 'subtle', 'transparent'];
20
+ /**
21
+ * Button-specific variants (extends canonical variants with semantic additions)
22
+ */
23
+ export const DS_BUTTON_VARIANTS = [
24
+ 'primary',
25
+ 'secondary',
26
+ 'default',
27
+ 'disabled',
28
+ 'link',
29
+ 'secret',
30
+ 'outline',
31
+ 'danger',
32
+ ];
33
+ /**
34
+ * Badge `variant` values on the wrapper. Figma Code Connect exposes
35
+ * `filled` | `outline`; the wrapper also accepts semantic names as shortcuts.
36
+ */
37
+ export const DS_BADGE_VARIANTS = [
38
+ 'filled',
39
+ 'outline',
40
+ 'info',
41
+ 'success',
42
+ 'danger',
43
+ 'pending',
44
+ 'default',
45
+ 'warning',
46
+ ];
47
+ /**
48
+ * Badge `color` values on the wrapper (semantic names plus Mantine aliases).
49
+ */
50
+ export const DS_BADGE_COLORS = [
51
+ 'info',
52
+ 'success',
53
+ 'danger',
54
+ 'pending',
55
+ 'default',
56
+ 'warning',
57
+ 'blue',
58
+ 'green',
59
+ 'red',
60
+ 'yellow',
61
+ 'gray',
62
+ ];
63
+ /**
64
+ * Alert `color` / deprecated `type` on the wrapper. No `warning` — use `pending`.
65
+ */
66
+ export const DS_ALERT_COLORS = ['info', 'success', 'danger', 'pending', 'default'];
67
+ // ========================== SEMANTIC COLOR TOKENS ==========================
68
+ /**
69
+ * Semantic color names for the Design System
70
+ * These are the ONLY color values that should be exposed in the public API
71
+ */
72
+ export const DS_SEMANTIC_COLORS = [
73
+ 'neutral', // Gray scale - for default/inactive states
74
+ 'info', // Blue - for informational content
75
+ 'success', // Green - for success/positive states
76
+ 'warning', // Yellow/Orange - for warnings/caution
77
+ 'danger', // Red - for errors/destructive actions
78
+ 'highlight', // Violet/Accent - for highlighting/emphasis
79
+ ];
80
+ /**
81
+ * Status-oriented semantic colors (commonly used for feedback)
82
+ * A subset focused on status indication
83
+ */
84
+ export const DS_STATUS_COLORS = ['default', 'info', 'success', 'warning', 'danger', 'pending'];
85
+ /**
86
+ * Semantic → Mantine color map. Wrappers that import a map must stay in sync.
87
+ */
88
+ export const SEMANTIC_TO_MANTINE_COLOR = {
89
+ neutral: 'gray',
90
+ info: 'blue',
91
+ success: 'green',
92
+ warning: 'yellow',
93
+ danger: 'red',
94
+ highlight: 'violet',
95
+ };
96
+ /**
97
+ * Status color mapping (Badge / Chip / Indicator). Alert uses `DS_ALERT_COLORS`
98
+ * (no `warning`).
99
+ */
100
+ export const STATUS_TO_MANTINE_COLOR = {
101
+ default: 'gray',
102
+ info: 'blue',
103
+ success: 'green',
104
+ warning: 'yellow',
105
+ danger: 'red',
106
+ pending: 'yellow',
107
+ };
108
+ export const ALERT_TO_MANTINE_COLOR = {
109
+ default: 'gray',
110
+ info: 'blue',
111
+ success: 'green',
112
+ danger: 'red',
113
+ pending: 'yellow',
114
+ };
115
+ // ========================== HELPER FUNCTIONS ==========================
116
+ /**
117
+ * Convert semantic color to Mantine color
118
+ */
119
+ export function getSemanticColor(semanticColor) {
120
+ return SEMANTIC_TO_MANTINE_COLOR[semanticColor];
121
+ }
122
+ /**
123
+ * Convert status color to Mantine color
124
+ */
125
+ export function getStatusColor(statusColor) {
126
+ return STATUS_TO_MANTINE_COLOR[statusColor];
127
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@appdirect/design-system",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
5
- "main": "./dist/index.ts",
5
+ "main": "./dist/index.js",
6
6
  "types": "./dist/index.ts",
7
7
  "bin": {
8
8
  "ds-audit": "./dist/bin/ds-audit.js"
@@ -10,20 +10,22 @@
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/index.ts",
13
- "default": "./dist/index.ts"
13
+ "default": "./dist/index.js"
14
14
  },
15
15
  "./config": {
16
16
  "types": "./dist/config.ts",
17
- "default": "./dist/config.ts"
17
+ "default": "./dist/config.js"
18
18
  },
19
19
  "./types": {
20
20
  "types": "./dist/types.ts",
21
- "default": "./dist/types.ts"
21
+ "default": "./dist/types.js"
22
22
  },
23
23
  "./css/foundations.css": "./dist/css/foundations.css",
24
24
  "./css/mantine.css": "./dist/css/mantine.css",
25
25
  "./contracts": "./dist/contracts/index.json",
26
- "./contracts/*": "./dist/contracts/*"
26
+ "./contracts/*": "./dist/contracts/*",
27
+ "./stories": "./dist/stories/index.json",
28
+ "./stories/*": "./dist/stories/*"
27
29
  },
28
30
  "files": [
29
31
  "dist",
@@ -37,7 +39,7 @@
37
39
  "prepublishOnly": "npm run build"
38
40
  },
39
41
  "dependencies": {
40
- "@appdirect/ad-design-tokens": "0.0.10",
42
+ "@appdirect/ad-design-tokens": "0.0.12",
41
43
  "@mantine/dropzone": "^9.6.0",
42
44
  "@remixicon/react": "^4.6.0",
43
45
  "@tabler/icons-react": "^3.33.0",
@@ -50,6 +52,9 @@
50
52
  "react": "^19.2.0",
51
53
  "react-dom": "^19.2.0"
52
54
  },
55
+ "devDependencies": {
56
+ "typescript": "^5.9.3"
57
+ },
53
58
  "repository": {
54
59
  "type": "git",
55
60
  "url": "git+https://github.com/AppDirect/ad-design-system.git"
@@ -1,65 +0,0 @@
1
- import React from 'react';
2
- import { Inline } from '../../Layout/Inline';
3
- import { Title } from '../../Typography/Title';
4
- import { Text } from '../../Typography/Text';
5
-
6
- export interface DescriptionBlockProps {
7
- /** Optional title for the description block */
8
- title?: string;
9
- /** Description text content */
10
- description: string;
11
- /** Whether description supports HTML/links */
12
- allowHtml?: boolean;
13
- }
14
-
15
- /**
16
- * DescriptionBlock Component
17
- *
18
- * A component for displaying structured description content with an optional title.
19
- * Uses Group layout with Title (h4) and Text (md) styling.
20
- *
21
- * @example
22
- * // Basic usage with title
23
- * <DescriptionBlock
24
- * title="This is an optional title"
25
- * description="This is some descriptive text. Try not to make this too long and don't be too specific to prevent stale documentation."
26
- * />
27
- *
28
- * @example
29
- * // With HTML content
30
- * <DescriptionBlock
31
- * title="Getting Started"
32
- * description="This is some descriptive text. It's <a href='/docs'>great to link into doc</a> pages!"
33
- * allowHtml={true}
34
- * />
35
- *
36
- * @example
37
- * // Description only (no title)
38
- * <DescriptionBlock
39
- * description="This standalone description provides context without a title."
40
- * />
41
- */
42
- export function DescriptionBlock({
43
- title,
44
- description,
45
- allowHtml = false,
46
- }: DescriptionBlockProps) {
47
- return (
48
- <Inline gap="xs" align="flex-start" p="sm">
49
- {title && (
50
- <Title order={4}>
51
- {title}
52
- </Title>
53
- )}
54
- {allowHtml ? (
55
- <Text size="md" style={{ lineHeight: 1.6 }}>
56
- <div dangerouslySetInnerHTML={{ __html: description }} />
57
- </Text>
58
- ) : (
59
- <Text size="md" style={{ lineHeight: 1.6 }}>
60
- {description}
61
- </Text>
62
- )}
63
- </Inline>
64
- );
65
- }