@aurora-ds/components 0.22.4 → 0.22.6
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/dist/cjs/components/foundation/icon/Icon.d.ts +8 -1
- package/dist/cjs/components/foundation/icon/Icon.props.d.ts +2 -0
- package/dist/cjs/components/foundation/icon/Icon.styles.d.ts +1 -1
- package/dist/cjs/index.js +17 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/foundation/icon/Icon.d.ts +8 -1
- package/dist/esm/components/foundation/icon/Icon.props.d.ts +2 -0
- package/dist/esm/components/foundation/icon/Icon.styles.d.ts +1 -1
- package/dist/esm/index.js +17 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { IconProps } from '@components/foundation/icon/Icon.props.ts';
|
|
|
5
5
|
*
|
|
6
6
|
* **Features:**
|
|
7
7
|
* - Theme-aware sizing via font sizes
|
|
8
|
-
* - Color and fill support from theme
|
|
8
|
+
* - Color (stroke) and fill support from theme
|
|
9
9
|
* - Optional background with padding and border radius
|
|
10
10
|
* - Transition animation on color changes
|
|
11
11
|
*
|
|
@@ -13,9 +13,15 @@ import { IconProps } from '@components/foundation/icon/Icon.props.ts';
|
|
|
13
13
|
* ```tsx
|
|
14
14
|
* import { SomeIcon } from 'some-icon-library'
|
|
15
15
|
*
|
|
16
|
+
* // Stroke color only
|
|
16
17
|
* <Icon size="md" color="primary">
|
|
17
18
|
* <SomeIcon />
|
|
18
19
|
* </Icon>
|
|
20
|
+
*
|
|
21
|
+
* // With fill color
|
|
22
|
+
* <Icon size="md" color="primary" fill="secondary">
|
|
23
|
+
* <SomeIcon />
|
|
24
|
+
* </Icon>
|
|
19
25
|
* ```
|
|
20
26
|
*
|
|
21
27
|
* **With background:**
|
|
@@ -23,6 +29,7 @@ import { IconProps } from '@components/foundation/icon/Icon.props.ts';
|
|
|
23
29
|
* <Icon
|
|
24
30
|
* size="lg"
|
|
25
31
|
* color="onPrimary"
|
|
32
|
+
* fill="onPrimary"
|
|
26
33
|
* backgroundColor="primary"
|
|
27
34
|
* padding="sm"
|
|
28
35
|
* borderRadius="full"
|
|
@@ -5,6 +5,8 @@ export type IconProps = PropsWithChildren<{
|
|
|
5
5
|
size?: keyof ThemeContract['fontSize'];
|
|
6
6
|
/** Icon stroke/line color from theme */
|
|
7
7
|
color?: keyof ThemeContract['colors'];
|
|
8
|
+
/** Icon fill color from theme (for filled icons) */
|
|
9
|
+
fill?: keyof ThemeContract['colors'];
|
|
8
10
|
/** Background color from theme */
|
|
9
11
|
backgroundColor?: keyof ThemeContract['colors'];
|
|
10
12
|
/** Padding from theme spacing */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const ICON_STYLES: {
|
|
2
|
-
root: (size?: keyof import("@/interfaces").ThemeFontSizeContract | undefined, color?: keyof import("@/interfaces").ThemeColorContract | undefined, backgroundColor?: keyof import("@/interfaces").ThemeColorContract | undefined, padding?: keyof import("@/interfaces").ThemeSpacingContract | undefined, borderRadius?: keyof import("@/interfaces").ThemeRadiusContract | undefined) => string;
|
|
2
|
+
root: (size?: keyof import("@/interfaces").ThemeFontSizeContract | undefined, color?: keyof import("@/interfaces").ThemeColorContract | undefined, fill?: keyof import("@/interfaces").ThemeColorContract | undefined, backgroundColor?: keyof import("@/interfaces").ThemeColorContract | undefined, padding?: keyof import("@/interfaces").ThemeSpacingContract | undefined, borderRadius?: keyof import("@/interfaces").ThemeRadiusContract | undefined) => string;
|
|
3
3
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,13 +6,13 @@ var theme = require('@aurora-ds/theme');
|
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
7
|
|
|
8
8
|
const ICON_STYLES = theme.createStyles((theme) => ({
|
|
9
|
-
root: (size, color, backgroundColor, padding, borderRadius) => ({
|
|
9
|
+
root: (size, color, fill, backgroundColor, padding, borderRadius) => ({
|
|
10
10
|
boxSizing: 'content-box',
|
|
11
11
|
display: 'flex',
|
|
12
12
|
alignItems: 'center',
|
|
13
13
|
justifyContent: 'center',
|
|
14
14
|
overflow: 'hidden',
|
|
15
|
-
transition: 'color 150ms ease-in-out',
|
|
15
|
+
transition: 'color 150ms ease-in-out, fill 150ms ease-in-out',
|
|
16
16
|
flexShrink: 0,
|
|
17
17
|
lineHeight: 0,
|
|
18
18
|
height: theme.fontSize[size ?? 'md'],
|
|
@@ -20,9 +20,13 @@ const ICON_STYLES = theme.createStyles((theme) => ({
|
|
|
20
20
|
minWidth: theme.fontSize[size ?? 'md'],
|
|
21
21
|
minHeight: theme.fontSize[size ?? 'md'],
|
|
22
22
|
color: color ? theme.colors[color] : 'inherit',
|
|
23
|
+
fill: fill ? theme.colors[fill] : undefined,
|
|
23
24
|
backgroundColor: backgroundColor ? theme.colors[backgroundColor] : undefined,
|
|
24
25
|
padding: padding ? theme.spacing[padding] : 0,
|
|
25
26
|
borderRadius: theme.radius[borderRadius ?? 'md'],
|
|
27
|
+
'& svg': {
|
|
28
|
+
fill: fill ? theme.colors[fill] : undefined,
|
|
29
|
+
},
|
|
26
30
|
}),
|
|
27
31
|
}));
|
|
28
32
|
|
|
@@ -31,7 +35,7 @@ const ICON_STYLES = theme.createStyles((theme) => ({
|
|
|
31
35
|
*
|
|
32
36
|
* **Features:**
|
|
33
37
|
* - Theme-aware sizing via font sizes
|
|
34
|
-
* - Color and fill support from theme
|
|
38
|
+
* - Color (stroke) and fill support from theme
|
|
35
39
|
* - Optional background with padding and border radius
|
|
36
40
|
* - Transition animation on color changes
|
|
37
41
|
*
|
|
@@ -39,9 +43,15 @@ const ICON_STYLES = theme.createStyles((theme) => ({
|
|
|
39
43
|
* ```tsx
|
|
40
44
|
* import { SomeIcon } from 'some-icon-library'
|
|
41
45
|
*
|
|
46
|
+
* // Stroke color only
|
|
42
47
|
* <Icon size="md" color="primary">
|
|
43
48
|
* <SomeIcon />
|
|
44
49
|
* </Icon>
|
|
50
|
+
*
|
|
51
|
+
* // With fill color
|
|
52
|
+
* <Icon size="md" color="primary" fill="secondary">
|
|
53
|
+
* <SomeIcon />
|
|
54
|
+
* </Icon>
|
|
45
55
|
* ```
|
|
46
56
|
*
|
|
47
57
|
* **With background:**
|
|
@@ -49,6 +59,7 @@ const ICON_STYLES = theme.createStyles((theme) => ({
|
|
|
49
59
|
* <Icon
|
|
50
60
|
* size="lg"
|
|
51
61
|
* color="onPrimary"
|
|
62
|
+
* fill="onPrimary"
|
|
52
63
|
* backgroundColor="primary"
|
|
53
64
|
* padding="sm"
|
|
54
65
|
* borderRadius="full"
|
|
@@ -57,7 +68,7 @@ const ICON_STYLES = theme.createStyles((theme) => ({
|
|
|
57
68
|
* </Icon>
|
|
58
69
|
* ```
|
|
59
70
|
*/
|
|
60
|
-
const Icon = ({ children, size, color, backgroundColor, padding, borderRadius, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
71
|
+
const Icon = ({ children, size, color, fill, backgroundColor, padding, borderRadius, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
61
72
|
// Clone child element to apply width and height
|
|
62
73
|
const child = React.Children.only(children);
|
|
63
74
|
const styledChild = React.isValidElement(child)
|
|
@@ -66,7 +77,7 @@ const Icon = ({ children, size, color, backgroundColor, padding, borderRadius, a
|
|
|
66
77
|
height: '100%',
|
|
67
78
|
})
|
|
68
79
|
: child;
|
|
69
|
-
return (jsxRuntime.jsx("div", { className: ICON_STYLES.root(size, color, backgroundColor, padding, borderRadius), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, children: styledChild }));
|
|
80
|
+
return (jsxRuntime.jsx("div", { className: ICON_STYLES.root(size, color, fill, backgroundColor, padding, borderRadius), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, children: styledChild }));
|
|
70
81
|
};
|
|
71
82
|
Icon.displayName = 'Icon';
|
|
72
83
|
|
|
@@ -2046,6 +2057,7 @@ const CARD_STYLES = theme.createStyles((theme) => ({
|
|
|
2046
2057
|
width,
|
|
2047
2058
|
height,
|
|
2048
2059
|
maxHeight,
|
|
2060
|
+
overflowY: maxHeight ? 'auto' : undefined,
|
|
2049
2061
|
gap: gap ? theme.spacing[gap] : undefined,
|
|
2050
2062
|
borderRadius: theme.radius[radius],
|
|
2051
2063
|
boxShadow: theme.shadows[shadow],
|