Skip to content

Commit 56d87cc

Browse files
giardivYevgenChopmw-kupros
authored
Release 1.2.0 (#49)
* Update to 1.1.1, minor updates (#38) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * update to 1.1.1, minor updates * plus git issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Master update dev (#40) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * Update to 1.1.1, minor updates (#38) (#39) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * update to 1.1.1, minor updates * plus git issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Minor issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Rows * yk6Mla2q Rows (#27) - Added Row, RowGroup, RowItem components - Added stories * yk6Mla2q Rows (#27) - Added ghost button onClick action - Fixed text split multiline - Fixed padding in full mode - Removed the backgrounds of the text - Replace avatar component with user badge * l4DjkT0E Sticky Summary (#25) (#35) * l4DjkT0E Sticky Summary (#25) - Added Sticky Summary component - Added stories * l4DjkT0E Sticky Summary (#25) Update - Replaced box-shadow with border - Fixed padding Co-authored-by: Vincent <giardiv@users.noreply.github.com> * version 1.1.2 (#41) * Fixes for display FG * fix: - Updated Navigation logic - Updated labels prop type in the Select - Fixed Tooltip container sizing - Fixed badges color * - Fixed bug on the Select component when it disabled * - Added right border to the Navigation * Pickers (#44) * ShXEDsDr Pickers (#41) - Added single and multi range components - Added stories - Added rc-slider npm package - Fixed badges component styles * ShXEDsDr Pickers (#41) Update - Fix tooltip is always visible - Added track bg change on active and hover handler - Added an example with include mode * ShXEDsDr Pickers (#41) Added component export * fix npm dependencies * ONZZrzqQ Callout (#50) (#45) * ONZZrzqQ Callout (#50) - Added callout component - Added stories * ONZZrzqQ Callout (#50) Update - Replaced svg with fontawesome icon - Updated colors in theme - Added example where there is no CTA * Pagination and component fixes (#46) * fix: - Updated Navigation logic - Updated labels prop type in the Select - Fixed Tooltip container sizing - Fixed badges color * - Fixed bug on the Select component when it disabled * - Added right border to the Navigation * - Added Icon component - Removed "info" variant from Dot component - Fixed Card typings - Fixed Tooltip z index - Fixed green color in Dot * feat: - Added Pagination component - Added pagination stories * - Added cursor in Pagination * - Use default input in the Pagination * Read only table (#47) * Release 1.1.2 (#42) * Update to 1.1.1, minor updates (#38) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * update to 1.1.1, minor updates * plus git issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Master update dev (#40) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * Update to 1.1.1, minor updates (#38) (#39) * Release #4 (#27) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Add rebassform (#28) * feat: - Added ProgressBar, FreshnessBar components - Added stories * fix: - Removed useHover utility * rk2k8t60 Select (#23) * feat: - Added Checkbox, CheckboxGroup components - Added stories * feat: - Added ToggleButton component - Added stories * feat: - Added ability to set list item action - Renamed folder icon - Fix variable name in useDropdown - Added Select component - Added Select stories * fix: - Incorrect variant in storybook * fix: - Added spacing for the label * fix: - Build error * fix: - Circle dependency - Updated peerDependencies * add rebass form dependencie * 1.1.0 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * update to 1.1.1, minor updates (#36) * Revert "update to 1.1.1, minor updates (#36)" (#37) This reverts commit c86a823. * update to 1.1.1, minor updates * plus git issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Minor issue Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> * Rows * yk6Mla2q Rows (#27) - Added Row, RowGroup, RowItem components - Added stories * yk6Mla2q Rows (#27) - Added ghost button onClick action - Fixed text split multiline - Fixed padding in full mode - Removed the backgrounds of the text - Replace avatar component with user badge * l4DjkT0E Sticky Summary (#25) (#35) * l4DjkT0E Sticky Summary (#25) - Added Sticky Summary component - Added stories * l4DjkT0E Sticky Summary (#25) Update - Replaced box-shadow with border - Fixed padding Co-authored-by: Vincent <giardiv@users.noreply.github.com> * version 1.1.2 (#41) Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> Co-authored-by: mw-kupros <70627550+mw-kupros@users.noreply.github.com> * table works * freeze column * last check * rebase and version * feedback 1 Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> Co-authored-by: mw-kupros <70627550+mw-kupros@users.noreply.github.com> * 7jO5gHUS Simple Notifications/Radio (#48) * feat: - Added Radio, RadioGroup components - Added CheckboxGroup export * fix: - Set StickySummary background white - Fixed input prop typings * fix: - Fixed Tooltip typings - Added export Callout types enum * fix: Added onBackNavigate in Navigation component * feat: - Added Notifications components - Added Notifications stories * fix: Merge conflicts * fix: package lock Co-authored-by: YevgenChop <yevgenchop@gmail.com> Co-authored-by: YevgenChop <44809341+YevgenChop@users.noreply.github.com> Co-authored-by: mw-kupros <70627550+mw-kupros@users.noreply.github.com>
1 parent 57c6693 commit 56d87cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+20839
-19472
lines changed

package-lock.json

+17,906-19,428
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@logicalclocks/quartz",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "Logical Clocks Design System Library",
55
"author": "logicalclocks",
66
"license": "MIT",
@@ -44,6 +44,7 @@
4444
"@testing-library/user-event": "^7.2.1",
4545
"@types/jest": "^25.1.4",
4646
"@types/node": "^12.12.38",
47+
"@types/rc-slider": "^8.6.6",
4748
"@types/react": "^16.9.27",
4849
"@types/react-dom": "^16.9.7",
4950
"@types/rebass": "^4.0.6",
@@ -54,6 +55,7 @@
5455
"babel-loader": "^8.1.0",
5556
"chromatic": "^5.1.0",
5657
"cross-env": "^7.0.2",
58+
"emotion-theming": "^10.0.27",
5759
"eslint": "^6.8.0",
5860
"eslint-config-airbnb-typescript": "^10.0.0",
5961
"eslint-config-prettier": "^6.7.0",
@@ -71,10 +73,9 @@
7173
"microbundle-crl": "^0.13.10",
7274
"npm-run-all": "^4.1.5",
7375
"prettier": "^2.0.4",
74-
"rebass": "^4.0.7",
75-
"emotion-theming": "^10.0.27",
7676
"react-is": "^16.13.1",
7777
"react-scripts": "^3.4.1",
78+
"rebass": "^4.0.7",
7879
"typescript": "^3.7.5"
7980
},
8081
"files": [
@@ -87,6 +88,11 @@
8788
"@fortawesome/free-solid-svg-icons": "^5.14.0",
8889
"@fortawesome/react-fontawesome": "^0.1.11",
8990
"@rebass/forms": "^4.0.6",
90-
"@styled-system/css": "^5.1.5"
91+
"@styled-system/css": "^5.1.5",
92+
"events": "^3.2.0",
93+
"rc-slider": "^9.5.3",
94+
"react-spring": "^8.0.27",
95+
"rc-tooltip": "^4.2.3",
96+
"react-table": "^7.6.0"
9197
}
9298
}

src/components/badges/dot.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TooltipPositions from '../tooltip/positions';
88

99
export interface DotProps extends Omit<FlexProps, 'css'> {
1010
mainText: string;
11-
variant?: 'green' | 'black' | 'info';
11+
variant?: 'green' | 'black';
1212
secondaryText?: string;
1313
position?: TooltipPositions;
1414
}
@@ -40,9 +40,7 @@ const Dot: FC<DotProps> = ({
4040
borderRadius: '50%',
4141
userSelect: 'none',
4242
}}
43-
>
44-
{variant === 'info' && 'i'}
45-
</Flex>
43+
/>
4644
</Tooltip>
4745
);
4846

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import React from 'react';
2+
import { Story, Meta } from '@storybook/react/types-6-0';
3+
// eslint-disable-next-line import/no-extraneous-dependencies
4+
import { action } from '@storybook/addon-actions';
5+
import { Box } from 'rebass';
6+
import Callout, { ICalloutProps, CalloutTypes } from './index';
7+
import Button from '../button';
8+
9+
export default {
10+
title: 'Quartz/Callout',
11+
component: Callout,
12+
} as Meta;
13+
14+
const argTypes = {
15+
type: {
16+
control: {
17+
type: 'select',
18+
options: CalloutTypes,
19+
},
20+
type: {
21+
required: true,
22+
summary: 'valid, error, warning, neutral',
23+
},
24+
},
25+
content: {
26+
control: {
27+
type: 'text',
28+
},
29+
type: {
30+
required: true,
31+
summary: 'string',
32+
},
33+
},
34+
cta: {
35+
control: {
36+
type: 'object',
37+
},
38+
type: {
39+
required: false,
40+
summary: 'component',
41+
},
42+
},
43+
};
44+
45+
export const Default: Story<ICalloutProps> = (props) => (
46+
<Box width="700px">
47+
<Callout {...props} />
48+
</Box>
49+
);
50+
51+
Default.args = {
52+
type: CalloutTypes.valid,
53+
content: 'lorem ipsum',
54+
cta: (
55+
<Button intent="secondary" onClick={action('onClick')}>
56+
Secondary
57+
</Button>
58+
),
59+
};
60+
61+
Default.argTypes = argTypes;
62+
63+
export const WithoutCTA: Story<ICalloutProps> = (props) => (
64+
<Box width="700px">
65+
<Callout {...props} />
66+
</Box>
67+
);
68+
69+
WithoutCTA.args = {
70+
type: CalloutTypes.valid,
71+
content: 'lorem ipsum',
72+
};
73+
74+
WithoutCTA.argTypes = argTypes;
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { SxStyleProp } from 'rebass';
2+
3+
export const iconStyles = {
4+
width: '12px',
5+
height: '12px',
6+
};
7+
8+
export default {
9+
py: '8px',
10+
px: '8px',
11+
justifyContent: 'space-between',
12+
alignItems: 'center',
13+
} as SxStyleProp;

src/components/callout/index.tsx

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React, { FC } from 'react';
2+
import { Box, Flex } from 'rebass';
3+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4+
import Labeling from '../typography/labeling';
5+
import styles, { iconStyles } from './callout.styles';
6+
7+
export enum CalloutTypes {
8+
valid = 'valid',
9+
error = 'error',
10+
warning = 'warning',
11+
neutral = 'neutral',
12+
}
13+
14+
export interface ICalloutProps {
15+
type: CalloutTypes;
16+
content: string;
17+
cta?: React.ReactNode;
18+
}
19+
20+
const Callout: FC<ICalloutProps> = ({
21+
type,
22+
content,
23+
cta,
24+
...props
25+
}: ICalloutProps) => (
26+
<Flex
27+
width="100%"
28+
variant={`callout.${type}`}
29+
sx={{ borderLeftWidth: cta ? '2px' : 0, ...styles }}
30+
{...props}
31+
>
32+
<Flex justifyContent="space-between" alignItems="center">
33+
<Box>
34+
<FontAwesomeIcon icon="info-circle" style={iconStyles} />
35+
</Box>
36+
<Box ml="8px" as="pre">
37+
<Labeling bold>{content}</Labeling>
38+
</Box>
39+
</Flex>
40+
41+
{cta && <Box>{cta}</Box>}
42+
</Flex>
43+
);
44+
45+
export default Callout;

src/components/card/index.tsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import React, { FC } from 'react';
2-
import { Box, Card as RebassCard, CardProps as RebassCardProps } from 'rebass';
2+
import {
3+
Box,
4+
Flex,
5+
Card as RebassCard,
6+
CardProps as RebassCardProps,
7+
} from 'rebass';
38

49
// Styles
510
import styles, { cardHeaderStyles } from './card.styles';
611

7-
export interface CardProps extends Omit<RebassCardProps, 'css'> {
12+
export interface CardProps extends Omit<RebassCardProps, 'css' | 'title'> {
13+
title?: React.ReactElement | string;
814
link?: string;
915
actions?: React.ReactNode;
1016
children: React.ReactNode;
11-
contentProps?: Omit<CardProps, 'css' | 'children'>;
17+
contentProps?: Omit<RebassCardProps, 'css' | 'children'>;
1218
}
1319

1420
const Card: FC<CardProps> = ({
@@ -26,7 +32,11 @@ const Card: FC<CardProps> = ({
2632
{/* Header */}
2733
{isShowHeader && (
2834
<Box sx={cardHeaderStyles}>
29-
{title && <h4>{title}</h4>}
35+
{title && (
36+
<Flex alignItems="center" as="h4">
37+
{title}
38+
</Flex>
39+
)}
3040
{actions && <div>{actions}</div>}
3141
</Box>
3242
)}
@@ -38,7 +48,6 @@ const Card: FC<CardProps> = ({
3848
width="100%"
3949
height="100%"
4050
p="20px"
41-
overflowY="auto"
4251
{...contentProps}
4352
>
4453
{children}

src/components/icon-button/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface IconButtonProps extends Omit<ButtonProps, 'css'> {
1515
icon: IconProp;
1616
disabled?: boolean;
1717
iconOnHover?: IconProp;
18-
tooltipProps?: TooltipProps;
18+
tooltipProps?: Omit<TooltipProps, 'children' | 'mainText'>;
1919
}
2020

2121
const IconButton: FC<IconButtonProps> = ({

src/components/icon/index.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { IconProp, SizeProp } from '@fortawesome/fontawesome-svg-core';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
import React, { FC } from 'react';
4+
import { Box, BoxProps } from 'rebass';
5+
6+
export interface IconProps extends Omit<BoxProps, 'css'> {
7+
size?: SizeProp;
8+
icon: IconProp;
9+
variant?: 'primary';
10+
}
11+
12+
const Icon: FC<IconProps> = ({
13+
size,
14+
icon,
15+
variant = 'primary',
16+
...props
17+
}: IconProps) => (
18+
<Box as="span" {...props} tx="icon" variant={variant}>
19+
<FontAwesomeIcon icon={icon} size={size} />
20+
</Box>
21+
);
22+
23+
export default Icon;

src/components/input/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface InputProps extends Omit<RebassInputProps, 'css'> {
2020
label?: string;
2121
placeholder?: string;
2222
width?: string | number;
23-
labelProps?: Omit<LabelProps, 'action' | 'text'>;
23+
labelProps?: Omit<LabelProps, 'action' | 'text' | 'children'>;
2424
labelAction?: React.ReactNode;
2525
}
2626

src/components/label/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ import styles from './label.styles';
66
export interface LabelProps extends Omit<FlexProps, 'css' | 'action'> {
77
action?: React.ReactNode;
88
text?: string;
9+
align?: 'top' | 'left';
910
children: React.ReactNode;
1011
}
1112

1213
const Label: FC<LabelProps> = ({
1314
action,
1415
text,
1516
children,
17+
align = 'top',
18+
as = 'label',
1619
...props
1720
}: LabelProps) => (
1821
<Flex
19-
as="label"
20-
flexDirection="column"
22+
flexDirection={align === 'top' ? 'column' : 'row'}
23+
as={as}
2124
{...props}
2225
variant="label"
2326
sx={styles}

src/components/label/label.styles.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ export default {
1212
alignItems: 'center',
1313

1414
mb: '4px',
15+
mr: '8px',
1516
},
1617
} as SxStyleProp;

src/components/list/container/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const List = forwardRef<HTMLUListElement, ListProps>(
1212
as="ul"
1313
m="0"
1414
p="0"
15-
overflowY="auto"
1615
width="max-content"
1716
{...props}
1817
tx="variants.list"

src/components/navigation/container/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ type INavigation<P> = FC<P> & {
2020

2121
export interface NavigationProps {
2222
children?: React.ReactNode;
23-
onNavigate?: (node: TreeNode | null) => void;
2423
footer?: React.ReactNode;
2524
trackBy?: string;
2625
tree?: TreeNode[];
26+
onNavigate?: (node: TreeNode | null) => void;
27+
onBackCLick?: () => void;
2728
}
2829

2930
const Navigation: INavigation<NavigationProps> = ({

src/components/navigation/container/navigation.styles.ts

+4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ export default {
44
alignItems: 'center',
55
justifyContent: 'space-between',
66

7+
borderRightStyle: 'solid',
8+
borderRightWidth: '1px',
9+
710
position: 'relative',
811

912
overflowX: 'hidden',
1013

1114
width: '240px',
15+
minWidth: '240px',
1216
height: '100%',
1317

1418
'> ul': {

src/components/navigation/context/navigation.provider.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ export interface CategoriesProviderProps {
1313
trackBy?: string;
1414
children: React.ReactNode;
1515
onNavigate?: (node: TreeNode | null) => void;
16+
onBackCLick?: () => void;
1617
}
1718

1819
const NavigationProvider: FC<CategoriesProviderProps> = ({
1920
tree,
2021
trackBy = 'title',
2122
children,
2223
onNavigate,
24+
onBackCLick,
2325
}: CategoriesProviderProps) => {
2426
const [activePath, setActivePath] = useState<string[]>([]);
2527
const [activeNode, setActiveNode] = useState<TreeNode | null>(null);
@@ -42,6 +44,10 @@ const NavigationProvider: FC<CategoriesProviderProps> = ({
4244
setActivePath((path) =>
4345
path.slice(path.indexOf(target) - 1, path.length - 1),
4446
);
47+
48+
if (onBackCLick) {
49+
onBackCLick();
50+
}
4551
},
4652
[activePath],
4753
);

0 commit comments

Comments
 (0)