@appdirect/design-system 0.0.24 → 0.0.28

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 (46) hide show
  1. package/README.md +11 -0
  2. package/dist/Combobox/AutocompleteClearable.js +33 -35
  3. package/dist/Combobox/AutocompleteClearable.tsx +56 -121
  4. package/dist/Combobox/SearchableSelect.js +23 -42
  5. package/dist/Combobox/SearchableSelect.tsx +33 -129
  6. package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +1 -1
  7. package/dist/ComplexComponents/DashboardWidget/DashboardWidget.tsx +9 -7
  8. package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +1 -1
  9. package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.tsx +1 -1
  10. package/dist/ComplexComponents/KeyInsight/KeyInsights.js +6 -1
  11. package/dist/ComplexComponents/KeyInsight/KeyInsights.tsx +12 -2
  12. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +1 -1
  13. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +16 -11
  14. package/dist/ComplexComponents/Slat/Slat.js +14 -7
  15. package/dist/ComplexComponents/Slat/Slat.tsx +31 -19
  16. package/dist/ComplexComponents/Utilities/CopyButton.js +15 -27
  17. package/dist/ComplexComponents/Utilities/CopyButton.tsx +35 -49
  18. package/dist/DESIGN.md +4 -0
  19. package/dist/DataDisplay/Alert.js +2 -2
  20. package/dist/DataDisplay/Alert.tsx +7 -0
  21. package/dist/DataDisplay/Avatar.js +26 -81
  22. package/dist/DataDisplay/Avatar.tsx +35 -93
  23. package/dist/DataDisplay/Card.js +5 -4
  24. package/dist/DataDisplay/Card.tsx +5 -11
  25. package/dist/Layout/Inline.js +5 -42
  26. package/dist/Layout/Inline.tsx +6 -79
  27. package/dist/Overlays/Modal.js +2 -2
  28. package/dist/Overlays/Modal.tsx +4 -4
  29. package/dist/contracts/Alert.json +5 -0
  30. package/dist/contracts/index.json +1 -1
  31. package/dist/css/mantine.css +120 -12
  32. package/dist/css/tokens.css +52 -14
  33. package/dist/hooks/index.js +18 -0
  34. package/dist/hooks/index.ts +28 -0
  35. package/dist/hooks/useSelectedRowsText.js +73 -0
  36. package/dist/hooks/useSelectedRowsText.ts +74 -0
  37. package/dist/stories/Combobox/SearchableSelect.stories.tsx +3 -3
  38. package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +7 -0
  39. package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +21 -21
  40. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +4 -14
  41. package/dist/stories/DataDisplay/Progress.stories.tsx +11 -27
  42. package/dist/stories/Navigation/Stepper.stories.tsx +25 -21
  43. package/dist/stories/Overlays/Drawer.stories.tsx +6 -6
  44. package/dist/stories/Overlays/Modal.stories.tsx +31 -11
  45. package/dist/stories/index.json +6 -6
  46. package/package.json +97 -3
@@ -148,19 +148,21 @@ export const InteractiveStepper: Story = {
148
148
  </Stepper>
149
149
 
150
150
  <Inline justify="center" gap="md">
151
- <Button
152
- variant="outline"
153
- onClick={() => setActiveStep((s) => Math.max(0, s - 1))}
154
- disabled={activeStep === 0}
155
- >
156
- Previous
157
- </Button>
158
- <Button
159
- onClick={() => setActiveStep((s) => Math.min(totalSteps - 1, s + 1))}
160
- disabled={activeStep === totalSteps - 1}
161
- >
162
- Next
163
- </Button>
151
+ {activeStep > 0 && (
152
+ <Button
153
+ variant="outline"
154
+ onClick={() => setActiveStep((s) => Math.max(0, s - 1))}
155
+ >
156
+ Previous
157
+ </Button>
158
+ )}
159
+ {activeStep < totalSteps - 1 && (
160
+ <Button
161
+ onClick={() => setActiveStep((s) => Math.min(totalSteps - 1, s + 1))}
162
+ >
163
+ Next
164
+ </Button>
165
+ )}
164
166
  </Inline>
165
167
 
166
168
  <Text size="sm" ta="center" c="dimmed">
@@ -261,13 +263,16 @@ export const FormWizard: Story = {
261
263
  </Stepper>
262
264
 
263
265
  <Inline justify="space-between" mt="lg">
264
- <Button
265
- variant="outline"
266
- onClick={() => setWizardStep(s => Math.max(0, s - 1))}
267
- disabled={wizardStep === 0}
268
- >
269
- Back
270
- </Button>
266
+ {wizardStep > 0 ? (
267
+ <Button
268
+ variant="outline"
269
+ onClick={() => setWizardStep(s => Math.max(0, s - 1))}
270
+ >
271
+ Back
272
+ </Button>
273
+ ) : (
274
+ <div />
275
+ )}
271
276
 
272
277
  <Text size="sm" c="dimmed">
273
278
  Step {wizardStep + 1} of {totalSteps}
@@ -275,7 +280,6 @@ export const FormWizard: Story = {
275
280
 
276
281
  <Button
277
282
  onClick={() => setWizardStep(s => Math.min(totalSteps - 1, s + 1))}
278
- disabled={wizardStep === totalSteps - 1}
279
283
  >
280
284
  {wizardStep === totalSteps - 1 ? 'Submit' : 'Continue'}
281
285
  </Button>
@@ -305,12 +305,12 @@ export const SettingsDrawer: Story = {
305
305
  <Divider />
306
306
 
307
307
  <Inline gap="sm" justify="flex-start">
308
- <Button variant="outline" onClick={() => setOpened(false)}>
309
- Cancel
310
- </Button>
311
308
  <Button variant="primary" onClick={() => setOpened(false)}>
312
309
  Save Changes
313
310
  </Button>
311
+ <Button variant="outline" onClick={() => setOpened(false)}>
312
+ Cancel
313
+ </Button>
314
314
  </Inline>
315
315
  </Stack>
316
316
  </Drawer>
@@ -743,12 +743,12 @@ export const UseCases: Story = {
743
743
  <Divider />
744
744
 
745
745
  <Inline gap="sm" justify="flex-start">
746
- <Button variant="outline" onClick={() => setProfileOpened(false)}>
747
- Cancel
748
- </Button>
749
746
  <Button variant="primary" onClick={() => setProfileOpened(false)}>
750
747
  Save Changes
751
748
  </Button>
749
+ <Button variant="outline" onClick={() => setProfileOpened(false)}>
750
+ Cancel
751
+ </Button>
752
752
  </Inline>
753
753
  </Stack>
754
754
  </Drawer>
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
2
  import { useState } from 'react';
3
- import { Inline, Stack, Modal, ConfirmationModal, Title, Text, TextInput, TextArea, Switch, Button } from '@appdirect/design-system';
3
+ import { Inline, Stack, Modal, ConfirmationModal, Text, TextInput, TextArea, Switch, Button } from '@appdirect/design-system';
4
4
 
5
5
  const meta: Meta<typeof Modal> = {
6
6
  title: 'Design System/Overlays/Modal',
@@ -110,12 +110,12 @@ export const ComposedConfirmation: Story = {
110
110
  <Stack gap="md">
111
111
  <Text>This action cannot be undone. Are you sure you want to delete this item?</Text>
112
112
  <Inline justify="flex-start" gap="sm">
113
- <Button variant="outline" onClick={() => setOpened(false)}>
114
- Cancel
115
- </Button>
116
113
  <Button variant="danger" onClick={() => setOpened(false)}>
117
114
  Delete
118
115
  </Button>
116
+ <Button variant="outline" onClick={() => setOpened(false)}>
117
+ Cancel
118
+ </Button>
119
119
  </Inline>
120
120
  </Stack>
121
121
  </Modal>
@@ -132,6 +132,16 @@ export const FormModal: Story = {
132
132
  description: '',
133
133
  active: false,
134
134
  });
135
+ const [nameError, setNameError] = useState<string | undefined>();
136
+
137
+ // The submit button is never disabled. An incomplete form is reported on click instead.
138
+ const handleCreate = () => {
139
+ if (!formData.name.trim()) {
140
+ setNameError('Name is required');
141
+ return;
142
+ }
143
+ setOpened(false);
144
+ };
135
145
 
136
146
  return (
137
147
  <>
@@ -143,7 +153,11 @@ export const FormModal: Story = {
143
153
  label="Name"
144
154
  placeholder="Enter item name..."
145
155
  value={formData.name}
146
- onChange={(event) => setFormData((prev) => ({ ...prev, name: event.target.value }))}
156
+ onChange={(event) => {
157
+ setFormData((prev) => ({ ...prev, name: event.target.value }));
158
+ setNameError(undefined);
159
+ }}
160
+ error={nameError}
147
161
  required
148
162
  />
149
163
  <TextArea
@@ -163,17 +177,23 @@ export const FormModal: Story = {
163
177
  }
164
178
  />
165
179
  <Inline justify="space-between" gap="sm">
166
- <Button variant="default" onClick={() => setFormData({ name: '', description: '', active: false })}>
167
- Reset Form
168
- </Button>
169
180
  <Inline justify="flex-start" gap="sm">
181
+ <Button variant="primary" onClick={handleCreate}>
182
+ Create Item
183
+ </Button>
170
184
  <Button variant="outline" onClick={() => setOpened(false)}>
171
185
  Cancel
172
186
  </Button>
173
- <Button variant="primary" disabled={!formData.name.trim()} onClick={() => setOpened(false)}>
174
- Create Item
175
- </Button>
176
187
  </Inline>
188
+ <Button
189
+ variant="default"
190
+ onClick={() => {
191
+ setFormData({ name: '', description: '', active: false });
192
+ setNameError(undefined);
193
+ }}
194
+ >
195
+ Reset
196
+ </Button>
177
197
  </Inline>
178
198
  </Stack>
179
199
  </Modal>
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.24",
2
+ "version": "0.0.28",
3
3
  "stories": [
4
4
  {
5
5
  "title": "Design System/Buttons/ActionIcon",
@@ -150,7 +150,7 @@
150
150
  {
151
151
  "title": "Design System/Combobox/SearchableSelect",
152
152
  "component": "SearchableSelect",
153
- "description": "Searchable select input with filtering capabilities and dropdown options.",
153
+ "description": "The DS Select with `searchable` on by default. Designers use Combobox in Figma; engineering swaps in SearchableSelect for type-to-filter fields.",
154
154
  "stories": [
155
155
  "Default",
156
156
  "Sizes",
@@ -168,7 +168,6 @@
168
168
  ],
169
169
  "file": "Combobox/SearchableSelect.stories.tsx",
170
170
  "designSystem": [
171
- "Inline",
172
171
  "SearchableSelect",
173
172
  "Text",
174
173
  "Title"
@@ -216,6 +215,7 @@
216
215
  "description": "A flexible dashboard widget container that supports: - **Header**: Title, optional switch, and actions menu - **Content Area**: Any React content (charts, tables, text, etc.) - **Optional Controls**: Header select for filtering/selection - **Footer**: Optional action links with arrows Built on top of our Card component with consistent Design System styling.",
217
216
  "stories": [
218
217
  "Basic",
218
+ "WithPanelNotification",
219
219
  "WithSwitch",
220
220
  "WithActionsMenu",
221
221
  "WithHeaderSelect",
@@ -417,7 +417,7 @@
417
417
  {
418
418
  "title": "Design System/Complex Components/Utilities/CopyButton",
419
419
  "component": "CopyButton",
420
- "description": "A reusable button component with copy-to-clipboard functionality and interactive tooltips. Shows \"Copy\" on hover and \"Copied\" after clicking, resetting when cursor leaves.",
420
+ "description": "A reusable button component with copy-to-clipboard functionality and interactive tooltips. Built on Mantine's CopyButton: clicking copies the value and the tooltip shows \"Copied\" briefly.",
421
421
  "stories": [
422
422
  "Default",
423
423
  "BasicUsage",
@@ -694,6 +694,7 @@
694
694
  ],
695
695
  "file": "DataDisplay/Progress.stories.tsx",
696
696
  "designSystem": [
697
+ "Button",
697
698
  "Inline",
698
699
  "Progress",
699
700
  "Text",
@@ -1311,8 +1312,7 @@
1311
1312
  "Switch",
1312
1313
  "Text",
1313
1314
  "TextArea",
1314
- "TextInput",
1315
- "Title"
1315
+ "TextInput"
1316
1316
  ],
1317
1317
  "mantine": []
1318
1318
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appdirect/design-system",
3
- "version": "0.0.24",
3
+ "version": "0.0.28",
4
4
  "description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.ts",
@@ -31,7 +31,99 @@
31
31
  "./contracts/*": "./dist/contracts/*",
32
32
  "./stories": "./dist/stories/index.json",
33
33
  "./stories/*": "./dist/stories/*",
34
- "./agent-kit/*": "./dist/agent-kit/*"
34
+ "./agent-kit/*": "./dist/agent-kit/*",
35
+ "./Buttons": {
36
+ "types": "./dist/Buttons/index.ts",
37
+ "default": "./dist/Buttons/index.js"
38
+ },
39
+ "./Buttons/*": {
40
+ "types": "./dist/Buttons/*.tsx",
41
+ "default": "./dist/Buttons/*.js"
42
+ },
43
+ "./Combobox": {
44
+ "types": "./dist/Combobox/index.ts",
45
+ "default": "./dist/Combobox/index.js"
46
+ },
47
+ "./Combobox/*": {
48
+ "types": "./dist/Combobox/*.tsx",
49
+ "default": "./dist/Combobox/*.js"
50
+ },
51
+ "./ComplexComponents/*": {
52
+ "types": "./dist/ComplexComponents/*/index.ts",
53
+ "default": "./dist/ComplexComponents/*/index.js"
54
+ },
55
+ "./DataDisplay": {
56
+ "types": "./dist/DataDisplay/index.ts",
57
+ "default": "./dist/DataDisplay/index.js"
58
+ },
59
+ "./DataDisplay/*": {
60
+ "types": "./dist/DataDisplay/*.tsx",
61
+ "default": "./dist/DataDisplay/*.js"
62
+ },
63
+ "./Inputs": {
64
+ "types": "./dist/Inputs/index.ts",
65
+ "default": "./dist/Inputs/index.js"
66
+ },
67
+ "./Inputs/*": {
68
+ "types": "./dist/Inputs/*.tsx",
69
+ "default": "./dist/Inputs/*.js"
70
+ },
71
+ "./Layout": {
72
+ "types": "./dist/Layout/index.ts",
73
+ "default": "./dist/Layout/index.js"
74
+ },
75
+ "./Layout/*": {
76
+ "types": "./dist/Layout/*.tsx",
77
+ "default": "./dist/Layout/*.js"
78
+ },
79
+ "./Misc": {
80
+ "types": "./dist/Misc/index.ts",
81
+ "default": "./dist/Misc/index.js"
82
+ },
83
+ "./Misc/*": {
84
+ "types": "./dist/Misc/*.tsx",
85
+ "default": "./dist/Misc/*.js"
86
+ },
87
+ "./Navigation": {
88
+ "types": "./dist/Navigation/index.ts",
89
+ "default": "./dist/Navigation/index.js"
90
+ },
91
+ "./Navigation/*": {
92
+ "types": "./dist/Navigation/*.tsx",
93
+ "default": "./dist/Navigation/*.js"
94
+ },
95
+ "./Overlays": {
96
+ "types": "./dist/Overlays/index.ts",
97
+ "default": "./dist/Overlays/index.js"
98
+ },
99
+ "./Overlays/*": {
100
+ "types": "./dist/Overlays/*.tsx",
101
+ "default": "./dist/Overlays/*.js"
102
+ },
103
+ "./Shell": {
104
+ "types": "./dist/Shell/index.ts",
105
+ "default": "./dist/Shell/index.js"
106
+ },
107
+ "./Shell/*": {
108
+ "types": "./dist/Shell/*.tsx",
109
+ "default": "./dist/Shell/*.js"
110
+ },
111
+ "./Typography": {
112
+ "types": "./dist/Typography/index.ts",
113
+ "default": "./dist/Typography/index.js"
114
+ },
115
+ "./Typography/*": {
116
+ "types": "./dist/Typography/*.tsx",
117
+ "default": "./dist/Typography/*.js"
118
+ },
119
+ "./hooks": {
120
+ "types": "./dist/hooks/index.ts",
121
+ "default": "./dist/hooks/index.js"
122
+ },
123
+ "./hooks/*": {
124
+ "types": "./dist/hooks/*.ts",
125
+ "default": "./dist/hooks/*.js"
126
+ }
35
127
  },
36
128
  "files": [
37
129
  "bin/ad-sync-design-md.mjs",
@@ -43,13 +135,15 @@
43
135
  "clean": "rm -rf dist",
44
136
  "build": "node scripts/build.js",
45
137
  "tarball": "npm run build && npm pack",
138
+ "test": "npm run test:sync-design-md && npm run test:sync-agents && npm run test:build",
46
139
  "test:sync-design-md": "node --test bin/ad-sync-design-md.test.mjs",
47
140
  "test:sync-agents": "node --test bin/ad-sync-agents.test.mjs",
141
+ "test:build": "node --test scripts/build.test.mjs",
48
142
  "verify:package": "npm pack --dry-run --ignore-scripts",
49
143
  "prepublishOnly": "npm run build"
50
144
  },
51
145
  "dependencies": {
52
- "@appdirect/ad-design-tokens": "0.0.24",
146
+ "@appdirect/ad-design-tokens": "0.0.28",
53
147
  "@remixicon/react": "^4.6.0",
54
148
  "@tabler/icons-react": "^3.33.0",
55
149
  "@tanstack/react-table": "^9.2.4",