Skip to content

Commit 02573bc

Browse files
committed
Modal
- font weight fix - title sperated - cancle button design match icon - icon fix - color changes BarChart - border radius fix
1 parent 5a5e159 commit 02573bc

File tree

13 files changed

+42
-8
lines changed

13 files changed

+42
-8
lines changed

packages/ui/src/components/Alert/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useCallback } from 'react';
22
import {
3+
AlertLineIcon,
34
CheckboxCircleLineIcon,
45
CloseLineIcon,
5-
ErrorWarningLineIcon,
66
InformationLineIcon,
77
QuestionLineIcon,
88
} from '@ifrc-go/icons';
@@ -40,7 +40,7 @@ const icon: {
4040
[key in AlertType]: React.ReactNode;
4141
} = {
4242
success: <CheckboxCircleLineIcon className={styles.icon} />,
43-
danger: <ErrorWarningLineIcon className={styles.icon} />,
43+
danger: <AlertLineIcon className={styles.icon} />,
4444
info: <InformationLineIcon className={styles.icon} />,
4545
warning: <QuestionLineIcon className={styles.icon} />,
4646
};

packages/ui/src/components/Alert/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
&.info {
17-
background-color: var(--go-ui-color-gray-80);
17+
background-color: var(--go-ui-color-gray-50);
1818
}
1919

2020
&.success {

packages/ui/src/components/BarChart/styles.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
}
2121

2222
.bar-track {
23-
border-radius: 0.3rem;
23+
border-radius: 0 var(--go-ui-border-radius-md) var(--go-ui-border-radius-md) 0;
2424
background-color: var(--go-ui-color-gray-30);
2525
width: 60%;
2626
height: 0.6rem;
2727

2828
.bar {
29-
border-radius: 0.3rem;
29+
border-radius: 0 var(--go-ui-border-radius-md) var(--go-ui-border-radius-md) 0;
3030
background-color: var(--go-ui-color-primary-red);
3131
height: 100%;
3232
}

packages/ui/src/components/Button/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565

6666
&.default-spacing {
67-
--padding: var(--go-ui-spacing-3xs) var(--go-ui-spacing-md);
67+
--padding: var(--go-ui-spacing-3xs) var(--go-ui-spacing-lg);
6868
}
6969

7070
&.comfortable-spacing {

packages/ui/src/components/ConfirmButton/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ import {
22
useCallback,
33
useState,
44
} from 'react';
5+
import { _cs } from '@togglecorp/fujs';
56

67
import Button, { Props as ButtonProps } from '#components/Button';
78
import Modal from '#components/Modal';
89
import useTranslation from '#hooks/useTranslation';
910

1011
import i18n from './i18n.json';
12+
import styles from './styles.module.css';
1113

1214
export interface Props<NAME> extends ButtonProps<NAME> {
1315
confirmMessage?: React.ReactNode;
1416
confirmHeading?: React.ReactNode;
1517
onClick?: (name: NAME, e: React.MouseEvent<HTMLButtonElement>) => void;
1618
onConfirm: (name: NAME) => void;
19+
disabled?: boolean;
20+
className?: string;
1721
}
1822

1923
function ConfirmButton<NAME>(props: Props<NAME>) {
@@ -25,6 +29,8 @@ function ConfirmButton<NAME>(props: Props<NAME>) {
2529
name,
2630
onConfirm,
2731
onClick,
32+
disabled,
33+
className,
2834
...buttonProps
2935
} = props;
3036

@@ -53,8 +59,10 @@ function ConfirmButton<NAME>(props: Props<NAME>) {
5359
<Button
5460
// eslint-disable-next-line react/jsx-props-no-spreading
5561
{...buttonProps}
62+
className={_cs(className, disabled && styles.disabled)}
5663
name={name}
5764
onClick={handleOnClick}
65+
disabled={disabled}
5866
/>
5967
{showConfirmation && (
6068
<Modal
@@ -66,7 +74,7 @@ function ConfirmButton<NAME>(props: Props<NAME>) {
6674
<Button
6775
name={false}
6876
onClick={setShowConfirmation}
69-
variant="secondary"
77+
variant="tertiary"
7078
>
7179
{strings.buttonCancel}
7280
</Button>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.disabled {
2+
border-color: var(--go-ui-color-gray-40);
3+
background-color: var(--go-ui-color-gray-40);
4+
color: var(--go-ui-color-black);
5+
}
6+

packages/ui/src/components/Container/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface Props {
3030
className?: string;
3131
contentViewType?: 'grid' | 'vertical' | 'default';
3232
ellipsizeHeading?: boolean;
33+
modalHeading?: boolean;
3334
filters?: React.ReactNode;
3435
filterActions?: React.ReactNode;
3536
footerActions?: React.ReactNode;
@@ -85,6 +86,7 @@ function Container(props: Props) {
8586
containerRef,
8687
contentViewType = 'default',
8788
ellipsizeHeading,
89+
modalHeading,
8890
filters,
8991
filterActions,
9092
footerActions,
@@ -207,6 +209,7 @@ function Container(props: Props) {
207209
elementRef={headerElementRef}
208210
actionsContainerClassName={actionsContainerClassName}
209211
ellipsizeHeading={ellipsizeHeading}
212+
modalHeading={modalHeading}
210213
heading={heading}
211214
headingLevel={headingLevel}
212215
icons={icons}

packages/ui/src/components/Header/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface Props {
1515
className?: string;
1616
elementRef?: React.Ref<HTMLDivElement>;
1717
ellipsizeHeading?: boolean;
18+
modalHeading?: boolean;
1819

1920
actions?: React.ReactNode;
2021
actionsContainerClassName?: string;
@@ -47,6 +48,7 @@ function Header(props: Props) {
4748
className,
4849
elementRef,
4950
ellipsizeHeading,
51+
modalHeading,
5052
heading,
5153
headingClassName,
5254
headingLevel,
@@ -72,6 +74,7 @@ function Header(props: Props) {
7274
level={headingLevel}
7375
className={headingClassName}
7476
ellipsize={ellipsizeHeading}
77+
modalHeading={modalHeading}
7578
>
7679
{heading}
7780
</Heading>
@@ -80,10 +83,12 @@ function Header(props: Props) {
8083
{headingDescription}
8184
</div>
8285
)}
86+
{modalHeading && <div className={styles.border} />}
8387
</>
8488
);
8589
},
8690
[
91+
modalHeading,
8792
heading,
8893
ellipsizeHeading,
8994
headingDescription,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.header {
22
display: flex;
33
flex-direction: column;
4+
5+
.border {
6+
border-bottom: var(--go-ui-width-separator-thin) solid var(--go-ui-color-separator);
7+
}
48
}

packages/ui/src/components/Heading/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface Props {
2525
level?: HeadingLevel;
2626
children: ReactNode;
2727
ellipsize?: boolean;
28+
modalHeading?: boolean;
2829
}
2930

3031
function Heading(props: Props) {
@@ -33,6 +34,7 @@ function Heading(props: Props) {
3334
level = 3,
3435
children,
3536
ellipsize,
37+
modalHeading,
3638
} = props;
3739

3840
const HeadingTag = `h${level}` as ElementType;
@@ -47,6 +49,7 @@ function Heading(props: Props) {
4749
return (
4850
<HeadingTag
4951
className={_cs(
52+
modalHeading && styles.modalFontWeight,
5053
styles.heading,
5154
ellipsize && styles.ellipsized,
5255
levelToClassName[level],

0 commit comments

Comments
 (0)