Skip to content

Commit a907b59

Browse files
authored
Merge pull request #48 from buildo/fixes
Various fixes after integrating with HM
2 parents a38f904 + 3d13a26 commit a907b59

File tree

13 files changed

+43
-12
lines changed

13 files changed

+43
-12
lines changed

Diff for: src/Avatar/createAvatar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function createAvatar(
5151
{initial ? (
5252
<Label size={config.labelSize}>{unsafeLocalizedString(initial)}</Label>
5353
) : (
54-
<config.icon size={16} />
54+
<config.icon size={16} color="primary" />
5555
)}
5656
</Box>
5757
</Box>

Diff for: src/Banner/Banner.css.ts

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export const bannerRecipe = strictRecipe({
1616
negative: bentoSprinkles({
1717
background: "backgroundNegative",
1818
}),
19+
tip: bentoSprinkles({
20+
background: "backgroundSecondary",
21+
}),
1922
},
2023
},
2124
});

Diff for: src/Banner/createBanner.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
IconCheckCircleSolid,
1010
IconWarning,
1111
IconNegative,
12+
IconIdea,
1213
} from "..";
1314
import { Columns, Column, Box, Stack, BentoSprinkles } from "../internal";
1415
import { bannerRecipe } from "./Banner.css";
@@ -25,7 +26,7 @@ type DismissProps =
2526
onDismiss?: never;
2627
};
2728

28-
type Kind = "informative" | "positive" | "warning" | "negative";
29+
type Kind = "informative" | "positive" | "warning" | "negative" | "tip";
2930

3031
type Props = {
3132
kind: Kind;
@@ -64,12 +65,13 @@ export function createBanner({
6465
positive: IconCheckCircleSolid,
6566
warning: IconWarning,
6667
negative: IconNegative,
68+
tip: IconIdea,
6769
},
6870
}: BannerConfig) {
6971
return function Banner({ title, description, kind, ...dismissProps }: Props) {
7072
const isWithoutTitle = title === undefined;
7173
const iconSize = isWithoutTitle ? 16 : 24;
72-
const iconProps = { size: iconSize, color: kind } as const;
74+
const iconProps = { size: iconSize, color: kind === "tip" ? "secondary" : kind } as const;
7375
const Icon = kindIcons[kind];
7476

7577
return (
@@ -82,7 +84,7 @@ export function createBanner({
8284
</Column>
8385
<Stack align="left" space={4}>
8486
{title && (
85-
<Title size={titleSize} color={kind}>
87+
<Title size={titleSize} color={kind === "tip" ? "secondary" : kind}>
8688
{title}
8789
</Title>
8890
)}
@@ -93,9 +95,8 @@ export function createBanner({
9395
<IconButton
9496
label={dismissProps.dismissButtonLabel}
9597
onPress={dismissProps.onDismiss}
96-
size={16}
98+
size={12}
9799
icon={closeIcon}
98-
color="primary"
99100
/>
100101
</Column>
101102
)}

Diff for: src/Icons/Icon.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const iconRecipe = recipe({
1717
24: bentoSprinkles({ height: 24 }),
1818
},
1919
color: {
20-
default: bentoSprinkles({ fill: "foregroundPrimary" }),
20+
default: bentoSprinkles({ fill: "foregroundSecondary" }),
2121
primary: bentoSprinkles({ fill: "foregroundPrimary" }),
2222
secondary: bentoSprinkles({ fill: "foregroundSecondary" }),
2323
informative: bentoSprinkles({ fill: "foregroundInformative" }),

Diff for: src/Icons/IconIdea.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { IconProps } from "./IconProps";
2+
import { svgIconProps } from "./svgIconProps";
3+
4+
export function IconIdea(props: IconProps) {
5+
return (
6+
<svg {...svgIconProps(props)}>
7+
<path d="M12 5.45455C13.736 5.45455 15.4008 6.14415 16.6283 7.37167C17.8558 8.59918 18.5455 10.264 18.5455 12C18.5455 14.4218 17.2255 16.5382 15.2727 17.6727V19.6364C15.2727 19.9257 15.1578 20.2032 14.9532 20.4078C14.7486 20.6123 14.4711 20.7273 14.1818 20.7273H9.81818C9.52886 20.7273 9.25138 20.6123 9.04679 20.4078C8.84221 20.2032 8.72727 19.9257 8.72727 19.6364V17.6727C6.77455 16.5382 5.45455 14.4218 5.45455 12C5.45455 10.264 6.14415 8.59918 7.37167 7.37167C8.59918 6.14415 10.264 5.45455 12 5.45455ZM13.1818 21.8182C13.7341 21.8182 14.1818 22.2659 14.1818 22.8182V22.9091C14.1818 23.1984 14.0669 23.4759 13.8623 23.6805C13.6577 23.8851 13.3802 24 13.0909 24H10.9091C10.6198 24 10.3423 23.8851 10.1377 23.6805C9.93312 23.4759 9.81818 23.1984 9.81818 22.9091V22.8182C9.81818 22.2659 10.2659 21.8182 10.8182 21.8182H13.1818ZM20.7273 11.9091C20.7273 11.3568 21.175 10.9091 21.7273 10.9091H23C23.5523 10.9091 24 11.3568 24 11.9091V12.0909C24 12.6432 23.5523 13.0909 23 13.0909H21.7273C21.175 13.0909 20.7273 12.6432 20.7273 12.0909V11.9091ZM0 11.9091C0 11.3568 0.447715 10.9091 1 10.9091H2.27273C2.82501 10.9091 3.27273 11.3568 3.27273 11.9091V12.0909C3.27273 12.6432 2.82501 13.0909 2.27273 13.0909H1C0.447715 13.0909 0 12.6432 0 12.0909V11.9091ZM12.0909 0C12.6432 0 13.0909 0.447715 13.0909 1V2.27273C13.0909 2.82501 12.6432 3.27273 12.0909 3.27273H11.9091C11.3568 3.27273 10.9091 2.82501 10.9091 2.27273V1C10.9091 0.447715 11.3568 0 11.9091 0H12.0909ZM3.56761 3.44102C3.95837 3.04751 4.59473 3.04713 4.98595 3.44019L5.89371 4.35221C6.28365 4.74398 6.28179 5.37779 5.88955 5.76726L5.75635 5.89953C5.36607 6.28706 4.73611 6.28668 4.3463 5.8987L3.43522 4.9919C3.0441 4.60261 3.04225 3.97008 3.43108 3.57851L3.56761 3.44102ZM18.1054 5.75635C17.7156 5.36648 17.7148 4.7346 18.1038 4.34381L19.0056 3.43771C19.3959 3.04562 20.0303 3.04487 20.4215 3.43605L20.564 3.5785C20.9551 3.96967 20.9544 4.60412 20.5623 4.99438L19.6562 5.89622C19.2654 6.28517 18.6335 6.28443 18.2436 5.89456L18.1054 5.75635Z" />
8+
</svg>
9+
);
10+
}

Diff for: src/Icons/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from "./IconChevronDown";
44
export * from "./IconChevronRight";
55
export * from "./IconChevronUp";
66
export * from "./IconClose";
7+
export * from "./IconIdea";
78
export * from "./IconInformative";
89
export * from "./IconNegative";
910
export * from "./IconProps";

Diff for: src/Modal/createModal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { IconProps } from "../Icons/IconProps";
2020
export type ModalProps = {
2121
title: LocalizedString;
2222
children: Children;
23-
primaryAction?: Omit<ButtonProps, "kind" | "size">;
24-
secondaryAction?: Omit<ButtonProps, "kind" | "size">;
23+
primaryAction?: Omit<ButtonProps, "kind" | "hierarchy" | "size">;
24+
secondaryAction?: Omit<ButtonProps, "kind" | "hierarchy" | "size">;
2525
onClose: () => void;
2626
closeButtonLabel: LocalizedString;
2727
isDestructive?: boolean;

Diff for: src/SearchBar/createSearchBar.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export function createSearchBar(
6060
onPress={() => props.onChange("")}
6161
size={16}
6262
icon={config.clearIcon}
63-
color="primary"
6463
/>
6564
) : null;
6665

Diff for: src/TextField/createTextField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { InputConfig } from "../Field/InputConfig";
1010

1111
type Props = FieldProps<string> & {
1212
placeholder: LocalizedString;
13-
type?: "text" | "email" | "url" | "search";
13+
type?: "text" | "email" | "url" | "password";
1414
disabled?: boolean;
1515
};
1616

Diff for: src/Typography/Title/Title.css.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const titleRecipe = strictRecipe({
1919
positive: bentoSprinkles({ color: "textPositive" }),
2020
warning: bentoSprinkles({ color: "textWarning" }),
2121
negative: bentoSprinkles({ color: "textNegative" }),
22+
secondary: bentoSprinkles({ color: "textSecondary" }),
2223
},
2324
},
2425
});

Diff for: src/Typography/Title/Title.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { titleRecipe } from "./Title.css";
55

66
type Size = "small" | "medium" | "large";
77
type Align = "left" | "center" | "right";
8-
type Color = "default" | "informative" | "positive" | "warning" | "negative";
8+
type Color = "default" | "informative" | "positive" | "warning" | "negative" | "secondary";
99

1010
type Props = {
1111
children: LocalizedString;

Diff for: src/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export * from "./Layout/createLayoutComponents";
2424
export * from "./Link/createLink";
2525
export * from "./List/createList";
2626
export * from "./Modal/createModal";
27+
export * from "./NumberInput/createNumberInput";
2728
export * from "./Placeholder/Placeholder";
2829
export * from "./SearchBar/createSearchBar";
2930
export * from "./Switch/createSwitch";
@@ -44,3 +45,12 @@ export * from "./util/atoms";
4445
export * from "./util/breakpoints";
4546
export * from "./util/conditions";
4647
export * from "./util/link";
48+
49+
export { bodyRecipe } from "./Typography/Body/Body.css";
50+
export { labelRecipe } from "./Typography/Label/Label.css";
51+
export { titleRecipe } from "./Typography/Title/Title.css";
52+
export { headlineRecipe } from "./Typography/Headline/Headline.css";
53+
export { displayRecipe } from "./Typography/Display/Display.css";
54+
export { inputRecipe } from "./Field/Field.css";
55+
56+
export type { SelectFieldProps } from "./SelectField/createSelectField";

Diff for: stories/Components/Banner.stories.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export const Negative = createStory({
6060
description: shortDescription,
6161
});
6262

63+
export const Tip = createStory({
64+
kind: "tip",
65+
title,
66+
description: shortDescription,
67+
});
68+
6369
export const NoDescription = createStory({
6470
kind: "informative",
6571
title,

0 commit comments

Comments
 (0)