Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOAPPX-467] Remove legacy color palette #384

Merged
merged 7 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/src/components/AssetViewerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const AssetViewerBox = ({
>
{name && (
<BodySmall
color={"bluegrey"}
color={"grey-700"}
style={{ alignSelf: "flex-start" }}
weight={"Regular"}
>
Expand Down
4 changes: 2 additions & 2 deletions example/src/components/ComponentViewerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const styles = StyleSheet.create({
fontSize: 10
},
componenentLabelLight: {
color: IOColors.bluegrey
color: IOColors["grey-700"]
},
componenentLabelDark: {
color: IOColors.greyLight
color: IOColors["grey-100"]
}
});

Expand Down
2 changes: 1 addition & 1 deletion example/src/components/LogoPaymentViewerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const styles = StyleSheet.create({
},
iconLabel: {
fontSize: 10,
color: IOColors.bluegrey
color: IOColors["grey-700"]
}
});

Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const renderRawAccordion = () => (
<RawAccordion
headerStyle={{
paddingVertical: 16,
backgroundColor: IOColors.greyLight
backgroundColor: IOColors["grey-200"]
}}
header={
<View style={IOStyles.row}>
Expand Down
18 changes: 6 additions & 12 deletions example/src/pages/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const DSAlert = () => {
return (
<Screen>
<H3
color={"bluegrey"}
color={"grey-700"}
style={{
paddingTop: IOVisualCostants.appMarginDefault,
marginBottom: 16
Expand All @@ -117,7 +117,7 @@ export const DSAlert = () => {
<VStack space={8}>
{["info", "warning", "error"].map(variant => (
<VStack space={4} key={variant}>
<H6 color={"bluegrey"} style={{ textTransform: "capitalize" }}>
<H6 color={"grey-700"} style={{ textTransform: "capitalize" }}>
{variant}
</H6>
<HStack space={4}>
Expand Down Expand Up @@ -146,7 +146,7 @@ export const DSAlert = () => {

{/* Content only */}
<H3
color={"bluegrey"}
color={"grey-700"}
style={{
marginBottom: 16
}}
Expand Down Expand Up @@ -194,9 +194,7 @@ export const DSAlert = () => {

<VSpacer size={40} />

<H3 color={"bluegrey"} style={{ marginBottom: 16 }}>
Title + Content
</H3>
<H3 style={{ marginBottom: 16 }}>Title + Content</H3>

<Alert
ref={viewRef}
Expand Down Expand Up @@ -243,9 +241,7 @@ export const DSAlert = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16 }}>
Content + Action
</H2>
<H2 style={{ marginBottom: 16 }}>Content + Action</H2>

<Alert
ref={viewRef}
Expand Down Expand Up @@ -296,9 +292,7 @@ export const DSAlert = () => {
<VSpacer size={40} />

{/* Full width */}
<H2 color={"bluegrey"} style={{ marginBottom: 16 }}>
Full width
</H2>
<H2 style={{ marginBottom: 16 }}>Full width</H2>
<FullWidthComponent>
<Alert
fullWidth
Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/Badges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const renderBadge = () => (
<View
style={{
alignSelf: "flex-start",
backgroundColor: IOColors.bluegrey,
backgroundColor: IOColors["grey-700"],
padding: 16,
borderRadius: IOBadgeRadius + 16,
borderCurve: "continuous"
Expand Down
25 changes: 7 additions & 18 deletions example/src/pages/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Screen } from "../components/Screen";

const styles = StyleSheet.create({
primaryBlockLegacy: {
backgroundColor: IOColors.blue,
backgroundColor: IOColors["blue-500"],
padding: 16,
borderRadius: 8
},
Expand All @@ -43,7 +43,6 @@ export const Buttons = () => {
<Screen>
{/* The title should be dynamic, got from the route object */}
<H2
color={"bluegrey"}
style={{
marginBottom: 16,
paddingTop: IOVisualCostants.appMarginDefault
Expand Down Expand Up @@ -289,9 +288,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
ButtonOutline
</H2>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>ButtonOutline</H2>
<ComponentViewerBox name="ButtonOutline · Primary variant (using Pressable API)">
<ButtonOutline
accessibilityHint="Tap to trigger test alert"
Expand Down Expand Up @@ -444,9 +441,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
ButtonLink
</H2>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>ButtonLink</H2>
<ComponentViewerBox name="ButtonLink · Primary variant (using Pressable API)">
<ButtonLink
accessibilityHint="Tap to trigger test alert"
Expand Down Expand Up @@ -598,9 +593,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
IconButton
</H2>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>IconButton</H2>
<ComponentViewerBox name="IconButton · Primary variant">
<View style={IOStyles.row}>
<IconButton
Expand Down Expand Up @@ -707,9 +700,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
IconButtonSolid
</H2>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>IconButtonSolid</H2>

<ComponentViewerBox name="IconButtonSolid · Primary variant, large">
<View style={IOStyles.row}>
Expand Down Expand Up @@ -771,7 +762,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>
IconButtonContained (Icebox)
</H2>
<ComponentViewerBox name="IconButtonContained · Primary variant">
Expand Down Expand Up @@ -853,9 +844,7 @@ export const Buttons = () => {

<VSpacer size={40} />

<H2 color={"bluegrey"} style={{ marginBottom: 16, marginTop: 16 }}>
Specific buttons
</H2>
<H2 style={{ marginBottom: 16, marginTop: 16 }}>Specific buttons</H2>

<ComponentViewerBox name="CalendarEventButton (using new ButtonOutline)">
<ButtonOutline
Expand Down
25 changes: 6 additions & 19 deletions example/src/pages/Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const styles = StyleSheet.create({
marginBottom: 12
},
smallCapsLightMode: {
color: IOColors.bluegrey
color: IOColors["grey-700"]
},
smallCapsDarkMode: {
color: IOColors["grey-450"]
Expand Down Expand Up @@ -139,11 +139,7 @@ const renderColorThemeGroup = (

return (
<View style={{ marginBottom: 40 }}>
{name && (
<H3 color={"bluegrey"} style={{ marginBottom: sectionTitleMargin }}>
{name}
</H3>
)}
{name && <H3 style={{ marginBottom: sectionTitleMargin }}>{name}</H3>}
{/* Show the two different columns
with both light and dark modes */}
<View style={IOStyles.row}>
Expand Down Expand Up @@ -219,11 +215,7 @@ const renderColorGroup = (
colorObject: Record<string, ColorValue>
) => (
<View style={{ marginBottom: 24 }}>
{name && (
<H3 color={"bluegrey"} style={{ marginBottom: sectionTitleMargin }}>
{name}
</H3>
)}
{name && <H3 style={{ marginBottom: sectionTitleMargin }}>{name}</H3>}

{Object.entries(colorObject).map(([name, colorValue]) => (
<ColorBox key={name} name={name} color={colorValue} />
Expand All @@ -234,7 +226,6 @@ const renderColorGroup = (
export const Colors = () => (
<Screen>
<H2
color={"bluegrey"}
style={{
marginBottom: sectionTitleMargin,
paddingTop: IOVisualCostants.appMarginDefault
Expand All @@ -251,9 +242,7 @@ export const Colors = () => (
{/* Extra */}
{renderColorGroup("Extra", IOColorsExtra)}

<H2 color={"bluegrey"} style={{ marginBottom: sectionTitleMargin }}>
Theme
</H2>
<H2 style={{ marginBottom: sectionTitleMargin }}>Theme</H2>

{renderColorThemeGroup("Main", IOThemeLight, IOThemeDark)}

Expand All @@ -264,9 +253,7 @@ export const Colors = () => (
)}

{/* Gradients */}
<H2 color={"bluegrey"} style={{ marginBottom: sectionTitleMargin }}>
Gradients
</H2>
<H2 style={{ marginBottom: sectionTitleMargin }}>Gradients</H2>
<View style={styles.gradientItemsWrapper}>
{Object.entries(IOColorGradients).map(([name, colorValues]) => (
<GradientBox key={name} name={name} colors={colorValues} />
Expand Down Expand Up @@ -308,7 +295,7 @@ const ColorBox = ({
{name && (
<LabelMini
numberOfLines={1}
color={mode === "dark" ? "grey-200" : "bluegrey"}
color={mode === "dark" ? "grey-200" : "grey-700"}
weight={"Regular"}
>
{name}
Expand Down
4 changes: 1 addition & 3 deletions example/src/pages/HeaderFirstLevel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ export const HeaderFirstLevelScreen = () => {
<VSpacer />
{["info", "warning", "error"].map(variant => (
<VStack space={4} key={variant}>
<H6 color={"bluegrey"} style={{ textTransform: "capitalize" }}>
{variant}
</H6>
<H6 style={{ textTransform: "capitalize" }}>{variant}</H6>
<HStack space={4}>
<ButtonSolid
label="w/ Action"
Expand Down
4 changes: 1 addition & 3 deletions example/src/pages/HeaderSecondLevel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ export const HeaderSecondLevelScreen = () => {
<VSpacer />
{["info", "warning", "error"].map(variant => (
<VStack space={4} key={variant}>
<H6 color={"bluegrey"} style={{ textTransform: "capitalize" }}>
{variant}
</H6>
<H6 style={{ textTransform: "capitalize" }}>{variant}</H6>
<HStack space={4}>
<ButtonSolid
label="w/ Action"
Expand Down
4 changes: 2 additions & 2 deletions example/src/pages/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ const renderListItemTransaction = () => (
amount: "",
amountAccessibilityLabel: ""
}}
paymentLogoIcon={<Icon name="notice" color="red" />}
paymentLogoIcon={<Icon name="notice" color="error-600" />}
onPress={onButtonPress}
/>

Expand All @@ -705,7 +705,7 @@ const renderListItemTransaction = () => (
amountAccessibilityLabel: "€ 100",
refund: true
}}
paymentLogoIcon={<Icon name="refund" color="bluegrey" />}
paymentLogoIcon={<Icon name="refund" />}
onPress={onButtonPress}
/>

Expand Down
27 changes: 1 addition & 26 deletions example/src/pages/Pictograms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
IOColors,
IOPictograms,
IOPictogramsBleed,
IOPictogramsLegacy,
IOPictogramsObject,
IOVisualCostants,
Pictogram,
Expand Down Expand Up @@ -58,17 +57,13 @@ const sortPictogramSet = (
);

const filteredIOPictograms = filterPictogramSet(
{
...IOPictogramsObject,
...IOPictogramsLegacy
},
IOPictogramsObject,
IOPictograms
);

const sortedIOPictograms = sortPictogramSet(filteredIOPictograms);
const sortedIOPictogramsBleed = sortPictogramSet(IOPictogramsBleed);
const sortedIOPictogramsObject = sortPictogramSet(IOPictogramsObject);
const sortedIOPictogramsLegacy = sortPictogramSet(IOPictogramsLegacy);

export const Pictograms = () => (
<Screen>
Expand Down Expand Up @@ -188,25 +183,5 @@ export const Pictograms = () => (
<Pictogram name="charity" pictogramStyle="dark-content" />
</View>
</ComponentViewerBox>

<H2
style={{
marginBottom: 16,
paddingTop: IOVisualCostants.appMarginDefault
}}
>
Legacy Pictograms
</H2>
<View style={styles.itemsWrapper}>
{Object.entries(sortedIOPictogramsLegacy).map(([pictogramItemName]) => (
<AssetViewerBox
key={pictogramItemName}
name={pictogramItemName}
image={
<Pictogram name={pictogramItemName as IOPictograms} size="100%" />
}
/>
))}
</View>
</Screen>
);
Loading
Loading