@appdirect/design-system 0.0.14 → 0.0.16

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.
@@ -8,7 +8,7 @@ const meta: Meta<typeof KeyInsight> = {
8
8
  layout: 'centered',
9
9
  docs: {
10
10
  description: {
11
- component: 'KeyInsight component for displaying key metrics or insights with a title, value, and optional subtitle. Supports multiple sizes from xs to xxl. Commonly used in dashboards, analytics pages, or summary sections.',
11
+ component: 'KeyInsight component for displaying key metrics or insights with a title, value, and optional subtitle. Sizes: super-jumbo, jumbo, and level-1 through level-6. Use valueAs="p" or "span" when a level-1 visual size must not be an h1.',
12
12
  },
13
13
  },
14
14
  },
@@ -32,8 +32,13 @@ const meta: Meta<typeof KeyInsight> = {
32
32
  },
33
33
  size: {
34
34
  control: 'select',
35
- options: ['xs', 'sm', 'md', 'lg', 'jumbo', 'super-jumbo'],
36
- description: 'Size of the KeyInsight component',
35
+ options: ['super-jumbo', 'jumbo', 'level-1', 'level-2', 'level-3', 'level-4', 'level-5', 'level-6'],
36
+ description: 'Visual size. Deprecated aliases xs/sm/md/lg still resolve to level-4/3/2/1.',
37
+ },
38
+ valueAs: {
39
+ control: 'select',
40
+ options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'],
41
+ description: 'Element for the value. Defaults to the heading for the size. Use p or span so level-1 is not an h1.',
37
42
  },
38
43
  },
39
44
  };
@@ -45,7 +50,7 @@ export const Default: Story = {
45
50
  args: {
46
51
  value: 1250,
47
52
  title: 'Total Users',
48
- size: 'md',
53
+ size: 'level-2',
49
54
  },
50
55
  };
51
56
 
@@ -54,7 +59,7 @@ export const WithSubtitle: Story = {
54
59
  value: '95%',
55
60
  title: 'Success Rate',
56
61
  subtitle: 'Last 30 days',
57
- size: 'lg',
62
+ size: 'level-1',
58
63
  },
59
64
  };
60
65
 
@@ -63,7 +68,7 @@ export const WithBorder: Story = {
63
68
  value: 987,
64
69
  title: 'Active Users',
65
70
  showBorder: true,
66
- size: 'md',
71
+ size: 'level-2',
67
72
  },
68
73
  };
69
74
 
@@ -74,67 +79,33 @@ export const AllSizes: Story = {
74
79
  <Stack gap="xl" align="center">
75
80
  <Title order={2}>KeyInsight Size Variations</Title>
76
81
  <Stack gap="lg" align="center">
77
- <div>
78
- <Text size="sm" c="dimmed" mb="xs" ta="center">Extra Small (xs)</Text>
79
- <KeyInsight
80
- value={1250}
81
- title="Total Users"
82
- subtitle="Last 30 days"
83
- size="xs"
84
- />
85
- </div>
86
- <div>
87
- <Text size="sm" c="dimmed" mb="xs" ta="center">Small (sm)</Text>
88
- <KeyInsight
89
- value={1250}
90
- title="Total Users"
91
- subtitle="Last 30 days"
92
- size="sm"
93
- />
94
- </div>
95
- <div>
96
- <Text size="sm" c="dimmed" mb="xs" ta="center">Medium (md) - Default</Text>
97
- <KeyInsight
98
- value={1250}
99
- title="Total Users"
100
- subtitle="Last 30 days"
101
- size="md"
102
- />
103
- </div>
104
- <div>
105
- <Text size="sm" c="dimmed" mb="xs" ta="center">Large (lg)</Text>
106
- <KeyInsight
107
- value={1250}
108
- title="Total Users"
109
- subtitle="Last 30 days"
110
- size="lg"
111
- />
112
- </div>
113
- <div>
114
- <Text size="sm" c="dimmed" mb="xs" ta="center">Extra Large (jumbo)</Text>
115
- <KeyInsight
116
- value={1250}
117
- title="Total Users"
118
- subtitle="Last 30 days"
119
- size="jumbo"
120
- />
121
- </div>
122
- <div>
123
- <Text size="sm" c="dimmed" mb="xs" ta="center">Super Jumbo (super-jumbo)</Text>
124
- <KeyInsight
125
- value={1250}
126
- title="Total Users"
127
- subtitle="Last 30 days"
128
- size="super-jumbo"
129
- />
130
- </div>
82
+ {([
83
+ ['super-jumbo', 'Super Jumbo'],
84
+ ['jumbo', 'Jumbo'],
85
+ ['level-1', 'Level 1'],
86
+ ['level-2', 'Level 2 (default)'],
87
+ ['level-3', 'Level 3'],
88
+ ['level-4', 'Level 4'],
89
+ ['level-5', 'Level 5'],
90
+ ['level-6', 'Level 6'],
91
+ ] as const).map(([size, label]) => (
92
+ <div key={size}>
93
+ <Text size="sm" c="dimmed" mb="xs" ta="center">{label}</Text>
94
+ <KeyInsight
95
+ value={1250}
96
+ title="Total Users"
97
+ subtitle="Last 30 days"
98
+ size={size}
99
+ />
100
+ </div>
101
+ ))}
131
102
  </Stack>
132
103
  </Stack>
133
104
  ),
134
105
  parameters: {
135
106
  docs: {
136
107
  description: {
137
- story: 'Showcase of all available KeyInsight sizes from xs to super-jumbo. Each size adjusts the value text, title text, subtitle text, and padding proportionally.',
108
+ story: 'All eight KeyInsight sizes. level-1 uses the h1 type scale; pass valueAs="p" when that value must not be an h1.',
138
109
  },
139
110
  },
140
111
  },
@@ -147,19 +118,19 @@ export const SizeComparison: Story = {
147
118
  value="$24.5K"
148
119
  title="Revenue"
149
120
  subtitle="This month"
150
- size="sm"
121
+ size="level-3"
151
122
  />
152
123
  <KeyInsight
153
124
  value={1847}
154
125
  title="Orders"
155
126
  subtitle="Last 30 days"
156
- size="md"
127
+ size="level-2"
157
128
  />
158
129
  <KeyInsight
159
130
  value="12.5%"
160
131
  title="Growth"
161
132
  subtitle="vs last month"
162
- size="lg"
133
+ size="level-1"
163
134
  />
164
135
  </SimpleGrid>
165
136
  ),
@@ -180,27 +151,27 @@ export const DashboardExample: Story = {
180
151
  <KeyInsight
181
152
  value={1250}
182
153
  title="Total Users"
183
- size="md"
154
+ size="level-2"
184
155
  showBorder={true}
185
156
  />
186
157
  <KeyInsight
187
158
  value={987}
188
159
  title="Active Users"
189
160
  subtitle="Last 7 days"
190
- size="md"
161
+ size="level-2"
191
162
  showBorder={true}
192
163
  />
193
164
  <KeyInsight
194
165
  value={263}
195
166
  title="New Users"
196
167
  subtitle="This month"
197
- size="md"
168
+ size="level-2"
198
169
  showBorder={true}
199
170
  />
200
171
  <KeyInsight
201
172
  value="95%"
202
173
  title="Success Rate"
203
- size="md"
174
+ size="level-2"
204
175
  showBorder={false}
205
176
  />
206
177
  </SimpleGrid>
@@ -223,36 +194,36 @@ export const MetricsGrid: Story = {
223
194
  value="$24,500"
224
195
  title="Revenue"
225
196
  subtitle="This month"
226
- size="lg"
197
+ size="level-1"
227
198
  />
228
199
  <KeyInsight
229
200
  value={1847}
230
201
  title="Orders"
231
202
  subtitle="Last 30 days"
232
- size="lg"
203
+ size="level-1"
233
204
  />
234
205
  <KeyInsight
235
206
  value="12.5%"
236
207
  title="Growth"
237
208
  subtitle="vs last month"
238
- size="lg"
209
+ size="level-1"
239
210
  />
240
211
  <KeyInsight
241
212
  value={456}
242
213
  title="New Customers"
243
- size="lg"
214
+ size="level-1"
244
215
  />
245
216
  <KeyInsight
246
217
  value="4.2"
247
218
  title="Avg Rating"
248
219
  subtitle="Customer satisfaction"
249
- size="lg"
220
+ size="level-1"
250
221
  />
251
222
  <KeyInsight
252
223
  value={89}
253
224
  title="Support Tickets"
254
225
  subtitle="Open"
255
- size="lg"
226
+ size="level-1"
256
227
  />
257
228
  </SimpleGrid>
258
229
  </div>
@@ -274,25 +245,25 @@ export const HorizontalLayout: Story = {
274
245
  <KeyInsight
275
246
  value={1250}
276
247
  title="Total Users"
277
- size="md"
248
+ size="level-2"
278
249
  showBorder={true}
279
250
  />
280
251
  <KeyInsight
281
252
  value={987}
282
253
  title="Active Users"
283
- size="md"
254
+ size="level-2"
284
255
  showBorder={true}
285
256
  />
286
257
  <KeyInsight
287
258
  value={263}
288
259
  title="New Users"
289
- size="md"
260
+ size="level-2"
290
261
  showBorder={true}
291
262
  />
292
263
  <KeyInsight
293
264
  value="95%"
294
265
  title="Success Rate"
295
- size="md"
266
+ size="level-2"
296
267
  showBorder={false}
297
268
  />
298
269
  </Inline>
@@ -342,19 +313,19 @@ export const WithTrendIndicator: Story = {
342
313
  <KeyInsight
343
314
  value="42%"
344
315
  title="Conversion Rate"
345
- size="lg"
316
+ size="level-1"
346
317
  rightSection={<span style={{ color: 'var(--ad-color-status-success)', fontSize: 20 }}>↑</span>}
347
318
  />
348
319
  <KeyInsight
349
320
  value="12%"
350
321
  title="Churn Rate"
351
- size="lg"
322
+ size="level-1"
352
323
  rightSection={<span style={{ color: 'var(--ad-color-status-error)', fontSize: 20 }}>↓</span>}
353
324
  />
354
325
  <KeyInsight
355
326
  value="2.4M"
356
327
  title="Annual Revenue"
357
- size="lg"
328
+ size="level-1"
358
329
  leftSection={<span style={{ fontSize: 20 }}>$</span>}
359
330
  />
360
331
  </Inline>
@@ -368,13 +339,30 @@ export const WithTrendIndicator: Story = {
368
339
  },
369
340
  };
370
341
 
342
+ export const Level1AsParagraph: Story = {
343
+ args: {
344
+ value: '12.5%',
345
+ title: 'Growth',
346
+ subtitle: 'vs last month',
347
+ size: 'level-1',
348
+ valueAs: 'p',
349
+ },
350
+ parameters: {
351
+ docs: {
352
+ description: {
353
+ story: 'level-1 uses the h1 type scale. valueAs="p" keeps that size without rendering an h1.',
354
+ },
355
+ },
356
+ },
357
+ };
358
+
371
359
  export const Interactive: Story = {
372
360
  args: {
373
361
  value: 1250,
374
362
  title: 'Total Users',
375
363
  subtitle: 'Last 30 days',
376
364
  showBorder: false,
377
- size: 'md',
365
+ size: 'level-2',
378
366
  },
379
367
  parameters: {
380
368
  docs: {
@@ -0,0 +1,59 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack, StatusGem } from '@appdirect/design-system';
3
+
4
+ const meta: Meta<typeof StatusGem> = {
5
+ title: 'Design System/Complex Components/StatusGem',
6
+ component: StatusGem,
7
+ parameters: {
8
+ layout: 'padded',
9
+ docs: {
10
+ description: {
11
+ component: 'A colored status dot with an adjacent label, used to call out a record\'s state inline (e.g. in a table cell or list row).',
12
+ },
13
+ },
14
+ },
15
+ tags: ['autodocs', 'needs-connect'],
16
+ argTypes: {
17
+ variant: {
18
+ control: 'select',
19
+ options: ['success', 'danger', 'pending', 'info', 'default'],
20
+ },
21
+ size: {
22
+ control: 'select',
23
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
24
+ },
25
+ },
26
+ };
27
+
28
+ export default meta;
29
+ type Story = StoryObj<typeof meta>;
30
+
31
+ export const Default: Story = {
32
+ args: {
33
+ variant: 'success',
34
+ label: 'This is a status gem label',
35
+ size: 'xs',
36
+ },
37
+ };
38
+
39
+ export const AllVariants: Story = {
40
+ render: () => (
41
+ <Stack gap="xs">
42
+ <StatusGem variant="success" label="Active" />
43
+ <StatusGem variant="danger" label="Failed" />
44
+ <StatusGem variant="pending" label="Awaiting approval" />
45
+ <StatusGem variant="info" label="In review" />
46
+ <StatusGem variant="default" label="Inactive" />
47
+ </Stack>
48
+ ),
49
+ };
50
+
51
+ export const AllSizes: Story = {
52
+ render: () => (
53
+ <Stack gap="md">
54
+ {(['xs', 'sm', 'md', 'lg', 'xl'] as const).map((size) => (
55
+ <StatusGem key={size} size={size} variant="success" label="This is a status gem label" />
56
+ ))}
57
+ </Stack>
58
+ ),
59
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.14",
2
+ "version": "0.0.16",
3
3
  "stories": [
4
4
  {
5
5
  "title": "Design System/Buttons/ActionIcon",
@@ -272,7 +272,7 @@
272
272
  {
273
273
  "title": "Design System/Complex Components/KeyInsight",
274
274
  "component": "KeyInsight",
275
- "description": "KeyInsight component for displaying key metrics or insights with a title, value, and optional subtitle. Supports multiple sizes from xs to xxl. Commonly used in dashboards, analytics pages, or summary sections.",
275
+ "description": "KeyInsight component for displaying key metrics or insights with a title, value, and optional subtitle. Sizes: super-jumbo, jumbo, and level-1 through level-6. Use valueAs=\"p\" or \"span\" when a level-1 visual size must not be an h1.",
276
276
  "stories": [
277
277
  "Default",
278
278
  "WithSubtitle",
@@ -284,6 +284,7 @@
284
284
  "HorizontalLayout",
285
285
  "HeroMetrics",
286
286
  "WithTrendIndicator",
287
+ "Level1AsParagraph",
287
288
  "Interactive"
288
289
  ],
289
290
  "file": "ComplexComponents/KeyInsight/KeyInsights.stories.tsx",
@@ -392,6 +393,22 @@
392
393
  ],
393
394
  "mantine": []
394
395
  },
396
+ {
397
+ "title": "Design System/Complex Components/StatusGem",
398
+ "component": "StatusGem",
399
+ "description": "A colored status dot with an adjacent label, used to call out a record\\",
400
+ "stories": [
401
+ "Default",
402
+ "AllVariants",
403
+ "AllSizes"
404
+ ],
405
+ "file": "ComplexComponents/StatusGem/StatusGem.stories.tsx",
406
+ "designSystem": [
407
+ "Stack",
408
+ "StatusGem"
409
+ ],
410
+ "mantine": []
411
+ },
395
412
  {
396
413
  "title": "Design System/Complex Components/Utilities/CopyButton",
397
414
  "component": "CopyButton",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appdirect/design-system",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
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",
@@ -44,7 +44,7 @@
44
44
  "prepublishOnly": "npm run build"
45
45
  },
46
46
  "dependencies": {
47
- "@appdirect/ad-design-tokens": "0.0.14",
47
+ "@appdirect/ad-design-tokens": "0.0.16",
48
48
  "@mantine/dropzone": "^9.6.0",
49
49
  "@remixicon/react": "^4.6.0",
50
50
  "@tabler/icons-react": "^3.33.0",