@latte-macchiat-io/latte-vanilla-components 0.0.484 → 0.0.485
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/package.json
CHANGED
|
@@ -37,9 +37,9 @@ export const ExpandCollapseItem = ({ title, text, icon }: ExpandCollapseItemsPro
|
|
|
37
37
|
className={collapseExpandItemTitle}
|
|
38
38
|
onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && toggleList()}>
|
|
39
39
|
<Icon
|
|
40
|
-
size={15}
|
|
41
40
|
iconPath={icon || icons.caret}
|
|
42
41
|
className={collapseExpandTitleIcon}
|
|
42
|
+
size={themeContract.expandCollapse.item.title.icon.size || 20}
|
|
43
43
|
color={themeContract.expandCollapse.item.title.icon.color || themeContract.icon.color}
|
|
44
44
|
/>
|
|
45
45
|
<Heading as="h3" size="sm">
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import path from './path';
|
|
2
2
|
|
|
3
3
|
import { iconRecipe } from './style.css';
|
|
4
|
+
|
|
4
5
|
import { themeContract } from '../../theme/contract.css';
|
|
5
6
|
import { cn } from '../../utils/styleOverride';
|
|
6
7
|
|
|
7
8
|
export type IconProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
8
9
|
icon?: string;
|
|
9
|
-
size?: number;
|
|
10
10
|
color?: string;
|
|
11
11
|
viewBox?: string;
|
|
12
12
|
iconPath?: string;
|
|
13
|
+
size?: number | string;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const Icon = ({ icon = '', className, size = 24, iconPath = '', viewBox = '0 0 24 24', color = themeContract.icon.color }: IconProps) => {
|
|
16
17
|
const d = iconPath || path[icon as keyof typeof path];
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<svg
|
|
20
|
+
<svg
|
|
21
|
+
viewBox={viewBox}
|
|
22
|
+
className={cn(iconRecipe, className)}
|
|
23
|
+
width={typeof size === 'number' ? `${size}px` : size}
|
|
24
|
+
height={typeof size === 'number' ? `${size}px` : size}>
|
|
20
25
|
<path d={d} fill={color} />
|
|
21
26
|
</svg>
|
|
22
27
|
);
|
|
@@ -1379,6 +1379,7 @@ export const themeContract = createGlobalThemeContract({
|
|
|
1379
1379
|
},
|
|
1380
1380
|
|
|
1381
1381
|
icon: {
|
|
1382
|
+
size: 'latte-expandCollapse-item-title-icon-size',
|
|
1382
1383
|
color: 'latte-expandCollapse-item-title-icon-color',
|
|
1383
1384
|
marginTop: {
|
|
1384
1385
|
mobile: 'latte-expandCollapse-item-title-icon-marginTop-mobile',
|