@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.
- package/README.md +11 -0
- package/dist/Combobox/AutocompleteClearable.js +33 -35
- package/dist/Combobox/AutocompleteClearable.tsx +56 -121
- package/dist/Combobox/SearchableSelect.js +23 -42
- package/dist/Combobox/SearchableSelect.tsx +33 -129
- package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +1 -1
- package/dist/ComplexComponents/DashboardWidget/DashboardWidget.tsx +9 -7
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +1 -1
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.tsx +1 -1
- package/dist/ComplexComponents/KeyInsight/KeyInsights.js +6 -1
- package/dist/ComplexComponents/KeyInsight/KeyInsights.tsx +12 -2
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +1 -1
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +16 -11
- package/dist/ComplexComponents/Slat/Slat.js +14 -7
- package/dist/ComplexComponents/Slat/Slat.tsx +31 -19
- package/dist/ComplexComponents/Utilities/CopyButton.js +15 -27
- package/dist/ComplexComponents/Utilities/CopyButton.tsx +35 -49
- package/dist/DESIGN.md +4 -0
- package/dist/DataDisplay/Alert.js +2 -2
- package/dist/DataDisplay/Alert.tsx +7 -0
- package/dist/DataDisplay/Avatar.js +26 -81
- package/dist/DataDisplay/Avatar.tsx +35 -93
- package/dist/DataDisplay/Card.js +5 -4
- package/dist/DataDisplay/Card.tsx +5 -11
- package/dist/Layout/Inline.js +5 -42
- package/dist/Layout/Inline.tsx +6 -79
- package/dist/Overlays/Modal.js +2 -2
- package/dist/Overlays/Modal.tsx +4 -4
- package/dist/contracts/Alert.json +5 -0
- package/dist/contracts/index.json +1 -1
- package/dist/css/mantine.css +120 -12
- package/dist/css/tokens.css +52 -14
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/index.ts +28 -0
- package/dist/hooks/useSelectedRowsText.js +73 -0
- package/dist/hooks/useSelectedRowsText.ts +74 -0
- package/dist/stories/Combobox/SearchableSelect.stories.tsx +3 -3
- package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +7 -0
- package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +21 -21
- package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +4 -14
- package/dist/stories/DataDisplay/Progress.stories.tsx +11 -27
- package/dist/stories/Navigation/Stepper.stories.tsx +25 -21
- package/dist/stories/Overlays/Drawer.stories.tsx +6 -6
- package/dist/stories/Overlays/Modal.stories.tsx +31 -11
- package/dist/stories/index.json +6 -6
- package/package.json +97 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React, { forwardRef,
|
|
3
|
+
import React, { forwardRef, useEffect } from 'react';
|
|
4
4
|
import { Avatar as MantineAvatar, AvatarProps as MantineAvatarProps } from '@mantine/core';
|
|
5
5
|
import { RiUser3Fill } from '@remixicon/react';
|
|
6
6
|
|
|
@@ -53,7 +53,8 @@ const ICON_SIZES = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Avatar Component
|
|
55
55
|
*
|
|
56
|
-
* Built on top of Mantine's Avatar component with design system styling.
|
|
56
|
+
* Built on top of Mantine's Avatar component with design system styling. Image load
|
|
57
|
+
* failures fall back to the placeholder content (icon or initials) via Mantine core.
|
|
57
58
|
* Supports three variants: icon, image, and initials with all Mantine t-shirt sizes.
|
|
58
59
|
*
|
|
59
60
|
* @example
|
|
@@ -88,7 +89,7 @@ const ICON_SIZES = {
|
|
|
88
89
|
* />
|
|
89
90
|
*/
|
|
90
91
|
export const Avatar = forwardRef<HTMLDivElement, DSAvatarProps>(
|
|
91
|
-
({
|
|
92
|
+
({
|
|
92
93
|
variant,
|
|
93
94
|
size = 'md',
|
|
94
95
|
src,
|
|
@@ -97,120 +98,61 @@ export const Avatar = forwardRef<HTMLDivElement, DSAvatarProps>(
|
|
|
97
98
|
icon,
|
|
98
99
|
fallback = 'icon',
|
|
99
100
|
fallbackInitials,
|
|
100
|
-
...props
|
|
101
|
+
...props
|
|
101
102
|
}, ref) => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// Check if URL is obviously invalid
|
|
107
|
-
const isInvalidUrl = (url: string) => {
|
|
108
|
-
if (!url || url.trim() === '') return true;
|
|
109
|
-
try {
|
|
110
|
-
const hostname = new URL(url, 'https://local.invalid').hostname;
|
|
111
|
-
if (hostname === 'example.com' || hostname.endsWith('.example.com')) return true;
|
|
112
|
-
} catch {
|
|
113
|
-
return true;
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (process.env.NODE_ENV !== 'development') return;
|
|
105
|
+
if (variant === 'image' && !src) {
|
|
106
|
+
console.warn('Avatar: src is required when variant is "image"');
|
|
114
107
|
}
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// Reset image error when src changes
|
|
120
|
-
React.useEffect(() => {
|
|
121
|
-
if (src && isInvalidUrl(src)) {
|
|
122
|
-
setImageError(true);
|
|
123
|
-
} else {
|
|
124
|
-
setImageError(false);
|
|
108
|
+
if (variant === 'initials' && !initials) {
|
|
109
|
+
console.warn('Avatar: initials is required when variant is "initials"');
|
|
125
110
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
setImageError(true);
|
|
131
|
-
}, []);
|
|
132
|
-
|
|
133
|
-
if (process.env.NODE_ENV === 'development') {
|
|
134
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
135
|
-
React.useEffect(() => {
|
|
136
|
-
if (variant === 'image' && !src) {
|
|
137
|
-
console.warn('Avatar: src is required when variant is "image"');
|
|
138
|
-
}
|
|
139
|
-
if (variant === 'initials' && !initials) {
|
|
140
|
-
console.warn('Avatar: initials is required when variant is "initials"');
|
|
141
|
-
}
|
|
142
|
-
if (variant === 'initials' && initials && initials.length !== 2) {
|
|
143
|
-
console.warn('Avatar: initials should be exactly 2 characters');
|
|
144
|
-
}
|
|
145
|
-
}, [variant, src, initials]);
|
|
146
|
-
}
|
|
111
|
+
if (variant === 'initials' && initials && initials.length !== 2) {
|
|
112
|
+
console.warn('Avatar: initials should be exactly 2 characters');
|
|
113
|
+
}
|
|
114
|
+
}, [variant, src, initials]);
|
|
147
115
|
|
|
148
|
-
// Render icon content
|
|
149
116
|
const renderIcon = () => {
|
|
150
117
|
const iconSize = ICON_SIZES[size];
|
|
151
|
-
|
|
118
|
+
|
|
152
119
|
if (icon) {
|
|
153
|
-
return React.isValidElement(icon)
|
|
154
|
-
? React.cloneElement(icon as React.ReactElement
|
|
120
|
+
return React.isValidElement(icon)
|
|
121
|
+
? React.cloneElement(icon as React.ReactElement<{ size?: number; color?: string }>, {
|
|
155
122
|
size: iconSize,
|
|
156
123
|
color: 'var(--ad-color-text-default)',
|
|
157
124
|
})
|
|
158
125
|
: icon;
|
|
159
126
|
}
|
|
160
|
-
|
|
161
|
-
return <RiUser3Fill size={iconSize} color="var(--ad-color-text-default)" />;
|
|
162
|
-
};
|
|
163
127
|
|
|
164
|
-
|
|
165
|
-
const renderInitials = (text: string) => {
|
|
166
|
-
return text.substring(0, 2).toUpperCase();
|
|
128
|
+
return <RiUser3Fill size={iconSize} color="var(--ad-color-text-default)" />;
|
|
167
129
|
};
|
|
168
130
|
|
|
169
|
-
|
|
170
|
-
const getAvatarContent = () => {
|
|
171
|
-
switch (variant) {
|
|
172
|
-
case 'image':
|
|
173
|
-
// For image variant, always check if we should show fallback first
|
|
174
|
-
if (!src || imageError) {
|
|
175
|
-
// Show fallback content instead of trying to load image
|
|
176
|
-
return {
|
|
177
|
-
children: fallback === 'initials' && fallbackInitials
|
|
178
|
-
? renderInitials(fallbackInitials)
|
|
179
|
-
: renderIcon(),
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
// Only try to load image if we have src and no error yet
|
|
183
|
-
return {
|
|
184
|
-
src: src,
|
|
185
|
-
alt: alt,
|
|
186
|
-
onError: handleImageError,
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
case 'initials':
|
|
190
|
-
return {
|
|
191
|
-
children: initials ? renderInitials(initials) : '??',
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
case 'icon':
|
|
195
|
-
default:
|
|
196
|
-
return {
|
|
197
|
-
children: renderIcon(),
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
};
|
|
131
|
+
const renderInitials = (text: string) => text.substring(0, 2).toUpperCase();
|
|
201
132
|
|
|
202
|
-
|
|
133
|
+
// Mantine renders `children` whenever there is no `src` or the image fails to load.
|
|
134
|
+
let placeholder: React.ReactNode;
|
|
135
|
+
if (variant === 'initials') {
|
|
136
|
+
placeholder = initials ? renderInitials(initials) : '??';
|
|
137
|
+
} else if (variant === 'image' && fallback === 'initials' && fallbackInitials) {
|
|
138
|
+
placeholder = renderInitials(fallbackInitials);
|
|
139
|
+
} else {
|
|
140
|
+
placeholder = renderIcon();
|
|
141
|
+
}
|
|
203
142
|
|
|
204
143
|
return (
|
|
205
144
|
<MantineAvatar
|
|
206
145
|
ref={ref}
|
|
207
146
|
size={AVATAR_SIZES[size]}
|
|
208
147
|
radius={1000} // Perfect circle - large enough radius to ensure circular shape at all sizes
|
|
209
|
-
{
|
|
148
|
+
src={variant === 'image' ? src : undefined}
|
|
149
|
+
alt={alt}
|
|
210
150
|
{...props}
|
|
211
|
-
|
|
151
|
+
>
|
|
152
|
+
{placeholder}
|
|
153
|
+
</MantineAvatar>
|
|
212
154
|
);
|
|
213
155
|
}
|
|
214
156
|
);
|
|
215
157
|
|
|
216
|
-
Avatar.displayName = 'Avatar';
|
|
158
|
+
Avatar.displayName = 'Avatar';
|
package/dist/DataDisplay/Card.js
CHANGED
|
@@ -21,10 +21,11 @@ import classes from './Card.module.css';
|
|
|
21
21
|
* </Card>
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
// Mantine's Card finds its sections by element type and marks the first and last ones
|
|
25
|
+
// (`data-first-section` / `data-last-section`), which is what makes a section bleed through the
|
|
26
|
+
// card padding at the top and bottom. A forwardRef wrapper is a different type and is never
|
|
27
|
+
// marked, so the section would leave a gap above it. Use Mantine's component directly.
|
|
28
|
+
const CardSection = MantineCard.Section;
|
|
28
29
|
/**
|
|
29
30
|
* Card Component
|
|
30
31
|
*
|
|
@@ -45,17 +45,11 @@ export interface DSCardSectionProps extends
|
|
|
45
45
|
* </Card>
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</MantineCard.Section>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
CardSection.displayName = 'Card.Section';
|
|
48
|
+
// Mantine's Card finds its sections by element type and marks the first and last ones
|
|
49
|
+
// (`data-first-section` / `data-last-section`), which is what makes a section bleed through the
|
|
50
|
+
// card padding at the top and bottom. A forwardRef wrapper is a different type and is never
|
|
51
|
+
// marked, so the section would leave a gap above it. Use Mantine's component directly.
|
|
52
|
+
const CardSection: typeof MantineCard.Section = MantineCard.Section;
|
|
59
53
|
|
|
60
54
|
/**
|
|
61
55
|
* Card Component
|
package/dist/Layout/Inline.js
CHANGED
|
@@ -1,46 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
4
|
-
import { Group as MantineGroup } from '@mantine/core';
|
|
2
|
+
import { Group } from './Group.js';
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
4
|
+
* Inline
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* same primitive — do not mix both in new code.
|
|
11
|
-
*
|
|
12
|
-
* Arranges children horizontally with design-system spacing. Built on Mantine Group.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* // Basic horizontal layout
|
|
17
|
-
* <Inline gap="md">
|
|
18
|
-
* <Button>First</Button>
|
|
19
|
-
* <Button>Second</Button>
|
|
20
|
-
* <Button>Third</Button>
|
|
21
|
-
* </Inline>
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* // Inline with alignment and wrapping
|
|
27
|
-
* <Inline gap="sm" align="center" wrap="wrap">
|
|
28
|
-
* <Badge>Tag 1</Badge>
|
|
29
|
-
* <Badge>Tag 2</Badge>
|
|
30
|
-
* <Badge>Tag 3</Badge>
|
|
31
|
-
* </Inline>
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```tsx
|
|
36
|
-
* // Justified inline layout
|
|
37
|
-
* <Inline justify="space-between">
|
|
38
|
-
* <Text>Left content</Text>
|
|
39
|
-
* <Button>Right action</Button>
|
|
40
|
-
* </Inline>
|
|
41
|
-
* ```
|
|
6
|
+
* The DS name for a horizontal flex row (Figma `flex-direction: row`). It is the same
|
|
7
|
+
* component as `Group` (Mantine's `Group` with DS defaults), not a separate implementation.
|
|
42
8
|
*/
|
|
43
|
-
export const Inline =
|
|
44
|
-
return (_jsx(MantineGroup, { ref: ref, gap: gap, align: align, justify: justify, wrap: wrap, ...props, children: children }));
|
|
45
|
-
});
|
|
46
|
-
Inline.displayName = 'Inline';
|
|
9
|
+
export const Inline = Group;
|
package/dist/Layout/Inline.tsx
CHANGED
|
@@ -1,86 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { Group as MantineGroup, GroupProps as MantineGroupProps } from '@mantine/core';
|
|
5
|
-
import { SpacingScale } from './Stack';
|
|
3
|
+
import { Group, DSGroupProps } from './Group';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
* Enhanced Inline props extending Mantine's GroupProps
|
|
9
|
-
*/
|
|
10
|
-
export interface DSInlineProps extends Omit<MantineGroupProps, 'gap'> {
|
|
11
|
-
/** Spacing between inline items using design system scale */
|
|
12
|
-
gap?: SpacingScale | string | number;
|
|
13
|
-
/** Alignment of items along the cross axis */
|
|
14
|
-
align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
15
|
-
/** Distribution of items along the main axis */
|
|
16
|
-
justify?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
17
|
-
/** Whether items should wrap to new lines */
|
|
18
|
-
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
19
|
-
}
|
|
5
|
+
export type DSInlineProps = DSGroupProps;
|
|
20
6
|
|
|
21
7
|
/**
|
|
22
|
-
*
|
|
8
|
+
* Inline
|
|
23
9
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* same primitive — do not mix both in new code.
|
|
27
|
-
*
|
|
28
|
-
* Arranges children horizontally with design-system spacing. Built on Mantine Group.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* // Basic horizontal layout
|
|
33
|
-
* <Inline gap="md">
|
|
34
|
-
* <Button>First</Button>
|
|
35
|
-
* <Button>Second</Button>
|
|
36
|
-
* <Button>Third</Button>
|
|
37
|
-
* </Inline>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```tsx
|
|
42
|
-
* // Inline with alignment and wrapping
|
|
43
|
-
* <Inline gap="sm" align="center" wrap="wrap">
|
|
44
|
-
* <Badge>Tag 1</Badge>
|
|
45
|
-
* <Badge>Tag 2</Badge>
|
|
46
|
-
* <Badge>Tag 3</Badge>
|
|
47
|
-
* </Inline>
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```tsx
|
|
52
|
-
* // Justified inline layout
|
|
53
|
-
* <Inline justify="space-between">
|
|
54
|
-
* <Text>Left content</Text>
|
|
55
|
-
* <Button>Right action</Button>
|
|
56
|
-
* </Inline>
|
|
57
|
-
* ```
|
|
10
|
+
* The DS name for a horizontal flex row (Figma `flex-direction: row`). It is the same
|
|
11
|
+
* component as `Group` (Mantine's `Group` with DS defaults), not a separate implementation.
|
|
58
12
|
*/
|
|
59
|
-
export const Inline =
|
|
60
|
-
(
|
|
61
|
-
{
|
|
62
|
-
gap = 'md',
|
|
63
|
-
align = 'center',
|
|
64
|
-
justify = 'flex-start',
|
|
65
|
-
wrap = 'wrap',
|
|
66
|
-
children,
|
|
67
|
-
...props
|
|
68
|
-
},
|
|
69
|
-
ref
|
|
70
|
-
) => {
|
|
71
|
-
return (
|
|
72
|
-
<MantineGroup
|
|
73
|
-
ref={ref}
|
|
74
|
-
gap={gap}
|
|
75
|
-
align={align}
|
|
76
|
-
justify={justify}
|
|
77
|
-
wrap={wrap}
|
|
78
|
-
{...props}
|
|
79
|
-
>
|
|
80
|
-
{children}
|
|
81
|
-
</MantineGroup>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
Inline.displayName = 'Inline';
|
|
13
|
+
export const Inline = Group;
|
package/dist/Overlays/Modal.js
CHANGED
|
@@ -34,8 +34,8 @@ import { Button } from '../Buttons/index.js';
|
|
|
34
34
|
* <Stack gap="md">
|
|
35
35
|
* <Text>Are you sure you want to perform this action?</Text>
|
|
36
36
|
* <Inline justify="flex-start" gap="sm">
|
|
37
|
-
* <Button variant="outline">Cancel</Button>
|
|
38
37
|
* <Button variant="primary">Confirm</Button>
|
|
38
|
+
* <Button variant="outline">Cancel</Button>
|
|
39
39
|
* </Inline>
|
|
40
40
|
* </Stack>
|
|
41
41
|
* </Modal>
|
|
@@ -56,6 +56,6 @@ export const ConfirmationModal = forwardRef(({ confirmLabel = 'Confirm', cancelL
|
|
|
56
56
|
onClose();
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
return (_jsx(Modal, { ref: ref, onClose: onClose, ...props, children: _jsxs(Stack, { gap: "md", children: [children, _jsxs(Inline, { justify: "flex-start", gap: "sm", children: [_jsx(Button, { variant:
|
|
59
|
+
return (_jsx(Modal, { ref: ref, onClose: onClose, ...props, children: _jsxs(Stack, { gap: "md", children: [children, _jsxs(Inline, { justify: "flex-start", gap: "sm", children: [_jsx(Button, { variant: confirmVariant, onClick: handleConfirm, loading: confirmLoading, children: confirmLabel }), _jsx(Button, { variant: "outline", onClick: handleCancel, children: cancelLabel })] })] }) }));
|
|
60
60
|
});
|
|
61
61
|
ConfirmationModal.displayName = 'ConfirmationModal';
|
package/dist/Overlays/Modal.tsx
CHANGED
|
@@ -46,8 +46,8 @@ export interface DSModalProps extends Omit<MantineModalProps, 'title'> {
|
|
|
46
46
|
* <Stack gap="md">
|
|
47
47
|
* <Text>Are you sure you want to perform this action?</Text>
|
|
48
48
|
* <Inline justify="flex-start" gap="sm">
|
|
49
|
-
* <Button variant="outline">Cancel</Button>
|
|
50
49
|
* <Button variant="primary">Confirm</Button>
|
|
50
|
+
* <Button variant="outline">Cancel</Button>
|
|
51
51
|
* </Inline>
|
|
52
52
|
* </Stack>
|
|
53
53
|
* </Modal>
|
|
@@ -143,12 +143,12 @@ export const ConfirmationModal = forwardRef<HTMLDivElement, ConfirmationModalPro
|
|
|
143
143
|
<Stack gap="md">
|
|
144
144
|
{children}
|
|
145
145
|
<Inline justify="flex-start" gap="sm">
|
|
146
|
-
<Button variant="outline" onClick={handleCancel}>
|
|
147
|
-
{cancelLabel}
|
|
148
|
-
</Button>
|
|
149
146
|
<Button variant={confirmVariant} onClick={handleConfirm} loading={confirmLoading}>
|
|
150
147
|
{confirmLabel}
|
|
151
148
|
</Button>
|
|
149
|
+
<Button variant="outline" onClick={handleCancel}>
|
|
150
|
+
{cancelLabel}
|
|
151
|
+
</Button>
|
|
152
152
|
</Inline>
|
|
153
153
|
</Stack>
|
|
154
154
|
</Modal>
|
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"title": {
|
|
51
51
|
"type": "string"
|
|
52
52
|
},
|
|
53
|
+
"panel": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"default": false,
|
|
56
|
+
"notes": "Figma Panel Notification: compact 30px bar for the top of a card, slat or widget. Place it flush to the container's top and sides (Card.Section)."
|
|
57
|
+
},
|
|
53
58
|
"withCloseButton": {
|
|
54
59
|
"type": "boolean",
|
|
55
60
|
"default": false
|
package/dist/css/mantine.css
CHANGED
|
@@ -78,6 +78,13 @@
|
|
|
78
78
|
--ad-alert-title-gap-bottom: var(--ad-spacing-xs);
|
|
79
79
|
--ad-alert-body-font-size: var(--ad-font-sizes-sm);
|
|
80
80
|
--ad-alert-body-fg: var(--ad-color-text-bright);
|
|
81
|
+
--ad-alert-panel-padding-x: var(--ad-spacing-xs);
|
|
82
|
+
--ad-alert-panel-padding-y: var(--ad-spacing-xxs);
|
|
83
|
+
--ad-alert-panel-border-width: var(--ad-border-width-none);
|
|
84
|
+
--ad-alert-panel-border-radius: 0px;
|
|
85
|
+
--ad-alert-panel-icon-size: var(--ad-icon-size-md);
|
|
86
|
+
--ad-alert-panel-icon-gap: var(--ad-spacing-xs);
|
|
87
|
+
--ad-alert-panel-icon-offset-top: 3px;
|
|
81
88
|
--ad-alert-icon-size: 20px;
|
|
82
89
|
--ad-alert-icon-margin-right: var(--ad-spacing-md);
|
|
83
90
|
--ad-app-shell-root-bg: var(--ad-color-bg-body);
|
|
@@ -105,7 +112,6 @@
|
|
|
105
112
|
--ad-avatar-sizes-xl-size: 84px;
|
|
106
113
|
--ad-badge-root-base-font-family: var(--ad-font-family-body);
|
|
107
114
|
--ad-badge-root-base-font-weight: var(--ad-font-weights-bold);
|
|
108
|
-
--ad-badge-root-base-line-height: var(--ad-line-heights-xs);
|
|
109
115
|
--ad-badge-root-base-border-radius: var(--ad-radius-sm);
|
|
110
116
|
--ad-badge-root-base-gap: 5px;
|
|
111
117
|
--ad-badge-root-base-padding-y: var(--ad-spacing-none);
|
|
@@ -562,6 +568,7 @@
|
|
|
562
568
|
--ad-drawer-overlay-bg: rgba(0, 0, 0, 0.55);
|
|
563
569
|
--ad-drawer-content-bg: var(--ad-color-bg-default);
|
|
564
570
|
--ad-drawer-content-shadow: var(--ad-shadows-xl);
|
|
571
|
+
--ad-drawer-content-border-radius: 0px;
|
|
565
572
|
--ad-drawer-content-z-index: var(--ad-z-index-modal);
|
|
566
573
|
--ad-drawer-header-bg: var(--ad-color-bg-body);
|
|
567
574
|
--ad-drawer-header-padding-x: var(--ad-spacing-md);
|
|
@@ -1149,22 +1156,34 @@
|
|
|
1149
1156
|
--ad-slat-row-padding: var(--ad-spacing-sm);
|
|
1150
1157
|
--ad-slat-row-gap: var(--ad-spacing-sm);
|
|
1151
1158
|
--ad-slat-row-icon-header-gap: var(--ad-spacing-xs);
|
|
1152
|
-
--ad-slat-row-subhead-gap: var(--ad-spacing-xshalf);
|
|
1153
1159
|
--ad-slat-sizes-xs-title-order: 6;
|
|
1154
1160
|
--ad-slat-sizes-xs-subtitle-size: xs;
|
|
1155
|
-
--ad-slat-sizes-xs-
|
|
1161
|
+
--ad-slat-sizes-xs-subhead-gap: var(--ad-spacing-xshalf);
|
|
1162
|
+
--ad-slat-sizes-xs-indicator-size: 8px;
|
|
1163
|
+
--ad-slat-sizes-xs-badge-size: xs;
|
|
1156
1164
|
--ad-slat-sizes-sm-title-order: 5;
|
|
1157
1165
|
--ad-slat-sizes-sm-subtitle-size: sm;
|
|
1158
|
-
--ad-slat-sizes-sm-
|
|
1166
|
+
--ad-slat-sizes-sm-subhead-gap: var(--ad-spacing-xshalf);
|
|
1167
|
+
--ad-slat-sizes-sm-indicator-size: 12px;
|
|
1168
|
+
--ad-slat-sizes-sm-badge-size: sm;
|
|
1159
1169
|
--ad-slat-sizes-md-title-order: 4;
|
|
1160
1170
|
--ad-slat-sizes-md-subtitle-size: md;
|
|
1161
|
-
--ad-slat-sizes-md-
|
|
1171
|
+
--ad-slat-sizes-md-subhead-gap: var(--ad-spacing-xshalf);
|
|
1172
|
+
--ad-slat-sizes-md-indicator-size: 16px;
|
|
1173
|
+
--ad-slat-sizes-md-badge-size: md;
|
|
1162
1174
|
--ad-slat-sizes-lg-title-order: 3;
|
|
1163
1175
|
--ad-slat-sizes-lg-subtitle-size: lg;
|
|
1164
|
-
--ad-slat-sizes-lg-
|
|
1176
|
+
--ad-slat-sizes-lg-subhead-gap: var(--ad-spacing-xs);
|
|
1177
|
+
--ad-slat-sizes-lg-indicator-size: 20px;
|
|
1178
|
+
--ad-slat-sizes-lg-badge-size: lg;
|
|
1165
1179
|
--ad-slat-sizes-xl-title-order: 2;
|
|
1166
1180
|
--ad-slat-sizes-xl-subtitle-size: xl;
|
|
1167
|
-
--ad-slat-sizes-xl-
|
|
1181
|
+
--ad-slat-sizes-xl-subhead-gap: var(--ad-spacing-xs);
|
|
1182
|
+
--ad-slat-sizes-xl-indicator-size: 24px;
|
|
1183
|
+
--ad-slat-sizes-xl-badge-size: xl;
|
|
1184
|
+
--ad-slat-title-font-weight: var(--ad-font-weights-medium);
|
|
1185
|
+
--ad-slat-title-line-height: 1.16;
|
|
1186
|
+
--ad-slat-subtitle-line-height: 1.16;
|
|
1168
1187
|
--ad-slider-root-color: var(--ad-color-brand-primary);
|
|
1169
1188
|
--ad-slider-root-track-bg: var(--ad-color-border-subtle);
|
|
1170
1189
|
--ad-slider-root-track-disabled-bg: var(--ad-color-state-disabled);
|
|
@@ -1591,6 +1610,22 @@
|
|
|
1591
1610
|
margin-inline-end: var(--ad-spacing-md);
|
|
1592
1611
|
flex-shrink: 0;
|
|
1593
1612
|
}
|
|
1613
|
+
.mantine-Alert-root[data-panel] {
|
|
1614
|
+
padding-inline: var(--ad-spacing-xs);
|
|
1615
|
+
padding-block: var(--ad-spacing-xxs);
|
|
1616
|
+
border-radius: 0px;
|
|
1617
|
+
border-width: var(--ad-border-width-none);
|
|
1618
|
+
}
|
|
1619
|
+
.mantine-Alert-root[data-panel] .mantine-Alert-icon {
|
|
1620
|
+
width: var(--ad-icon-size-md);
|
|
1621
|
+
height: var(--ad-icon-size-md);
|
|
1622
|
+
margin-inline-end: var(--ad-spacing-xs);
|
|
1623
|
+
margin-top: 3px;
|
|
1624
|
+
}
|
|
1625
|
+
.mantine-Alert-root[data-panel] .mantine-Alert-icon svg {
|
|
1626
|
+
width: 100%;
|
|
1627
|
+
height: 100%;
|
|
1628
|
+
}
|
|
1594
1629
|
/* === AppShell === */
|
|
1595
1630
|
.mantine-AppShell-root {
|
|
1596
1631
|
background: var(--ad-color-bg-body);
|
|
@@ -1627,33 +1662,37 @@
|
|
|
1627
1662
|
.mantine-Badge-root {
|
|
1628
1663
|
font-family: var(--ad-font-family-body);
|
|
1629
1664
|
font-weight: var(--ad-font-weights-bold);
|
|
1630
|
-
line-height: var(--ad-line-heights-xs);
|
|
1631
1665
|
border-radius: var(--ad-radius-sm);
|
|
1632
1666
|
padding-block: var(--ad-spacing-none);
|
|
1633
1667
|
gap: 5px;
|
|
1634
1668
|
}
|
|
1635
1669
|
.mantine-Badge-root[data-size="xs"] {
|
|
1636
1670
|
height: 16px;
|
|
1671
|
+
line-height: calc(16px - 2px);
|
|
1637
1672
|
padding-inline: 6px;
|
|
1638
1673
|
font-size: 9px;
|
|
1639
1674
|
}
|
|
1640
1675
|
.mantine-Badge-root[data-size="sm"] {
|
|
1641
1676
|
height: 18px;
|
|
1677
|
+
line-height: calc(18px - 2px);
|
|
1642
1678
|
padding-inline: 8px;
|
|
1643
1679
|
font-size: 10px;
|
|
1644
1680
|
}
|
|
1645
1681
|
.mantine-Badge-root[data-size="md"] {
|
|
1646
1682
|
height: 20px;
|
|
1683
|
+
line-height: calc(20px - 2px);
|
|
1647
1684
|
padding-inline: 10px;
|
|
1648
1685
|
font-size: 11px;
|
|
1649
1686
|
}
|
|
1650
1687
|
.mantine-Badge-root[data-size="lg"] {
|
|
1651
1688
|
height: 26px;
|
|
1689
|
+
line-height: calc(26px - 2px);
|
|
1652
1690
|
padding-inline: 12px;
|
|
1653
1691
|
font-size: 13px;
|
|
1654
1692
|
}
|
|
1655
1693
|
.mantine-Badge-root[data-size="xl"] {
|
|
1656
1694
|
height: 32px;
|
|
1695
|
+
line-height: calc(32px - 2px);
|
|
1657
1696
|
padding-inline: 16px;
|
|
1658
1697
|
font-size: 16px;
|
|
1659
1698
|
}
|
|
@@ -2336,6 +2375,11 @@
|
|
|
2336
2375
|
background: var(--ad-color-brand-light);
|
|
2337
2376
|
border-color: var(--ad-color-border-primary);
|
|
2338
2377
|
}
|
|
2378
|
+
.ad-DashboardWidget-notification {
|
|
2379
|
+
margin-top: calc(var(--ad-spacing-sm) * -1);
|
|
2380
|
+
margin-inline: calc(var(--ad-spacing-lg) * -1);
|
|
2381
|
+
margin-bottom: var(--ad-spacing-sm);
|
|
2382
|
+
}
|
|
2339
2383
|
.ad-DashboardWidget-body {
|
|
2340
2384
|
display: flex;
|
|
2341
2385
|
flex-direction: column;
|
|
@@ -2468,9 +2512,13 @@
|
|
|
2468
2512
|
.mantine-Drawer-overlay {
|
|
2469
2513
|
background: rgba(0, 0, 0, 0.55);
|
|
2470
2514
|
}
|
|
2471
|
-
.mantine-Drawer-content {
|
|
2515
|
+
.mantine-Drawer-content.mantine-Paper-root {
|
|
2472
2516
|
background: var(--ad-color-bg-default);
|
|
2473
2517
|
box-shadow: var(--ad-shadows-xl);
|
|
2518
|
+
border-radius: 0px;
|
|
2519
|
+
}
|
|
2520
|
+
.mantine-Drawer-inner {
|
|
2521
|
+
inset-inline-start: 0;
|
|
2474
2522
|
}
|
|
2475
2523
|
.mantine-Drawer-header {
|
|
2476
2524
|
background: var(--ad-color-bg-body);
|
|
@@ -3096,6 +3144,9 @@
|
|
|
3096
3144
|
.mantine-Modal-overlay {
|
|
3097
3145
|
background: rgba(0, 0, 0, 0.55);
|
|
3098
3146
|
}
|
|
3147
|
+
.mantine-Modal-inner {
|
|
3148
|
+
inset-inline-start: 0;
|
|
3149
|
+
}
|
|
3099
3150
|
.mantine-Modal-content {
|
|
3100
3151
|
background: var(--ad-color-bg-default);
|
|
3101
3152
|
border-radius: var(--ad-radius-sm);
|
|
@@ -3237,12 +3288,10 @@
|
|
|
3237
3288
|
color: var(--ad-color-text-dimmed);
|
|
3238
3289
|
}
|
|
3239
3290
|
/* === NumberInput === */
|
|
3240
|
-
.mantine-NumberInput-
|
|
3291
|
+
.mantine-NumberInput-control {
|
|
3241
3292
|
border-inline-start-color: var(--ad-color-border-default);
|
|
3242
3293
|
border-inline-start-width: var(--ad-border-width-thin);
|
|
3243
3294
|
border-inline-start-style: var(--ad-border-style-solid);
|
|
3244
|
-
}
|
|
3245
|
-
.mantine-NumberInput-control {
|
|
3246
3295
|
background: var(--ad-transparent);
|
|
3247
3296
|
color: var(--ad-color-text-default);
|
|
3248
3297
|
}
|
|
@@ -3483,6 +3532,65 @@ fieldset:disabled .mantine-SegmentedControl-label,
|
|
|
3483
3532
|
border-color: var(--ad-color-transparent);
|
|
3484
3533
|
background: var(--ad-color-transparent);
|
|
3485
3534
|
}
|
|
3535
|
+
/* === Slat === */
|
|
3536
|
+
.ad-Slat .ad-Slat-title.mantine-Title-root {
|
|
3537
|
+
font-weight: var(--ad-font-weights-medium);
|
|
3538
|
+
line-height: 1.16;
|
|
3539
|
+
}
|
|
3540
|
+
.ad-Slat .ad-Slat-subtitle.mantine-Text-root {
|
|
3541
|
+
line-height: 1.16;
|
|
3542
|
+
}
|
|
3543
|
+
.ad-Slat {
|
|
3544
|
+
overflow: hidden;
|
|
3545
|
+
}
|
|
3546
|
+
.ad-Slat .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3547
|
+
flex-shrink: 0;
|
|
3548
|
+
}
|
|
3549
|
+
.ad-Slat[data-size="xs"] .ad-Slat-subhead {
|
|
3550
|
+
gap: var(--ad-spacing-xshalf);
|
|
3551
|
+
}
|
|
3552
|
+
.ad-Slat[data-size="xs"] .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3553
|
+
width: calc(var(--ad-headings-sizes-h6-font-size) * 1.16 + var(--ad-font-sizes-xs) * 1.16);
|
|
3554
|
+
height: calc(var(--ad-headings-sizes-h6-font-size) * 1.16 + var(--ad-font-sizes-xs) * 1.16);
|
|
3555
|
+
min-width: calc(var(--ad-headings-sizes-h6-font-size) * 1.16 + var(--ad-font-sizes-xs) * 1.16);
|
|
3556
|
+
min-height: calc(var(--ad-headings-sizes-h6-font-size) * 1.16 + var(--ad-font-sizes-xs) * 1.16);
|
|
3557
|
+
}
|
|
3558
|
+
.ad-Slat[data-size="sm"] .ad-Slat-subhead {
|
|
3559
|
+
gap: var(--ad-spacing-xshalf);
|
|
3560
|
+
}
|
|
3561
|
+
.ad-Slat[data-size="sm"] .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3562
|
+
width: calc(var(--ad-headings-sizes-h5-font-size) * 1.16 + var(--ad-font-sizes-sm) * 1.16);
|
|
3563
|
+
height: calc(var(--ad-headings-sizes-h5-font-size) * 1.16 + var(--ad-font-sizes-sm) * 1.16);
|
|
3564
|
+
min-width: calc(var(--ad-headings-sizes-h5-font-size) * 1.16 + var(--ad-font-sizes-sm) * 1.16);
|
|
3565
|
+
min-height: calc(var(--ad-headings-sizes-h5-font-size) * 1.16 + var(--ad-font-sizes-sm) * 1.16);
|
|
3566
|
+
}
|
|
3567
|
+
.ad-Slat[data-size="md"] .ad-Slat-subhead {
|
|
3568
|
+
gap: var(--ad-spacing-xshalf);
|
|
3569
|
+
}
|
|
3570
|
+
.ad-Slat[data-size="md"] .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3571
|
+
width: calc(var(--ad-headings-sizes-h4-font-size) * 1.16 + var(--ad-font-sizes-md) * 1.16);
|
|
3572
|
+
height: calc(var(--ad-headings-sizes-h4-font-size) * 1.16 + var(--ad-font-sizes-md) * 1.16);
|
|
3573
|
+
min-width: calc(var(--ad-headings-sizes-h4-font-size) * 1.16 + var(--ad-font-sizes-md) * 1.16);
|
|
3574
|
+
min-height: calc(var(--ad-headings-sizes-h4-font-size) * 1.16 + var(--ad-font-sizes-md) * 1.16);
|
|
3575
|
+
}
|
|
3576
|
+
.ad-Slat[data-size="lg"] .ad-Slat-subhead {
|
|
3577
|
+
gap: var(--ad-spacing-xs);
|
|
3578
|
+
}
|
|
3579
|
+
.ad-Slat[data-size="lg"] .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3580
|
+
width: calc(var(--ad-headings-sizes-h3-font-size) * 1.16 + var(--ad-font-sizes-lg) * 1.16);
|
|
3581
|
+
height: calc(var(--ad-headings-sizes-h3-font-size) * 1.16 + var(--ad-font-sizes-lg) * 1.16);
|
|
3582
|
+
min-width: calc(var(--ad-headings-sizes-h3-font-size) * 1.16 + var(--ad-font-sizes-lg) * 1.16);
|
|
3583
|
+
min-height: calc(var(--ad-headings-sizes-h3-font-size) * 1.16 + var(--ad-font-sizes-lg) * 1.16);
|
|
3584
|
+
}
|
|
3585
|
+
.ad-Slat[data-size="xl"] .ad-Slat-subhead {
|
|
3586
|
+
gap: var(--ad-spacing-xs);
|
|
3587
|
+
}
|
|
3588
|
+
.ad-Slat[data-size="xl"] .ad-Slat-icon.mantine-ThemeIcon-root {
|
|
3589
|
+
width: calc(var(--ad-headings-sizes-h2-font-size) * 1.16 + var(--ad-font-sizes-xl) * 1.16);
|
|
3590
|
+
height: calc(var(--ad-headings-sizes-h2-font-size) * 1.16 + var(--ad-font-sizes-xl) * 1.16);
|
|
3591
|
+
min-width: calc(var(--ad-headings-sizes-h2-font-size) * 1.16 + var(--ad-font-sizes-xl) * 1.16);
|
|
3592
|
+
min-height: calc(var(--ad-headings-sizes-h2-font-size) * 1.16 + var(--ad-font-sizes-xl) * 1.16);
|
|
3593
|
+
}
|
|
3486
3594
|
/* === Slider === */
|
|
3487
3595
|
.mantine-Slider-root {
|
|
3488
3596
|
--slider-color: var(--ad-color-brand-primary);
|