@egov3/system-design 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.storybook/main.ts +21 -0
  2. package/.storybook/preview.ts +24 -0
  3. package/@types/typings.d.ts +1 -0
  4. package/index.tsx +3 -0
  5. package/package.json +42 -0
  6. package/public/NationalEmblem.webp +0 -0
  7. package/public/favicon.ico +0 -0
  8. package/public/fonts/Inter-Regular.ttf +0 -0
  9. package/public/img/Circled-1.svg +11 -0
  10. package/public/img/Circled-2.svg +11 -0
  11. package/public/img/Circled-3.svg +11 -0
  12. package/public/img/Mobile-chat.svg +12 -0
  13. package/public/img/accessibility-1.svg +3 -0
  14. package/public/img/account-1.svg +3 -0
  15. package/public/img/bg/Auth-bg.webp +0 -0
  16. package/public/img/bg/Autumn-bg.webp +0 -0
  17. package/public/img/bg/Msg-bg.webp +0 -0
  18. package/public/img/bg/Spring-bg.webp +0 -0
  19. package/public/img/bg/Summer-bg.webp +0 -0
  20. package/public/img/bg/Winter-bg.webp +0 -0
  21. package/public/img/car.svg +3 -0
  22. package/public/img/egov-logo.png +0 -0
  23. package/public/img/language-1.svg +5 -0
  24. package/public/img/logo.svg +7 -0
  25. package/src/baseComponents/Button/button.module.scss +101 -0
  26. package/src/baseComponents/Button/index.tsx +49 -0
  27. package/src/baseComponents/index.tsx +3 -0
  28. package/src/stories/CardWrapperItem.tsx +29 -0
  29. package/src/stories/Configure.tsx +494 -0
  30. package/src/stories/assets/accessibility.png +0 -0
  31. package/src/stories/assets/accessibility.svg +5 -0
  32. package/src/stories/assets/addon-library.png +0 -0
  33. package/src/stories/assets/assets.png +0 -0
  34. package/src/stories/assets/avif-test-image.avif +0 -0
  35. package/src/stories/assets/context.png +0 -0
  36. package/src/stories/assets/discord.svg +15 -0
  37. package/src/stories/assets/docs.png +0 -0
  38. package/src/stories/assets/figma-plugin.png +0 -0
  39. package/src/stories/assets/github.svg +3 -0
  40. package/src/stories/assets/share.png +0 -0
  41. package/src/stories/assets/styling.png +0 -0
  42. package/src/stories/assets/testing.png +0 -0
  43. package/src/stories/assets/theming.png +0 -0
  44. package/src/stories/assets/tutorials.svg +12 -0
  45. package/src/stories/assets/youtube.svg +4 -0
  46. package/src/stories/components/Button.stories.tsx +127 -0
  47. package/src/styles/colors.module.scss +42 -0
  48. package/src/styles/globals.scss +43 -0
  49. package/src/styles/structure.module.scss +60 -0
  50. package/src/styles/typography.module.scss +120 -0
  51. package/src/utils/ClassNamesFn.tsx +2 -0
  52. package/tsconfig.json +54 -0
@@ -0,0 +1,127 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { fn } from "@storybook/test";
3
+
4
+ import { Button } from "~baseComponents";
5
+
6
+ const meta = {
7
+ title: "baseComponents/Button",
8
+ component: Button,
9
+ parameters: {
10
+ layout: "centered",
11
+ },
12
+ tags: ["autodocs"],
13
+ argTypes: {},
14
+ args: {
15
+ onClick: fn(),
16
+ },
17
+ } satisfies Meta<typeof Button>;
18
+
19
+ export default meta;
20
+ type Story = StoryObj<typeof meta>;
21
+
22
+ export const IsRounded: Story = {
23
+ args: {
24
+ isRounded: true,
25
+ size: "large",
26
+ children: "Button",
27
+ ariaLabel: "Кпнока",
28
+ },
29
+ };
30
+
31
+ export const NotRounded: Story = {
32
+ args: {
33
+ isRounded: false,
34
+ size: "large",
35
+ children: "Button",
36
+ ariaLabel: "Кпнока",
37
+ },
38
+ };
39
+
40
+ export const Large: Story = {
41
+ args: {
42
+ size: "large",
43
+ children: "Button",
44
+ ariaLabel: "Кпнока",
45
+ },
46
+ };
47
+
48
+ export const Medium: Story = {
49
+ args: {
50
+ size: "medium",
51
+ children: "Button",
52
+ ariaLabel: "Кпнока",
53
+ },
54
+ };
55
+
56
+ export const Small: Story = {
57
+ args: {
58
+ size: "small",
59
+ children: "Button",
60
+ ariaLabel: "Кпнока",
61
+ },
62
+ };
63
+
64
+ export const Mini: Story = {
65
+ args: {
66
+ size: "mini",
67
+ children: "Button",
68
+ ariaLabel: "Кпнока",
69
+ },
70
+ };
71
+
72
+ export const VariantDefault: Story = {
73
+ args: {
74
+ variant: "default",
75
+ size: "large",
76
+ children: "Button",
77
+ ariaLabel: "Кпнока",
78
+ },
79
+ };
80
+
81
+ export const VariantTinted: Story = {
82
+ args: {
83
+ variant: "tinted",
84
+ size: "large",
85
+ children: "Button",
86
+ ariaLabel: "Кпнока",
87
+ },
88
+ };
89
+
90
+ export const VariantSecondary: Story = {
91
+ args: {
92
+ variant: "secondary",
93
+ size: "large",
94
+ children: "Button",
95
+ ariaLabel: "Кпнока",
96
+ },
97
+ };
98
+
99
+ export const VariantDefaultDisabled: Story = {
100
+ args: {
101
+ variant: "default",
102
+ size: "large",
103
+ children: "Button",
104
+ disabled: true,
105
+ ariaLabel: "Кпнока",
106
+ },
107
+ };
108
+
109
+ export const VariantTintedDisabled: Story = {
110
+ args: {
111
+ variant: "tinted",
112
+ size: "large",
113
+ children: "Button",
114
+ disabled: true,
115
+ ariaLabel: "Кпнока",
116
+ },
117
+ };
118
+
119
+ export const VariantSecondaryDisabled: Story = {
120
+ args: {
121
+ variant: "secondary",
122
+ size: "large",
123
+ children: "Button",
124
+ disabled: true,
125
+ ariaLabel: "Кпнока",
126
+ },
127
+ };
@@ -0,0 +1,42 @@
1
+ $default-primary-accent: #0581da;
2
+ $default-white-color: #fff;
3
+
4
+ // Surface Colors
5
+ $Surface-Surface-3-color: #e3e7eb;
6
+ $Surface-Surface-2: #fff;
7
+ $Surface-Surface-1: #f0f2f4;
8
+ $Surface-Surface-White---Nonconvert: #fff;
9
+ $Surface-Surface-Alt: rgba(240, 242, 244, 0.8);
10
+ $Surface-Surface-BlackOpacity: rgba(0, 0, 0, 0.24);
11
+
12
+ // Text Colors
13
+ $Text-Accent: #0581da;
14
+ $Text-Primary: #000;
15
+ $Text-White-nonconvert-color: #ffffff;
16
+ $Text-Disabled-color: #929daa;
17
+ $Text-Disabled-Accent-color: #9bcdf0;
18
+ $Text-Secondary: #758393;
19
+
20
+ // Icons Colors
21
+ $icon-error-color: #f35929;
22
+ $icon-warning-color: #f3a229;
23
+ $icon-accent-color: #0581da;
24
+ $icon-secondary-color: #758393;
25
+ $Icon-Success: #57bb09;
26
+
27
+ // Buttons Colors
28
+ $Button-Primary-Default: #0581da; // TODO
29
+ $button-tinted-default-color: #e1f0fb;
30
+ $button-tinted-on-hover-color: #b2d9f5;
31
+ $button-primary-on-hover-color: #1a9cfa;
32
+ $button-secondary-on-hover: #c5ccd3;
33
+ $button-disabled-default-color: #c5ccd3;
34
+ $button-secondary-default-color: #e6e9ec;
35
+ $button-alternative-default-color: rgba(170, 170, 170, 0.64);
36
+
37
+ // Page Color
38
+ $Page-Color-Background-Gray: #f0f2f4;
39
+ $Page-Color-Background-White: #fff;
40
+
41
+ // General lightmode colors
42
+ $Leaf: #c1dc19;
@@ -0,0 +1,43 @@
1
+ @import '/src/styles/colors.module';
2
+
3
+ :root {
4
+ --default-primary-accent-color: #0581da;
5
+ --default-black-color: #000;
6
+ --default-white-color: #fff;
7
+ --default-secondary-grey-color: #758393;
8
+ --background-color: #f0f2f4;
9
+ }
10
+
11
+ * {
12
+ padding: 0;
13
+ margin: 0;
14
+ }
15
+
16
+ html,
17
+ body {
18
+ height: 100%;
19
+ background-color: #f0f2f4;
20
+ font-family: 'Inter', sans-serif;
21
+ }
22
+
23
+ a {
24
+ text-decoration: none;
25
+ color: $default-primary-accent;
26
+ }
27
+
28
+ ul {
29
+ list-style: none;
30
+ list-style-type: none;
31
+ }
32
+
33
+ @font-face {
34
+ font-family: 'Inter';
35
+ src: url('/fonts/Inter-Regular.ttf');
36
+ font-display: swap;
37
+ }
38
+
39
+ fieldset,
40
+ button {
41
+ border: none;
42
+ background: inherit;
43
+ }
@@ -0,0 +1,60 @@
1
+ @import '/src/styles/typography.module';
2
+ @import '/src/styles/colors.module';
3
+
4
+ .authBtn {
5
+ display: flex;
6
+ padding: 14px 24px;
7
+ justify-content: center;
8
+ align-items: center;
9
+ gap: 8px;
10
+ align-self: stretch;
11
+
12
+ border-radius: 12px;
13
+ background: var(--default-primary-accent-color, #0581da);
14
+
15
+ line-height: 16px;
16
+
17
+ text-transform: none;
18
+ box-shadow: none;
19
+ }
20
+
21
+ .serviceBodyContainer {
22
+ display: grid;
23
+ grid-template-areas: 'serviceBody1 serviceBody2';
24
+ grid-template-columns: 2fr 282px;
25
+
26
+ margin-bottom: 32px;
27
+ }
28
+
29
+ .serviceBody1 {
30
+ grid-area: serviceBody1;
31
+ margin-right: 32px;
32
+ }
33
+
34
+ .serviceBodyItem {
35
+ border-radius: 12px;
36
+ background: var(--default-white-color, #fff);
37
+ height: fit-content;
38
+ }
39
+
40
+ .updAndDownloadBtn {
41
+ width: 100%;
42
+ }
43
+
44
+ .stepWrapper {
45
+ padding: 16px;
46
+ border-bottom: 1px solid #f0f2f4;
47
+ }
48
+
49
+ .serviceStatusLabel {
50
+ display: block;
51
+ color: $icon-secondary-color;
52
+ padding: 12px 16px;
53
+ @include bodyMedium;
54
+ }
55
+
56
+ .serviceContainerStepTitle {
57
+ color: var(--default-primary-accent-color, #0581da);
58
+ margin-bottom: 16px;
59
+ @include subtitles3;
60
+ }
@@ -0,0 +1,120 @@
1
+ /* Headings/Heading 1 */
2
+ @mixin heading1 {
3
+ font-family: Inter;
4
+ font-size: 32px;
5
+ font-style: normal;
6
+ font-weight: 600;
7
+ line-height: 36px; /* 112.5% */
8
+ letter-spacing: -0.32px;
9
+ }
10
+
11
+ /* Headings/Heading 3 */
12
+ @mixin heading3 {
13
+ font-family: Inter;
14
+ font-size: 24px;
15
+ font-style: normal;
16
+ font-weight: 600;
17
+ line-height: 28px; /* 116.667% */
18
+ letter-spacing: -0.24px;
19
+ }
20
+
21
+ /* Subtitles/Subtitle 3 */
22
+ @mixin subtitles3 {
23
+ font-family: Inter;
24
+ font-size: 16px;
25
+ font-style: normal;
26
+ font-weight: 600;
27
+ line-height: 24px; /* 150% */
28
+ }
29
+
30
+ /* Body/Body 1, Medium */
31
+ @mixin bodyMedium {
32
+ font-family: Inter;
33
+ font-size: 16px;
34
+ font-style: normal;
35
+ font-weight: 500;
36
+ line-height: 24px; /* 150% */
37
+ }
38
+
39
+ /* Body/Body 1, Regular */
40
+ @mixin Body1Regular {
41
+ font-family: Inter;
42
+ font-size: 16px;
43
+ font-style: normal;
44
+ font-weight: 400;
45
+ line-height: 24px; /* 150% */
46
+ }
47
+
48
+ /* Body/Body 2, Medium */
49
+ @mixin body2Medium {
50
+ font-family: Inter;
51
+ font-size: 14px;
52
+ font-style: normal;
53
+ font-weight: 500;
54
+ line-height: 20px; /* 142.857% */
55
+ }
56
+
57
+ /* Body/Body 2, Regular */
58
+ @mixin body2Regular {
59
+ font-family: Inter;
60
+ font-size: 14px;
61
+ font-style: normal;
62
+ font-weight: 400;
63
+ line-height: 20px; /* 142.857% */
64
+ }
65
+
66
+ /* Body/Body 3, Regular */
67
+ @mixin body3Regular {
68
+ font-family: Inter;
69
+ font-size: 14px;
70
+ font-style: normal;
71
+ font-weight: 400;
72
+ line-height: 16px; /* 114.286% */
73
+ }
74
+
75
+ /* Caption/Caption 1, Medium */
76
+ @mixin caption1Medium {
77
+ font-family: Inter;
78
+ font-size: 12px;
79
+ font-style: normal;
80
+ font-weight: 500;
81
+ line-height: 16px; /* 133.333% */
82
+ }
83
+
84
+ /* Caption/Caption 1, Regular */
85
+ @mixin caption1Regular {
86
+ font-family: Inter;
87
+ font-size: 12px;
88
+ font-style: normal;
89
+ font-weight: 400;
90
+ line-height: 16px; /* 133.333% */
91
+ }
92
+
93
+ /* Caption/Caption 1, Semibold */
94
+ @mixin caption1Semibold {
95
+ font-family: Inter;
96
+ font-size: 12px;
97
+ font-style: normal;
98
+ font-weight: 600;
99
+ line-height: 16px; /* 133.333% */
100
+ }
101
+
102
+ /* Caption/Caption 2, Medium */
103
+ @mixin caption2Medium {
104
+ font-family: Inter;
105
+ font-size: 10px;
106
+ font-style: normal;
107
+ font-weight: 500;
108
+ line-height: 12px; /* 120% */
109
+ }
110
+
111
+ /* Caption/Caption 2, Regular */
112
+ @mixin caption2Regular {
113
+ font-family: Inter;
114
+ font-size: 10px;
115
+ font-style: normal;
116
+ font-weight: 400;
117
+ line-height: 12px; /* 120% */
118
+ }
119
+
120
+ $borderRadius: 4px;
@@ -0,0 +1,2 @@
1
+ export const ClassNamesFn = (...args: unknown[]) =>
2
+ args.filter((item) => !!item).join(' ');
package/tsconfig.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "compilerOptions": {
3
+ "types": ["@types/react", "@types/react-dom"],
4
+ "baseUrl": "./",
5
+ "target": "es5",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "noEmit": true,
11
+ "esModuleInterop": true,
12
+ "module": "esnext",
13
+ "moduleResolution": "node",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "jsx": "preserve",
17
+ "incremental": true,
18
+ "plugins": [
19
+ {
20
+ "name": "next"
21
+ }
22
+ ],
23
+ "paths": {
24
+ "~utils/*": ["./src/utils/*"],
25
+ "~baseComponents": ["./src/baseComponents/index"]
26
+
27
+ // "react": ["./node_modules/@types/react"],
28
+ // "~app/*": ["./src/app/*"],
29
+ // "~assets/*": ["./src/assets/*"],
30
+ // "~components": ["./src/components/index"],
31
+ // "~module": ["./src/module/index"],
32
+ // "~constants/*": ["./src/constants/*"],
33
+ // "~customHooks/*": ["./src/customHooks/*"],
34
+ // "~interfaces/*": ["./src/interfaces/*"],
35
+ // "~services/*": ["./src/services/*"],
36
+ // "~store": ["./src/store/index"],
37
+ // "~stories/*": ["./src/stories/*"],
38
+ // "~styles/*": ["./src/styles/*"],
39
+ // "~svg": ["./src/svg/index"],
40
+ // "~templates": ["./src/templates/index"],
41
+ // "~new/*": ["./src/new/*"],
42
+ // "~customMock/*": ["./__tests__/customMock/*"],
43
+ // "~responses/*": ["./__tests__/responses/*"]
44
+ }
45
+ },
46
+ "include": [
47
+ "next-env.d.ts",
48
+ "**/*.ts",
49
+ "**/*.tsx",
50
+ "**/*.css",
51
+ ".next/types/**/*.ts"
52
+ ],
53
+ "exclude": ["node_modules"]
54
+ }