@appdirect/design-system 0.0.6 → 0.0.7
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.
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { Box } from '../../Layout/Box';
|
|
5
5
|
import { Text } from '../../Typography/Text';
|
|
6
6
|
import { Title } from '../../Typography/Title';
|
|
7
|
+
import { Inline } from '../../Layout/Inline';
|
|
7
8
|
|
|
8
9
|
export type KeyInsightSize = 'xs' | 'sm' | 'md' | 'lg' | 'jumbo' | 'super-jumbo';
|
|
9
10
|
|
|
@@ -18,6 +19,10 @@ export interface KeyInsightProps {
|
|
|
18
19
|
showBorder?: boolean;
|
|
19
20
|
/** Size of the KeyInsight component */
|
|
20
21
|
size?: KeyInsightSize;
|
|
22
|
+
/** Optional content rendered inline before the value (e.g. a trend arrow or unit) */
|
|
23
|
+
leftSection?: React.ReactNode;
|
|
24
|
+
/** Optional content rendered inline after the value (e.g. a trend arrow or unit) */
|
|
25
|
+
rightSection?: React.ReactNode;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
// Size mappings for different elements
|
|
@@ -124,6 +129,14 @@ const sizeConfig = {
|
|
|
124
129
|
* </Stack>
|
|
125
130
|
*
|
|
126
131
|
* @example
|
|
132
|
+
* // With a trend indicator next to the value
|
|
133
|
+
* <KeyInsight
|
|
134
|
+
* value="42%"
|
|
135
|
+
* title="Conversion Rate"
|
|
136
|
+
* rightSection={<RiArrowUpLine size={16} color="var(--ad-color-status-success)" />}
|
|
137
|
+
* />
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
127
140
|
* // Hero metrics with jumbo size
|
|
128
141
|
* <KeyInsight
|
|
129
142
|
* value="$2.4M"
|
|
@@ -182,24 +195,29 @@ export function KeyInsight({
|
|
|
182
195
|
subtitle,
|
|
183
196
|
showBorder = false,
|
|
184
197
|
size = 'md',
|
|
198
|
+
leftSection,
|
|
199
|
+
rightSection,
|
|
185
200
|
}: KeyInsightProps) {
|
|
186
201
|
const config = sizeConfig[size];
|
|
187
|
-
|
|
202
|
+
|
|
188
203
|
return (
|
|
189
|
-
<Box
|
|
190
|
-
ta="center"
|
|
204
|
+
<Box
|
|
205
|
+
ta="center"
|
|
191
206
|
p={config.padding}
|
|
192
|
-
style={{
|
|
193
|
-
borderRight: showBorder ? '1px solid var(--ad-color-border-subtle)' : undefined
|
|
207
|
+
style={{
|
|
208
|
+
borderRight: showBorder ? '1px solid var(--ad-color-border-subtle)' : undefined
|
|
194
209
|
}}
|
|
195
210
|
>
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
211
|
+
<Inline gap="xxs" align="center" justify="center">
|
|
212
|
+
{leftSection}
|
|
213
|
+
<Title
|
|
214
|
+
order={config.valueOrder}
|
|
215
|
+
style={config.customValueStyle}
|
|
216
|
+
>
|
|
217
|
+
{value}
|
|
218
|
+
</Title>
|
|
219
|
+
{rightSection}
|
|
220
|
+
</Inline>
|
|
203
221
|
<Text
|
|
204
222
|
size={config.titleSize}
|
|
205
223
|
mt={0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appdirect/design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
|
|
5
5
|
"main": "./dist/index.ts",
|
|
6
6
|
"types": "./dist/index.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prepublishOnly": "npm run build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@appdirect/ad-design-tokens": "0.0.
|
|
40
|
+
"@appdirect/ad-design-tokens": "0.0.7",
|
|
41
41
|
"@mantine/dropzone": "^9.6.0",
|
|
42
42
|
"@remixicon/react": "^4.6.0",
|
|
43
43
|
"@tabler/icons-react": "^3.33.0",
|