@aurora-ds/components 0.22.3 → 0.22.5
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/components/layout/card/Card.props.d.ts +3 -0
- package/dist/cjs/index.js +20 -7
- 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/components/layout/card/Card.props.d.ts +3 -0
- package/dist/esm/index.js +20 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +12 -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
|
};
|
|
@@ -11,6 +11,8 @@ export type CardProps = {
|
|
|
11
11
|
width?: CSSProperties['width'];
|
|
12
12
|
/** Height of the card */
|
|
13
13
|
height?: CSSProperties['height'];
|
|
14
|
+
/** Maximum height of the card */
|
|
15
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
14
16
|
/** Gap between children (theme spacing key) */
|
|
15
17
|
gap?: keyof ThemeContract['spacing'];
|
|
16
18
|
/** Border radius of the card */
|
|
@@ -55,6 +57,7 @@ export type CardStyleParams = {
|
|
|
55
57
|
padding?: keyof ThemeContract['spacing'];
|
|
56
58
|
width?: CSSProperties['width'];
|
|
57
59
|
height?: CSSProperties['height'];
|
|
60
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
58
61
|
gap?: keyof ThemeContract['spacing'];
|
|
59
62
|
radius: keyof ThemeContract['radius'];
|
|
60
63
|
shadow: keyof ThemeContract['shadows'];
|
package/dist/esm/index.js
CHANGED
|
@@ -4,13 +4,13 @@ import { createStyles, useTheme, keyframes, colors } from '@aurora-ds/theme';
|
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
const ICON_STYLES = createStyles((theme) => ({
|
|
7
|
-
root: (size, color, backgroundColor, padding, borderRadius) => ({
|
|
7
|
+
root: (size, color, fill, backgroundColor, padding, borderRadius) => ({
|
|
8
8
|
boxSizing: 'content-box',
|
|
9
9
|
display: 'flex',
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
justifyContent: 'center',
|
|
12
12
|
overflow: 'hidden',
|
|
13
|
-
transition: 'color 150ms ease-in-out',
|
|
13
|
+
transition: 'color 150ms ease-in-out, fill 150ms ease-in-out',
|
|
14
14
|
flexShrink: 0,
|
|
15
15
|
lineHeight: 0,
|
|
16
16
|
height: theme.fontSize[size ?? 'md'],
|
|
@@ -18,9 +18,13 @@ const ICON_STYLES = createStyles((theme) => ({
|
|
|
18
18
|
minWidth: theme.fontSize[size ?? 'md'],
|
|
19
19
|
minHeight: theme.fontSize[size ?? 'md'],
|
|
20
20
|
color: color ? theme.colors[color] : 'inherit',
|
|
21
|
+
fill: fill ? theme.colors[fill] : undefined,
|
|
21
22
|
backgroundColor: backgroundColor ? theme.colors[backgroundColor] : undefined,
|
|
22
23
|
padding: padding ? theme.spacing[padding] : 0,
|
|
23
24
|
borderRadius: theme.radius[borderRadius ?? 'md'],
|
|
25
|
+
'& svg': {
|
|
26
|
+
fill: fill ? theme.colors[fill] : undefined,
|
|
27
|
+
},
|
|
24
28
|
}),
|
|
25
29
|
}));
|
|
26
30
|
|
|
@@ -29,7 +33,7 @@ const ICON_STYLES = createStyles((theme) => ({
|
|
|
29
33
|
*
|
|
30
34
|
* **Features:**
|
|
31
35
|
* - Theme-aware sizing via font sizes
|
|
32
|
-
* - Color and fill support from theme
|
|
36
|
+
* - Color (stroke) and fill support from theme
|
|
33
37
|
* - Optional background with padding and border radius
|
|
34
38
|
* - Transition animation on color changes
|
|
35
39
|
*
|
|
@@ -37,9 +41,15 @@ const ICON_STYLES = createStyles((theme) => ({
|
|
|
37
41
|
* ```tsx
|
|
38
42
|
* import { SomeIcon } from 'some-icon-library'
|
|
39
43
|
*
|
|
44
|
+
* // Stroke color only
|
|
40
45
|
* <Icon size="md" color="primary">
|
|
41
46
|
* <SomeIcon />
|
|
42
47
|
* </Icon>
|
|
48
|
+
*
|
|
49
|
+
* // With fill color
|
|
50
|
+
* <Icon size="md" color="primary" fill="secondary">
|
|
51
|
+
* <SomeIcon />
|
|
52
|
+
* </Icon>
|
|
43
53
|
* ```
|
|
44
54
|
*
|
|
45
55
|
* **With background:**
|
|
@@ -47,6 +57,7 @@ const ICON_STYLES = createStyles((theme) => ({
|
|
|
47
57
|
* <Icon
|
|
48
58
|
* size="lg"
|
|
49
59
|
* color="onPrimary"
|
|
60
|
+
* fill="onPrimary"
|
|
50
61
|
* backgroundColor="primary"
|
|
51
62
|
* padding="sm"
|
|
52
63
|
* borderRadius="full"
|
|
@@ -55,7 +66,7 @@ const ICON_STYLES = createStyles((theme) => ({
|
|
|
55
66
|
* </Icon>
|
|
56
67
|
* ```
|
|
57
68
|
*/
|
|
58
|
-
const Icon = ({ children, size, color, backgroundColor, padding, borderRadius, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
69
|
+
const Icon = ({ children, size, color, fill, backgroundColor, padding, borderRadius, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
59
70
|
// Clone child element to apply width and height
|
|
60
71
|
const child = Children.only(children);
|
|
61
72
|
const styledChild = isValidElement(child)
|
|
@@ -64,7 +75,7 @@ const Icon = ({ children, size, color, backgroundColor, padding, borderRadius, a
|
|
|
64
75
|
height: '100%',
|
|
65
76
|
})
|
|
66
77
|
: child;
|
|
67
|
-
return (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 }));
|
|
78
|
+
return (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 }));
|
|
68
79
|
};
|
|
69
80
|
Icon.displayName = 'Icon';
|
|
70
81
|
|
|
@@ -2037,12 +2048,13 @@ Box.displayName = 'Box';
|
|
|
2037
2048
|
* Card styles using createStyles from @aurora-ds/theme
|
|
2038
2049
|
*/
|
|
2039
2050
|
const CARD_STYLES = createStyles((theme) => ({
|
|
2040
|
-
root: ({ direction, padding, width, height, gap, radius, shadow, align, justify, backgroundColor, borderColor }) => ({
|
|
2051
|
+
root: ({ direction, padding, width, height, maxHeight, gap, radius, shadow, align, justify, backgroundColor, borderColor }) => ({
|
|
2041
2052
|
display: 'flex',
|
|
2042
2053
|
flexDirection: direction,
|
|
2043
2054
|
padding: padding ? theme.spacing[padding] : undefined,
|
|
2044
2055
|
width,
|
|
2045
2056
|
height,
|
|
2057
|
+
maxHeight,
|
|
2046
2058
|
gap: gap ? theme.spacing[gap] : undefined,
|
|
2047
2059
|
borderRadius: theme.radius[radius],
|
|
2048
2060
|
boxShadow: theme.shadows[shadow],
|
|
@@ -2066,12 +2078,13 @@ const CARD_STYLES = createStyles((theme) => ({
|
|
|
2066
2078
|
* - `column`: Vertical layout (default)
|
|
2067
2079
|
* - `row`: Horizontal layout
|
|
2068
2080
|
*/
|
|
2069
|
-
const Card = ({ children, direction = 'column', padding = 'md', width, height, gap, radius = 'md', shadow = 'none', align, justify, backgroundColor = 'surface', borderColor = 'border', ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, onDragOver, onDragLeave, onDrop, onDragStart, onDragEnd, onDragEnter, draggable, }) => {
|
|
2081
|
+
const Card = ({ children, direction = 'column', padding = 'md', width, height, maxHeight, gap, radius = 'md', shadow = 'none', align, justify, backgroundColor = 'surface', borderColor = 'border', ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, onDragOver, onDragLeave, onDrop, onDragStart, onDragEnd, onDragEnter, draggable, }) => {
|
|
2070
2082
|
return (jsx("div", { className: CARD_STYLES.root({
|
|
2071
2083
|
direction,
|
|
2072
2084
|
padding,
|
|
2073
2085
|
width,
|
|
2074
2086
|
height,
|
|
2087
|
+
maxHeight,
|
|
2075
2088
|
gap,
|
|
2076
2089
|
radius,
|
|
2077
2090
|
shadow,
|