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

Add question icons #390

Merged
merged 2 commits into from
Mar 24, 2023
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@lyyti/design-system",
"description": "Lyyti Design System",
"homepage": "https://lyytioy.github.io/lyyti-design-system",
"version": "1.4.4",
"version": "1.4.5",
"engines": {
"node": "^18",
"npm": "^8"
Expand Down
19 changes: 19 additions & 0 deletions src/icons/Check.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';

const Check = (props: any) =>
createElement(
SvgIcon,
props,
<circle cx={12} cy={12} r={12} fill="currentColor" fillOpacity={0.5} />,
<path
d="m17.833 6.167-7.291 11.666-4.375-5.25"
stroke="#fff"
fill="none"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
/>
);

export default Check;
31 changes: 31 additions & 0 deletions src/icons/DateQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';
import { useTheme } from '@mui/material/styles';

const DateQuestion = (props: any) => {
const theme = useTheme();

return createElement(
SvgIcon,
props,
<rect width={24} height={24} rx={3} fill={theme.palette.coral['300']} />,
<path
clipRule="evenodd"
d="M4.502 8a1.5 1.5 0 0 1 1.5-1.5h12a1.5 1.5 0 0 1 1.5 1.5v10a1.5 1.5 0 0 1-1.5 1.5h-12a1.5 1.5 0 0 1-1.5-1.5V8Z"
stroke={theme.palette.primary.contrastText}
fill={theme.palette.coral['300']}
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>,
<path
d="M4.502 10.5h15M8.502 8V4.5M15.502 8V4.5"
stroke={theme.palette.primary.contrastText}
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>
);
};

export default DateQuestion;
31 changes: 31 additions & 0 deletions src/icons/EmailQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';
import { useTheme } from '@mui/material/styles';

const EmailQuestion = (props: any) => {
const theme = useTheme();

return createElement(
SvgIcon,
props,
<rect width={24} height={24} rx={3} fill={theme.palette.sunset['300']} />,
<path
clipRule="evenodd"
d="M4 8.5A1.5 1.5 0 0 1 5.5 7h13A1.5 1.5 0 0 1 20 8.5v7.667a1.5 1.5 0 0 1-1.5 1.5h-13a1.5 1.5 0 0 1-1.5-1.5V8.5Z"
stroke={theme.palette.primary.contrastText}
fill="none"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>,
<path
d="m14.621 10.893 2.712 2.506M9.38 10.893l-2.712 2.506M19.738 7.365l-6.765 4.665a1.71 1.71 0 0 1-1.945 0L4.264 7.365"
stroke={theme.palette.primary.contrastText}
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
/>
);
};

export default EmailQuestion;
30 changes: 30 additions & 0 deletions src/icons/SelectManyQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';
import { useTheme } from '@mui/material/styles';

const SelectManyQuestion = (props: any) => {
const theme = useTheme();

return createElement(
SvgIcon,
props,
<rect width={24} height={24} rx={3} fill={theme.palette.balticSea['100']} />,
<path
d="m16.167 7.833-5.208 8.333-3.125-3.75"
stroke={theme.palette.primary.contrastText}
fill="none"
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>,
<path
stroke={theme.palette.primary.contrastText}
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
d="M19.5 4.5v15h-15v-15z"
/>
);
};

export default SelectManyQuestion;
31 changes: 31 additions & 0 deletions src/icons/SelectOneQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';
import { useTheme } from '@mui/material/styles';

const SelectOneQuestion = (props: any) => {
const theme = useTheme();

return createElement(
SvgIcon,
props,
<rect width={24} height={24} rx={3} fill={theme.palette.sky['400']} />,
<g clipPath="url(#select-one_svg__a)">
<circle cx={11.999} cy={12} r={5.833} fill={theme.palette.sky['400']} />
<path
d="M12 8.666A3.335 3.335 0 1 0 15.334 12a3.335 3.335 0 0 0-3.332-3.333Zm0-3.333A6.67 6.67 0 0 0 5.335 12a6.67 6.67 0 0 0 6.667 6.666A6.669 6.669 0 0 0 18.667 12a6.669 6.669 0 0 0-6.666-6.667Zm0 12A5.332 5.332 0 0 1 6.668 12a5.332 5.332 0 0 1 5.334-5.334A5.332 5.332 0 0 1 17.334 12a5.332 5.332 0 0 1-5.333 5.333Z"
fill={theme.palette.primary.contrastText}
/>
</g>,
<defs>
<clipPath id="select-one_svg__a">
<path
fill={theme.palette.primary.contrastText}
transform="translate(2 2)"
d="M0 0h20v20H0z"
/>
</clipPath>
</defs>
);
};

export default SelectOneQuestion;
23 changes: 23 additions & 0 deletions src/icons/TextQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { createElement } from 'react';
import SvgIcon from '@mui/material/SvgIcon';
import { useTheme } from '@mui/material/styles';

const TextQuestion = (props: any) => {
const theme = useTheme();

return createElement(
SvgIcon,
props,
<rect width={24} height={24} rx={3} fill={theme.palette.primary.main} />,
<path
clipRule="evenodd"
d="M4.5 11.998a1.5 1.5 0 0 1 1.5-1.5h12a1.5 1.5 0 0 1 1.5 1.5v0a1.5 1.5 0 0 1-1.5 1.5H6a1.5 1.5 0 0 1-1.5-1.5v0Z"
stroke={theme.palette.primary.contrastText}
strokeWidth={1.5}
strokeLinecap="round"
strokeLinejoin="round"
/>
);
};

export default TextQuestion;
6 changes: 6 additions & 0 deletions src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ export { default as HeavyPlus } from './HeavyPlus';
export { default as Checkbox } from './Checkbox';
export { default as Radio } from './Radio';
export { default as Rectangle } from './Rectangle';
export { default as TextQuestion } from './TextQuestion';
export { default as SelectOneQuestion } from './SelectOneQuestion';
export { default as SelectManyQuestion } from './SelectManyQuestion';
export { default as DateQuestion } from './DateQuestion';
export { default as EmailQuestion } from './EmailQuestion';
export { default as Check } from './Check';
6 changes: 6 additions & 0 deletions stories/DataDisplay/Icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ const iconsList = [
{ name: 'HeavyPlus', component: i.HeavyPlus },
{ name: 'Folder', component: i.Folder },
{ name: 'Person', component: i.Person },
{ name: 'TextQuestion', component: i.TextQuestion },
{ name: 'SelectOneQuestion', component: i.SelectOneQuestion },
{ name: 'SelectManyQuestion', component: i.SelectManyQuestion },
{ name: 'DateQuestion', component: i.DateQuestion },
{ name: 'EmailQuestion', component: i.EmailQuestion },
{ name: 'Check', component: i.Check },
];

const Template: Story<SvgIconProps> = (args) => {
Expand Down