@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/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
|
|
|
@@ -2039,12 +2050,13 @@ Box.displayName = 'Box';
|
|
|
2039
2050
|
* Card styles using createStyles from @aurora-ds/theme
|
|
2040
2051
|
*/
|
|
2041
2052
|
const CARD_STYLES = theme.createStyles((theme) => ({
|
|
2042
|
-
root: ({ direction, padding, width, height, gap, radius, shadow, align, justify, backgroundColor, borderColor }) => ({
|
|
2053
|
+
root: ({ direction, padding, width, height, maxHeight, gap, radius, shadow, align, justify, backgroundColor, borderColor }) => ({
|
|
2043
2054
|
display: 'flex',
|
|
2044
2055
|
flexDirection: direction,
|
|
2045
2056
|
padding: padding ? theme.spacing[padding] : undefined,
|
|
2046
2057
|
width,
|
|
2047
2058
|
height,
|
|
2059
|
+
maxHeight,
|
|
2048
2060
|
gap: gap ? theme.spacing[gap] : undefined,
|
|
2049
2061
|
borderRadius: theme.radius[radius],
|
|
2050
2062
|
boxShadow: theme.shadows[shadow],
|
|
@@ -2068,12 +2080,13 @@ const CARD_STYLES = theme.createStyles((theme) => ({
|
|
|
2068
2080
|
* - `column`: Vertical layout (default)
|
|
2069
2081
|
* - `row`: Horizontal layout
|
|
2070
2082
|
*/
|
|
2071
|
-
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, }) => {
|
|
2083
|
+
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, }) => {
|
|
2072
2084
|
return (jsxRuntime.jsx("div", { className: CARD_STYLES.root({
|
|
2073
2085
|
direction,
|
|
2074
2086
|
padding,
|
|
2075
2087
|
width,
|
|
2076
2088
|
height,
|
|
2089
|
+
maxHeight,
|
|
2077
2090
|
gap,
|
|
2078
2091
|
radius,
|
|
2079
2092
|
shadow,
|